1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/freshrss_ynh.git synced 2024-09-03 18:36:33 +02:00

scripts: fix path of log file for fail2ban

This commit is contained in:
Gwen Lg 2023-12-25 11:41:44 +01:00
parent 8f670668e9
commit ebbeecde1f
2 changed files with 4 additions and 4 deletions

View file

@ -55,7 +55,7 @@ ynh_use_logrotate
ynh_script_progression --message="Upgrading fail2ban configuration..."
# Create the logfile, required before configuring fail2ban
touch "/var/log/${domain}-access.log"
touch "/var/log/nginx/${domain}-access.log"
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/${domain}-access.log" --failregex="<HOST> .* \"GET /api/.*\" 401" --max_retry=5

View file

@ -106,12 +106,12 @@ ynh_use_logrotate --non-append
ynh_script_progression --message="Upgrading fail2ban configuration..."
# If it doesn't exist, create the logfile, required before configuring fail2ban
if [ ! -f "/var/log/${domain}-access.log" ]; then
touch "/var/log/${domain}-access.log"
if [ ! -f "/var/log/nginx/${domain}-access.log" ]; then
touch "/var/log/nginx/${domain}-access.log"
fi
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/${domain}-access.log" --failregex="<HOST> .* \"GET /api/.*\" 401" --max_retry=5
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-access.log" --failregex="<HOST> .* \"GET /api/.*\" 401" --max_retry=5
#=================================================
# SPECIFIC UPGRADE