mirror of
https://github.com/YunoHost-Apps/leed_ynh.git
synced 2024-09-03 19:26:32 +02:00
Merge pull request #39 from yunohost-bot/new-permission-system
[autopatch] Autopatch to migrate to new permission system
This commit is contained in:
commit
11d4378a34
2 changed files with 16 additions and 8 deletions
|
@ -109,7 +109,7 @@ ynh_script_progression --message="Installing Leed with cURL..." --weight=5
|
||||||
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
|
||||||
|
|
||||||
|
@ -162,14 +162,12 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failreg
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..." --weight=2
|
ynh_script_progression --message="Configuring SSOwat..." --weight=2
|
||||||
|
|
||||||
# Make app private if necessary
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value="$is_public"
|
|
||||||
if [ $is_public -eq 0 ];
|
# Make app public if necessary
|
||||||
|
if [ "$is_public" -eq 1 ]
|
||||||
then
|
then
|
||||||
# Remove the public access
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
ynh_app_setting_delete --app=$app --key=unprotected_uris
|
|
||||||
# Set the action.php script public for the cron task
|
|
||||||
ynh_app_setting_set --app=$app --key=skipped_uris --value="/action.php"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -132,6 +132,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…
Add table
Reference in a new issue