From eb4f85bd841211de9bf8bede9f2b20d38352a420 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Thu, 30 May 2019 00:14:48 +0200 Subject: [PATCH] Upgrade fail2ban for new_path and new_domain --- scripts/change_url | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index d705d5e..249d73b 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -75,7 +75,7 @@ then ynh_add_nginx_config fi -# Change the domain for nginx and update Fail2ban +# Change the domain for nginx if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -83,11 +83,17 @@ then mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf # Store file checksum for the new config file location ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Update Fail2ban configuration - ynh_add_fail2ban_config --logpath="/var/log/nginx/$new_domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: ,.*POST $path_url.*$" --max_retry=5 fi +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +# UPGRADE FAIL2BAN +#================================================= +ynh_script_progression --message="Reconfiguring fail2ban..." --weight=6 + +ynh_add_fail2ban_config --logpath="/var/log/nginx/$new_domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: ,.*POST $new_path.*$" --max_retry=5 + #================================================= # GENERIC FINALISATION #=================================================