diff --git a/scripts/upgrade b/scripts/upgrade index 44c8690..9bdc659 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) #admin=$(ynh_app_setting_get --app=$app --key=admin) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) +#is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #language=$(ynh_app_setting_get --app=$app --key=language) #db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -42,12 +42,19 @@ upgrade_type=$(ynh_check_app_version_changed) ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 # Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 +#if [ "$is_public" = "Yes" ]; then +# ynh_app_setting_set --app=$app --key=is_public --value=1 +# is_public=1 +#elif [ "$is_public" = "No" ]; then +# ynh_app_setting_set --app=$app --key=is_public --value=0 +# is_public=0 +#fi + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public fi # If db_name doesn't exist, create it @@ -86,7 +93,7 @@ ynh_abort_if_errors # instead of /foo .... # If nobody installed your app before 2.7, then you may # safely remove this line -path_url=$(ynh_normalize_url_path --path_url=$path_url) +#path_url=$(ynh_normalize_url_path --path_url=$path_url) #================================================= # STANDARD UPGRADE STEPS @@ -112,7 +119,7 @@ fi #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -135,7 +142,7 @@ ynh_system_user_create --username=$app #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --time --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -192,14 +199,14 @@ chown -R $app: $final_path #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 +#ynh_script_progression --message="Upgrading SSOwat configuration..." --time --weight=1 # Make app public if necessary -if [ $is_public -eq 1 ] -then +#if [ $is_public -eq 1 ] +#then # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi + #ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" +#fi #================================================= # START SYSTEMD SERVICE @@ -211,7 +218,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 ynh_systemd_action --service_name=nginx --action=reload