diff --git a/README.md b/README.md index c1cc953..f933c09 100644 --- a/README.md +++ b/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) [![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 -Are LDAP and HTTP auth supported? **Yes** -Can the app be used by multiple users? **Yes** +* Are LDAP and HTTP auth supported? **Yes** +* Can the app be used by multiple users? **Yes** #### 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/) * 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 * 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/ --- -Developer info ----------------- +## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/lstu_ynh/tree/testing). diff --git a/conf/lstu-minion@.service b/conf/lstu-minion@.service index cc9931a..7363924 100644 --- a/conf/lstu-minion@.service +++ b/conf/lstu-minion@.service @@ -3,10 +3,10 @@ Description=Shortened URLs service job queue Documentation=https://framagit.org/luc/lstu [Service] -Type=simple +Type=forking User=www-data WorkingDirectory=__FINALPATH__ -ExecStart=/usr/local/bin/carton exec script/application minion worker +ExecStart=/usr/bin/carton exec script/application minion worker [Install] WantedBy=multi-user.target diff --git a/conf/systemd.service b/conf/systemd.service index f7517e1..b499d7f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -5,16 +5,15 @@ Requires=network.target After=network.target [Service] -Type=simple +Type=forking User=www-data -RemainAfterExit=yes Restart=always RestartSec=10 WorkingDirectory=__FINALPATH__ PIDFile=__FINALPATH__/script/hypnotoad.pid -ExecStart=/usr/local/bin/carton exec hypnotoad script/lstu -ExecStop=/usr/local/bin/carton exec hypnotoad -s script/lstu -ExecReload=/usr/local/bin/carton exec hypnotoad script/lstu +ExecStart=/usr/bin/carton exec hypnotoad script/lstu +ExecStop=/usr/bin/carton exec hypnotoad -s script/lstu +ExecReload=/usr/bin/carton exec hypnotoad script/lstu [Install] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index 2bf0e04..49b417f 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "abld@abld.info" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 50159c9..95b18ef 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,7 @@ #================================================= # 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 diff --git a/scripts/install b/scripts/install index 6f4bd70..d13242e 100644 --- a/scripts/install +++ b/scripts/install @@ -61,19 +61,12 @@ ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find an available port port=$(ynh_find_port --port=8095) 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 #================================================= @@ -81,9 +74,6 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies -# Install Carton -echo yes | cpanm Carton - #================================================= # CREATE A POSTGRESQL DATABASE #================================================= diff --git a/scripts/remove b/scripts/remove index f66f57f..328174a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -83,16 +83,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config 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 #================================================= diff --git a/scripts/restore b/scripts/restore index 98e822c..2b7145f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -86,9 +86,6 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies -# Install Carton -echo yes | cpanm Carton - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f73a794..ccd9121 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,6 +90,13 @@ if [ -z "$hashed_password" ]; then ynh_app_setting_set --app=$app --key=hashed_password --value=$hashed_password 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 #=================================================