diff --git a/scripts/install b/scripts/install index 22569b0..4d9a443 100644 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=2 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=admin --value=$admin_wordpress -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=multisite --value=$multisite @@ -140,7 +139,7 @@ ynh_script_progression --message="Installing wordpress with cURL..." --weight=10 chown -R $app: $final_path # Set the app as temporarily public for cURL call -ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Regen SSOwat configuration yunohost app ssowatconf @@ -259,10 +258,11 @@ ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authenticatio #================================================= ynh_script_progression --message="Configuring SSOwat..." -if [ $is_public -eq 0 ] + +# Make app public if necessary +if [ "$is_public" -eq 1 ] then - # Remove the public access - ynh_app_setting_delete --app=$app --key=unprotected_uris + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 004059f..89070a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -161,6 +161,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 + #================================================= # ACTIVATE MAINTENANCE MODE #=================================================