From afc719d2bb51017a17820a5e7dd00d753dfdd006 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 2 Jul 2021 15:45:21 +0200 Subject: [PATCH] set permissions --- conf/config.dist.php | 7 ------- scripts/install | 10 ++-------- scripts/upgrade | 29 ++++++++++++----------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/conf/config.dist.php b/conf/config.dist.php index ca3d0f0..98cc27e 100644 --- a/conf/config.dist.php +++ b/conf/config.dist.php @@ -28,13 +28,6 @@ $providers = array( 'markdown' => false, 'html' => true, ), - 'factor' => array( - 'name' => "Factor", - 'url' => "https://factor.cc/pad", - 'default_text' => "Welcome to factor.cc Pad!", - 'markdown' => false, - 'html' => true, - ), 'etherpad' => array( 'name' => "Etherpad.net", 'url' => "https://etherpad.net", diff --git a/scripts/install b/scripts/install index db4d1bb..086ffc1 100755 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,6 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url 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=etherpad_instance --value=$etherpad_instance -ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open #================================================= @@ -125,17 +124,12 @@ ynh_store_file_checksum "$final_path/config.php" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] then - if [ $creation_open -eq 1 ] - then - ynh_app_setting_set $app skipped_uris "/" - else - ynh_app_setting_set $app skipped_regex "/[^/]+" - fi + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 27ff9ff..c69f910 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance) creation_open=$(ynh_app_setting_get --app=$app --key=creation_open) @@ -41,6 +40,18 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # CREATE DEDICATED USER #================================================= @@ -95,22 +106,6 @@ ynh_backup_if_checksum_is_different "$final_path/config.php" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/config.php" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1 - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - if [ $creation_open -eq 1 ] - then - ynh_app_setting_set $app skipped_uris "/" - else - ynh_app_setting_set $app skipped_regex "/[^/]+" - fi -fi - #================================================= # RELOAD NGINX #=================================================