1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00

Fix missing log file for fail2ban

This commit is contained in:
lapineige 2019-05-04 19:54:56 +02:00 committed by GitHub
parent f08fe78531
commit d492a2452e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,6 +114,14 @@ exec_console $app "${final_path}" cache:clear
ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_user" <<< "UPDATE craue_config_setting SET value = 'https://$domain$path_url' WHERE name = 'wallabag_url'"
# Set-up fail2ban
# Create the log file is not already existing
if [ ! -f "/var/www/$app/var/logs/prod.log" ];
then
mkdir -p "/var/www/$app/var/logs/"
touch "/var/www/$app/var/logs/prod.log"
chown $app: "/var/www/$app/var/logs/prod.log"
fi
# Add fail2ban config
ynh_add_fail2ban_config --logpath="/var/www/$app/var/logs/prod.log" --failregex='app.ERROR: Authentication failure for user "([\w]+)?", from IP "<HOST>"' --max_retry=5 # same as install config
#=================================================