Merge pull request #102 from WordOps/updating-configuration

Updating configuration
This commit is contained in:
VirtuBox
2019-07-23 13:08:41 +02:00
committed by GitHub
4 changed files with 25 additions and 14 deletions

View File

@@ -8,6 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased] ### v3.9.x - [Unreleased]
### v3.9.6.1 - 2019-07-23
#### Fixed
- Typo in `--letsencrypt=subdomain`
- phpMyAdmin upgrade archive extraction
### v3.9.6 - 2019-07-20 ### v3.9.6 - 2019-07-20
#### Added #### Added

27
install
View File

@@ -10,7 +10,7 @@
# Version 3.9.6 - 2019-07-20 # Version 3.9.6 - 2019-07-20
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
readonly wo_version_old="2.2.3" readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.6" readonly wo_version_new="3.9.6.1"
# CONTENTS # CONTENTS
# --- # ---
# 1. VARIABLES AND DECLARATIONS # 1. VARIABLES AND DECLARATIONS
@@ -385,6 +385,8 @@ wo_install_acme_sh() {
# create acme.sh.env file inlcuded in .bashrc to avoid error when logging in # create acme.sh.env file inlcuded in .bashrc to avoid error when logging in
mkdir -p "$HOME/.acme.sh" mkdir -p "$HOME/.acme.sh"
echo '' > "$HOME/.acme.sh/acme.sh.env" echo '' > "$HOME/.acme.sh/acme.sh.env"
# removing previous cronjob
crontab -l | sed '/41 0 \* \* \* "\/root\/\.acme\.sh"\/acme.sh --cron --home "\/root\/\.acme\.sh" > \/dev\/null/d' | crontab -
} >> "$wo_install_log" 2>&1 } >> "$wo_install_log" 2>&1
fi fi
@@ -430,10 +432,10 @@ wo_upgrade_nginx() {
fi fi
# backup nginx conf # backup nginx conf
if [ -d /etc/nginx ]; then if [ -d /etc/nginx ]; then
/usr/bin/rsync -az /etc/nginx/ /var/lib/wo-backup/nginx/ /usr/bin/rsync -a --noatime /etc/nginx/ /var/lib/wo-backup/nginx/
fi fi
if [ -d /etc/php ]; then if [ -d /etc/php ]; then
/usr/bin/rsync -az /etc/php/ /var/lib/wo-backup/php/ /usr/bin/rsync -a --noatime /etc/php/ /var/lib/wo-backup/php/
fi fi
# chec if the package nginx-ee is installed # chec if the package nginx-ee is installed
CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee) CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee)
@@ -452,7 +454,7 @@ wo_upgrade_nginx() {
# import the respository key for updates # import the respository key for updates
apt-key add - < /tmp/nginx-wo.key apt-key add - < /tmp/nginx-wo.key
rm -f /tmp/nginx-wo.key rm -f /tmp/nginx-wo.key
sudo apt-get update -qq apt-get update -qq
fi fi
# stop nginx # stop nginx
@@ -470,6 +472,11 @@ wo_upgrade_nginx() {
# remove previous package # remove previous package
apt-mark unhold nginx-ee nginx-common nginx-custom apt-mark unhold nginx-ee nginx-common nginx-custom
apt-get -y purge nginx-ee nginx-common nginx-custom --allow-change-held-packages apt-get -y purge nginx-ee nginx-common nginx-custom --allow-change-held-packages
# remove previous php-fpm pool configuration
if [ -n "$CHECK_PHP72" ]; then
apt-get purge php7.2-fpm -y -qq
rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
fi
elif [ -n "$CHECK_NGINX_WO" ]; then elif [ -n "$CHECK_NGINX_WO" ]; then
apt-mark unhold nginx-wo nginx-common nginx-custom apt-mark unhold nginx-wo nginx-common nginx-custom
apt-get -y purge nginx-wo nginx-common nginx-custom --allow-change-held-packages apt-get -y purge nginx-wo nginx-common nginx-custom --allow-change-held-packages
@@ -478,18 +485,14 @@ wo_upgrade_nginx() {
if [ -d /etc/nginx ]; then if [ -d /etc/nginx ]; then
rm -rf /etc/nginx rm -rf /etc/nginx
fi fi
# remove previous php-fpm pool configuration
if [ -n "$CHECK_PHP72" ]; then
apt-get purge php7.2-fpm -y -qq
rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf}
fi
/usr/local/bin/wo stack install --nginx --php /usr/local/bin/wo stack install --nginx --php
rm -f /etc/nginx/common/acl.conf /etc/nginx/conf.d/{map-wp-cache.conf,map-wp.conf,fascgi.conf} rm -f /etc/nginx/common/acl.conf /etc/nginx/conf.d/{map-wp-cache.conf,map-wp.conf,fascgi.conf} /etc/nginx/htpasswd-wo
fi fi
# restore sites and configuration # restore sites and configuration
/usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/ /usr/bin/rsync -au --noatime /var/lib/wo-backup/nginx/ /etc/nginx/
[ -f /etc/nginx/htpasswd-ee ] && { mv /etc/nginx/htpasswd-ee /etc/nginx/htpasswd-wo; }
sed -i "s/locations.conf/locations-wo.conf/" /etc/nginx/sites-available/* sed -i "s/locations.conf/locations-wo.conf/" /etc/nginx/sites-available/*
sed -i "s/locations-php7.conf/locations-wo.conf/" /etc/nginx/sites-available/* sed -i "s/locations-php7.conf/locations-wo.conf/" /etc/nginx/sites-available/*
sed -i "s/locations-php72.conf/locations-wo.conf/" /etc/nginx/sites-available/* sed -i "s/locations-php72.conf/locations-wo.conf/" /etc/nginx/sites-available/*
@@ -681,7 +684,7 @@ if [ -x /usr/local/bin/wo ]; then
fi fi
if [ -z "$wo_preserve_config" ]; then if [ -z "$wo_preserve_config" ]; then
if [ -n "$(command -v nginx)" ]; then if [ -n "$(command -v nginx)" ]; then
if ! grep -q "v3.9.5." /etc/nginx/common/release; then if [ ! -f /etc/nginx/common/release ] || ! grep -q "v3.9.6" /etc/nginx/common/release; then
wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log
wo_upgrade_nginx | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log
fi fi

View File

@@ -1369,7 +1369,7 @@ def setupLetsEncrypt(self, wo_domain_name, subdomain=False, wildcard=False,
"'/etc/letsencrypt/config' " "'/etc/letsencrypt/config' "
"--issue " "--issue "
"-d {0} {1}" "-d {0} {1}"
"-k {3} -f" "-k {2} -f"
.format(wo_domain_name, .format(wo_domain_name,
acme_mode, acme_mode,
keylenght)) keylenght))

View File

@@ -7,10 +7,11 @@ from wo.core.apt_repo import WORepo
from wo.core.services import WOService from wo.core.services import WOService
from wo.core.fileutils import WOFileUtils from wo.core.fileutils import WOFileUtils
from wo.core.shellexec import WOShellExec from wo.core.shellexec import WOShellExec
from wo.core.git import WOGit from wo.core.extract import WOExtract
from wo.core.download import WODownload from wo.core.download import WODownload
import configparser import configparser
import os import os
import shutil
class WOStackUpgradeController(CementBaseController): class WOStackUpgradeController(CementBaseController):