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