From a5fb19581261fd1eaae1dd8e9218ebecf5a51e6c Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 15 Mar 2021 00:26:10 +0100 Subject: [PATCH 1/2] [autopatch] Autopatch to migrate to new permission system --- scripts/install | 3 ++- scripts/upgrade | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 9d83f264..19e4b356 100755 --- a/scripts/install +++ b/scripts/install @@ -246,7 +246,8 @@ ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.ph #================================================= # As Hubzilla is social network and have its own permission there is no need to keep Hubzilla behind SSO ynh_script_progression --message="Configuring SSOwat..." -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +ynh_permission_update --permission="main" --add="visitors" + #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index a928e9db..b2e1cfbf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -49,6 +49,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 86e537563d40a682d54833a48ef1787e61b249d9 Mon Sep 17 00:00:00 2001 From: Amo Date: Tue, 25 May 2021 05:43:05 +0530 Subject: [PATCH 2/2] patch fixed --- scripts/restore | 3 --- scripts/upgrade | 9 --------- 2 files changed, 12 deletions(-) diff --git a/scripts/restore b/scripts/restore index 5f8af875..49c03768 100644 --- a/scripts/restore +++ b/scripts/restore @@ -125,9 +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 b2e1cfbf..16649bc9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,8 +66,6 @@ fi #================================================= ynh_print_info "Upgrading source files..." - - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app @@ -225,13 +223,6 @@ if [ "$is_version_less_then_five" -eq 1 ] && [ -f "$final_path/util/z6convert.ph popd fi -#================================================= -# SETUP SSOWAT -#================================================= -# As Hubzilla is social network and have its own permission there is no need to keep Hubzilla behind SSO -ynh_script_progression --message="Upgrading SSOwat configuration..." -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" - #================================================= # RELOAD NGINX #=================================================