Browse Source

[autopatch] Autopatch to migrate to new permission system

pull/129/head
Yunohost-Bot 5 years ago
committed by Alexandre Aubin
parent
commit
d8bf5dfecb
  1. 10
      scripts/install
  2. 10
      scripts/upgrade

10
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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url 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=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=language --value=$language
ynh_app_setting_set --app=$app --key=multisite --value=$multisite 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 chown -R $app: $final_path
# Set the app as temporarily public for cURL call # Set the app as temporarily public for cURL call
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
# Regen SSOwat configuration # Regen SSOwat configuration
yunohost app ssowatconf yunohost app ssowatconf
@ -259,10 +258,11 @@ ynh_add_fail2ban_config --logpath="/var/log/auth.log" --failregex="Authenticatio
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." ynh_script_progression --message="Configuring SSOwat..."
if [ $is_public -eq 0 ]
# Make app public if necessary
if [ "$is_public" -eq 1 ]
then then
# Remove the public access
ynh_app_setting_delete --app=$app --key=unprotected_uris
ynh_permission_update --permission="main" --add="visitors"
fi fi
#================================================= #=================================================

10
scripts/upgrade

@ -161,6 +161,16 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors 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 # ACTIVATE MAINTENANCE MODE
#================================================= #=================================================

Loading…
Cancel
Save