From 8b29633460d5ef1daabca9a2a10e83c3a39eb676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:48:45 +0200 Subject: [PATCH] cleaning --- manifest.toml | 2 +- scripts/backup | 9 --------- scripts/install | 11 ----------- scripts/remove | 3 --- scripts/restore | 2 -- scripts/upgrade | 18 ++---------------- 6 files changed, 3 insertions(+), 42 deletions(-) diff --git a/manifest.toml b/manifest.toml index 5f33b1b..a47d65b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,7 +19,7 @@ admindoc = "https://docs.itflow.org/installation" code = "https://github.com/itflow-org/itflow" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.29" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/backup b/scripts/backup index 1be73a8..0f78ab4 100755 --- a/scripts/backup +++ b/scripts/backup @@ -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 @@ -18,16 +17,8 @@ ynh_backup "$install_dir" 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" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup "/etc/cron.d/$app" #================================================= diff --git a/scripts/install b/scripts/install index 6cad8b6..739d128 100755 --- a/scripts/install +++ b/scripts/install @@ -5,17 +5,13 @@ source /usr/share/yunohost/helpers ynh_app_setting_set --key=php_upload_max_filesize --value=500M -#================================================= -# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= @@ -26,11 +22,7 @@ ynh_config_add_phpfpm ynh_config_add_nginx ynh_config_add --template="cron" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" -#================================================= -# APP INITIAL CONFIGURATION #================================================= # ADD A CONFIGURATION #================================================= @@ -38,9 +30,6 @@ ynh_config_add --template="cron" --destination="/etc/cron.d/$app" #ynh_config_add --template="config.php" --destination="$install_dir/config.php" -##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "$install_dir/config.php" -##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.php" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 8b3d88b..af48d46 100755 --- a/scripts/remove +++ b/scripts/remove @@ -5,9 +5,6 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS -#================================================= -# REMOVE SYSTEMD SERVICE - #================================================= ynh_script_progression "Removing system configurations related to $app..." diff --git a/scripts/restore b/scripts/restore index 51bfa9e..7305cf1 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 @@ -11,7 +10,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f5159e2..48cd7fb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,22 +12,13 @@ ynh_script_progression "Stopping $app's systemd service..." ynh_systemctl --service=$app --action="stop" -#================================================= -# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." +ynh_setup_source --dest_dir="$install_dir" # --full_replace --keep="config.php" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" # --full_replace --keep="config.php" -fi - -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -37,8 +28,6 @@ ynh_config_add_phpfpm ynh_config_add_nginx -#================================================= -# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= # UPDATE A CONFIG FILE #================================================= @@ -46,9 +35,6 @@ ynh_config_add_nginx #ynh_config_add --template="config.php" --destination="$install_dir/config.php" -##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.php" -##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.php" - #================================================= # END OF SCRIPT #=================================================