Reduce WO size
This commit is contained in:
@@ -37,22 +37,23 @@ class WOCleanController(CementBaseController):
|
|||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
if (not (self.app.pargs.all or self.app.pargs.fastcgi or
|
pargs = self.app.pargs
|
||||||
self.app.pargs.memcached or self.app.pargs.opcache or
|
if (not (pargs.all or pargs.fastcgi or
|
||||||
self.app.pargs.redis)):
|
pargs.memcached or pargs.opcache or
|
||||||
|
pargs.redis)):
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
if self.app.pargs.all:
|
if pargs.all:
|
||||||
self.clean_memcached()
|
self.clean_memcached()
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
self.clean_opcache()
|
self.clean_opcache()
|
||||||
self.clean_redis()
|
self.clean_redis()
|
||||||
if self.app.pargs.fastcgi:
|
if pargs.fastcgi:
|
||||||
self.clean_fastcgi()
|
self.clean_fastcgi()
|
||||||
if self.app.pargs.memcached:
|
if pargs.memcached:
|
||||||
self.clean_memcached()
|
self.clean_memcached()
|
||||||
if self.app.pargs.opcache:
|
if pargs.opcache:
|
||||||
self.clean_opcache()
|
self.clean_opcache()
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
self.clean_redis()
|
self.clean_redis()
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
|
|||||||
@@ -35,31 +35,33 @@ class WOSecureController(CementBaseController):
|
|||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
if self.app.pargs.auth:
|
pargs = self.app.pargs
|
||||||
|
if pargs.auth:
|
||||||
self.secure_auth()
|
self.secure_auth()
|
||||||
if self.app.pargs.port:
|
if pargs.port:
|
||||||
self.secure_port()
|
self.secure_port()
|
||||||
if self.app.pargs.ip:
|
if pargs.ip:
|
||||||
self.secure_ip()
|
self.secure_ip()
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def secure_auth(self):
|
def secure_auth(self):
|
||||||
"""This function secures authentication"""
|
"""This function secures authentication"""
|
||||||
|
pargs = self.app.pargs
|
||||||
passwd = ''.join([random.choice
|
passwd = ''.join([random.choice
|
||||||
(string.ascii_letters + string.digits)
|
(string.ascii_letters + string.digits)
|
||||||
for n in range(24)])
|
for n in range(24)])
|
||||||
if not self.app.pargs.user_input:
|
if not pargs.user_input:
|
||||||
username = input("Provide HTTP authentication user "
|
username = input("Provide HTTP authentication user "
|
||||||
"name [{0}] :".format(WOVariables.wo_user))
|
"name [{0}] :".format(WOVariables.wo_user))
|
||||||
self.app.pargs.user_input = username
|
pargs.user_input = username
|
||||||
if username == "":
|
if username == "":
|
||||||
self.app.pargs.user_input = WOVariables.wo_user
|
pargs.user_input = WOVariables.wo_user
|
||||||
if not self.app.pargs.user_pass:
|
if not pargs.user_pass:
|
||||||
password = getpass.getpass("Provide HTTP authentication "
|
password = getpass.getpass("Provide HTTP authentication "
|
||||||
"password [{0}] :".format(passwd))
|
"password [{0}] :".format(passwd))
|
||||||
self.app.pargs.user_pass = password
|
pargs.user_pass = password
|
||||||
if password == "":
|
if password == "":
|
||||||
self.app.pargs.user_pass = passwd
|
pargs.user_pass = passwd
|
||||||
Log.debug(self, "printf username:"
|
Log.debug(self, "printf username:"
|
||||||
"$(openssl passwd -crypt "
|
"$(openssl passwd -crypt "
|
||||||
"password 2> /dev/null)\n\""
|
"password 2> /dev/null)\n\""
|
||||||
@@ -68,8 +70,8 @@ class WOSecureController(CementBaseController):
|
|||||||
"$(openssl passwd -crypt "
|
"$(openssl passwd -crypt "
|
||||||
"{password} 2> /dev/null)\n\""
|
"{password} 2> /dev/null)\n\""
|
||||||
"> /etc/nginx/htpasswd-wo 2>/dev/null"
|
"> /etc/nginx/htpasswd-wo 2>/dev/null"
|
||||||
.format(username=self.app.pargs.user_input,
|
.format(username=pargs.user_input,
|
||||||
password=self.app.pargs.user_pass),
|
password=pargs.user_pass),
|
||||||
log=False)
|
log=False)
|
||||||
WOGit.add(self, ["/etc/nginx"],
|
WOGit.add(self, ["/etc/nginx"],
|
||||||
msg="Adding changed secure auth into Git")
|
msg="Adding changed secure auth into Git")
|
||||||
@@ -77,41 +79,42 @@ class WOSecureController(CementBaseController):
|
|||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def secure_port(self):
|
def secure_port(self):
|
||||||
"""This function Secures port"""
|
"""This function Secures port"""
|
||||||
if self.app.pargs.user_input:
|
pargs = self.app.pargs
|
||||||
while not self.app.pargs.user_input.isdigit():
|
if pargs.user_input:
|
||||||
|
while not pargs.user_input.isdigit():
|
||||||
Log.info(self, "Please enter a valid port number ")
|
Log.info(self, "Please enter a valid port number ")
|
||||||
self.app.pargs.user_input = input("WordOps "
|
pargs.user_input = input("WordOps "
|
||||||
"admin port [22222]:")
|
"admin port [22222]:")
|
||||||
if not self.app.pargs.user_input:
|
if not pargs.user_input:
|
||||||
port = input("WordOps admin port [22222]:")
|
port = input("WordOps admin port [22222]:")
|
||||||
if port == "":
|
if port == "":
|
||||||
self.app.pargs.user_input = 22222
|
pargs.user_input = 22222
|
||||||
while not port.isdigit() and port != "":
|
while not port.isdigit() and port != "":
|
||||||
Log.info(self, "Please Enter valid port number :")
|
Log.info(self, "Please Enter valid port number :")
|
||||||
port = input("WordOps admin port [22222]:")
|
port = input("WordOps admin port [22222]:")
|
||||||
self.app.pargs.user_input = port
|
pargs.user_input = port
|
||||||
WOShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
|
WOShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
|
||||||
"{port} default_server ssl http2;/\" "
|
"{port} default_server ssl http2;/\" "
|
||||||
"/etc/nginx/sites-available/22222"
|
"/etc/nginx/sites-available/22222"
|
||||||
.format(port=self.app.pargs.user_input))
|
.format(port=pargs.user_input))
|
||||||
WOGit.add(self, ["/etc/nginx"],
|
WOGit.add(self, ["/etc/nginx"],
|
||||||
msg="Adding changed secure port into Git")
|
msg="Adding changed secure port into Git")
|
||||||
if not WOService.reload_service(self, 'nginx'):
|
if not WOService.reload_service(self, 'nginx'):
|
||||||
Log.error(self, "service nginx reload failed. "
|
Log.error(self, "service nginx reload failed. "
|
||||||
"check issues with `nginx -t` command")
|
"check issues with `nginx -t` command")
|
||||||
Log.info(self, "Successfully port changed {port}"
|
Log.info(self, "Successfully port changed {port}"
|
||||||
.format(port=self.app.pargs.user_input))
|
.format(port=pargs.user_input))
|
||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def secure_ip(self):
|
def secure_ip(self):
|
||||||
"""IP whitelisting"""
|
"""IP whitelisting"""
|
||||||
newlist = []
|
pargs = self.app.pargs
|
||||||
if not self.app.pargs.user_input:
|
if not pargs.user_input:
|
||||||
ip = input("Enter the comma separated IP addresses "
|
ip = input("Enter the comma separated IP addresses "
|
||||||
"to white list [127.0.0.1]:")
|
"to white list [127.0.0.1]:")
|
||||||
self.app.pargs.user_input = ip
|
pargs.user_input = ip
|
||||||
try:
|
try:
|
||||||
user_ip = self.app.pargs.user_input.split(',')
|
user_ip = pargs.user_input.split(',')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
user_ip = ['127.0.0.1']
|
user_ip = ['127.0.0.1']
|
||||||
|
|||||||
@@ -1235,7 +1235,8 @@ def post_pref(self, apt_packages, packages):
|
|||||||
'/usr/local/bin/composer')
|
'/usr/local/bin/composer')
|
||||||
WOFileUtils.chmod(self, "/usr/local/bin/composer", 0o775)
|
WOFileUtils.chmod(self, "/usr/local/bin/composer", 0o775)
|
||||||
Log.info(self, "Updating phpMyAdmin, please wait...")
|
Log.info(self, "Updating phpMyAdmin, please wait...")
|
||||||
WOShellExec.cmd_exec(self, "/usr/local/bin/composer update --no-plugins --no-scripts "
|
WOShellExec.cmd_exec(self, "/usr/local/bin/composer update "
|
||||||
|
"--no-plugins --no-scripts "
|
||||||
"-n --no-dev -d "
|
"-n --no-dev -d "
|
||||||
"/var/www/22222/htdocs/db/pma/")
|
"/var/www/22222/htdocs/db/pma/")
|
||||||
WOFileUtils.chown(self, '{0}22222/htdocs/db/pma'
|
WOFileUtils.chown(self, '{0}22222/htdocs/db/pma'
|
||||||
|
|||||||
@@ -18,24 +18,25 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def start(self):
|
def start(self):
|
||||||
"""Start services"""
|
"""Start services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
pargs = pargs = self.app.pargs
|
||||||
self.app.pargs.php73 or
|
if not (pargs.nginx or pargs.php or
|
||||||
self.app.pargs.mysql or
|
pargs.php73 or
|
||||||
self.app.pargs.redis or
|
pargs.mysql or
|
||||||
self.app.pargs.fail2ban or
|
pargs.redis or
|
||||||
self.app.pargs.proftpd or
|
pargs.fail2ban or
|
||||||
self.app.pargs.netdata):
|
pargs.proftpd or
|
||||||
self.app.pargs.nginx = True
|
pargs.netdata):
|
||||||
self.app.pargs.php = True
|
pargs.nginx = True
|
||||||
self.app.pargs.mysql = True
|
pargs.php = True
|
||||||
|
pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.2-fpm']
|
||||||
else:
|
else:
|
||||||
@@ -45,13 +46,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.3-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
@@ -64,27 +65,27 @@ class WOStackStatusController(CementBaseController):
|
|||||||
Log.warn(self, "Remote MySQL found, "
|
Log.warn(self, "Remote MySQL found, "
|
||||||
"Unable to check MySQL service status")
|
"Unable to check MySQL service status")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
services = services + ['redis-server']
|
services = services + ['redis-server']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis server is not installed")
|
Log.info(self, "Redis server is not installed")
|
||||||
|
|
||||||
if self.app.pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
services = services + ['fail2ban']
|
services = services + ['fail2ban']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "fail2ban is not installed")
|
Log.info(self, "fail2ban is not installed")
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if self.app.pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
services = services + ['proftpd']
|
services = services + ['proftpd']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "ProFTPd is not installed")
|
Log.info(self, "ProFTPd is not installed")
|
||||||
|
|
||||||
# netdata
|
# netdata
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir("/opt/netdata"):
|
if os.path.isdir("/opt/netdata"):
|
||||||
services = services + ['netdata']
|
services = services + ['netdata']
|
||||||
else:
|
else:
|
||||||
@@ -98,26 +99,27 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stop services"""
|
"""Stop services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
pargs = self.app.pargs
|
||||||
self.app.pargs.php73 or
|
if not (pargs.nginx or pargs.php or
|
||||||
self.app.pargs.mysql or
|
pargs.php73 or
|
||||||
self.app.pargs.fail2ban or
|
pargs.mysql or
|
||||||
self.app.pargs.netdata or
|
pargs.fail2ban or
|
||||||
self.app.pargs.proftpd or
|
pargs.netdata or
|
||||||
self.app.pargs.redis):
|
pargs.proftpd or
|
||||||
self.app.pargs.nginx = True
|
pargs.redis):
|
||||||
self.app.pargs.php = True
|
pargs.nginx = True
|
||||||
self.app.pargs.mysql = True
|
pargs.php = True
|
||||||
|
pargs.mysql = True
|
||||||
|
|
||||||
# nginx
|
# nginx
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
# php7.2
|
# php7.2
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.2-fpm']
|
||||||
else:
|
else:
|
||||||
@@ -129,14 +131,14 @@ class WOStackStatusController(CementBaseController):
|
|||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
# php7.3
|
# php7.3
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.3-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
# mysql
|
# mysql
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
@@ -150,28 +152,28 @@ class WOStackStatusController(CementBaseController):
|
|||||||
"Unable to check MySQL service status")
|
"Unable to check MySQL service status")
|
||||||
|
|
||||||
# redis
|
# redis
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
services = services + ['redis-server']
|
services = services + ['redis-server']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis server is not installed")
|
Log.info(self, "Redis server is not installed")
|
||||||
|
|
||||||
# fail2ban
|
# fail2ban
|
||||||
if self.app.pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
services = services + ['fail2ban']
|
services = services + ['fail2ban']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "fail2ban is not installed")
|
Log.info(self, "fail2ban is not installed")
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if self.app.pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
services = services + ['proftpd']
|
services = services + ['proftpd']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "ProFTPd is not installed")
|
Log.info(self, "ProFTPd is not installed")
|
||||||
|
|
||||||
# netdata
|
# netdata
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir("/opt/netdata"):
|
if os.path.isdir("/opt/netdata"):
|
||||||
services = services + ['netdata']
|
services = services + ['netdata']
|
||||||
else:
|
else:
|
||||||
@@ -185,24 +187,25 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def restart(self):
|
def restart(self):
|
||||||
"""Restart services"""
|
"""Restart services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
pargs = self.app.pargs
|
||||||
self.app.pargs.php73 or
|
if not (pargs.nginx or pargs.php or
|
||||||
self.app.pargs.mysql or
|
pargs.php73 or
|
||||||
self.app.pargs.netdata or
|
pargs.mysql or
|
||||||
self.app.pargs.proftpd or
|
pargs.netdata or
|
||||||
self.app.pargs.redis or
|
pargs.proftpd or
|
||||||
self.app.pargs.fail2ban):
|
pargs.redis or
|
||||||
self.app.pargs.nginx = True
|
pargs.fail2ban):
|
||||||
self.app.pargs.php = True
|
pargs.nginx = True
|
||||||
self.app.pargs.mysql = True
|
pargs.php = True
|
||||||
|
pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.2-fpm']
|
||||||
else:
|
else:
|
||||||
@@ -213,13 +216,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.3-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if ((WOAptGet.is_installed(self, 'mysql-server') or
|
if ((WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
@@ -233,27 +236,27 @@ class WOStackStatusController(CementBaseController):
|
|||||||
Log.warn(self, "Remote MySQL found, "
|
Log.warn(self, "Remote MySQL found, "
|
||||||
"Unable to check MySQL service status")
|
"Unable to check MySQL service status")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
services = services + ['redis-server']
|
services = services + ['redis-server']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis server is not installed")
|
Log.info(self, "Redis server is not installed")
|
||||||
|
|
||||||
if self.app.pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
services = services + ['fail2ban']
|
services = services + ['fail2ban']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "fail2ban is not installed")
|
Log.info(self, "fail2ban is not installed")
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if self.app.pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
services = services + ['proftpd']
|
services = services + ['proftpd']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "ProFTPd is not installed")
|
Log.info(self, "ProFTPd is not installed")
|
||||||
|
|
||||||
# netdata
|
# netdata
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir("/opt/netdata"):
|
if os.path.isdir("/opt/netdata"):
|
||||||
services = services + ['netdata']
|
services = services + ['netdata']
|
||||||
else:
|
else:
|
||||||
@@ -267,24 +270,25 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def status(self):
|
def status(self):
|
||||||
"""Status of services"""
|
"""Status of services"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
pargs = self.app.pargs
|
||||||
self.app.pargs.php73 or
|
if not (pargs.nginx or pargs.php or
|
||||||
self.app.pargs.mysql or
|
pargs.php73 or
|
||||||
self.app.pargs.netdata or
|
pargs.mysql or
|
||||||
self.app.pargs.proftpd or
|
pargs.netdata or
|
||||||
self.app.pargs.redis or
|
pargs.proftpd or
|
||||||
self.app.pargs.fail2ban):
|
pargs.redis or
|
||||||
self.app.pargs.nginx = True
|
pargs.fail2ban):
|
||||||
self.app.pargs.php = True
|
pargs.nginx = True
|
||||||
self.app.pargs.mysql = True
|
pargs.php = True
|
||||||
|
pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
if (WOAptGet.is_installed(self, 'nginx-custom')):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.2-fpm']
|
||||||
else:
|
else:
|
||||||
@@ -295,13 +299,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.3-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
@@ -314,27 +318,27 @@ class WOStackStatusController(CementBaseController):
|
|||||||
Log.warn(self, "Remote MySQL found, "
|
Log.warn(self, "Remote MySQL found, "
|
||||||
"Unable to check MySQL service status")
|
"Unable to check MySQL service status")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
services = services + ['redis-server']
|
services = services + ['redis-server']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis server is not installed")
|
Log.info(self, "Redis server is not installed")
|
||||||
|
|
||||||
if self.app.pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
services = services + ['fail2ban']
|
services = services + ['fail2ban']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "fail2ban is not installed")
|
Log.info(self, "fail2ban is not installed")
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if self.app.pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
services = services + ['proftpd']
|
services = services + ['proftpd']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "ProFTPd is not installed")
|
Log.info(self, "ProFTPd is not installed")
|
||||||
|
|
||||||
# netdata
|
# netdata
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir("/opt/netdata"):
|
if os.path.isdir("/opt/netdata"):
|
||||||
services = services + ['netdata']
|
services = services + ['netdata']
|
||||||
else:
|
else:
|
||||||
@@ -348,25 +352,26 @@ class WOStackStatusController(CementBaseController):
|
|||||||
def reload(self):
|
def reload(self):
|
||||||
"""Reload service"""
|
"""Reload service"""
|
||||||
services = []
|
services = []
|
||||||
if not (self.app.pargs.nginx or self.app.pargs.php or
|
pargs = self.app.pargs
|
||||||
self.app.pargs.php73 or
|
if not (pargs.nginx or pargs.php or
|
||||||
self.app.pargs.mysql or
|
pargs.php73 or
|
||||||
self.app.pargs.netdata or
|
pargs.mysql or
|
||||||
self.app.pargs.proftpd or
|
pargs.netdata or
|
||||||
self.app.pargs.redis or
|
pargs.proftpd or
|
||||||
self.app.pargs.fail2ban):
|
pargs.redis or
|
||||||
self.app.pargs.nginx = True
|
pargs.fail2ban):
|
||||||
self.app.pargs.php = True
|
pargs.nginx = True
|
||||||
self.app.pargs.mysql = True
|
pargs.php = True
|
||||||
|
pargs.mysql = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
if (WOAptGet.is_installed(self, 'nginx-custom') or
|
if (WOAptGet.is_installed(self, 'nginx-custom') or
|
||||||
WOAptGet.is_installed(self, 'nginx-mainline')):
|
WOAptGet.is_installed(self, 'nginx-mainline')):
|
||||||
services = services + ['nginx']
|
services = services + ['nginx']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not installed")
|
Log.info(self, "Nginx is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
services = services + ['php7.2-fpm']
|
services = services + ['php7.2-fpm']
|
||||||
else:
|
else:
|
||||||
@@ -377,13 +382,13 @@ class WOStackStatusController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
services = services + ['php7.3-fpm']
|
services = services + ['php7.3-fpm']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "PHP7.3-FPM is not installed")
|
Log.info(self, "PHP7.3-FPM is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||||
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
(WOVariables.wo_mysql_host is "127.0.0.1")):
|
||||||
if (WOAptGet.is_installed(self, 'mysql-server') or
|
if (WOAptGet.is_installed(self, 'mysql-server') or
|
||||||
@@ -396,27 +401,27 @@ class WOStackStatusController(CementBaseController):
|
|||||||
Log.warn(self, "Remote MySQL found, "
|
Log.warn(self, "Remote MySQL found, "
|
||||||
"Unable to check MySQL service status")
|
"Unable to check MySQL service status")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
services = services + ['redis-server']
|
services = services + ['redis-server']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis server is not installed")
|
Log.info(self, "Redis server is not installed")
|
||||||
|
|
||||||
if self.app.pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
services = services + ['fail2ban']
|
services = services + ['fail2ban']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "fail2ban is not installed")
|
Log.info(self, "fail2ban is not installed")
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if self.app.pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
services = services + ['proftpd']
|
services = services + ['proftpd']
|
||||||
else:
|
else:
|
||||||
Log.info(self, "ProFTPd is not installed")
|
Log.info(self, "ProFTPd is not installed")
|
||||||
|
|
||||||
# netdata
|
# netdata
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir("/opt/netdata"):
|
if os.path.isdir("/opt/netdata"):
|
||||||
services = services + ['netdata']
|
services = services + ['netdata']
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -57,35 +57,36 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
apt_packages = []
|
apt_packages = []
|
||||||
packages = []
|
packages = []
|
||||||
empty_packages = []
|
empty_packages = []
|
||||||
|
pargs = pargs = self.app.pargs
|
||||||
|
|
||||||
if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and
|
if ((not pargs.web) and (not pargs.nginx) and
|
||||||
(not self.app.pargs.php) and (not self.app.pargs.php73) and
|
(not pargs.php) and (not pargs.php73) and
|
||||||
(not self.app.pargs.mysql) and
|
(not pargs.mysql) and
|
||||||
(not self.app.pargs.all) and (not self.app.pargs.wpcli) and
|
(not pargs.all) and (not pargs.wpcli) and
|
||||||
(not self.app.pargs.netdata) and (not self.app.pargs.composer) and
|
(not pargs.netdata) and (not pargs.composer) and
|
||||||
(not self.app.pargs.phpmyadmin) and
|
(not pargs.phpmyadmin) and
|
||||||
(not self.app.pargs.redis)):
|
(not pargs.redis)):
|
||||||
self.app.pargs.web = True
|
pargs.web = True
|
||||||
|
|
||||||
if self.app.pargs.all:
|
if pargs.all:
|
||||||
self.app.pargs.web = True
|
pargs.web = True
|
||||||
|
|
||||||
if self.app.pargs.web:
|
if pargs.web:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom'):
|
if WOAptGet.is_installed(self, 'nginx-custom'):
|
||||||
self.app.pargs.nginx = True
|
pargs.nginx = True
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Nginx is not already installed")
|
Log.info(self, "Nginx is not already installed")
|
||||||
self.app.pargs.php = True
|
pargs.php = True
|
||||||
self.app.pargs.mysql = True
|
pargs.mysql = True
|
||||||
self.app.pargs.wpcli = True
|
pargs.wpcli = True
|
||||||
|
|
||||||
if self.app.pargs.nginx:
|
if pargs.nginx:
|
||||||
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")
|
Log.info(self, "Nginx Stable is not already installed")
|
||||||
|
|
||||||
if self.app.pargs.php:
|
if pargs.php:
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php + \
|
apt_packages = apt_packages + WOVariables.wo_php + \
|
||||||
@@ -95,7 +96,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP 7.2 is not installed")
|
Log.info(self, "PHP 7.2 is not installed")
|
||||||
|
|
||||||
if self.app.pargs.php73:
|
if pargs.php73:
|
||||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||||
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if not WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php73 + \
|
apt_packages = apt_packages + WOVariables.wo_php73 + \
|
||||||
@@ -105,19 +106,19 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "PHP 7.3 is not installed")
|
Log.info(self, "PHP 7.3 is not installed")
|
||||||
|
|
||||||
if self.app.pargs.mysql:
|
if pargs.mysql:
|
||||||
if WOAptGet.is_installed(self, 'mariadb-server'):
|
if WOAptGet.is_installed(self, 'mariadb-server'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_mysql
|
apt_packages = apt_packages + WOVariables.wo_mysql
|
||||||
else:
|
else:
|
||||||
Log.info(self, "MariaDB is not installed")
|
Log.info(self, "MariaDB is not installed")
|
||||||
|
|
||||||
if self.app.pargs.redis:
|
if pargs.redis:
|
||||||
if WOAptGet.is_installed(self, 'redis-server'):
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_redis
|
apt_packages = apt_packages + WOVariables.wo_redis
|
||||||
else:
|
else:
|
||||||
Log.info(self, "Redis is not installed")
|
Log.info(self, "Redis is not installed")
|
||||||
|
|
||||||
if self.app.pargs.wpcli:
|
if pargs.wpcli:
|
||||||
if os.path.isfile('/usr/local/bin/wp'):
|
if os.path.isfile('/usr/local/bin/wp'):
|
||||||
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
||||||
"releases/download/v{0}/"
|
"releases/download/v{0}/"
|
||||||
@@ -128,13 +129,13 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.info(self, "WPCLI is not installed with WordOps")
|
Log.info(self, "WPCLI is not installed with WordOps")
|
||||||
|
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
if os.path.isdir('/opt/netdata'):
|
if os.path.isdir('/opt/netdata'):
|
||||||
packages = packages + [['https://my-netdata.io/'
|
packages = packages + [['https://my-netdata.io/'
|
||||||
'kickstart-static64.sh',
|
'kickstart-static64.sh',
|
||||||
'/var/lib/wo/tmp/kickstart.sh',
|
'/var/lib/wo/tmp/kickstart.sh',
|
||||||
'Netdata']]
|
'Netdata']]
|
||||||
if self.app.pargs.phpmyadmin:
|
if pargs.phpmyadmin:
|
||||||
if os.path.isdir('/var/www/22222/htdocs/db/pma'):
|
if os.path.isdir('/var/www/22222/htdocs/db/pma'):
|
||||||
packages = packages + \
|
packages = packages + \
|
||||||
[["https://files.phpmyadmin.net"
|
[["https://files.phpmyadmin.net"
|
||||||
@@ -147,7 +148,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
else:
|
else:
|
||||||
Log.error(self, "phpMyAdmin isn't installed")
|
Log.error(self, "phpMyAdmin isn't installed")
|
||||||
|
|
||||||
if self.app.pargs.composer:
|
if pargs.composer:
|
||||||
if os.path.isfile('/usr/local/bin/composer'):
|
if os.path.isfile('/usr/local/bin/composer'):
|
||||||
packages = packages + [["https://getcomposer.org/installer",
|
packages = packages + [["https://getcomposer.org/installer",
|
||||||
"/var/lib/wo/tmp/composer-install",
|
"/var/lib/wo/tmp/composer-install",
|
||||||
@@ -160,7 +161,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
Log.info(self, "During package update process non nginx-cached"
|
Log.info(self, "During package update process non nginx-cached"
|
||||||
" parts of your site may remain down")
|
" parts of your site may remain down")
|
||||||
# Check prompt
|
# Check prompt
|
||||||
if (not self.app.pargs.no_prompt):
|
if (not pargs.no_prompt):
|
||||||
start_upgrade = input("Do you want to continue:[y/N]")
|
start_upgrade = input("Do you want to continue:[y/N]")
|
||||||
if start_upgrade != "Y" and start_upgrade != "y":
|
if start_upgrade != "Y" and start_upgrade != "y":
|
||||||
Log.error(self, "Not starting package update")
|
Log.error(self, "Not starting package update")
|
||||||
@@ -191,25 +192,25 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
WOService.restart_service(self, 'redis-server')
|
WOService.restart_service(self, 'redis-server')
|
||||||
|
|
||||||
if len(packages):
|
if len(packages):
|
||||||
if self.app.pargs.wpcli:
|
if pargs.wpcli:
|
||||||
WOFileUtils.remove(self, ['/usr/local/bin/wp'])
|
WOFileUtils.remove(self, ['/usr/local/bin/wp'])
|
||||||
|
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
WOFileUtils.remove(self, ['/var/lib/wo/tmp/kickstart.sh'])
|
WOFileUtils.remove(self, ['/var/lib/wo/tmp/kickstart.sh'])
|
||||||
|
|
||||||
Log.debug(self, "Downloading following: {0}".format(packages))
|
Log.debug(self, "Downloading following: {0}".format(packages))
|
||||||
WODownload.download(self, packages)
|
WODownload.download(self, packages)
|
||||||
|
|
||||||
if self.app.pargs.wpcli:
|
if pargs.wpcli:
|
||||||
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
|
WOFileUtils.chmod(self, "/usr/local/bin/wp", 0o775)
|
||||||
|
|
||||||
if self.app.pargs.netdata:
|
if pargs.netdata:
|
||||||
Log.info(self, "Upgrading Netdata, please wait...")
|
Log.info(self, "Upgrading Netdata, please wait...")
|
||||||
WOShellExec.cmd_exec(self, "/bin/bash /var/lib/wo/tmp/"
|
WOShellExec.cmd_exec(self, "/bin/bash /var/lib/wo/tmp/"
|
||||||
"kickstart.sh "
|
"kickstart.sh "
|
||||||
"--dont-wait")
|
"--dont-wait")
|
||||||
|
|
||||||
if self.app.pargs.composer:
|
if pargs.composer:
|
||||||
Log.info(self, "Upgrading Composer, please wait...")
|
Log.info(self, "Upgrading Composer, please wait...")
|
||||||
WOShellExec.cmd_exec(self, "php -q /var/lib/wo"
|
WOShellExec.cmd_exec(self, "php -q /var/lib/wo"
|
||||||
"/tmp/composer-install "
|
"/tmp/composer-install "
|
||||||
@@ -218,7 +219,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
'/usr/local/bin/composer')
|
'/usr/local/bin/composer')
|
||||||
WOFileUtils.chmod(self, "/usr/local/bin/composer", 0o775)
|
WOFileUtils.chmod(self, "/usr/local/bin/composer", 0o775)
|
||||||
|
|
||||||
if self.app.pargs.phpmyadmin:
|
if pargs.phpmyadmin:
|
||||||
Log.info(self, "Upgrading phpMyAdmin, please wait...")
|
Log.info(self, "Upgrading phpMyAdmin, please wait...")
|
||||||
WOExtract.extract(self, '/var/lib/wo/tmp/pma.tar.gz',
|
WOExtract.extract(self, '/var/lib/wo/tmp/pma.tar.gz',
|
||||||
'/var/lib/wo/tmp/')
|
'/var/lib/wo/tmp/')
|
||||||
|
|||||||
@@ -36,20 +36,21 @@ class WOUpdateController(CementBaseController):
|
|||||||
|
|
||||||
@expose(hide=True)
|
@expose(hide=True)
|
||||||
def default(self):
|
def default(self):
|
||||||
|
pargs = self.app.pargs
|
||||||
filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S")
|
filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S")
|
||||||
|
|
||||||
if self.app.pargs.travis:
|
if pargs.travis:
|
||||||
wo_branch = "updating-configuration"
|
wo_branch = "updating-configuration"
|
||||||
install_args = "--travis --force "
|
install_args = "--travis --force "
|
||||||
elif self.app.pargs.beta:
|
elif pargs.beta:
|
||||||
wo_branch = "beta"
|
wo_branch = "beta"
|
||||||
install_args = ""
|
install_args = ""
|
||||||
else:
|
else:
|
||||||
wo_branch = "master"
|
wo_branch = "master"
|
||||||
install_args = ""
|
install_args = ""
|
||||||
if self.app.pargs.force:
|
if pargs.force:
|
||||||
install_args = install_args + "--force "
|
install_args = install_args + "--force "
|
||||||
if self.app.pargs.preserve:
|
if pargs.preserve:
|
||||||
install_args = install_args + "--preserve "
|
install_args = install_args + "--preserve "
|
||||||
|
|
||||||
WODownload.download(self, [["https://raw.githubusercontent.com/"
|
WODownload.download(self, [["https://raw.githubusercontent.com/"
|
||||||
|
|||||||
Reference in New Issue
Block a user