1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Fail2ban fixes (#44)

* fix fail2ban

* fix fail2ban
This commit is contained in:
lapineige 2019-07-22 16:27:12 +02:00 committed by GitHub
parent 225d5fe51e
commit 4a7390447f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -31,7 +31,7 @@ pkg_dependencies="php-cli php-gettext php-curl php-intl php-gd php-mbstring open
# | arg: failregex - Failregex to be looked for by fail2ban
# | arg: max_retry - Maximum number of retries allowed before banning IP address - default: 3
# | arg: ports - Ports blocked for a banned IP address - default: http,https
ynh_add_fail2ban_config () {
ynh_add_fail2ban_config_temp () {
# Process parameters
logpath=$1
failregex=$2
@ -66,7 +66,7 @@ EOF
ynh_store_file_checksum "$finalfail2banjailconf"
ynh_store_file_checksum "$finalfail2banfilterconf"
systemctl restart fail2ban
service fail2ban restart
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
if [ -n "$fail2ban_error" ]
then

View file

@ -159,7 +159,7 @@ ynh_use_logrotate "$final_path/data/log.txt"
# SETUP FAIL2BAN
#=================================================
ynh_print_info "Add Fail2Ban configuration..."
ynh_add_fail2ban_config "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
ynh_add_fail2ban_config_temp "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
#=================================================
# SETUP SSOWAT

View file

@ -135,7 +135,7 @@ ynh_use_logrotate --non-append
# SETUP FAIL2BAN
#=================================================
ynh_print_info "Upgrading Fail2Ban configuration..."
ynh_add_fail2ban_config "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
ynh_add_fail2ban_config_temp "$final_path/data/log.txt" "\s-\s<HOST>\s-\sLogin failed for user.*$" 5
# Set right permissions
chown -R $app: $final_path