From c611f7a0d6a1d2053180778d398305278ab68749 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 24 Jun 2021 14:03:14 +0200 Subject: [PATCH] Fix --- scripts/install | 7 ++++++- scripts/upgrade | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index c5b1f86..a180b8d 100644 --- a/scripts/install +++ b/scripts/install @@ -125,13 +125,18 @@ done $php_exec fos:user:promote --super "$admin" #================================================= -# CONFIGURE FAIL2BAN +# CONFIGURE LOG #================================================= # Create the log file is not already existing during install mkdir -p "$final_path/var/logs/" touch "$final_path/var/logs/prod.log" chown $app: "$final_path/var/logs/prod.log" + +#================================================= +# CONFIGURE FAIL2BAN +#================================================= + # Add fail2ban config ynh_add_fail2ban_config --logpath="$final_path/var/logs/prod.log" --failregex='app.ERROR: Authentication failure for user "([\w]+)?", from IP ""' --max_retry=5 diff --git a/scripts/upgrade b/scripts/upgrade index 8d6fbac..2826443 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,7 +125,10 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config --package="$extra_php_dependencies" -# Add fail2ban config +#================================================= +# CONFIGURE FAIL2BAN +#================================================= + ynh_add_fail2ban_config --logpath="$final_path/var/logs/prod.log" --failregex='app.ERROR: Authentication failure for user "([\w]+)?", from IP ""' --max_retry=5 # same as install config #=================================================