Add support for custom nginx

This commit is contained in:
VirtuBox
2019-09-27 14:15:00 +02:00
parent 8f886b5dcd
commit 5fbb0f58e6
4 changed files with 21 additions and 4 deletions

View File

@@ -847,6 +847,8 @@ def site_package_check(self, stype):
apt = ["nginx"] + WOVariables.wo_nginx
# apt_packages = apt_packages + WOVariables.wo_nginx
post_pref(self, apt, packages)
elif os.file.isfile('/usr/sbin/nginx'):
post_pref(self, WOVariables.wo_nginx, [])
else:
apt_packages = apt_packages + WOVariables.wo_nginx
else:
@@ -920,6 +922,16 @@ def site_package_check(self, stype):
else:
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,
disp_msg=False))