From 3ffeec6ef48847d3735f556e815ef6a16114da5e Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 14:50:05 +0200 Subject: [PATCH 01/19] Fix Sendmail configuration --- CHANGELOG.md | 7 +++++++ wo/cli/plugins/stack_pref.py | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6587a92..11c55ff 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] +### v3.12.4 - 2020-10-14 + +#### Fixed + +- Avif (AV1 Image Format) & WebP Nginx conditional support([PR #322](https://github.com/WordOps/WordOps/pull/322)) +- Sendmail initial configuration with sendmailconfig + ### v3.12.3 - 2020-10-13 #### Added diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index d1ea138..2e1e4b5 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1135,6 +1135,16 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOGit.add(self, ["/etc/proftpd"], msg="Adding ProFTPd into Git") + # Sendmail configuration + if "sendmail" in apt_packages: + if (os.path.exists("/usr/bin/yes") and + os.path.exists("/usr/sbin/sendmailconfig")): + Log.wait(self, "Configuring Sendmail") + if WOShellExec.cmd_exec(self, "yes 'y' | sendmailconfig"): + Log.valide(self, "Configuring Sendmail") + else: + Log.failed(self, "Configuring Sendmail") + if "ufw" in apt_packages: # check if ufw is already enabled if not WOFileUtils.grep(self, From c3076cfdfe0432db26e8de859739aa9d3db8a0f1 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 15:29:06 +0200 Subject: [PATCH 02/19] Fix cert.csv encoding to utf-8 --- install | 2 +- setup.py | 2 +- wo/core/acme.py | 5 ++++- wo/core/fileutils.py | 25 +++++++++++++++++++++++++ wo/core/variables.py | 2 +- 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/install b/install index 4944fd3..6e57049 100755 --- a/install +++ b/install @@ -9,7 +9,7 @@ # ------------------------------------------------------------------------- # wget -qO wo wops.cc && sudo -E bash wo # ------------------------------------------------------------------------- -# Version 3.12.3 - 2020-10-13 +# Version 3.12.4 - 2020-10-14 # ------------------------------------------------------------------------- # CONTENTS diff --git a/setup.py b/setup.py index 090bd92..d60768b 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ if os.geteuid() == 0: os.makedirs('/var/lib/wo/tmp/') setup(name='wordops', - version='3.12.3', + version='3.12.4', description='An essential toolset that eases server administration', long_description=LONG, long_description_content_type='text/markdown', diff --git a/wo/core/acme.py b/wo/core/acme.py index cab1978..86de29e 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -206,12 +206,15 @@ class WOAcme: def cert_check(self, wo_domain_name): """Check certificate existance with acme.sh and return Boolean""" WOAcme.export_cert(self) + WOFileUtils.convertFileBestGuess(self, "cert.csv", + "/var/lib/wo/") # set variable acme_cert acme_cert = False # define new csv dialect csv.register_dialect('acmeconf', delimiter='|') # open file - certfile = open('/var/lib/wo/cert.csv', mode='r', encoding='utf-8') + certfile = open('/var/lib/wo/cert.csv', + mode='r', encoding='utf-8') reader = csv.reader(certfile, 'acmeconf') for row in reader: # check if domain exist diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index be676f0..ec03698 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -3,6 +3,7 @@ import fileinput import os import pwd import shutil +import codecs from wo.core.logging import Log @@ -385,3 +386,27 @@ class WOFileUtils(): return True else: return False + + def writeConversion(self, file): + with codecs.open('tmp' + '/' + file, 'w', 'utf-8') as targetFile: + for line in file: + targetFile.write(line) + + def convertFileBestGuess(self, filename, filepath): + """Convert file to utf-8""" + sourceFormats = ['ascii', 'iso-8859-1'] + for format in sourceFormats: + try: + os.chdir(filepath) + with codecs.open(filename, 'rU', format) as sourceFile: + self.writeConversion(sourceFile) + return + except UnicodeDecodeError: + pass + if os.path.exists("/tmp/{0}".format(filename)): + try: + self.rm(filepath + filename) + self.mvfile("/tmp/{0}".format(filename), filepath + filename) + except Exception as e: + Log.debug(self, "{0}".format(e)) + Log.error(self, "Unable to change owner : {0} ".format(path)) diff --git a/wo/core/variables.py b/wo/core/variables.py index 5661f29..7b80219 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -14,7 +14,7 @@ class WOVar(): """Intialization of core variables""" # WordOps version - wo_version = "3.12.3" + wo_version = "3.12.4" # WordOps packages versions wo_wp_cli = "2.4.0" wo_adminer = "4.7.5" From 0a1a4da63a2f575b783822aa8c0e8b609ecc0e57 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 15:39:06 +0200 Subject: [PATCH 03/19] Add sendmail to testing --- tests/travis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/travis.sh b/tests/travis.sh index 40cea22..742d80f 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -30,7 +30,7 @@ exit_script() { echo -e "${CGREEN}#############################################${CEND}" echo -e ' stack install ' echo -e "${CGREEN}#############################################${CEND}" -stack_list='nginx php php73 php74 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis phpredisadmin mysqltuner utils ufw ngxblocker cheat nanorc' +stack_list='nginx php php73 php74 mysql redis fail2ban clamav proftpd netdata phpmyadmin composer dashboard extplorer adminer redis sendmail phpredisadmin mysqltuner utils ufw ngxblocker cheat nanorc' for stack in $stack_list; do echo -ne " Installing $stack [..]\r" if { From 7f0f5dbbcb033df0750a5b156bb6e85bbbbaa3f4 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 17:08:28 +0200 Subject: [PATCH 04/19] [skip travis] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11c55ff..f4a2b58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Avif (AV1 Image Format) & WebP Nginx conditional support([PR #322](https://github.com/WordOps/WordOps/pull/322)) - Sendmail initial configuration with sendmailconfig +- SSL certificates export encoding with utf-8 ### v3.12.3 - 2020-10-13 From 82536f4f0d84f9a0d7ef65afd84c3cb82591e335 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 17:15:13 +0200 Subject: [PATCH 05/19] Fix variable --- wo/core/fileutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index ec03698..6f40ebc 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -409,4 +409,6 @@ class WOFileUtils(): self.mvfile("/tmp/{0}".format(filename), filepath + filename) except Exception as e: Log.debug(self, "{0}".format(e)) - Log.error(self, "Unable to change owner : {0} ".format(path)) + Log.error( + self, + "Unable to move file : {0} ".format(filepath + filename)) From 256a07b4a5cb836c04613f217afce31fe01d66d9 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 17:48:36 +0200 Subject: [PATCH 06/19] Fix utf-8 convertion --- wo/core/fileutils.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index 6f40ebc..f6011da 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -387,11 +387,6 @@ class WOFileUtils(): else: return False - def writeConversion(self, file): - with codecs.open('tmp' + '/' + file, 'w', 'utf-8') as targetFile: - for line in file: - targetFile.write(line) - def convertFileBestGuess(self, filename, filepath): """Convert file to utf-8""" sourceFormats = ['ascii', 'iso-8859-1'] @@ -399,8 +394,11 @@ class WOFileUtils(): try: os.chdir(filepath) with codecs.open(filename, 'rU', format) as sourceFile: - self.writeConversion(sourceFile) - return + with codecs.open( + 'tmp' + '/' + sourceFile, 'w', 'utf-8') as targetFile: + for line in sourceFile: + targetFile.write(line) + return except UnicodeDecodeError: pass if os.path.exists("/tmp/{0}".format(filename)): From c0547392e9bddf4e850faa343f0fdc5c52cf0a1a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 18:17:06 +0200 Subject: [PATCH 07/19] Fix cert.csv utf-8 --- wo/core/acme.py | 11 +++++++---- wo/core/fileutils.py | 24 ------------------------ 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/wo/core/acme.py b/wo/core/acme.py index 86de29e..dcc1944 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -51,11 +51,14 @@ class WOAcme: """Export acme.sh csv certificate list""" # check acme.sh is installed WOAcme.check_acme(self) - if not WOShellExec.cmd_exec( - self, "{0} ".format(WOAcme.wo_acme_exec) + - "--list --listraw > /var/lib/wo/cert.csv"): + acme_list = WOShellExec.cmd_exec_stdout( + self, "{0} ".format(WOAcme.wo_acme_exec) + + "--list --listraw") + if acme_list: + WOFileUtils.textwrite(self, '/var/lib/wo/cert.csv', acme_list) + WOFileUtils.chmod(self, '/var/lib/wo/cert.csv', 0o600) + else: Log.error(self, "Unable to export certs list") - WOFileUtils.chmod(self, '/var/lib/wo/cert.csv', 0o600) def setupletsencrypt(self, acme_domains, acmedata): """Issue SSL certificates with acme.sh""" diff --git a/wo/core/fileutils.py b/wo/core/fileutils.py index f6011da..92d45bf 100644 --- a/wo/core/fileutils.py +++ b/wo/core/fileutils.py @@ -386,27 +386,3 @@ class WOFileUtils(): return True else: return False - - def convertFileBestGuess(self, filename, filepath): - """Convert file to utf-8""" - sourceFormats = ['ascii', 'iso-8859-1'] - for format in sourceFormats: - try: - os.chdir(filepath) - with codecs.open(filename, 'rU', format) as sourceFile: - with codecs.open( - 'tmp' + '/' + sourceFile, 'w', 'utf-8') as targetFile: - for line in sourceFile: - targetFile.write(line) - return - except UnicodeDecodeError: - pass - if os.path.exists("/tmp/{0}".format(filename)): - try: - self.rm(filepath + filename) - self.mvfile("/tmp/{0}".format(filename), filepath + filename) - except Exception as e: - Log.debug(self, "{0}".format(e)) - Log.error( - self, - "Unable to move file : {0} ".format(filepath + filename)) From 8d19fd7a264102fc6da318fdcc1425f970074099 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 18:22:21 +0200 Subject: [PATCH 08/19] Fix missing function --- wo/core/acme.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/wo/core/acme.py b/wo/core/acme.py index dcc1944..a20c475 100644 --- a/wo/core/acme.py +++ b/wo/core/acme.py @@ -209,8 +209,6 @@ class WOAcme: def cert_check(self, wo_domain_name): """Check certificate existance with acme.sh and return Boolean""" WOAcme.export_cert(self) - WOFileUtils.convertFileBestGuess(self, "cert.csv", - "/var/lib/wo/") # set variable acme_cert acme_cert = False # define new csv dialect From b9a748c926bb330e68be088781f7ae506905da9c Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 18:38:03 +0200 Subject: [PATCH 09/19] Add idn package to dependencies --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index 6e57049..a30a82c 100755 --- a/install +++ b/install @@ -209,13 +209,13 @@ wo_install_dep() { # install dependencies apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \ build-essential curl gzip python3-pip python3-apt gcc python3-dev sqlite3 git tar software-properties-common pigz \ - gnupg2 cron ccze rsync apt-transport-https tree haveged ufw unattended-upgrades tzdata ntp zstd >/dev/null 2>&1 + gnupg2 cron ccze rsync apt-transport-https tree haveged ufw unattended-upgrades tzdata ntp zstd idn >/dev/null 2>&1 curl -sL https://download.opensuse.org/repositories/home:/virtubox:/WordOps/xUbuntu_18.04/Release.key | apt-key add - else # install dependencies apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \ build-essential curl gzip dirmngr sudo python3-pip python3-apt gcc python3-dev ca-certificates sqlite3 git tar \ - software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp zstd >/dev/null 2>&1 + software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp zstd idn >/dev/null 2>&1 # add php repository gpg key [ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; } # add nginx repository gpg key From c6bd9b329a2d35c50c870c93bf0335405a760021 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 19:06:37 +0200 Subject: [PATCH 10/19] Update README.md and travis --- .travis.yml | 10 +++++++--- README.md | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6cdc7f6..9fbd85e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ -os: linux -dist: bionic - language: shell +jobs: + include: + - os: linux + dist: bionic + - os: linux + dist: focal + notifications: webhooks: secure: "JiGtzYplTyFg/L6Rsi7ptEQIV29O5qCWU2Zf5pLITsQrBrQO4cIXXp9G4Z+cenXjfIiqbqIgU0US3zXeIAl4g14xdfzmMYeMMwuKBpI8afMYv8MD6ldoP0MTFHQfROE6OXxKLVUvZn1R0oLLU1fzVSI0qGjNkt20cf/Lrt/reH/zS5hAI92kWI3u2zPu7Zn/g/a8MO/Y3Iv7v1PSQaVkVJVqtOK3U2GJqhIv2G1AVcaPb7Nh/V2zm2dDYBVT0UotBnlBUcUXbEMP77D9pjtWXd1/0rWuJIHixMjwUybpZqY75UMee5INynU6OZRsv029LRHAIMkWhfBkdVN/U5jhQJzui14+vRQrb5nfUMG8Cd8INojDlu6dk/ps2GzTCCXBITeMQKAouUoHD2LEbsNp17xi1K4ZlKb3+0lrOAiS4JYFE6wOo4yMlLTYoquYSqk7AuxuUS8A5OD5MYxhk9uafiTSxKFOo39KYWTSaACsPD8q1swaTSjoYm9skyZvIkIFq5bHBCYEGFe6X/NY9l5tz3hSe+TJOerCHsg+dXVuQl+pIp5nw2as9TH9ox5Vgqc9Zh4GbTDQVvdAmUpmlsZ/SKoOMCkmkB1aRNFq/7RnERIJyAEGJbauHWmjtOM4cCxesl0L0b2Eab89zQpSn7pzE8JTiJgpzCUc22p653PTaqM=" diff --git a/README.md b/README.md index 235e0eb..7a37251 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ - **Easy to install** : One step automated installer with migration from EasyEngine v3 support - **Fast deployment** : Fast and automated WordPress, Nginx, PHP, MySQL & Redis installation - **Custom Nginx build** : Nginx 1.18.0 - TLS v1.3 Cloudflare HTTP/2 HPACK & Brotli support -- **Up-to-date** : PHP 7.2, 7.3 & 7.4, MariaDB 10.3 & Redis 5.0 +- **Up-to-date** : PHP 7.2, 7.3 & 7.4, MariaDB 10.3 & Redis 6.0 - **Secured** : Hardened WordPress security with strict Nginx location directives - **Powerful** : Optimized Nginx configurations with multiple cache backends support - **SSL** : Domain, Subdomain & Wildcard Let's Encrypt SSL certificates with DNS API support From bf8cc157444f836f5d4d6ab5d8516d9fb23e1129 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 19:07:31 +0200 Subject: [PATCH 11/19] Update Travis for multiple distro testing --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9fbd85e..d397036 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: shell jobs: include: + - os: linux + dist: xenial - os: linux dist: bionic - os: linux From 9b1bccb336c1517b7e4c722fe0c9959dfcf2d7fd Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 19:59:30 +0200 Subject: [PATCH 12/19] Fix travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d397036..d63edd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ before_script: - sudo rm -rf /etc/mysql - sudo bash -c 'echo example.com > /etc/hostname' - unset LANG - - sudo apt-get update --allow-releaseinfo-change -qq + - sudo apt-get update -qq - sudo apt-get -qq purge mysql* graphviz* redis* php* - sudo apt-get -qq autoremove --purge From 8a5f6ca69288343ce603a0b2f00212665817bba2 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 14 Oct 2020 22:28:30 +0200 Subject: [PATCH 13/19] Fix nanorc install on Xenial --- wo/cli/plugins/stack_pref.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 2e1e4b5..e172942 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -153,11 +153,9 @@ def pre_pref(self, apt_packages): # nano if 'nano' in apt_packages: - if WOVar.wo_distro == 'ubuntu': - if (WOVar.wo_platform_codename == 'bionic' or - WOVar.wo_platform_codename == 'xenial'): - Log.debug(self, 'Adding ppa for nano') - WORepo.add(self, ppa=WOVar.wo_ubuntu_backports) + if WOVar.wo_platform_codename == 'bionic': + Log.debug(self, 'Adding ppa for nano') + WORepo.add(self, ppa=WOVar.wo_ubuntu_backports) else: if not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', From ba4b83a51208e8d78f6b9320d68e11a70ae98afc Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 12:24:51 +0200 Subject: [PATCH 14/19] Fix nanorc install, update Redis to 6.0.6 --- CHANGELOG.md | 5 +++++ wo/cli/plugins/stack_pref.py | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4a2b58..5a2e551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### v3.12.4 - 2020-10-14 +#### Changed + +- Redis 6.0.6 available on Ubuntu LTS + #### Fixed - Avif (AV1 Image Format) & WebP Nginx conditional support([PR #322](https://github.com/WordOps/WordOps/pull/322)) - Sendmail initial configuration with sendmailconfig - SSL certificates export encoding with utf-8 +- Nanorc install on Ubuntu 16.04 LTS ### v3.12.3 - 2020-10-13 diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index e172942..01154ac 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -139,10 +139,9 @@ def pre_pref(self, apt_packages): # add redis repository if set(WOVar.wo_redis).issubset(set(apt_packages)): if WOVar.wo_distro == 'ubuntu': - if not WOVar.wo_platform_codename == 'focal': - Log.info(self, "Adding repository for Redis, please wait...") - Log.debug(self, 'Adding ppa for redis') - WORepo.add(self, ppa=WOVar.wo_redis_repo) + Log.info(self, "Adding repository for Redis, please wait...") + Log.debug(self, 'Adding ppa for redis') + WORepo.add(self, ppa=WOVar.wo_redis_repo) else: if not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', @@ -157,9 +156,9 @@ def pre_pref(self, apt_packages): Log.debug(self, 'Adding ppa for nano') WORepo.add(self, ppa=WOVar.wo_ubuntu_backports) else: - if not WOFileUtils.grepcheck( + if (not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', - 'WordOps'): + 'WordOps') and not WOVar.wo_platform_codename == 'focal'): Log.info(self, "Adding repository for Nano, please wait...") Log.debug(self, 'Adding repository for Nano') WORepo.add_key(self, WOVar.wo_nginx_key) From 78d8b984373e63bf2a2653bd66e75468d571908c Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 12:43:05 +0200 Subject: [PATCH 15/19] Fix nano install on xenial --- wo/cli/plugins/stack_pref.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 01154ac..eaf56af 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -1260,7 +1260,8 @@ def post_pref(self, apt_packages, packages, upgrade=False): 'added by WordOps') # nanorc - if 'nano' in apt_packages: + if (('nano' in apt_packages) and + (not WOVar.wo_platform_codename == 'xenial')): Log.debug(self, 'Setting up nanorc') WOGit.clone(self, 'https://github.com/scopatz/nanorc.git', '/usr/share/nano-syntax-highlighting') From afa17b62dd0ce5ba54c385e3d79077651f1e74fe Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 13:24:00 +0200 Subject: [PATCH 16/19] Final fix for Xenial stack --- wo/cli/plugins/stack_pref.py | 16 ++++++++++------ wo/core/variables.py | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index eaf56af..2c20e5c 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -152,13 +152,18 @@ def pre_pref(self, apt_packages): # nano if 'nano' in apt_packages: - if WOVar.wo_platform_codename == 'bionic': - Log.debug(self, 'Adding ppa for nano') - WORepo.add(self, ppa=WOVar.wo_ubuntu_backports) + if WOVar.wo_distro == 'ubuntu': + if WOVar.wo_platform_codename == 'bionic': + Log.debug(self, 'Adding ppa for nano') + WORepo.add(self, ppa=WOVar.wo_ubuntu_backports) + elif WOVar.wo_platform_codename == 'xenial': + Log.debug(self, 'Adding ppa for nano') + WORepo.add_key(self, WOVar.wo_nginx_key) + WORepo.add(self, repo_url=WOVar.wo_extra_repo) else: if (not WOFileUtils.grepcheck( self, '/etc/apt/sources.list/wo-repo.list', - 'WordOps') and not WOVar.wo_platform_codename == 'focal'): + 'WordOps')): Log.info(self, "Adding repository for Nano, please wait...") Log.debug(self, 'Adding repository for Nano') WORepo.add_key(self, WOVar.wo_nginx_key) @@ -1260,8 +1265,7 @@ def post_pref(self, apt_packages, packages, upgrade=False): 'added by WordOps') # nanorc - if (('nano' in apt_packages) and - (not WOVar.wo_platform_codename == 'xenial')): + if 'nano' in apt_packages: Log.debug(self, 'Setting up nanorc') WOGit.clone(self, 'https://github.com/scopatz/nanorc.git', '/usr/share/nano-syntax-highlighting') diff --git a/wo/core/variables.py b/wo/core/variables.py index 7b80219..3905beb 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -111,6 +111,10 @@ class WOVar(): # Nginx repo and packages if wo_distro == 'ubuntu': wo_nginx_repo = "ppa:wordops/nginx-wo" + wo_extra_repo = ( + "deb http://download.opensuse.org" + "/repositories/home:/virtubox:" + "/WordOps/xUbuntu_{0}/".format(wo_platform_version)) else: if wo_distro == 'debian': if wo_platform_codename == 'jessie': From 5b6fbe278b70ee33b7dc3a65ee7e41e3fdf687b6 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 13:25:07 +0200 Subject: [PATCH 17/19] Fix wo_extra_repo variable --- wo/core/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wo/core/variables.py b/wo/core/variables.py index 3905beb..62fd5f2 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -114,7 +114,7 @@ class WOVar(): wo_extra_repo = ( "deb http://download.opensuse.org" "/repositories/home:/virtubox:" - "/WordOps/xUbuntu_{0}/".format(wo_platform_version)) + "/WordOps/xUbuntu_{0}/ /".format(wo_platform_version)) else: if wo_distro == 'debian': if wo_platform_codename == 'jessie': From 43cd78ebc682d77f9b34af496985e3d785a08f75 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 13:40:17 +0200 Subject: [PATCH 18/19] Fix for travis on Ubuntu focal --- tests/travis.sh | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tests/travis.sh b/tests/travis.sh index 742d80f..1919cdb 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -13,6 +13,7 @@ export DEBIAN_FRONTEND=noninteractive unset LANG export LANG='en_US.UTF-8' export LC_ALL='C.UTF-8' +wo_distro=$(lsb_release -sc) if [ -z "$1" ]; then { @@ -259,29 +260,31 @@ else exit_script fi -echo -ne " wo secure --sshport [..]\r" -if { - wo secure --sshport 2022 -} >>/var/log/wo/test.log; then - echo -ne " wo secure --sshport [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' -else - echo -e " wo secure --sshport [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script +if [ "$wo_distro" != "focal" ]; then + echo -ne " wo secure --sshport [..]\r" + if { + wo secure --sshport 2022 + } >>/var/log/wo/test.log; then + echo -ne " wo secure --sshport [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " wo secure --sshport [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script -fi -echo -ne " wo secure --ssh [..]\r" -if { - wo secure --ssh --force -} >>/var/log/wo/test.log; then - echo -ne " wo secure --ssh [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' -else - echo -e " wo secure --ssh [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script + fi + echo -ne " wo secure --ssh [..]\r" + if { + wo secure --ssh --force + } >>/var/log/wo/test.log; then + echo -ne " wo secure --ssh [${CGREEN}OK${CEND}]\\r" + echo -ne '\n' + else + echo -e " wo secure --ssh [${CRED}FAIL${CEND}]" + echo -ne '\n' + exit_script + fi fi echo -ne " wo secure --port [..]\r" if { From 0da8fdcac9f26fe05028e6439ffeafcd6d2c9df6 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Thu, 15 Oct 2020 14:02:09 +0200 Subject: [PATCH 19/19] Fix for fail2ban --- tests/travis.sh | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/travis.sh b/tests/travis.sh index 1919cdb..073d75a 100644 --- a/tests/travis.sh +++ b/tests/travis.sh @@ -354,18 +354,3 @@ for stack in $stack_purge; do fi done - -echo -e "${CGREEN}#############################################${CEND}" -echo -e ' wo stack fail2ban ' -echo -e "${CGREEN}#############################################${CEND}" -if { - wo stack install --fail2ban -} >>/var/log/wo/test.log; then - echo -ne " purging $stack [${CGREEN}OK${CEND}]\\r" - echo -ne '\n' -else - echo -e " purging $stack [${CRED}FAIL${CEND}]" - echo -ne '\n' - exit_script - -fi