From 2a069a0851a1fa74ec20805c2e477c40ea3c1a31 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 21:34:33 +0100 Subject: [PATCH 1/6] We recommend to *not* use 'ynh_script_progression' in backup scripts --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index 5fcb288..1e33267 100755 --- a/scripts/backup +++ b/scripts/backup @@ -79,7 +79,7 @@ ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # BACKUP THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Backing up data directory..." +ynh_print_info --message="Backing up data directory..." ynh_backup --src_path="$datadir" --is_big From 2276181983a3b466522a493680ab02b8c8802ddc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 21:35:10 +0100 Subject: [PATCH 2/6] Please add --quiet to systemctl enable/disable commands --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index c4e556c..cc8ef1a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -136,7 +136,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" ynh_script_progression --message="Restoring the systemd configuration..." ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST From 1c0be61b0c801a01d7d43bf81f36b5ae0f45c805 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 21:35:59 +0100 Subject: [PATCH 3/6] Using option '--log_type systemd' with 'yunohost service add' is not relevant anymore --- scripts/install | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4a35df8..4d60f97 100755 --- a/scripts/install +++ b/scripts/install @@ -253,7 +253,7 @@ chown -R "$app":"$app" "$final_path" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Pleroma" --log_type "systemd" +yunohost service add $app --description "$app daemon for Pleroma" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index cc8ef1a..f8692d7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -143,7 +143,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --description "$app daemon for Pleroma" --log_type "systemd" +yunohost service add $app --description "$app daemon for Pleroma" #================================================= # START SYSTEMD SERVICE From e8e4483e284df14149baa04b0c2ccefcb5f4efdc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 21:38:05 +0100 Subject: [PATCH 4/6] Found some inconsistencies in the 'yunohost service add' commands --- scripts/upgrade | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3f49609..29f3ed9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -285,16 +285,11 @@ ynh_script_progression --message="Securing files and directories..." chown -R "$app":"$app" "$final_path" #================================================= -# SETUP SSOWAT +# INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." +ynh_script_progression --message="Integrating service in YunoHost..." -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi +yunohost service add $app --description "$app daemon for Pleroma" #================================================= # START SYSTEMD SERVICE @@ -306,6 +301,18 @@ if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then sleep 60 fi +#================================================= +# SETUP SSOWAT +#================================================= +ynh_script_progression --message="Upgrading SSOwat configuration..." + +# Make app public if necessary +if [ $is_public -eq 1 ] +then + # unprotected_uris allows SSO credentials to be passed anyway + ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +fi + #================================================= # RELOAD NGINX #================================================= From db6a540d5dc158d17e9b37397714472f6d855b92 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 22 Dec 2020 21:51:15 +0100 Subject: [PATCH 5/6] Replace space by _ in instance name Fix #144 --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 4d60f97..9109e2b 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,7 @@ path_url="/" admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD -name=$YNH_APP_ARG_NAME +name=${$YNH_APP_ARG_NAME// /_} registration=$YNH_APP_ARG_REGISTRATION cache=$YNH_APP_ARG_CACHE size=$YNH_APP_ARG_SIZE From d0eee28555152b40b0491c713d839db09894d51f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 24 Dec 2020 18:44:42 +0100 Subject: [PATCH 6/6] fix substitution --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9109e2b..5a4b37c 100755 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,7 @@ path_url="/" admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD -name=${$YNH_APP_ARG_NAME// /_} +name="${YNH_APP_ARG_NAME// /_}" registration=$YNH_APP_ARG_REGISTRATION cache=$YNH_APP_ARG_CACHE size=$YNH_APP_ARG_SIZE