Add support for custom nginx
This commit is contained in:
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- [STACK] Nginx server_names_hash_bucket_size automated fix
|
- [STACK] Nginx server_names_hash_bucket_size automated fix
|
||||||
- [STACK] Nginx configuration rollback in case of failure after `wo stack upgrade --nginx
|
- [STACK] Nginx configuration rollback in case of failure after `wo stack upgrade --nginx
|
||||||
- [STACK] Nginx ultimate bad bots blocker with `wo stack install --ngxblocker`
|
- [STACK] Nginx ultimate bad bots blocker with `wo stack install --ngxblocker`
|
||||||
|
- [STACK] Added support for custom Nginx compiled from source
|
||||||
|
|
||||||
### v3.9.9.1 - 2019-09-26
|
### v3.9.9.1 - 2019-09-26
|
||||||
|
|
||||||
|
|||||||
@@ -847,6 +847,8 @@ def site_package_check(self, stype):
|
|||||||
apt = ["nginx"] + WOVariables.wo_nginx
|
apt = ["nginx"] + WOVariables.wo_nginx
|
||||||
# apt_packages = apt_packages + WOVariables.wo_nginx
|
# apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
post_pref(self, apt, packages)
|
post_pref(self, apt, packages)
|
||||||
|
elif os.file.isfile('/usr/sbin/nginx'):
|
||||||
|
post_pref(self, WOVariables.wo_nginx, [])
|
||||||
else:
|
else:
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
else:
|
else:
|
||||||
@@ -920,6 +922,16 @@ def site_package_check(self, stype):
|
|||||||
else:
|
else:
|
||||||
apt_packages = apt_packages + WOVariables.wo_php73
|
apt_packages = apt_packages + WOVariables.wo_php73
|
||||||
|
|
||||||
|
if self.app.pargs.ngxblocker:
|
||||||
|
if not os.path.isdir('/etc/nginx/bots.d'):
|
||||||
|
Log.debug(self, "Setting packages variable for ngxblocker")
|
||||||
|
packages = packages + \
|
||||||
|
[["https://raw.githubusercontent.com/"
|
||||||
|
"mitchellkrogza/nginx-ultimate-bad-bot-blocker"
|
||||||
|
"/master/install-ngxblocker",
|
||||||
|
"/usr/local/sbin/install-ngxblocker",
|
||||||
|
"ngxblocker"]]
|
||||||
|
|
||||||
return(stack.install(apt_packages=apt_packages, packages=packages,
|
return(stack.install(apt_packages=apt_packages, packages=packages,
|
||||||
disp_msg=False))
|
disp_msg=False))
|
||||||
|
|
||||||
|
|||||||
@@ -159,11 +159,11 @@ class WOStackController(CementBaseController):
|
|||||||
# Nginx
|
# Nginx
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
Log.debug(self, "Setting apt_packages variable for Nginx")
|
Log.debug(self, "Setting apt_packages variable for Nginx")
|
||||||
|
|
||||||
if not (WOAptGet.is_installed(self, 'nginx-custom')):
|
if not (WOAptGet.is_installed(self, 'nginx-custom')):
|
||||||
if not (WOAptGet.is_installed(self, 'nginx-plus') or
|
if not (WOAptGet.is_installed(self, 'nginx-plus') or
|
||||||
WOAptGet.is_installed(self, 'nginx')):
|
WOAptGet.is_installed(self, 'nginx')):
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
if not os.path.isfile('/usr/sbin/nginx'):
|
||||||
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
else:
|
else:
|
||||||
if WOAptGet.is_installed(self, 'nginx-plus'):
|
if WOAptGet.is_installed(self, 'nginx-plus'):
|
||||||
Log.info(self, "NGINX PLUS Detected ...")
|
Log.info(self, "NGINX PLUS Detected ...")
|
||||||
@@ -177,7 +177,7 @@ class WOStackController(CementBaseController):
|
|||||||
apt = ["nginx"] + WOVariables.wo_nginx
|
apt = ["nginx"] + WOVariables.wo_nginx
|
||||||
self.post_pref(apt, empty_packages)
|
self.post_pref(apt, empty_packages)
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "Nginx Stable already installed")
|
Log.debug(self, "Nginx already installed")
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
if pargs.redis:
|
if pargs.redis:
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
if WOAptGet.is_installed(self, 'nginx-custom'):
|
if WOAptGet.is_installed(self, 'nginx-custom'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx Stable is not already installed")
|
if os.path.isfile(self, '/usr/sbin/nginx'):
|
||||||
|
Log.info(self, "Updating Nginx templates")
|
||||||
|
post_pref(self, WOVariables.wo_nginx, [])
|
||||||
|
else:
|
||||||
|
Log.info(self, "Nginx Stable is not already installed")
|
||||||
|
|
||||||
if pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
|
|||||||
Reference in New Issue
Block a user