From 5ad068dc7c73dd138769c22cad3e7dec8c71d1f6 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Fri, 18 Oct 2019 10:49:06 +0200 Subject: [PATCH] Several fixes * don't deploy ssl certificate if acme.sh failed * install script issues * GPG keys error with old EasyEngine Nginx repository --- CHANGELOG.md | 7 +++++++ install | 19 ++++++++++++++----- setup.py | 2 +- wo/cli/plugins/stack_pref.py | 1 - wo/cli/plugins/stack_upgrade.py | 20 +++++++------------- wo/cli/templates/php-pool.mustache | 2 +- wo/core/acme.py | 7 ++++--- wo/core/variables.py | 2 +- wo/utils/test.py | 2 +- 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2af07c..f98030b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.x - [Unreleased] +#### Fixed + +- GPG keys error with previous EasyEngine Nginx repository +- Issue with `--ngxblocker` stack removal/purge +- Install/Update issues with python3 setup.py +- WordOps deploying SSL certificate even if acme.sh failed + ### v3.9.9.3 - 2019-10-15 #### Added diff --git a/install b/install index 9ed4b8c..c99a132 100755 --- a/install +++ b/install @@ -9,7 +9,7 @@ # ------------------------------------------------------------------------- # wget -qO wo wops.cc && sudo bash wo # ------------------------------------------------------------------------- -# Version 3.9.9.3 - 2019-10-14 +# Version 3.9.9.4 - 2019-10-18 # ------------------------------------------------------------------------- # CONTENTS @@ -119,6 +119,15 @@ _run() { } +wo_clean_repo() { + # remove old EasyEngine Nginx repository + if [ -f /etc/apt/sources.list.d/ee-repo.list ]; then + cp -f /etc/apt/sources.list.d/ee-repo.list /etc/apt/sources.list.d/ee-repo.list.save + grep -v "/home:/rtCamp:/EasyEngine" -r /etc/apt/sources.list.d/ee-repo.list.save > /etc/apt/sources.list.d/ee-repo.list + fi +} +_run wo_clean_repo + ### # 1- Update the apt sewers with fresh info ### @@ -462,6 +471,7 @@ wo_download() { curl -sL https://github.com/WordOps/WordOps/archive/v${wo_version}.tar.gz | tar -I pigz -xf - -C /var/lib/wo/tmp mv "/var/lib/wo/tmp/WordOps-$wo_version" /var/lib/wo/tmp/WordOps-install fi + return 0 } # WordOps install @@ -680,12 +690,12 @@ wo_nginx_tweak() { } wo_clean() { - rm -rf /usr/local/lib/python3.*/dist-packages/wo-* + rm -rf /usr/local/lib/python3.*/dist-packages/wo-* /usr/local/lib/python3.*/dist-packages/wordops-* + } wo_uninstall() { - python3 -m pip uninstall wordops -y - rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates + rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*,wordops-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates } wo_cheat_install() { @@ -734,7 +744,6 @@ else _run wo_timesync # skip steps if travis if [ -z "$wo_travis" ]; then - _run wo_dist_upgrade _run wo_download "Downloading WordOps" wo_git_config _run wo_install "Installing WordOps" diff --git a/setup.py b/setup.py index 269b8a9..0f4c472 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ if os.geteuid() == 0: os.makedirs('/var/lib/wo/tmp/') setup(name='wordops', - version='3.9.9.3', + version='3.9.9.4', description='WordPress & server administration toolset', long_description=LONG, classifiers=[ diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index b1068d4..0127746 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -851,7 +851,6 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOGit.add(self, ["/etc/proftpd"], msg="Adding ProFTPd into Git") if os.path.isfile("/etc/proftpd/proftpd.conf"): - Log.info(self, "Configuring ProFTPd") Log.debug(self, "Setting up Proftpd configuration") WOFileUtils.searchreplace( self, "/etc/proftpd/proftpd.conf", diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index 5ee3769..e8cc4bf 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -100,26 +100,20 @@ class WOStackUpgradeController(CementBaseController): if pargs.php: if WOAptGet.is_installed(self, 'php7.2-fpm'): - if not WOAptGet.is_installed(self, 'php7.3-fpm'): - apt_packages = apt_packages + WOVar.wo_php + \ - WOVar.wo_php_extra - else: - apt_packages = apt_packages + WOVar.wo_php + apt_packages = apt_packages + WOVar.wo_php + \ + WOVar.wo_php_extra else: Log.info(self, "PHP 7.2 is not installed") if pargs.php73: if WOAptGet.is_installed(self, 'php7.3-fpm'): - if not WOAptGet.is_installed(self, 'php7.2-fpm'): - apt_packages = apt_packages + WOVar.wo_php73 + \ - WOVar.wo_php_extra - else: - apt_packages = apt_packages + WOVar.wo_php73 + apt_packages = apt_packages + WOVar.wo_php73 + \ + WOVar.wo_php_extra else: Log.info(self, "PHP 7.3 is not installed") if pargs.mysql: - if WOAptGet.is_installed(self, 'mariadb-server'): + if WOShellExec.cmd_exec(self, 'mysqladmin ping'): apt_packages = apt_packages + ['mariadb-server'] else: Log.info(self, "MariaDB is not installed") @@ -170,7 +164,7 @@ class WOStackUpgradeController(CementBaseController): "/var/lib/wo/tmp/pma.tar.gz", "PHPMyAdmin"]] else: - Log.error(self, "phpMyAdmin isn't installed") + Log.info(self, "phpMyAdmin isn't installed") if pargs.composer: if os.path.isfile('/usr/local/bin/composer'): @@ -178,7 +172,7 @@ class WOStackUpgradeController(CementBaseController): "/var/lib/wo/tmp/composer-install", "Composer"]] else: - Log.error(self, "Composer isn't installed") + Log.info(self, "Composer isn't installed") if ((not (apt_packages)) and (not(packages))): self.app.args.print_help() diff --git a/wo/cli/templates/php-pool.mustache b/wo/cli/templates/php-pool.mustache index e153bf0..654e944 100644 --- a/wo/cli/templates/php-pool.mustache +++ b/wo/cli/templates/php-pool.mustache @@ -20,4 +20,4 @@ listen.backlog = 32768 catch_workers_output = yes -{{#openbasedir}}php_admin_value[open_basedir] = "/var/www/:/usr/share/php/:/tmp/:/var/run/nginx-cache/"{{/openbasedir}} +{{#openbasedir}}php_admin_value[open_basedir] = "/var/www/:/usr/share/php/:/tmp/:/var/run/nginx-cache/:/dev/urandom:/dev/shm"{{/openbasedir}} diff --git a/wo/core/acme.py b/wo/core/acme.py index b2c514b..3d5e04d 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -47,16 +47,17 @@ class WOAcme: .format(all_domains, acme_mode, keylenght)): Log.failed(self, "Issuing SSL cert with acme.sh") if acmedata['dns'] is True: - Log.warn( + Log.error( self, "Please make sure your properly " "set your DNS API credentials for acme.sh") + return False else: Log.error( self, "Your domain is properly configured " "but acme.sh was unable to issue certificate.\n" "You can find more informations in " - "/var/log/wo/wordops.log", False) - return False + "/var/log/wo/wordops.log") + return False else: Log.valide(self, "Issuing SSL cert with acme.sh") return True diff --git a/wo/core/variables.py b/wo/core/variables.py index 16729d9..8654783 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -13,7 +13,7 @@ class WOVar(): """Intialization of core variables""" # WordOps version - wo_version = "3.9.9.3" + wo_version = "3.9.9.4" # WordOps packages versions wo_wp_cli = "2.3.0" wo_adminer = "4.7.3" diff --git a/wo/utils/test.py b/wo/utils/test.py index e543a1c..920fd62 100644 --- a/wo/utils/test.py +++ b/wo/utils/test.py @@ -1,6 +1,6 @@ """Testing utilities for WordOps""" -from wo.cli.main import WOTestApp from cement.utils.test import * +from wo.cli.main import WOTestApp class WOTestCase(CementTestCase):