diff --git a/CHANGELOG.md b/CHANGELOG.md index c5f7b6a..107d91a 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.13.1 - 2020-10-26 + +#### Fixed + +- Python virtualenv configuration +- Removing ssl certificate when deleting a site + #### v3.13.0 - 2020-10-25 #### Added diff --git a/install b/install index c5b8714..f7ce8df 100755 --- a/install +++ b/install @@ -9,7 +9,7 @@ # ------------------------------------------------------------------------- # wget -qO wo wops.cc && sudo -E bash wo # ------------------------------------------------------------------------- -# Version 3.13.0 - 2020-10-25 +# Version 3.13.1 - 2020-10-26 # ------------------------------------------------------------------------- # CONTENTS @@ -209,13 +209,15 @@ 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 python3-venv 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 idn >/dev/null 2>&1 + gnupg2 cron ccze rsync apt-transport-https tree haveged ufw unattended-upgrades tzdata ntp zstd idn \ + python3-distutils-extra libapt-pkg-dev >/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 python3-venv 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 idn >/dev/null 2>&1 + software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp zstd idn \ + python3-distutils-extra libapt-pkg-dev >/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 @@ -427,22 +429,41 @@ wo_install_acme_sh() { wo_install() { local python_ver python_ver=$(python3 -c "import sys; print(sys.version_info[1])") + local wo_distro_codename + wo_distro_codename=$(lsb_release -sc) + local wo_linux_distro + wo_linux_distro=$(lsb_release -is) if [ -d /usr/local/lib/python3."$python_ver"/dist-packages ]; then cd /usr/local/lib/python3."$python_ver"/dist-packages || exit 1 fi python3 -m pip uninstall -yq wo wordops ee - if [ -d /opt/wo ]; then - cd /opt/wo || exit 1 - source bin/activate + if [ -d /opt/wo/lib/python3."$python_ver"/site-packages/apt ]; then + source /opt/wo/bin/activate + python3 -m pip install -U pip setuptools wheel else - mkdir -p /opt/wo - cd /opt || exit 1 - python3 -m venv --system-site-packages wo - source wo/bin/activate + rm -rf /opt/wo + python3 -m venv /opt/wo + source /opt/wo/bin/activate + python3 -m pip install -U pip setuptools wheel + if [ "$wo_linux_distro" = "Debian" ] || [ "$wo_linux_distro" = "Raspbian" ]; then + if [ "$wo_distro_codename" = "stretch" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.4.y#egg=python-apt + else + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.8.4.y#egg=python-apt + fi + else + if [ "$wo_distro_codename" = "focal" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@2.0.0#egg=python-apt + elif [ "$wo_distro_codename" = "bionic" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.6.y#egg=python-apt + else + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.1.y-xenial#egg=python-apt + fi + fi fi - python3 -m pip install -U pip setuptools wheel + if [ "$wo_branch" = "master" ]; then - python3 -m pip install -I wordops + python3 -m pip install -U wordops else python3 -m pip install -I "git+git://github.com/WordOps/WordOps.git@$wo_branch#egg=wordops" fi @@ -458,18 +479,38 @@ wo_install() { wo_travis_install() { local python_ver python_ver=$(python3 -c "import sys; print(sys.version_info[1])") + local wo_distro_codename + wo_distro_codename=$(lsb_release -sc) + local wo_linux_distro + wo_linux_distro=$(lsb_release -is) if [ -d ./dist ]; then rm -rf dist fi if [ -f ./setup.py ]; then - if [ -d /opt/wo ]; then + if [ -d /opt/wo/lib/python3."$python_ver"/site-packages/apt ]; then source /opt/wo/bin/activate + python3 -m pip install -U pip setuptools wheel else - mkdir -p /opt/wo - python3 -m venv --system-site-packages /opt/wo + rm -rf /opt/wo + python3 -m venv /opt/wo source /opt/wo/bin/activate + python3 -m pip install -U pip setuptools wheel + if [ "$wo_linux_distro" = "Debian" ] || [ "$wo_linux_distro" = "Raspbian" ]; then + if [ "$wo_distro_codename" = "stretch" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.4.y#egg=python-apt + else + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.8.4.y#egg=python-apt + fi + else + if [ "$wo_distro_codename" = "focal" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@2.0.0#egg=python-apt + elif [ "$wo_distro_codename" = "bionic" ]; then + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.6.y#egg=python-apt + else + python3 -m pip install git+https://salsa.debian.org/apt-team/python-apt.git@1.1.y-xenial#egg=python-apt + fi + fi fi - python3 -m pip install -U pip setuptools wheel python3 -m pip install -U . else python3 -m pip install -U "git+git://github.com/WordOps/WordOps.git@$wo_branch#egg=wordops" diff --git a/setup.py b/setup.py index d437072..05d08f0 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.13.0', + version='3.13.1', description='An essential toolset that eases server administration', long_description=LONG, long_description_content_type='text/markdown', diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index 5f5c7e9..fec615c 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -17,6 +17,7 @@ from wo.core.services import WOService from wo.core.shellexec import WOShellExec, CommandExecutionError from wo.core.sslutils import SSL from wo.core.variables import WOVar +from wo.core.acme import WOAcme def wo_site_hook(app): @@ -432,6 +433,7 @@ class WOSiteDeleteController(CementBaseController): # TODO Delete nginx conf removeNginxConf(self, wo_domain) deleteSiteInfo(self, wo_domain) + WOAcme.removeconf(self, wo_domain) Log.info(self, "Deleted site {0}".format(wo_domain)) # else: # Log.error(self, " site {0} does @@ -442,6 +444,10 @@ class WOSiteDeleteController(CementBaseController): # TODO Delete nginx conf removeNginxConf(self, wo_domain) deleteSiteInfo(self, wo_domain) + # To improve + if not WOFileUtils.grepcheck( + self, '/var/www/22222/conf/nginx/ssl.conf', wo_domain): + WOAcme.removeconf(self, wo_domain) Log.info(self, "Deleted site {0}".format(wo_domain)) diff --git a/wo/core/variables.py b/wo/core/variables.py index 6af68de..bc46051 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.13.0" + wo_version = "3.13.1" # WordOps packages versions wo_wp_cli = "2.4.0" wo_adminer = "4.7.5"