From 71e8ecf4d80e83876f1f28d9630eb99e8efd42b7 Mon Sep 17 00:00:00 2001 From: Augustin Trancart Date: Thu, 21 May 2020 15:56:13 +0200 Subject: [PATCH 1/6] Fix unit Type and User --- conf/lstu-minion@.service | 2 +- conf/systemd.service | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/conf/lstu-minion@.service b/conf/lstu-minion@.service index cc9931a..e0c001d 100644 --- a/conf/lstu-minion@.service +++ b/conf/lstu-minion@.service @@ -3,7 +3,7 @@ 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 diff --git a/conf/systemd.service b/conf/systemd.service index f7517e1..5cbd244 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -5,9 +5,8 @@ Requires=network.target After=network.target [Service] -Type=simple +Type=forking User=www-data -RemainAfterExit=yes Restart=always RestartSec=10 WorkingDirectory=__FINALPATH__ From 1cc0a2060264a3515cfa8704fde1b84234e9a27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 4 Nov 2020 22:47:01 +0100 Subject: [PATCH 2/6] Update README.md --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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). From 9fb94fa7aed8721c2b2f8cd6024730a31c3800e3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 6 Nov 2020 18:48:01 +0100 Subject: [PATCH 3/6] Do not open port in firewall... --- scripts/install | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 6f4bd70..e987a8f 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 #================================================= From b5dfc534c67831f46caf39e4240d19f5df951cb7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 16 Nov 2020 16:26:56 +0100 Subject: [PATCH 4/6] Close port if it was opened in the firewall during upgrade --- scripts/remove | 10 ---------- scripts/upgrade | 7 +++++++ 2 files changed, 7 insertions(+), 10 deletions(-) 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/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 #================================================= From b94ef4c92709d4e624b2c73d884674d9953869c2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 16 Nov 2020 16:32:51 +0100 Subject: [PATCH 5/6] Use carton from debian's repositories --- conf/lstu-minion@.service | 2 +- conf/systemd.service | 6 +++--- scripts/_common.sh | 2 +- scripts/install | 3 --- scripts/restore | 3 --- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/conf/lstu-minion@.service b/conf/lstu-minion@.service index e0c001d..7363924 100644 --- a/conf/lstu-minion@.service +++ b/conf/lstu-minion@.service @@ -6,7 +6,7 @@ Documentation=https://framagit.org/luc/lstu 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 5cbd244..b499d7f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -11,9 +11,9 @@ 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/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 e987a8f..d13242e 100644 --- a/scripts/install +++ b/scripts/install @@ -74,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/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 #================================================= From 468b045a52bb7b097faa34ca7903e13c90547e8d Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 16 Nov 2020 16:44:42 +0100 Subject: [PATCH 6/6] Bump version requirement to 4.0 because carton from Debian's repo before buster isn't great according to framasky --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": [