From 3ef7d26ed2b1c7ee907eb4664d33a0514363dc22 Mon Sep 17 00:00:00 2001 From: Amo Date: Tue, 25 May 2021 03:05:19 +0530 Subject: [PATCH] [autopatch] Autopatch to migrate to new permission system --- scripts/restore | 2 -- scripts/upgrade | 16 ++++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5f8af87..fce850a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -125,8 +125,6 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban -# Make app public -ynh_app_setting_set $app skipped_uris "/" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 9d03e17..7d3f75f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -48,6 +48,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 #================================================= @@ -222,12 +232,6 @@ elif [ $database -eq 2 ]; then ynh_install_app_dependencies $pkg_dependencies fi -#================================================= -# SETUP SSOWAT -#================================================= -# As Osada is social network and have its own permission there is no need to keep Osada behind SSO -ynh_script_progression --message="Upgrading SSOwat configuration..." -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" #================================================= # RELOAD NGINX