From 2defb346e3907dc08a4506ff06dcab75180344dd Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Fri, 23 Aug 2019 17:11:43 +0200 Subject: [PATCH] Fix migration from EE with custom nginx-ee --- install | 2 ++ wo/cli/plugins/stack.py | 19 ++++++++++++++----- wo/cli/plugins/stack_pref.py | 6 ++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/install b/install index d40a208..6ae2bd7 100755 --- a/install +++ b/install @@ -494,6 +494,7 @@ wo_upgrade_nginx() { # install new nginx package if [ -n "$CHECK_NGINX_EE" ]; then if [ -x /usr/local/bin/wo ]; then + [ -f /etc/apt/preferences.d/nginx-block ] && { mv /etc/apt/preferences.d/nginx-block .;} # stop nginx service nginx stop # remove previous package @@ -544,6 +545,7 @@ wo_upgrade_nginx() { systemctl stop nginx systemctl start nginx fi + [ -f ./nginx-block ] && { mv nginx-block /etc/apt/preferences.d/nginx-block ;} } \ >> "$wo_install_log" 2>&1 diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 12732cd..3ddc4ee 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -63,6 +63,8 @@ class WOStackController(CementBaseController): dict(help='Install PHP 7.3 stack', action='store_true')), (['--mysql'], dict(help='Install MySQL stack', action='store_true')), + (['--mariabackup'], + dict(help='Install MariaBackup stack', action='store_true')), (['--mysqlclient'], dict(help='Install MySQL client for remote MySQL server', action='store_true')), @@ -79,6 +81,8 @@ class WOStackController(CementBaseController): action='store_true')), (['--dashboard'], dict(help='Install WordOps dashboard', action='store_true')), + (['--extplorer'], + dict(help='Install eXtplorer file manager', action='store_true')), (['--adminer'], dict(help='Install Adminer stack', action='store_true')), (['--fail2ban'], @@ -119,6 +123,7 @@ class WOStackController(CementBaseController): and (not pargs.mysqlclient) and (not pargs.mysqltuner) and (not pargs.adminer) and (not pargs.utils) and (not pargs.redis) and (not pargs.proftpd) and + (not pargs.extplorer) and (not pargs.mariabackup) and (not pargs.phpredisadmin) and (not pargs.php73)): pargs.web = True @@ -139,17 +144,13 @@ class WOStackController(CementBaseController): pargs.wpcli = True if pargs.admin: - pargs.nginx = True - pargs.php = True - pargs.mysql = True + pargs.web = True pargs.adminer = True pargs.phpmyadmin = True - pargs.composer = True pargs.utils = True pargs.netdata = True pargs.dashboard = True pargs.phpredisadmin = True - pargs.mysqltuner = True if pargs.security: pargs.fail2ban = True @@ -213,6 +214,8 @@ class WOStackController(CementBaseController): # MariaDB 10.3 if pargs.mysql: + pargs.mariabackup = True + pargs.mysqltuner = True Log.debug(self, "Setting apt_packages variable for MySQL") if not WOShellExec.cmd_exec(self, "mysqladmin ping"): apt_packages = apt_packages + WOVariables.wo_mysql @@ -222,6 +225,12 @@ class WOStackController(CementBaseController): "for MySQL Client") apt_packages = apt_packages + WOVariables.wo_mysql_client + if pargs.mariabackup: + if not WOAptGet.is_installed(self, 'mariadb-backup'): + Log.debug(self, "Setting apt_packages variable " + "for MariaBackup") + apt_packages = apt_packages + ["mariadb-backup"] + # WP-CLI if pargs.wpcli: Log.debug(self, "Setting packages variable for WP-CLI") diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 65ba0e3..8d1eca4 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -27,7 +27,8 @@ def pre_pref(self, apt_packages): """Pre settings to do before installation packages""" if (set(WOVariables.wo_mysql).issubset(set(apt_packages)) or - set(WOVariables.wo_mysql_client).issubset(set(apt_packages))): + set(WOVariables.wo_mysql_client).issubset(set(apt_packages)) or + set(['mariadb-backup']).issubset(set(apt_packages))): # add mariadb repository excepted on raspbian and ubuntu 19.04 if (not WOVariables.wo_distro == 'raspbian'): Log.info(self, "Adding repository for MySQL, please wait...") @@ -1182,7 +1183,8 @@ def post_pref(self, apt_packages, packages): .format(WOVariables.wo_webroot), "$cfg[\'Servers\'][$i][\'host\']" " = \'localhost\';", "$cfg" - "[\'Servers\'][$i][\'host\'] = \'{0}\';" + "[\'Servers\'][$i][\'host\'] " + "= \'{0}\';" .format(WOVariables.wo_mysql_host)) Log.debug(self, 'Setting Privileges of webroot permission to ' '{0}22222/htdocs/db/pma file '