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,21 +340,22 @@ 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 + [[
|
||||||
"releases/download/v{0}"
|
"https://github.com/vrana/adminer/"
|
||||||
"/adminer-{0}.php"
|
"releases/download/v{0}"
|
||||||
.format(WOVar.wo_adminer),
|
"/adminer-{0}.php"
|
||||||
"{0}22222/"
|
.format(WOVar.wo_adminer),
|
||||||
"htdocs/db/adminer/index.php"
|
"{0}22222/"
|
||||||
.format(WOVar.wo_webroot),
|
"htdocs/db/adminer/index.php"
|
||||||
"Adminer"],
|
.format(WOVar.wo_webroot),
|
||||||
["https://raw.githubusercontent.com"
|
"Adminer"],
|
||||||
"/vrana/adminer/master/designs/"
|
["https://raw.githubusercontent.com"
|
||||||
"pepa-linha/adminer.css",
|
"/vrana/adminer/master/designs/"
|
||||||
"{0}22222/"
|
"pepa-linha/adminer.css",
|
||||||
"htdocs/db/adminer/adminer.css"
|
"{0}22222/"
|
||||||
.format(WOVar.wo_webroot),
|
"htdocs/db/adminer/adminer.css"
|
||||||
"Adminer theme"]]
|
.format(WOVar.wo_webroot),
|
||||||
|
"Adminer theme"]]
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "Adminer already installed")
|
Log.debug(self, "Adminer already installed")
|
||||||
Log.info(self, "Adminer already installed")
|
Log.info(self, "Adminer already installed")
|
||||||
@@ -399,14 +400,14 @@ 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"
|
||||||
.format(WOVar.wo_dashboard),
|
.format(WOVar.wo_dashboard),
|
||||||
"/var/lib/wo/tmp/wo-dashboard.tar.gz",
|
"/var/lib/wo/tmp/wo-dashboard.tar.gz",
|
||||||
"WordOps Dashboard"]]
|
"WordOps Dashboard"]]
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "WordOps dashboard already installed")
|
Log.debug(self, "WordOps dashboard already installed")
|
||||||
Log.info(self, "WordOps dashboard already installed")
|
Log.info(self, "WordOps dashboard already installed")
|
||||||
@@ -441,43 +442,44 @@ 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 + [[
|
||||||
"/rtCamp/eeadmin/master/cache/nginx/"
|
"https://raw.githubusercontent.com"
|
||||||
"clean.php",
|
"/rtCamp/eeadmin/master/cache/nginx/"
|
||||||
"{0}22222/htdocs/cache/"
|
"clean.php",
|
||||||
"nginx/clean.php"
|
"{0}22222/htdocs/cache/"
|
||||||
.format(WOVar.wo_webroot),
|
"nginx/clean.php"
|
||||||
"clean.php"],
|
.format(WOVar.wo_webroot),
|
||||||
["https://raw.github.com/rlerdorf/"
|
"clean.php"],
|
||||||
"opcache-status/master/opcache.php",
|
["https://raw.github.com/rlerdorf/"
|
||||||
"{0}22222/htdocs/cache/"
|
"opcache-status/master/opcache.php",
|
||||||
"opcache/opcache.php"
|
"{0}22222/htdocs/cache/"
|
||||||
.format(WOVar.wo_webroot),
|
"opcache/opcache.php"
|
||||||
"opcache.php"],
|
.format(WOVar.wo_webroot),
|
||||||
["https://raw.github.com/amnuts/"
|
"opcache.php"],
|
||||||
"opcache-gui/master/index.php",
|
["https://raw.github.com/amnuts/"
|
||||||
"{0}22222/htdocs/"
|
"opcache-gui/master/index.php",
|
||||||
"cache/opcache/opgui.php"
|
"{0}22222/htdocs/"
|
||||||
.format(WOVar.wo_webroot),
|
"cache/opcache/opgui.php"
|
||||||
"Opgui"],
|
.format(WOVar.wo_webroot),
|
||||||
["https://raw.githubusercontent.com/"
|
"Opgui"],
|
||||||
"mlazarov/ocp/master/ocp.php",
|
["https://raw.githubusercontent.com/"
|
||||||
"{0}22222/htdocs/cache/"
|
"mlazarov/ocp/master/ocp.php",
|
||||||
"opcache/ocp.php"
|
"{0}22222/htdocs/cache/"
|
||||||
.format(WOVar.wo_webroot),
|
"opcache/ocp.php"
|
||||||
"OCP.php"],
|
.format(WOVar.wo_webroot),
|
||||||
["https://github.com/jokkedk/webgrind/"
|
"OCP.php"],
|
||||||
"archive/master.tar.gz",
|
["https://github.com/jokkedk/webgrind/"
|
||||||
'/var/lib/wo/tmp/webgrind.tar.gz',
|
"archive/master.tar.gz",
|
||||||
'Webgrind'],
|
'/var/lib/wo/tmp/webgrind.tar.gz',
|
||||||
["https://www.percona.com/"
|
'Webgrind'],
|
||||||
"get/pt-query-digest",
|
["https://www.percona.com/"
|
||||||
"/usr/bin/pt-query-advisor",
|
"get/pt-query-digest",
|
||||||
"pt-query-advisor"],
|
"/usr/bin/pt-query-advisor",
|
||||||
["https://github.com/box/Anemometer/"
|
"pt-query-advisor"],
|
||||||
"archive/master.tar.gz",
|
["https://github.com/box/Anemometer/"
|
||||||
'/var/lib/wo/tmp/anemometer.tar.gz',
|
"archive/master.tar.gz",
|
||||||
'Anemometer']]
|
'/var/lib/wo/tmp/anemometer.tar.gz',
|
||||||
|
'Anemometer']]
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
@@ -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,14 +752,16 @@ 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(
|
||||||
"libexec/netdata/"
|
self, "bash /usr/"
|
||||||
"netdata-uninstaller.sh -y -f")
|
"libexec/netdata/"
|
||||||
|
"netdata-uninstaller.sh -y -f")
|
||||||
else:
|
else:
|
||||||
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
WOShellExec.cmd_exec(
|
||||||
"libexec/netdata/"
|
self, "bash /opt/netdata/usr/"
|
||||||
"netdata-uninstaller.sh - y - f",
|
"libexec/netdata/"
|
||||||
errormsg='', log=False)
|
"netdata-uninstaller.sh - y - f",
|
||||||
|
errormsg='', log=False)
|
||||||
|
|
||||||
if (packages):
|
if (packages):
|
||||||
Log.wait(self, "Removing packages ")
|
Log.wait(self, "Removing packages ")
|
||||||
@@ -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