1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/httpsh_ynh.git synced 2024-09-03 19:25:55 +02:00

Fix /var/log/app creation before fail2ban run

This commit is contained in:
Félix Piédallu 2023-09-26 12:28:43 +02:00
parent 04d33c8b98
commit 37f459efd2
2 changed files with 7 additions and 0 deletions

View file

@ -36,6 +36,11 @@ ynh_add_systemd_config
yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/var/log/$app/$app.log"
mkdir "/var/log/$app"
touch "/var/log/$app/$app.log"
chown -R "$app:$app" "/var/log/$app"
chmod -R 750 "/var/log/$app"
ynh_use_logrotate
ynh_add_fail2ban_config --logpath="/var/log/$app/$app.log" --failregex="^error: maximum authentication attempts exceeded for <F-USER>.*</F-USER> from <HOST>$"

View file

@ -34,6 +34,8 @@ yunohost service add "$app" --description="httpsh on ttyd web terminal" --log="/
mkdir "/var/log/$app"
touch "/var/log/$app/$app.log"
chown -R "$app:$app" "/var/log/$app"
chmod -R 750 "/var/log/$app"
ynh_restore_file --origin_path="/etc/logrotate.d/$app"