From e5ab15ffdac1f16616213b4fe17163511da6510c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 13 Aug 2023 22:48:21 +0200 Subject: [PATCH] cleaning --- manifest.toml | 2 +- scripts/install | 5 ----- scripts/remove | 17 ----------------- scripts/restore | 29 +++++++---------------------- 4 files changed, 8 insertions(+), 45 deletions(-) diff --git a/manifest.toml b/manifest.toml index 0a4d0f2..1aed414 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://codex.wordpress.org/" code = "https://core.trac.wordpress.org/browser" [integration] -yunohost = ">= 11.1.21" +yunohost = ">= 11.2" architectures = "all" multi_instance = true ldap = true diff --git a/scripts/install b/scripts/install index 9254878..ec0e781 100644 --- a/scripts/install +++ b/scripts/install @@ -17,11 +17,6 @@ if [ "$path" == "/" ] && [ $multisite -eq 1 ]; then ynh_die --message="Multisite option of WordPress doesn't work at the root of a domain." fi -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/remove b/scripts/remove index be80278..5bf850b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,29 +17,12 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=2 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=8 - # Remove the dedicated Fail2Ban config ynh_remove_fail2ban_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" diff --git a/scripts/restore b/scripts/restore index 76707f8..ba5afdb 100644 --- a/scripts/restore +++ b/scripts/restore @@ -38,13 +38,11 @@ chmod 400 "$install_dir/wp-config.php" chown $app:$app "$install_dir/wp-config.php" #================================================= -# RESTORE FAIL2BAN CONFIGURATION +# RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=6 +ynh_script_progression --message="Restoring the MySQL database..." --weight=3 -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -57,27 +55,14 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=2 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=3 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." --weight=1 - ynh_restore_file --origin_path="/etc/cron.d/$app" +ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" +ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" +ynh_systemd_action --action=restart --service_name=fail2ban + #================================================= # GENERIC FINALIZATION #=================================================