From ec128d2008ce9deeb932311e7c022f0a452f8f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:06:10 +0200 Subject: [PATCH] cleaning --- scripts/backup | 6 +----- scripts/install | 14 -------------- scripts/remove | 3 --- scripts/restore | 1 - scripts/upgrade | 42 +++++++++--------------------------------- 5 files changed, 10 insertions(+), 56 deletions(-) diff --git a/scripts/backup b/scripts/backup index ba7792d..82951e9 100755 --- a/scripts/backup +++ b/scripts/backup @@ -19,15 +19,11 @@ ynh_backup "$install_dir" ynh_backup "$data_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" #================================================= diff --git a/scripts/install b/scripts/install index 19be64d..7c9a252 100755 --- a/scripts/install +++ b/scripts/install @@ -5,18 +5,6 @@ source /usr/share/yunohost/helpers ynh_app_setting_set --key=php_upload_max_filesize --value=256M -# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | fpm_footprint="low" -# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_free_footprint=0 -# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | fpm_usage="low" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - -# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint -# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint -# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -39,10 +27,8 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated PHP-FPM config ynh_config_add_phpfpm #================================================= diff --git a/scripts/remove b/scripts/remove index dc7ebbf..9f3b139 100755 --- a/scripts/remove +++ b/scripts/remove @@ -8,13 +8,10 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Removing system configurations related to $app..." -# Remove the app-specific logrotate config ynh_config_remove_logrotate -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config ynh_config_remove_phpfpm #================================================= diff --git a/scripts/restore b/scripts/restore index fc9f859..e085db5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,6 +1,5 @@ #!/bin/bash -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index e046b0b..5fedfd9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -10,24 +10,6 @@ ynh_app_setting_set_default --key=php_upload_max_filesize --value=256M #================================================= ynh_script_progression "Ensuring downward compatibility..." -# If fpm_footprint doesn't exist, create it -if [ -z "${fpm_footprint:-}" ]; then - fpm_footprint=low -# REMOVEME ? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint -fi - -# If fpm_free_footprint doesn't exist, create it -if [ -z "${fpm_free_footprint:-}" ]; then - fpm_free_footprint=0 -# REMOVEME ? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint -fi - -# If fpm_usage doesn't exist, create it -if [ -z "${fpm_usage:-}" ]; then - fpm_usage=low -# REMOVEME ? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage -fi - # If release_cycle doesn't exist, create it # FIXME: maybe replace with: ynh_app_setting_set_default --key=release_cycle --value=longterm if [ -z "${release_cycle:-}" ]; then @@ -38,21 +20,17 @@ fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -if ynh_app_upstream_version_changed +# Download, check integrity, uncompress and patch the source from app.src +source_id_to_use="main" +if [[ "$release_cycle" == "longterm" ]] then - ynh_script_progression "Upgrading source files..." - - # Download, check integrity, uncompress and patch the source from app.src - source_id_to_use="main" - if [[ "$release_cycle" == "longterm" ]] - then - source_id_to_use="lts" - fi - - ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use" + source_id_to_use="lts" fi +ynh_setup_source --dest_dir="$install_dir" --source_id="$source_id_to_use" + chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -60,14 +38,12 @@ chown -R $app:www-data "$install_dir" (cd "$install_dir" && ynh_exec_as_app php${php_version} --define apc.enable_cli=1 console.php database:update) #================================================= -# NGINX CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression "Upgrading NGINX web server configuration..." +ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated PHP-FPM config ynh_config_add_phpfpm #=================================================