mirror of
https://github.com/YunoHost-Apps/lufi_ynh.git
synced 2024-09-03 19:36:28 +02:00
[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
parent
da55f12a32
commit
3ea84fb99a
2 changed files with 13 additions and 4 deletions
|
@ -56,7 +56,6 @@ 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=max_file_size --value=$max_file_size
|
||||
ynh_app_setting_set --app=$app --key=secret --value=$secret
|
||||
|
||||
|
@ -211,7 +210,7 @@ ynh_systemd_action --service_name=$app --action="start" --line_match="Creating p
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring SSOwat..."
|
||||
|
||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||
|
||||
if [ $is_public -eq 0 ]
|
||||
then
|
||||
if [ "$path_url" == "/" ]; then
|
||||
|
@ -219,8 +218,8 @@ then
|
|||
path_url=""
|
||||
fi
|
||||
# Modify the domain to be used in a regex
|
||||
domain_regex=$(echo "$domain" | sed 's@-@.@g')
|
||||
ynh_app_setting_set --app=$app --key=protected_regex --value="$domain_regex$path_url/stats$","$domain_regex$path_url/manifest.webapp$","$domain_regex$path_url/$","$domain_regex$path_url/d/.*$","$domain_regex$path_url/m/.*$"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -81,6 +81,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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue