From 914f049852971a4f5129811259eb8528695efe5f Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 5 Nov 2019 16:11:43 +0100 Subject: [PATCH] Fix acme certificate on domain --- CHANGELOG.md | 5 +++++ README.md | 2 +- install | 10 +++++++--- wo/cli/plugins/stack.py | 17 +++++++---------- wo/cli/plugins/stack_pref.py | 19 ++++++------------- wo/cli/plugins/stack_upgrade.py | 2 +- wo/core/acme.py | 2 +- wo/core/variables.py | 5 +++++ 8 files changed, 33 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e17b9d2..72f0751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.9.x - [Unreleased] +#### Fixed + +- Import rtCamp:EasyEngine GPG key to avoid issues with previous nginx repository +- Unable to issue certificate for a domain if a subdomain certificate exist + ### v3.10.1 - 2019-10-30 #### Fixed diff --git a/README.md b/README.md index fd9d101..9b687ca 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ MIT Commits GitHub release -
PyPI - Downloads +
PyPI - Downloads codacy Badge Twitter Badge Rocket.chat diff --git a/install b/install index 27f6969..9861ff1 100755 --- a/install +++ b/install @@ -220,7 +220,6 @@ wo_install_dep() { # add nginx repository gpg key curl -sL https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_10/Release.key | apt-key add - fi - locale-gen en # enable unattended upgades if [ ! -f /etc/apt/apt.conf.d/20auto-upgrades ]; then @@ -631,6 +630,8 @@ wo_init() { ### if [ -z "$wo_travis" ]; then + # import easyengine opensusebuildservice gpg key to avoid issues with packages update + apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 3050ac3cd2ae6f03 if ! { apt-get update --allow-releaseinfo-change -qq >/dev/null 2>&1 }; then @@ -673,8 +674,11 @@ wo_init wo_init_variables # remove old repositories _run wo_clean_repo -# check distribution support -wo_check_distro + +if [ -z "$wo_force_install" ]; then + # check distribution support + wo_check_distro +fi # wo uninstall script if [ "$wo_purge" = "y" ]; then diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index b3ec745..762e429 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -473,26 +473,22 @@ class WOStackController(CementBaseController): "https://raw.githubusercontent.com" "/rtCamp/eeadmin/master/cache/nginx/" "clean.php", - "{0}22222/htdocs/cache/" - "nginx/clean.php" + "{0}22222/htdocs/cache/nginx/clean.php" .format(WOVar.wo_webroot), "clean.php"], ["https://raw.github.com/rlerdorf/" "opcache-status/master/opcache.php", - "{0}22222/htdocs/cache/" - "opcache/opcache.php" + "{0}22222/htdocs/cache/opcache/opcache.php" .format(WOVar.wo_webroot), "opcache.php"], ["https://raw.github.com/amnuts/" "opcache-gui/master/index.php", - "{0}22222/htdocs/" - "cache/opcache/opgui.php" + "{0}22222/htdocs/cache/opcache/opgui.php" .format(WOVar.wo_webroot), "Opgui"], ["https://raw.githubusercontent.com/" "mlazarov/ocp/master/ocp.php", - "{0}22222/htdocs/cache/" - "opcache/ocp.php" + "{0}22222/htdocs/cache/opcache/ocp.php" .format(WOVar.wo_webroot), "OCP.php"], ["https://github.com/jokkedk/webgrind/" @@ -795,12 +791,13 @@ class WOStackController(CementBaseController): WOShellExec.cmd_exec( self, "bash /usr/" "libexec/netdata/" - "netdata-uninstaller.sh -y -f") + "netdata-uninstaller.sh -y -f", + errormsg='', log=False) else: WOShellExec.cmd_exec( self, "bash /opt/netdata/usr/" "libexec/netdata/" - "netdata-uninstaller.sh - y - f", + "netdata-uninstaller.sh -y -f", errormsg='', log=False) if (packages): diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index b03f225..c1bf59b 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -44,25 +44,18 @@ def pre_pref(self, apt_packages): # generate random 24 characters root password chars = ''.join(random.sample(string.ascii_letters, 24)) - # configure MySQL non-interactive install - if ((WOVar.wo_distro == 'raspbian') and - (WOVar.wo_platform_codename == 'stretch')): - mariadb_ver = '10.1' - else: - mariadb_ver = '10.3' - Log.debug(self, "Pre-seeding MySQL") Log.debug(self, "echo \"mariadb-server-{0} " "mysql-server/root_password " "password \" | " "debconf-set-selections" - .format(mariadb_ver)) + .format(WOVar.mariadb_ver)) try: WOShellExec.cmd_exec(self, "echo \"mariadb-server-{0} " "mysql-server/root_password " "password {chars}\" | " "debconf-set-selections" - .format(mariadb_ver, chars=chars), + .format(WOVar.mariadb_ver, chars=chars), log=False) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) @@ -72,13 +65,13 @@ def pre_pref(self, apt_packages): "mysql-server/root_password_again " "password \" | " "debconf-set-selections" - .format(mariadb_ver)) + .format(WOVar.mariadb_ver)) try: WOShellExec.cmd_exec(self, "echo \"mariadb-server-{0} " "mysql-server/root_password_again " "password {chars}\" | " "debconf-set-selections" - .format(mariadb_ver, chars=chars), + .format(WOVar.mariadb_ver, chars=chars), log=False) except CommandExecutionError as e: Log.debug(self, "{0}".format(e)) @@ -112,7 +105,7 @@ def pre_pref(self, apt_packages): else: if not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', - 'download.opensuse.org'): + 'WordOps'): Log.info(self, "Adding repository for NGINX, please wait...") Log.debug(self, 'Adding repository for Nginx') WORepo.add(self, repo_url=WOVar.wo_nginx_repo) @@ -160,7 +153,7 @@ def pre_pref(self, apt_packages): else: if not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', - 'download.opensuse.org'): + 'WordOps'): Log.info(self, "Adding repository for Redis, please wait...") WORepo.add(self, repo_url=WOVar.wo_nginx_repo) WORepo.add_key(self, WOVar.wo_nginx_key) diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index 64e75e1..c25a0e7 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -200,7 +200,7 @@ class WOStackUpgradeController(CementBaseController): # ngxblocker if pargs.ngxblocker: - if os.path.exists('/usr/local/sbin/update-ngxblocker'): + if os.path.exists('/usr/local/sbin/install-ngxblocker'): packages = packages + [[ 'https://raw.githubusercontent.com/mitchellkrogza/' 'nginx-ultimate-bad-bot-blocker/master/update-ngxblocker', diff --git a/wo/core/acme.py b/wo/core/acme.py index 8196238..883559b 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -172,7 +172,7 @@ class WOAcme: reader = csv.reader(certfile, 'acmeconf') for row in reader: # check if domain exist - if wo_domain_name in row[0]: + if wo_domain_name == row[0]: # check if cert expiration exist if not row[3] == '': return True diff --git a/wo/core/variables.py b/wo/core/variables.py index 14cd999..d0a72a1 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -149,7 +149,12 @@ class WOVar(): wo_mysql = ["mariadb-server", "percona-toolkit"] if wo_distro == 'raspbian': wo_mysql = wo_mysql + ["python3-mysqldb"] + if wo_platform_codename == 'stretch': + mariadb_ver = '10.1' + else: + mariadb_ver = '10.3' else: + mariadb_ver = '10.3' if wo_platform_codename == 'jessie': wo_mysql = wo_mysql + ["python3-mysql.connector"] else: