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:
parent
8f670668e9
commit
ebbeecde1f
2 changed files with 4 additions and 4 deletions
|
@ -55,7 +55,7 @@ ynh_use_logrotate
|
||||||
ynh_script_progression --message="Upgrading fail2ban configuration..."
|
ynh_script_progression --message="Upgrading fail2ban configuration..."
|
||||||
|
|
||||||
# Create the logfile, required before configuring fail2ban
|
# 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
|
# 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/${domain}-access.log" --failregex="<HOST> .* \"GET /api/.*\" 401" --max_retry=5
|
||||||
|
|
|
@ -106,12 +106,12 @@ ynh_use_logrotate --non-append
|
||||||
ynh_script_progression --message="Upgrading fail2ban configuration..."
|
ynh_script_progression --message="Upgrading fail2ban configuration..."
|
||||||
|
|
||||||
# If it doesn't exist, create the logfile, required before configuring fail2ban
|
# If it doesn't exist, create the logfile, required before configuring fail2ban
|
||||||
if [ ! -f "/var/log/${domain}-access.log" ]; then
|
if [ ! -f "/var/log/nginx/${domain}-access.log" ]; then
|
||||||
touch "/var/log/${domain}-access.log"
|
touch "/var/log/nginx/${domain}-access.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# 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
|
# SPECIFIC UPGRADE
|
||||||
|
|
Loading…
Add table
Reference in a new issue