From 3d4de89f141f3e6a845f0faa0f3f283949c05634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 7 Mar 2021 17:34:59 +0100 Subject: [PATCH 1/4] Fix linter warning --- scripts/experimental_helper.sh | 6 ++++++ scripts/restore | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index dc680bf..9c71494 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -124,3 +124,9 @@ ynh_remove_uwsgi_service () { ynh_secure_remove --file="/etc/systemd/system/uwsgi-app@$app.service.d" fi } + +ynh_restore_uwsgi_service () { + ynh_check_global_uwsgi_config + systemctl enable "uwsgi-app@$app" --quiet + yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log" +} diff --git a/scripts/restore b/scripts/restore index 7e9f87f..f5b4698 100644 --- a/scripts/restore +++ b/scripts/restore @@ -83,9 +83,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ ynh_script_progression --message="Reloading services..." --weight=3 -ynh_check_global_uwsgi_config -systemctl enable "uwsgi-app@$app" --quiet -yunohost service add "uwsgi-app@$app" --log "/var/log/uwsgi/$app/$app.log" +ynh_restore_uwsgi_service #================================================= # GENERIC FINALIZATION From 64692d6a011f7989e2bf094f855eafdf8789fa15 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:25:57 +0100 Subject: [PATCH 2/4] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 2 +- scripts/upgrade | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 0ba638a..caf0152 100644 --- a/scripts/install +++ b/scripts/install @@ -133,7 +133,7 @@ set_permissions ynh_script_progression --message="Configuring permissions" # accessible by everyone (authentification is done by firefox accounts) -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" + #================================================= # RELOAD Services diff --git a/scripts/upgrade b/scripts/upgrade index 69a52c1..6cde630 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,6 +88,16 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# Migrate legacy permissions to new system +#================================================= +if ynh_legacy_permissions_exists +then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= From 9e2cd8392f6714573605820a2e13ad560c5a8cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 15 Mar 2021 12:03:05 +0100 Subject: [PATCH 3/4] Add new permission correctly --- scripts/install | 2 +- scripts/upgrade | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index caf0152..090abd6 100644 --- a/scripts/install +++ b/scripts/install @@ -133,7 +133,7 @@ set_permissions ynh_script_progression --message="Configuring permissions" # accessible by everyone (authentification is done by firefox accounts) - +ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true #================================================= # RELOAD Services diff --git a/scripts/upgrade b/scripts/upgrade index 6cde630..6736e53 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,16 +88,6 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -#================================================= -# Migrate legacy permissions to new system -#================================================= -if ynh_legacy_permissions_exists -then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -165,10 +155,17 @@ ynh_script_progression --message="Securing files and directories..." set_permissions #================================================= -# SETUP SSOWAT +# Migrate legacy permissions to new system #================================================= -ynh_app_setting_set --app=$app --key=skipped_uris --value="/" +ynh_script_progression --message="Set permissions..." +if ynh_legacy_permissions_exists +then + ynh_legacy_permissions_delete_all + ynh_app_setting_delete --app=$app --key=is_public +fi +ynh_permission_update --permission=main --add=visitors --protected=true --show_tile=true + ynh_script_progression --message="Restarting $app services..." --weight=3 ynh_systemd_action --service_name "uwsgi-app@$app.service" \ From b0a40d638b0d2e082055766e7250c56c7601d779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 16 Mar 2021 16:03:36 +0100 Subject: [PATCH 4/4] Fix requirement --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 574b4cc..f1d1b83 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 4.1" }, "multi_instance": true, "services": [