From cc401d5d3b14d5c18625945e3ab482aae1095b83 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 Jun 2024 23:05:37 +0200 Subject: [PATCH] cleaning --- scripts/backup | 4 ---- scripts/install | 18 +----------------- scripts/upgrade | 43 +++++-------------------------------------- 3 files changed, 6 insertions(+), 59 deletions(-) diff --git a/scripts/backup b/scripts/backup index 6854aaa..e2e0c78 100644 --- a/scripts/backup +++ b/scripts/backup @@ -27,10 +27,6 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= diff --git a/scripts/install b/scripts/install index 711ba42..c8629ee 100644 --- a/scripts/install +++ b/scripts/install @@ -9,22 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -fpm_footprint="low" -fpm_free_footprint=0 -fpm_usage="low" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -42,7 +26,7 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=10 ynh_add_nginx_config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config #================================================= # MODIFY A CONFIG FILE diff --git a/scripts/upgrade b/scripts/upgrade index b15c0a5..c78fc96 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,46 +9,13 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# If fpm_footprint doesn't exist, create it -if [ -z "${fpm_footprint:-}" ]; then - fpm_footprint=low - ynh_app_setting_set --app=$app --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 - ynh_app_setting_set --app=$app --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 - ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=5 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=5 - - ynh_setup_source --dest_dir="$install_dir" --keep="data" - ynh_secure_remove --file="$install_dir/data/viewcache/*" -fi +ynh_setup_source --dest_dir="$install_dir" --keep="data" +ynh_secure_remove --file="$install_dir/data/viewcache/*" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -61,13 +28,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_add_nginx_config # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_add_fpm_config #================================================= # MODIFY A CONFIG FILE #================================================= -#ynh_add_config --template="../conf/config-dist.php" --destination="$install_dir/data/config.php" +#ynh_add_config --template="config-dist.php" --destination="$install_dir/data/config.php" #chmod 400 "$install_dir/data/config.php" #chown $app "$install_dir/data/config.php"