From 0f49b834fb9038f997e02241345575f7cbcc8c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:41:11 +0100 Subject: [PATCH] cleaning --- conf/htconfig.php | 104 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/install | 36 ++++------------ scripts/upgrade | 17 ++------ 3 files changed, 115 insertions(+), 42 deletions(-) create mode 100644 conf/htconfig.php diff --git a/conf/htconfig.php b/conf/htconfig.php new file mode 100644 index 0000000..a2ad41c --- /dev/null +++ b/conf/htconfig.php @@ -0,0 +1,104 @@ +> $install_dir/.htconfig.php +chmod 400 "$install_dir/.htconfig.php" +chown $app:$app "$install_dir/.htconfig.php" #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 9f80986..1e11536 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -101,26 +101,15 @@ ynh_add_nginx_config # Create a dedicated php-fpm config ynh_add_fpm_config -### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. -### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. -ynh_backup_if_checksum_is_different --file="$install_dir/.htconfig.php" -# Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum --file="$install_dir/.htconfig.php" - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -ynh_add_fail2ban_config --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" --max_retry="5" - -#================================================= -# UPGRADE CRON -#================================================= -ynh_script_progression --message="Setting up cron job..." - -ynh_add_config --template=".poller-cron" --destination="/etc/cron.d/$app" +ynh_add_config --template="poller-cron" --destination="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" +ynh_add_fail2ban_config --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" --max_retry="5" + #================================================= # END OF SCRIPT #=================================================