mirror of
https://github.com/YunoHost-Apps/lstu_ynh.git
synced 2024-09-03 19:36:12 +02:00
commit
b606544077
9 changed files with 21 additions and 42 deletions
14
README.md
14
README.md
|
@ -1,4 +1,4 @@
|
||||||
# Lstu app for YunoHost
|
# Lstu for YunoHost
|
||||||
|
|
||||||
[![Integration level](https://dash.yunohost.org/integration/lstu.svg)](https://dash.yunohost.org/appci/app/lstu) ![](https://ci-apps.yunohost.org/ci/badges/lstu.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/lstu.maintain.svg)
|
[![Integration level](https://dash.yunohost.org/integration/lstu.svg)](https://dash.yunohost.org/appci/app/lstu) ![](https://ci-apps.yunohost.org/ci/badges/lstu.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/lstu.maintain.svg)
|
||||||
[![Install Lstu with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=lstu)
|
[![Install Lstu with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=lstu)
|
||||||
|
@ -31,27 +31,23 @@ How to configure this app: a plain file at `/var/www/lstu/lstu.conf` with SSH.
|
||||||
|
|
||||||
#### Multi-user support
|
#### Multi-user support
|
||||||
|
|
||||||
Are LDAP and HTTP auth supported? **Yes**
|
* Are LDAP and HTTP auth supported? **Yes**
|
||||||
Can the app be used by multiple users? **Yes**
|
* Can the app be used by multiple users? **Yes**
|
||||||
|
|
||||||
#### Supported architectures
|
#### Supported architectures
|
||||||
|
|
||||||
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/)
|
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/lstu/)
|
||||||
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/)
|
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/lstu%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/lstu/)
|
||||||
|
|
||||||
**More info on the documentation page:**
|
|
||||||
https://yunohost.org/packaging_apps
|
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/lstu_ynh/issues
|
* Report a bug: https://github.com/YunoHost-Apps/lstu_ynh/issues
|
||||||
* Upstream app repository: Link to the official repository of the upstream app.
|
* Upstream app repository: https://framagit.org/fiat-tux/hat-softwares/lstu
|
||||||
* YunoHost website: https://yunohost.org/
|
* YunoHost website: https://yunohost.org/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Developer info
|
## Developer info
|
||||||
----------------
|
|
||||||
|
|
||||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/lstu_ynh/tree/testing).
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/lstu_ynh/tree/testing).
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,10 @@ Description=Shortened URLs service job queue
|
||||||
Documentation=https://framagit.org/luc/lstu
|
Documentation=https://framagit.org/luc/lstu
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=forking
|
||||||
User=www-data
|
User=www-data
|
||||||
WorkingDirectory=__FINALPATH__
|
WorkingDirectory=__FINALPATH__
|
||||||
ExecStart=/usr/local/bin/carton exec script/application minion worker
|
ExecStart=/usr/bin/carton exec script/application minion worker
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -5,16 +5,15 @@ Requires=network.target
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=forking
|
||||||
User=www-data
|
User=www-data
|
||||||
RemainAfterExit=yes
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
WorkingDirectory=__FINALPATH__
|
WorkingDirectory=__FINALPATH__
|
||||||
PIDFile=__FINALPATH__/script/hypnotoad.pid
|
PIDFile=__FINALPATH__/script/hypnotoad.pid
|
||||||
ExecStart=/usr/local/bin/carton exec hypnotoad script/lstu
|
ExecStart=/usr/bin/carton exec hypnotoad script/lstu
|
||||||
ExecStop=/usr/local/bin/carton exec hypnotoad -s script/lstu
|
ExecStop=/usr/bin/carton exec hypnotoad -s script/lstu
|
||||||
ExecReload=/usr/local/bin/carton exec hypnotoad script/lstu
|
ExecReload=/usr/bin/carton exec hypnotoad script/lstu
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "abld@abld.info"
|
"email": "abld@abld.info"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.5"
|
"yunohost": ">= 4.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="build-essential libssl-dev zlib1g-dev libpng-dev libpq-dev memcached postgresql cpanminus"
|
pkg_dependencies="build-essential libssl-dev zlib1g-dev libpng-dev libpq-dev memcached postgresql carton"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -61,19 +61,12 @@ ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
|
||||||
#=================================================
|
#=================================================
|
||||||
# FIND AND OPEN A PORT
|
# FIND AND OPEN A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring firewall..."
|
ynh_script_progression --message="Finding an available port..."
|
||||||
|
|
||||||
# Find an available port
|
# Find an available port
|
||||||
port=$(ynh_find_port --port=8095)
|
port=$(ynh_find_port --port=8095)
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port
|
ynh_app_setting_set --app=$app --key=port --value=$port
|
||||||
|
|
||||||
# Optional: Expose this port publicly
|
|
||||||
# (N.B. : you only need to do this if the app actually needs to expose the port publicly.
|
|
||||||
# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !)
|
|
||||||
|
|
||||||
# Open the port
|
|
||||||
ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
# INSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -81,9 +74,6 @@ ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
# Install Carton
|
|
||||||
echo yes | cpanm Carton
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A POSTGRESQL DATABASE
|
# CREATE A POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -83,16 +83,6 @@ ynh_script_progression --message="Removing logrotate configuration..."
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CLOSE A PORT
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port..."
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -86,9 +86,6 @@ ynh_script_progression --message="Reinstalling dependencies..."
|
||||||
# Define and install dependencies
|
# Define and install dependencies
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
# Install Carton
|
|
||||||
echo yes | cpanm Carton
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE POSTGRESQL DATABASE
|
# RESTORE THE POSTGRESQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -90,6 +90,13 @@ if [ -z "$hashed_password" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
|
ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# In previous versions, the port was mistakenly exposed to the outside world >_>
|
||||||
|
if yunohost firewall list | grep -q "\- $port$"
|
||||||
|
then
|
||||||
|
ynh_script_progression --message="Closing port $port..."
|
||||||
|
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue