From 665466b18a9a3b72b7f33d880a13647e7df3dad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 14 Mar 2023 07:45:56 +0100 Subject: [PATCH] Update upgrade --- scripts/upgrade | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6ae8bcf..3c85135 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,36 +47,16 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC UPGRADE -#================================================= -# UPGRADING FRESHRSS -#================================================= -ynh_script_progression --message="Upgrading FreshRSS..." --weight=1 - -# reconfigure application with latest parameters -ynh_exec_as $app $install_dir/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name - -#================================================= -# CRON SETUP -#================================================= -ynh_script_progression --message="Setting up cron..." --weight=1 - ynh_add_config --template="../conf/freshrss.cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" @@ -89,19 +69,22 @@ if [ -f $install_dir/$app.log ]; then ynh_secure_remove --file="/var/www/$app/$app.log" fi -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - log_path="/var/log/$app" mkdir -p $log_path chown $app:www-data "$log_path" # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append +#================================================= +# SPECIFIC UPGRADE +#================================================= +# UPGRADING FRESHRSS +#================================================= +ynh_script_progression --message="Upgrading FreshRSS..." --weight=1 + +# reconfigure application with latest parameters +ynh_exec_as $app $install_dir/cli/reconfigure.php --default_user $admin --auth_type http_auth --environment production --base_url https://$domain$path --title FreshRSS --api_enabled --db-type mysql --db-host localhost --db-user $db_name --db-password $db_pwd --db-base $db_name + #================================================= # END OF SCRIPT #=================================================