Fix variables_hash_bucket_size

This commit is contained in:
VirtuBox
2019-12-05 20:36:18 +01:00
parent 69d6b67b8b
commit e45955a513
3 changed files with 19 additions and 7 deletions

View File

@@ -8,9 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased]
#### Changed
#### Fixed
- Install ngxblocker with Nginx to set proper values for variables_hash_bucket_size & variables_hash_max_size without conflicts
- Issue with Nginx variables_hash_bucket_size & variables_hash_max_size
### v3.11.1 - 2019-12-04

View File

@@ -321,9 +321,15 @@ def post_pref(self, apt_packages, packages, upgrade=False):
"'\"$http_referer\" "
"\"$http_user_agent\"';\n")
# Nginx-Plus does not have nginx
# package structure like this
# So creating directories
if not os.path.exists('/etc/nginx/bots.d'):
WOFileUtils.textwrite(
self, '/etc/nginx/conf.d/variables-hash.conf',
'variables_hash_max_size 4096;\n'
'variables_hash_bucket_size 4096;')
# Nginx-Plus does not have nginx
# package structure like this
# So creating directories
if not os.path.exists('/etc/nginx/sites-available'):
Log.debug(self, 'Creating directory'
'/etc/nginx/sites-available')
@@ -1585,11 +1591,16 @@ def post_pref(self, apt_packages, packages, upgrade=False):
# ngxblocker
if any('/usr/local/sbin/install-ngxblocker' == x[1]
for x in packages):
# remove duplicate directives
if os.path.exists('/etc/nginx/conf.d/variables-hash.conf'):
WOFileUtils.rm(self, '/etc/nginx/conf.d/variables-hash.conf')
WOFileUtils.chmod(
self, "/usr/local/sbin/install-ngxblocker", 0o700)
WOShellExec.cmd_exec(self, '/usr/local/sbin/install-ngxblocker -x')
WOFileUtils.chmod(
self, "/usr/local/sbin/update-ngxblocker", 0o700)
if not WOService.restart_service(self, 'nginx'):
Log.error(self, 'ngxblocker install failed')
def pre_stack(self):

View File

@@ -269,8 +269,6 @@ class WOStackUpgradeController(CementBaseController):
'/usr/local/sbin/update-ngxblocker',
'ngxblocker'
]]
else:
Log.info(self, "ngxblocker is not installed")
if ((not (apt_packages)) and (not(packages))):
self.app.args.print_help()
@@ -347,6 +345,9 @@ class WOStackUpgradeController(CementBaseController):
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
if WOAptGet.is_selected(self, 'ngxblocker', packages):
if os.path.exists('/etc/nginx/conf.d/variables-hash.conf'):
WOFileUtils.rm(
self, '/etc/nginx/conf.d/variables-hash.conf')
WOFileUtils.chmod(
self, '/usr/local/sbin/update-ngxblocker', 0o775)
WOShellExec.cmd_exec(