Fix fail2ban variable
This commit is contained in:
@@ -1077,29 +1077,28 @@ class WOStackController(CementBaseController):
|
|||||||
# create fail2ban configuration files
|
# create fail2ban configuration files
|
||||||
if set(WOVariables.wo_fail2ban).issubset(set(apt_packages)):
|
if set(WOVariables.wo_fail2ban).issubset(set(apt_packages)):
|
||||||
if not os.path.isfile("/etc/fail2ban/jail.d/custom.conf"):
|
if not os.path.isfile("/etc/fail2ban/jail.d/custom.conf"):
|
||||||
data = dict()
|
|
||||||
Log.debug(self, "Setting up fail2ban jails configuration")
|
Log.debug(self, "Setting up fail2ban jails configuration")
|
||||||
wo_fail2ban = open('/etc/fail2ban/jail.d/custom.conf',
|
fail2ban_config = open('/etc/fail2ban/jail.d/custom.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'fail2ban.mustache',
|
self.app.render((data), 'fail2ban.mustache',
|
||||||
out=wo_fail2ban)
|
out=wo_fail2ban)
|
||||||
wo_fail2ban.close()
|
fail2ban_config.close()
|
||||||
|
|
||||||
Log.debug(self, "Setting up fail2ban wp filter")
|
Log.debug(self, "Setting up fail2ban wp filter")
|
||||||
wo_fail2ban = open('/etc/fail2ban/filter.d/'
|
fail2ban_config = open('/etc/fail2ban/filter.d/'
|
||||||
'wo-wordpress.conf',
|
'wo-wordpress.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'fail2ban-wp.mustache',
|
self.app.render((data), 'fail2ban-wp.mustache',
|
||||||
out=wo_fail2ban)
|
out=wo_fail2ban)
|
||||||
wo_fail2ban.close()
|
fail2ban_config.close()
|
||||||
|
|
||||||
Log.debug(self, "Setting up fail2ban wp filter")
|
Log.debug(self, "Setting up fail2ban wp filter")
|
||||||
wo_fail2ban = open('/etc/fail2ban/filter.d/'
|
fail2ban_config = open('/etc/fail2ban/filter.d/'
|
||||||
'nginx-forbidden.conf',
|
'nginx-forbidden.conf',
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'fail2ban-forbidden.mustache',
|
self.app.render((data), 'fail2ban-forbidden.mustache',
|
||||||
out=wo_fail2ban)
|
out=wo_fail2ban)
|
||||||
wo_fail2ban.close()
|
fail2ban_config.close()
|
||||||
WOGit.add(self, ["/etc/fail2ban"],
|
WOGit.add(self, ["/etc/fail2ban"],
|
||||||
msg="Adding Fail2ban into Git")
|
msg="Adding Fail2ban into Git")
|
||||||
WOService.reload_service(self, 'fail2ban')
|
WOService.reload_service(self, 'fail2ban')
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ class WOStackStatusController(CementBaseController):
|
|||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
if not (self.app.pargs.nginx or self.app.pargs.php or
|
||||||
self.app.pargs.php73 or
|
self.app.pargs.php73 or
|
||||||
self.app.pargs.mysql or
|
self.app.pargs.mysql or
|
||||||
|
self.app.pargs.fail2ban or
|
||||||
self.app.pargs.redis):
|
self.app.pargs.redis):
|
||||||
self.app.pargs.nginx = True
|
self.app.pargs.nginx = True
|
||||||
self.app.pargs.php = True
|
self.app.pargs.php = True
|
||||||
|
|||||||
Reference in New Issue
Block a user