From f2d768c3d3db8f4a4393bf15582b83bfe81cd332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:10:16 +0200 Subject: [PATCH] cleaning --- manifest.toml | 3 +-- scripts/install | 14 ++++---------- scripts/remove | 9 ++------- scripts/restore | 18 ++++++------------ scripts/upgrade | 11 +++-------- 5 files changed, 16 insertions(+), 39 deletions(-) diff --git a/manifest.toml b/manifest.toml index 92868e1..9bacfce 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ license = "MIT" code = "https://github.com/YunoHost-Apps/chtickynotes_ynh/" [integration] -yunohost = ">= 11.0.9" +yunohost = ">= 11.2" architectures = "all" multi_instance = false ldap = false # TODO: @@ -47,6 +47,5 @@ ram.runtime = "10M" [resources.apt] packages = [ - "php7.4", "php7.4-fpm", ] diff --git a/scripts/install b/scripts/install index 12a7ee8..76eb27d 100644 --- a/scripts/install +++ b/scripts/install @@ -16,23 +16,17 @@ ynh_script_progression --message="Setting up source files..." --weight=7 cp -a ../sources/* "$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= -# NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." - -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index f144c9c..a6a8ac5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,17 +10,12 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." - ynh_remove_fpm_config #================================================= diff --git a/scripts/restore b/scripts/restore index f3e1b37..076d3b4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,15 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -26,23 +17,26 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" +#================================================= +# RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." +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" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --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 2f33032..6b9b058 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,18 +21,13 @@ chmod -R o-rwx "$install_dir" chown -R "$app:www-data" "$install_dir" #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." - -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config #================================================= # END OF SCRIPT