diff --git a/scripts/restore b/scripts/restore index f72f47e..cdcbd0a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -42,8 +42,6 @@ ynh_script_progression --message="Validating restoration parameters..." remove_previous_zabbix -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " diff --git a/scripts/upgrade b/scripts/upgrade index dcc96c6..61e56ff 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,14 +24,6 @@ db_user=$(ynh_app_setting_get --app=$app --key=db_user) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) language=$(ynh_app_setting_get --app=$app --key=language) -trustedversion="4.4-1+stretch" -if ynh_permission_has_user --permission=main --user=visitors -then - is_public=0 -else - is_public=1 -fi - #================================================= # CHECK VERSION #================================================= @@ -148,6 +140,13 @@ fi ln -s "/etc/zabbix/web/zabbix.conf.php" "/usr/share/zabbix/conf/zabbix.conf.php" +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # NGINX CONFIGURATION #================================================= @@ -168,11 +167,6 @@ then ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies fi -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - chmod 750 "/usr/share/zabbix" chmod -R o-rwx "/usr/share/zabbix" chown -R $app:www-data "/usr/share/zabbix" @@ -205,10 +199,7 @@ ynh_script_progression --message="Setuping application with CURL..." # Set the app as temporarily public for curl call ynh_script_progression --message="Configuring SSOwat..." # Making the app public for curl -if [ $is_public -eq 0 ] -then - ynh_permission_update --permission="main" --add="visitors" -fi +ynh_permission_update --permission="main" --add="visitors" enable_admin_user @@ -255,19 +246,6 @@ ynh_script_progression --message="Starting a systemd service..." ynh_systemd_action --service_name=$app-server --action="restart" --log_path="/var/log/$app/${app}_server.log" ynh_systemd_action --service_name=$app-agent --action="restart" --log_path="/var/log/$app/${app}_agent.log" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Configuring permissions..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. - ynh_permission_update --permission="main" --add="visitors" -fi - #================================================= # RELOAD NGINX #=================================================