mirror of
https://github.com/YunoHost-Apps/bozon_ynh.git
synced 2024-09-03 18:16:09 +02:00
Merge pull request #47 from yunohost-bot/new-permission-system
[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
commit
b4189f578d
2 changed files with 12 additions and 3 deletions
|
@ -48,7 +48,6 @@ ynh_user_exists --username="$admin"
|
|||
ynh_script_progression --message="Storing installation settings..."
|
||||
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=is_public --value=$is_public
|
||||
ynh_app_setting_set --app="$app" --key=admin_user --value="$admin"
|
||||
ynh_app_setting_set --app="$app" --key=backup_core_only --value=$backup_core_only
|
||||
ynh_app_setting_set --app="$app" --key=final_path --value="$final_path"
|
||||
|
@ -108,7 +107,7 @@ ynh_add_fpm_config
|
|||
# create admin user in bozon
|
||||
ynh_script_progression --message="Configuring admin user in BoZon..." --weight=2
|
||||
## set the app as temporarily public for curl call
|
||||
ynh_app_setting_set --app="$app" --key=unprotected_uris --value="/"
|
||||
|
||||
## reload SSOwat config
|
||||
yunohost app ssowatconf
|
||||
## reload Nginx
|
||||
|
@ -132,7 +131,7 @@ if [ $is_public -eq 0 ]; then
|
|||
domainluaregex=$(echo "$domain" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
|
||||
pathluaregex=$([ "$path_url" == "/" ] || echo "$path_url" | sed -e 's/[]().%+*?[^$[]/\%&/g' | sed -e 's/\-/\%&/g')
|
||||
regexList="${domainluaregex}${pathluaregex}/index%.php$","${domainluaregex}${pathluaregex}/index%.php%?p=.*$"
|
||||
ynh_app_setting_set --app="$app" --key=protected_regex --value="$regexList"
|
||||
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -55,6 +55,16 @@ fi
|
|||
# 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
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue