Fix ngxblocker stack
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
# All built-in application controllers should be imported, and registered
|
||||
# in this file in the same way as WOBaseController.
|
||||
|
||||
from cement.core import handler
|
||||
|
||||
from wo.cli.controllers.base import WOBaseController
|
||||
|
||||
|
||||
@@ -340,7 +340,8 @@ class WOStackController(CementBaseController):
|
||||
"adminer/index.php"
|
||||
.format(wo_webroot)):
|
||||
Log.debug(self, "Setting packages variable for Adminer ")
|
||||
packages = packages + [["https://github.com/vrana/adminer/"
|
||||
packages = packages + [[
|
||||
"https://github.com/vrana/adminer/"
|
||||
"releases/download/v{0}"
|
||||
"/adminer-{0}.php"
|
||||
.format(WOVar.wo_adminer),
|
||||
@@ -399,8 +400,8 @@ class WOStackController(CementBaseController):
|
||||
if not os.path.isfile('/var/www/22222/htdocs/index.php'):
|
||||
Log.debug(self,
|
||||
"Setting packages variable for WO-Dashboard")
|
||||
packages = \
|
||||
packages + [["https://github.com/WordOps"
|
||||
packages = packages + [[
|
||||
"https://github.com/WordOps"
|
||||
"/wordops-dashboard/"
|
||||
"releases/download/v{0}/"
|
||||
"wordops-dashboard.tar.gz"
|
||||
@@ -441,7 +442,8 @@ class WOStackController(CementBaseController):
|
||||
# UTILS
|
||||
if pargs.utils:
|
||||
Log.debug(self, "Setting packages variable for utils")
|
||||
packages = packages + [["https://raw.githubusercontent.com"
|
||||
packages = packages + [[
|
||||
"https://raw.githubusercontent.com"
|
||||
"/rtCamp/eeadmin/master/cache/nginx/"
|
||||
"clean.php",
|
||||
"{0}22222/htdocs/cache/"
|
||||
@@ -698,12 +700,14 @@ class WOStackController(CementBaseController):
|
||||
'{0}22222/htdocs/db/anemometer'
|
||||
.format(WOVar.wo_webroot)]
|
||||
|
||||
# netdata
|
||||
if pargs.netdata:
|
||||
Log.debug(self, "Removing Netdata")
|
||||
if os.path.isfile('/opt/netdata/usr/'
|
||||
'libexec/netdata/netdata-uninstaller.sh'):
|
||||
packages = packages + ['/var/lib/wo/tmp/kickstart.sh']
|
||||
|
||||
# wordops dashboard
|
||||
if pargs.dashboard:
|
||||
if (os.path.isfile('{0}22222/htdocs/index.php'
|
||||
.format(WOVar.wo_webroot)) or
|
||||
@@ -716,6 +720,16 @@ class WOStackController(CementBaseController):
|
||||
.format(WOVar.wo_webroot),
|
||||
'{0}22222/htdocs/index.html'
|
||||
.format(WOVar.wo_webroot)]
|
||||
# ngxblocker
|
||||
if pargs.ngxblocker:
|
||||
if os.path.isfile('/usr/local/sbin/setup-ngxblocker'):
|
||||
packages = packages + [
|
||||
'/usr/local/sbin/setup-ngxblocker',
|
||||
'/usr/local/sbin/install-ngxblocker',
|
||||
'/usr/local/sbin/update-ngxblocker',
|
||||
'/etc/nginx/conf.d/globalblacklist.conf',
|
||||
'/etc/nginx/conf.d/botblocker-nginx-settings.conf',
|
||||
'/etc/nginx/bots.d']
|
||||
|
||||
if (packages) or (apt_packages):
|
||||
if (not pargs.force):
|
||||
@@ -738,11 +752,13 @@ class WOStackController(CementBaseController):
|
||||
if (set(['/var/lib/wo/tmp/'
|
||||
'kickstart.sh']).issubset(set(packages))):
|
||||
if WOVar.wo_distro == 'Raspbian':
|
||||
WOShellExec.cmd_exec(self, "bash /usr/"
|
||||
WOShellExec.cmd_exec(
|
||||
self, "bash /usr/"
|
||||
"libexec/netdata/"
|
||||
"netdata-uninstaller.sh -y -f")
|
||||
else:
|
||||
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
||||
WOShellExec.cmd_exec(
|
||||
self, "bash /opt/netdata/usr/"
|
||||
"libexec/netdata/"
|
||||
"netdata-uninstaller.sh - y - f",
|
||||
errormsg='', log=False)
|
||||
@@ -957,6 +973,7 @@ class WOStackController(CementBaseController):
|
||||
'libexec/netdata/netdata-uninstaller.sh'):
|
||||
packages = packages + ['/var/lib/wo/tmp/kickstart.sh']
|
||||
|
||||
# wordops dashboard
|
||||
if pargs.dashboard:
|
||||
Log.debug(self, "Removing Wo-Dashboard")
|
||||
packages = packages + ['{0}22222/htdocs/assets/'
|
||||
@@ -964,6 +981,17 @@ class WOStackController(CementBaseController):
|
||||
'{0}22222/htdocs/index.php'
|
||||
.format(WOVar.wo_webroot)]
|
||||
|
||||
# ngxblocker
|
||||
if pargs.ngxblocker:
|
||||
if os.path.isfile('/usr/local/sbin/setup-ngxblocker'):
|
||||
packages = packages + [
|
||||
'/usr/local/sbin/setup-ngxblocker',
|
||||
'/usr/local/sbin/install-ngxblocker',
|
||||
'/usr/local/sbin/update-ngxblocker',
|
||||
'/etc/nginx/conf.d/globalblacklist.conf',
|
||||
'/etc/nginx/conf.d/botblocker-nginx-settings.conf',
|
||||
'/etc/nginx/bots.d']
|
||||
|
||||
if (packages) or (apt_packages):
|
||||
if (not pargs.force):
|
||||
start_purge = input('Are you sure you to want to'
|
||||
|
||||
Reference in New Issue
Block a user