From 283f9a705a9f3775085c805b6e5e3b944d38a81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 18 Feb 2023 17:43:57 +0100 Subject: [PATCH] Fix --- manifest.toml | 2 +- scripts/change_url | 10 ---------- scripts/install | 9 ++------- scripts/remove | 9 ++------- scripts/restore | 14 ++++---------- scripts/upgrade | 9 ++------- 6 files changed, 11 insertions(+), 42 deletions(-) diff --git a/manifest.toml b/manifest.toml index efa57d5..3aa3c54 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://datenstrom.se/yellow/help/" code = "https://github.com/datenstrom/yellow/" [integration] -yunohost = ">= 11.1.6" +yunohost = ">= 11.1.7" architectures = "all" multi_instance = true ldap = false diff --git a/scripts/change_url b/scripts/change_url index aa9698b..518f1c0 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -19,16 +19,6 @@ old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index f475484..5410e0c 100644 --- a/scripts/install +++ b/scripts/install @@ -20,18 +20,13 @@ ynh_setup_source --dest_dir="$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - # Create a dedicated NGINX config ynh_add_nginx_config diff --git a/scripts/remove b/scripts/remove index e149006..0b80681 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,18 +10,13 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=3 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index d60bef8..ab36ead 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,20 +19,13 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -# Recreate a dedicated php-fpm config ynh_add_fpm_config --usage=low --footprint=low --phpversion=$phpversion -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= @@ -40,9 +33,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_systemd_action --service_name=php$phpversion-fpm --action=reload + ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8d8c2b4..7bd761c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,18 +30,13 @@ fi chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion=$phpversion --usage=low --footprint=low -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - # Create a dedicated NGINX config ynh_add_nginx_config