mirror of
https://github.com/YunoHost-Apps/dokuwiki_ynh.git
synced 2024-09-03 18:26:20 +02:00
Normalization...
This commit is contained in:
parent
bf641f873f
commit
71b270ab18
5 changed files with 12 additions and 5 deletions
|
@ -52,9 +52,10 @@ ynh_backup "/etc/php/7.0/fpm/pool.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP FAIL2BAN CONFIGURATION
|
# BACKUP FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Backing up fail2ban configuration..."
|
||||||
|
|
||||||
ynh_backup "/etc/fail2ban/jail.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_backup "/etc/fail2ban/filter.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -161,6 +161,7 @@ ynh_store_file_checksum "$final_path/conf/local.protected.php"
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
|
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Installing logautherror plugin for fail2ban..." --weight=2
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
|
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
|
||||||
|
|
||||||
|
@ -210,6 +211,7 @@ find $final_path/lib -type d -print0 | xargs -0 chmod 0755
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Configuring fail2ban..." --weight=7
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ ynh_remove_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE FAIL2BAN CONFIGURATION
|
# REMOVE FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing fail2ban configuration..." --weight=7
|
||||||
|
|
||||||
ynh_remove_fail2ban_config
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
|
|
|
@ -94,10 +94,11 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE FAIL2BAN CONFIGURATION
|
# RESTORE FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the fail2ban configuration..." --weight=7
|
||||||
|
|
||||||
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
systemctl restart fail2ban
|
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -242,6 +242,7 @@ ynh_store_file_checksum "$final_path/conf/local.protected.php"
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
|
# INSTALL LOGAUTHERROR PLUGIN FOR FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Upgrading logautherror plugin for fail2ban..." --weight=2
|
||||||
|
|
||||||
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
|
ynh_setup_source --dest_dir="$final_path/lib/plugins/logautherror" --source_id=logautherror
|
||||||
|
|
||||||
|
@ -291,6 +292,7 @@ find $final_path/lib -type d -print0 | xargs -0 chmod 0755
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Reconfiguring fail2ban..." --weight=7
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure. while reading response header from upstream, client: <HOST>,.*POST $path_url.*$" --max_retry=5
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue