another fail2ban fix

This commit is contained in:
VirtuBox
2020-01-30 15:37:56 +01:00
parent 8e40bac374
commit 6421e045b0

View File

@@ -1023,22 +1023,21 @@ def post_pref(self, apt_packages, packages, upgrade=False):
msg="Adding Fail2ban into Git") msg="Adding Fail2ban into Git")
Log.info(self, "Configuring Fail2Ban") Log.info(self, "Configuring Fail2Ban")
data = dict(release=WOVar.wo_version) data = dict(release=WOVar.wo_version)
if WOAptGet.is_exec(self, 'nginx'): WOTemplate.deploy(
WOTemplate.deploy( self,
self, '/etc/fail2ban/jail.d/custom.conf',
'/etc/fail2ban/jail.d/custom.conf', 'fail2ban.mustache',
'fail2ban.mustache', data, overwrite=False)
data, overwrite=False) WOTemplate.deploy(
WOTemplate.deploy( self,
self, '/etc/fail2ban/filter.d/wo-wordpress.conf',
'/etc/fail2ban/filter.d/wo-wordpress.conf', 'fail2ban-wp.mustache',
'fail2ban-wp.mustache', data, overwrite=False)
data, overwrite=False) WOTemplate.deploy(
WOTemplate.deploy( self,
self, '/etc/fail2ban/filter.d/nginx-forbidden.conf',
'/etc/fail2ban/filter.d/nginx-forbidden.conf', 'fail2ban-forbidden.mustache',
'fail2ban-forbidden.mustache', data, overwrite=False)
data, overwrite=False)
if not WOService.reload_service(self, 'fail2ban'): if not WOService.reload_service(self, 'fail2ban'):
WOGit.rollback( WOGit.rollback(