From 8667c1da839e3806f0530183d1344c1f5a7a7efe Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 23 Mar 2019 18:05:30 +0100 Subject: [PATCH 01/16] add backup and cleanup before upgrade --- CHANGELOG.md | 3 + install | 121 +++++++++++++++++++---------- wo/cli/plugins/stack.py | 5 +- wo/cli/templates/upstream.mustache | 12 +-- 4 files changed, 92 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce7d25..e28dbb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - load-balancing on unix socket for php-fpm - stub_status vhost for metrics - opcache optimization for php-fpm +- EasyEngine configuration backup before migration +- EasyEngine configuration cleanup +- WordOps configuration backup before upgrade #### Changed diff --git a/install b/install index 3cad1be..4a9f67b 100644 --- a/install +++ b/install @@ -83,10 +83,16 @@ fi ### wo_branch="$1" readonly wo_log_dir=/var/log/wo/ +readonly wo_backup_dir=/var/lib/wo-backup readonly wo_install_log=/var/log/wo/install.log readonly wo_linux_distro=$(lsb_release -is) readonly wo_distro_version=$(lsb_release -sc) readonly wo_distro_id=$(lsb_release -rs) +TIME_FORMAT='%d-%b-%Y-%H%M%S' +TIME=$(date +"$TIME_FORMAT") +NGINX_BACKUP_FILE="/var/lib/wo-backup/nginx-backup.$TIME.tar.gz" +EE_BACKUP_FILE="/var/lib/wo-backup/ee-backup.$TIME.tar.gz" +WO_BACKUP_FILE="/var/lib/wo-backup/wo-backup.$TIME.tar.gz" if [ -x /usr/local/bin/ee ]; then migration=1 @@ -118,6 +124,11 @@ if [ ! -d "$wo_log_dir" ]; then wo_lib_echo "Creating WordOps log directory, just a second..." mkdir -p "$wo_log_dir" || wo_lib_error "Whoops - seems we are unable to create the log directory $wo_log_dir, exit status " $? + wo_lib_echo "Creating WordOps backup directory, just a second..." + mkdir -p "$wo_backup_dir" || wo_lib_error "Whoops - seems we are unable to create the backup directory $wo_backup_dir, exit status " $? + chmod -R 600 "$wo_backup_dir" + + # create wordops log files touch /var/log/wo/{wordops.log,install.log} chmod -R 700 /var/log/wo || wo_lib_error "Whoops, there was an error setting the permissions on the WordOps log folder, exit status " $? @@ -137,7 +148,7 @@ wo_install_dep() { fi locale-gen en - } >> /var/log/wo/install.log 2>&1 + } >> "$wo_install_log" 2>&1 # Support PFS if [ -f /etc/nginx/nginx.conf ]; then # Replace previous ciphers @@ -151,6 +162,7 @@ wo_install_dep() { if [ ! -d /var/www/html/.well-known/acme-challenge ]; then mkdir -p /var/www/html/.well-known/acme-challenge chown -R www-data:www-data /var/www/html /var/www/html/.well-known + chmod 750 /var/www/html /var/www/html/.well-known fi } @@ -177,7 +189,6 @@ wo_sync_db() { ### cp /var/lib/ee/ee.db /var/lib/wo/dbase.db - rm -rf /var/lib/ee else # Create an empty database for WordOps @@ -306,7 +317,7 @@ wo_update_wp_cli() { [ ! -f /etc/bash_completion.d/wp-completion.bash ] && { wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash } - } >> /var/log/wo/install.log 2>&1 + } >> "$wo_install_log" 2>&1 } wo_install_acme_sh() { @@ -338,9 +349,25 @@ wo_install_acme_sh() { if [ ! -d /var/www/html/.well-known/acme-challenge ]; then mkdir -p /var/www/html/.well-known/acme-challenge chown -R www-data:www-data /var/www/html /var/www/html/.well-known + chmod 750 /var/www/html /var/www/html/.well-known + else + chmod 750 /var/www/html /var/www/html/.well-known fi - } >> /var/log/wo/install.log 2>&1 + } >> "$wo_install_log" 2>&1 + fi + if [ -d "$HOME/.acme/.sh" ]; then + { + rsync -az --exclude="account.conf" \ + --exclude="acme.sh" \ + --exclude="acme.sh.env" \ + --exclude="deploy" \ + --exclude="dnsapi" \ + --exclude="http.header" \ + --exclude="ca" \ + "$HOME/.acme.sh/" \ + /etc/letsencrypt/renewal/ + } >> "$wo_install_log" 2>&1 fi } @@ -357,7 +384,7 @@ wo_install() { git clone -b "$wo_branch" https://github.com/WordOps/WordOps.git /tmp/wordops --quiet cd /tmp/wordops || exit 1 - } >> /var/log/wo/install.log 2>&1 + } >> "$wo_install_log" 2>&1 python3 setup.py install } @@ -366,18 +393,12 @@ wo_upgrade_nginx() { { - if [ -d /var/lib/wo/backup/nginx ]; then - TIME_FORMAT='%d-%b-%Y-%H%M%S' - TIME=$(date +"$TIME_FORMAT") - BACKUP_FILE="/var/lib/wo/backup/nginx-backup.$TIME.tar.gz" - - tar -I pigz "$BACKUP_FILE" /var/lib/wo/backup/nginx - rm -rf /var/lib/wo/backup/nginx + if [ -d /var/lib/wo-backup/nginx ]; then + tar -I pigz "$NGINX_BACKUP_FILE" /var/lib/wo-backup/nginx + rm -rf /var/lib/wo-backup/nginx fi - # backup nginx conf - mkdir -p /var/lib/wo/backup - rsync -az /etc/nginx/ /var/lib/wo/backup/nginx/ - + # backup nginx conf + /usr/bin/rsync -az /etc/nginx/ /var/lib/wo-backup/nginx/ # chec if the package nginx-ee is installed CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee) @@ -408,17 +429,20 @@ wo_upgrade_nginx() { mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block" } - if [ -n "$CHECK_NGINX_EE" ]; then - # remove previous package - apt-mark unhold nginx-ee nginx-common nginx-custom - apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge - elif [ -n "$CHECK_NGINX_WO" ]; then - apt-mark unhold nginx-wo nginx-common nginx-custom - apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge - fi - # install new nginx package if [ -x /usr/local/bin/wo ]; then + + if [ -n "$CHECK_NGINX_EE" ]; then + # remove previous package + apt-mark unhold nginx-ee nginx-common nginx-custom + apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge + rm -rf /etc/nginx + elif [ -n "$CHECK_NGINX_WO" ]; then + apt-mark unhold nginx-wo nginx-common nginx-custom + apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge + rm -rf /etc/nginx + fi + # remove previous php-fpm pool configuration if [ -n "$CHECK_PHP72" ]; then apt-get remove php7.2-fpm -y -qq --purge @@ -433,7 +457,7 @@ wo_upgrade_nginx() { fi # restore sites and configuration - /usr/bin/rsync -auz /var/lib/wo/backup/nginx/ /etc/nginx/ + /usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/ # update redis.conf headers if [ -f /etc/nginx/common/redis.conf ]; then @@ -461,18 +485,18 @@ wo_upgrade_nginx() { mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block } - } >> /var/log/wo/install.log 2>&1 + } >> "$wo_install_log" 2>&1 } wo_update_latest() { if [ -f /etc/nginx/fastcgi_params ]; then - grep -q 'HTTP_PROXY' /etc/nginx/fastcgi_params - if [[ $? -ne 0 ]]; then + CHECK_HTTP_PROXY=$(grep 'HTTP_PROXY' /etc/nginx/fastcgi_params) + if [ -z "$CHECK_HTTP_PROXY" ]; then echo 'fastcgi_param HTTP_PROXY "";' >> /etc/nginx/fastcgi_params echo 'fastcgi_param HTTP_PROXY "";' >> /etc/nginx/fastcgi.conf - service nginx restart + service nginx restart | tee -ai $wo_install_log fi fi @@ -506,8 +530,8 @@ wo_update_latest() { fi # Fix WordPress example.html issue # Ref: http://wptavern.com/xss-vulnerability-in-jetpack-and-the-twenty-fifteen-default-theme-affects-millions-of-wordpress-users - dpkg --get-selections | grep -v deinstall | grep nginx - if [ $? -eq 0 ]; then + CHECK_DEINSTALL_NGINX=$(dpkg --get-selections | grep -v deinstall | grep nginx) + if [ -z "$CHECK_DEINSTALL_NGINX" ]; then cp /usr/lib/wo/templates/locations.mustache /etc/nginx/common/locations-php72.conf fi @@ -517,10 +541,10 @@ wo_update_latest() { if [ -f /etc/redis/redis.conf ]; then grep -0 -v "#" /etc/redis/redis.conf | grep 'bind' - if [ $? -ne 0 ]; then + if [ "$?" -ne 0 ]; then sed -i '$ a bind 127.0.0.1' /etc/redis/redis.conf & - service redis-server restart + service redis-server restart > /dev/null 2>&1 fi fi @@ -558,6 +582,18 @@ wo_git_init() { } >> /var/log/wo/install.log 2>&1 } +wo_backup_ee() { + tar -I pigz -cf "$EE_BACKUP_FILE" /etc/nginx /usr/local/bin/ee /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee +} + +wo_backup_wo() { + tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx/ /usr/local/lib/python3.6/dist-packages/wo-*.egg /etc/wo +} + +wo_clean_ee() { + rm -f /usr/local/bin/ee /etc/bash_completion.d/ee_auto.rc /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee +} + ### # 4 - WO MAIN SETUP ### @@ -570,11 +606,13 @@ if [ -x /usr/local/bin/wo ]; then if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_install_dep | tee -ai $wo_install_log + wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log + wo_backup_wo | tee -ai $wo_install_log wo_lib_echo "Syncing WO database" | tee -ai $wo_install_log - wo_sync_db >> $wo_install_log 2>&1 + wo_sync_db | tee -ai $wo_install_log secure_wo_db | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log - wo_install | tee -ai $wo_install_log + wo_install >> wo_install_log 2>&1 wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log wo_update_latest | tee -ai $wo_install_log @@ -596,11 +634,13 @@ else if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then wo_lib_echo "Installing wo dependencies " | tee -ai $wo_install_log wo_install_dep | tee -ai $wo_install_log + wo_lib_echo "Backing-up EE install" | tee -ai $wo_install_log + wo_backup_ee | tee -ai $wo_install_log wo_lib_echo "Syncing WO database" | tee -ai $wo_install_log - wo_sync_db >> $wo_install_log 2>&1 + wo_sync_db | tee -ai $wo_install_log secure_wo_db | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log - wo_install | tee -ai $wo_install_log + wo_install >> wo_install_log 2>&1 wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log wo_update_latest | tee -ai $wo_install_log @@ -609,6 +649,9 @@ else wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log wo_git_init | tee -ai $wo_install_log wo_update_wp_cli | tee -ai $wo_install_log + wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log + wo_clean_ee | tee -ai $wo_install_log + e else wo_lib_error "Not installing WordOps, exit status = " 1 fi @@ -632,7 +675,7 @@ wo sync | tee -ai $wo_install_log if [ "$migration" -eq "1" ]; then echo wo_lib_echo "The migration from EasyEngine to WordOps was succesfull!" - wo_lib_echo "The EasyEngine backup files can be found in /var/lib/wo/ee-backup.tgz" + wo_lib_echo "The EasyEngine backup files can be found in /var/lib/wo-backup/ee-backup.tgz" echo wo_lib_echo_info "For autocompletion, run the following command:" wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc" diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index a579f10..87430a1 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -214,10 +214,7 @@ class WOStackController(CementBaseController): wo_nginx.close() data = dict(php="9000", debug="9001", - php7="9070", debug7="9170", - php7conf=True - if WOAptGet.is_installed(self, 'php7.0-fpm') - else False) + php7="9070", debug7="9170") Log.debug(self, 'Writting the nginx configuration to ' 'file /etc/nginx/conf.d/upstream.conf') wo_nginx = open('/etc/nginx/conf.d/upstream.conf', diff --git a/wo/cli/templates/upstream.mustache b/wo/cli/templates/upstream.mustache index 61019af..8782258 100644 --- a/wo/cli/templates/upstream.mustache +++ b/wo/cli/templates/upstream.mustache @@ -10,7 +10,7 @@ upstream debug { server 127.0.0.1:{{debug}}; } -{{#php7conf}} + #------------------------------- # PHP 7.0 #------------------------------- @@ -22,7 +22,7 @@ upstream debug7 { # Debug Pool server 127.0.0.1:{{debug7}}; } -{{/php7conf}} + #------------------------------- # PHP 7.2 @@ -31,10 +31,10 @@ server 127.0.0.1:{{debug7}}; # PHP 7.2 upstream with load-balancing on two unix sockets upstream php72 { least_conn; - + server unix:/var/run/php/php72-fpm.sock; server unix:/var/run/php/php72-two-fpm.sock; - + keepalive 5; } @@ -51,10 +51,10 @@ server 127.0.0.1:9172; # PHP 7.3 upstream with load-balancing on two unix sockets upstream php73 { least_conn; - + server unix:/var/run/php/php73-fpm.sock; server unix:/var/run/php/php73-two-fpm.sock; - + keepalive 5; } From eed662afcac0d85c3f09483a092d5eb013a0f560 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 16:09:06 +0100 Subject: [PATCH 02/16] add wo maintenance (testing) --- wo/cli/plugins/maintenance.py | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 wo/cli/plugins/maintenance.py diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py new file mode 100644 index 0000000..c48ff3e --- /dev/null +++ b/wo/cli/plugins/maintenance.py @@ -0,0 +1,57 @@ +from cement.core.controller import CementBaseController, expose +from cement.core import handler, hook +from wo.core.logging import Log +from wo.core.variables import WOVariables +from wo.core.aptget import WOAptGet +from wo.core.apt_repo import WORepo +from wo.core.services import WOService +from wo.core.fileutils import WOFileUtils +from wo.core.shellexec import WOShellExec +from wo.core.git import WOGit +from wo.core.download import WODownload +import configparser +import os + + +def wo_stack_hook(app): + pass + + +class WOMaintenanceController(CementBaseController): + class Meta: + label = 'wo_maintenance' + stacked_on = 'base' + aliases = ['maintenance'] + aliases_only = True + stacked_type = 'nested' + description = ('update server packages to latest version') + usage = "wo maintenance" + + @expose(hide=True) + def default(self): + + try: + Log.info(self, "updating apt-cache, please wait...") + WOShellExec.cmd_exec(self, "apt-get update - qq") + Log.info(self, "updating packages, please wait...") + WOShellExec.cmd_exec(self, "DEBIAN_FRONTEND=noninteractive" + "apt-get -o " + "Dpkg::Options::='--force-confmiss' " + "-o Dpkg::Options::='--force-confold' " + "-y dist-upgrade") + Log.info(self, "cleaning-up packages, please wait...") + WOShellExec.cmd_exec(self, "apt-get -y --purge autoremove") + WOShellExec.cmd_exec(self, "apt-get - y autoclean") + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "Package updates failed !") + except Exception as e: + Log.debug(self, str(e)) + Log.error(self, "Packages updates failed !") + + +def load(app): + # register the plugin class.. this only happens if the plugin is enabled + handler.register(WOUpdateController) + # register a hook (function) to run after arguments are parsed. + hook.register('post_argument_parsing', wo_update_hook) From c151045814d697904f141c0131f37f63a61bd591 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 16:11:17 +0100 Subject: [PATCH 03/16] [skip travis] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e28dbb4..99bd06a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - EasyEngine configuration backup before migration - EasyEngine configuration cleanup - WordOps configuration backup before upgrade +- Previous acme.sh certs migration #### Changed From 4c1e336bfe58a842948d48221478956395032fef Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 20:55:35 +0100 Subject: [PATCH 04/16] fix typo --- install | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/install b/install index 4a9f67b..fc6a79e 100644 --- a/install +++ b/install @@ -357,17 +357,17 @@ wo_install_acme_sh() { } >> "$wo_install_log" 2>&1 fi if [ -d "$HOME/.acme/.sh" ]; then - { - rsync -az --exclude="account.conf" \ - --exclude="acme.sh" \ - --exclude="acme.sh.env" \ - --exclude="deploy" \ - --exclude="dnsapi" \ - --exclude="http.header" \ - --exclude="ca" \ - "$HOME/.acme.sh/" \ - /etc/letsencrypt/renewal/ - } >> "$wo_install_log" 2>&1 + { + rsync -az --exclude="account.conf" \ + --exclude="acme.sh" \ + --exclude="acme.sh.env" \ + --exclude="deploy" \ + --exclude="dnsapi" \ + --exclude="http.header" \ + --exclude="ca" \ + "$HOME/.acme.sh/" \ + /etc/letsencrypt/renewal/ + } >> "$wo_install_log" 2>&1 fi } @@ -651,7 +651,6 @@ else wo_update_wp_cli | tee -ai $wo_install_log wo_lib_echo "Cleaning-up EE previous install" | tee -ai $wo_install_log wo_clean_ee | tee -ai $wo_install_log - e else wo_lib_error "Not installing WordOps, exit status = " 1 fi From 8a180cff92a942cc1a2a842611869e09c3513e91 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 22:41:24 +0100 Subject: [PATCH 05/16] fix maintenance controller --- install | 1 + wo/cli/plugins/maintenance.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/install b/install index fc6a79e..6294fc4 100644 --- a/install +++ b/install @@ -389,6 +389,7 @@ wo_install() { } + wo_upgrade_nginx() { { diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index c48ff3e..baf5312 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -13,7 +13,7 @@ import configparser import os -def wo_stack_hook(app): +def wo_maintenance_hook(app): pass @@ -52,6 +52,6 @@ class WOMaintenanceController(CementBaseController): def load(app): # register the plugin class.. this only happens if the plugin is enabled - handler.register(WOUpdateController) + handler.register(WOMaintenanceController) # register a hook (function) to run after arguments are parsed. - hook.register('post_argument_parsing', wo_update_hook) + hook.register('post_argument_parsing', wo_maintenance_hook) From ccadf150ccea37e8c39e032dc042fa97fd64e7e8 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 22:54:04 +0100 Subject: [PATCH 06/16] fix maintenance --- wo/cli/plugins/maintenance.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index baf5312..07c9a51 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -1,3 +1,5 @@ +"""Maintenance Plugin for WordOps""" + from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from wo.core.logging import Log @@ -19,10 +21,8 @@ def wo_maintenance_hook(app): class WOMaintenanceController(CementBaseController): class Meta: - label = 'wo_maintenance' + label = 'maintenance' stacked_on = 'base' - aliases = ['maintenance'] - aliases_only = True stacked_type = 'nested' description = ('update server packages to latest version') usage = "wo maintenance" From e823492915b2210f3298fc1fa27c41115148fef4 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 24 Mar 2019 23:31:13 +0100 Subject: [PATCH 07/16] fix install --- install | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/install b/install index 6294fc4..bb51edd 100644 --- a/install +++ b/install @@ -540,7 +540,7 @@ wo_update_latest() { # Fix Redis-server security issue # http://redis.io/topics/security if [ -f /etc/redis/redis.conf ]; then - grep -0 -v "#" /etc/redis/redis.conf | grep 'bind' + grep -0 -v "#" /etc/redis/redis.conf | grep 'bind' >> /dev/null 2>&1 if [ "$?" -ne 0 ]; then sed -i '$ a bind 127.0.0.1' /etc/redis/redis.conf & @@ -584,15 +584,15 @@ wo_git_init() { } wo_backup_ee() { - tar -I pigz -cf "$EE_BACKUP_FILE" /etc/nginx /usr/local/bin/ee /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee + tar -I pigz -cf "$EE_BACKUP_FILE" /etc/nginx /usr/local/bin/ee /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee >> /var/log/wo/install.log 2>&1 } wo_backup_wo() { - tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx/ /usr/local/lib/python3.6/dist-packages/wo-*.egg /etc/wo + tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx/ /usr/local/lib/python3.6/dist-packages/wo-*.egg /etc/wo >> /var/log/wo/install.log 2>&1 } wo_clean_ee() { - rm -f /usr/local/bin/ee /etc/bash_completion.d/ee_auto.rc /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee + rm -f /usr/local/bin/ee /etc/bash_completion.d/ee_auto.rc /usr/local/lib/python3.6/dist-packages/ee-*.egg /etc/ee /var/lib/ee >> /var/log/wo/install.log 2>&1 } ### @@ -610,7 +610,6 @@ if [ -x /usr/local/bin/wo ]; then wo_lib_echo "Backing-up WO install" | tee -ai $wo_install_log wo_backup_wo | tee -ai $wo_install_log wo_lib_echo "Syncing WO database" | tee -ai $wo_install_log - wo_sync_db | tee -ai $wo_install_log secure_wo_db | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_install >> wo_install_log 2>&1 From 8ad070306bbaba22cf32b09161ffb413021a1943 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:05:20 +0100 Subject: [PATCH 08/16] fix maintenance --- config/bash_completion.d/wo_auto.rc | 2 +- config/plugins.d/maintenance.conf | 8 ++++++ install | 4 +-- wo/cli/plugins/maintenance.py | 2 -- .../templates/15-content_filter_mode.mustache | 27 ------------------- 5 files changed, 11 insertions(+), 32 deletions(-) create mode 100644 config/plugins.d/maintenance.conf delete mode 100644 wo/cli/templates/15-content_filter_mode.mustache diff --git a/config/bash_completion.d/wo_auto.rc b/config/bash_completion.d/wo_auto.rc index f08fced..8ff11e5 100644 --- a/config/bash_completion.d/wo_auto.rc +++ b/config/bash_completion.d/wo_auto.rc @@ -11,7 +11,7 @@ _wo_complete() # SETUP THE BASE LEVEL (everything after "wo") if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $(compgen \ - -W "stack site debug clean secure import-slow-log log update sync info --version --help --quiet" \ + -W "stack site debug clean secure import-slow-log log update sync info maintenance --version --help --quiet" \ -- $cur) ) diff --git a/config/plugins.d/maintenance.conf b/config/plugins.d/maintenance.conf new file mode 100644 index 0000000..07ac10a --- /dev/null +++ b/config/plugins.d/maintenance.conf @@ -0,0 +1,8 @@ +### Example Plugin Configuration for WordOps + +[maintenance] + +### If enabled, load a plugin named `example` either from the Python module +### `wo.cli.plugins.example` or from the file path +### `/var/lib/wo/plugins/example.py` +enable_plugin = true diff --git a/install b/install index bb51edd..9f2b424 100644 --- a/install +++ b/install @@ -679,7 +679,7 @@ if [ "$migration" -eq "1" ]; then wo_lib_echo_info "For autocompletion, run the following command:" wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc" echo - wo_lib_echo "WordOps (wo) help: https://wordops.io/docs" + wo_lib_echo "WordOps (wo) help: https://docs.wordops.io" else echo wo_lib_echo "For WordOps (wo) auto completion, run the following command" @@ -687,5 +687,5 @@ else wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc" echo wo_lib_echo "Yay! WordOps (wo) installed/updated successfully" - wo_lib_echo "WordOps (wo) help: https://wordops.io/docs" + wo_lib_echo "WordOps (wo) help: https://docs.wordops.io" fi diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index 07c9a51..67d7cad 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -11,8 +11,6 @@ from wo.core.fileutils import WOFileUtils from wo.core.shellexec import WOShellExec from wo.core.git import WOGit from wo.core.download import WODownload -import configparser -import os def wo_maintenance_hook(app): diff --git a/wo/cli/templates/15-content_filter_mode.mustache b/wo/cli/templates/15-content_filter_mode.mustache deleted file mode 100644 index 6fd8f21..0000000 --- a/wo/cli/templates/15-content_filter_mode.mustache +++ /dev/null @@ -1,27 +0,0 @@ -use strict; - -# You can modify this file to re-enable SPAM checking through spamassassin -# and to re-enable antivirus checking. - -# -# Default antivirus checking mode -# Please note, that anti-virus checking is DISABLED by -# default. -# If You wish to enable it, please uncomment the following lines: - - -@bypass_virus_checks_maps = ( - \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re); - - -# -# Default SPAM checking mode -# Please note, that anti-spam checking is DISABLED by -# default. -# If You wish to enable it, please uncomment the following lines: - - -@bypass_spam_checks_maps = ( - \%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re); - -1; # ensure a defined return From 05adfefe7163f4d59adeed6f44db7689d096b446 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:09:53 +0100 Subject: [PATCH 09/16] fix backup --- install | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/install b/install index 9f2b424..acf5c3d 100644 --- a/install +++ b/install @@ -83,7 +83,7 @@ fi ### wo_branch="$1" readonly wo_log_dir=/var/log/wo/ -readonly wo_backup_dir=/var/lib/wo-backup +readonly wo_backup_dir=/var/lib/wo-backup/ readonly wo_install_log=/var/log/wo/install.log readonly wo_linux_distro=$(lsb_release -is) readonly wo_distro_version=$(lsb_release -sc) @@ -124,16 +124,20 @@ if [ ! -d "$wo_log_dir" ]; then wo_lib_echo "Creating WordOps log directory, just a second..." mkdir -p "$wo_log_dir" || wo_lib_error "Whoops - seems we are unable to create the log directory $wo_log_dir, exit status " $? - wo_lib_echo "Creating WordOps backup directory, just a second..." - mkdir -p "$wo_backup_dir" || wo_lib_error "Whoops - seems we are unable to create the backup directory $wo_backup_dir, exit status " $? - chmod -R 600 "$wo_backup_dir" - # create wordops log files touch /var/log/wo/{wordops.log,install.log} chmod -R 700 /var/log/wo || wo_lib_error "Whoops, there was an error setting the permissions on the WordOps log folder, exit status " $? fi +if [ ! -d "$wo_backup_dir" ]; then + + wo_lib_echo "Creating WordOps backup directory, just a second..." + mkdir -p "$wo_backup_dir" || wo_lib_error "Whoops - seems we are unable to create the backup directory $wo_backup_dir, exit status " $? + chmod -R 600 "$wo_backup_dir" + +fi + ### # 2 - Setup the dependencies for installation #### @@ -389,7 +393,6 @@ wo_install() { } - wo_upgrade_nginx() { { From 55157d010b133a0417e7681235f0d29d3319abd0 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:14:05 +0100 Subject: [PATCH 10/16] fix maintenance --- wo/cli/plugins/maintenance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index 67d7cad..e352340 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -32,7 +32,7 @@ class WOMaintenanceController(CementBaseController): Log.info(self, "updating apt-cache, please wait...") WOShellExec.cmd_exec(self, "apt-get update - qq") Log.info(self, "updating packages, please wait...") - WOShellExec.cmd_exec(self, "DEBIAN_FRONTEND=noninteractive" + WOShellExec.cmd_exec(self, "DEBIAN_FRONTEND=noninteractive " "apt-get -o " "Dpkg::Options::='--force-confmiss' " "-o Dpkg::Options::='--force-confold' " From 58f9acc79079b66e20393488893e903fd904364a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:17:51 +0100 Subject: [PATCH 11/16] add wordops version into upstream.conf --- install | 115 +++++++++++++++-------------- wo/cli/templates/upstream.mustache | 3 +- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/install b/install index acf5c3d..63bcaf2 100644 --- a/install +++ b/install @@ -425,70 +425,73 @@ wo_upgrade_nginx() { rm -f /tmp/nginx-wo.key sudo apt-get update - # stop nginx - service nginx stop + CHECK_NGINX_UPSTREAM_VERSION=$(grep "v3.9.5" /etc/nginx/conf.d/upstream.conf) + if [ -z "$CHECK_NGINX_UPSTREAM_VERSION" ]; then - # prevent apt preference to block install - [ -f /etc/apt/preferences.d/nginx-block ] && { - mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block" - } + # stop nginx + service nginx stop - # install new nginx package - if [ -x /usr/local/bin/wo ]; then + # prevent apt preference to block install + [ -f /etc/apt/preferences.d/nginx-block ] && { + mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block" + } - if [ -n "$CHECK_NGINX_EE" ]; then - # remove previous package - apt-mark unhold nginx-ee nginx-common nginx-custom - apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge - rm -rf /etc/nginx - elif [ -n "$CHECK_NGINX_WO" ]; then - apt-mark unhold nginx-wo nginx-common nginx-custom - apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge - rm -rf /etc/nginx + # install new nginx package + if [ -x /usr/local/bin/wo ]; then + + if [ -n "$CHECK_NGINX_EE" ]; then + # remove previous package + apt-mark unhold nginx-ee nginx-common nginx-custom + apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom --purge + rm -rf /etc/nginx + elif [ -n "$CHECK_NGINX_WO" ]; then + apt-mark unhold nginx-wo nginx-common nginx-custom + apt-get -y -qq autoremove nginx-wo nginx-common nginx-custom --purge + rm -rf /etc/nginx + fi + + # remove previous php-fpm pool configuration + if [ -n "$CHECK_PHP72" ]; then + apt-get remove php7.2-fpm -y -qq --purge + rm -f /etc/php/7.2/fpm/pool.d/* + fi + /usr/local/bin/wo stack install --nginx --php + if [ -n "$CHECK_PHP73" ]; then + apt-get remove php7.3-fpm -y -qq --purge + rm -f /etc/php/7.3/fpm/pool.d/* + /usr/local/bin/wo stack install --php73 + fi fi - # remove previous php-fpm pool configuration - if [ -n "$CHECK_PHP72" ]; then - apt-get remove php7.2-fpm -y -qq --purge - rm -f /etc/php/7.2/fpm/pool.d/* + # restore sites and configuration + /usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/ + + # update redis.conf headers + if [ -f /etc/nginx/common/redis.conf ]; then + sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf + sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf + fi - /usr/local/bin/wo stack install --nginx --php - if [ -n "$CHECK_PHP73" ]; then - apt-get remove php7.3-fpm -y -qq --purge - rm -f /etc/php/7.3/fpm/pool.d/* - /usr/local/bin/wo stack install --php73 + + VERIFY_NGINX_CONFIG=$(nginx -t 2>&1 | grep failed) + # check if nginx -t do not return errors + if [ -z "$VERIFY_NGINX_CONFIG" ]; then + systemctl stop nginx + systemctl start nginx + else + VERIFY_NGINX_BUCKET=$(nginx -t 2>&1 | grep "server_names_hash_bucket_size") + if [ -n "$VERIFY_NGINX_BUCKET" ]; then + sed -i "s/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 64;/g" /etc/nginx/nginx.conf + fi + systemctl stop nginx + systemctl start nginx fi + + # set back apt preference + [ -f "$HOME/nginx-block" ] && { + mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block + } fi - - # restore sites and configuration - /usr/bin/rsync -auz /var/lib/wo-backup/nginx/ /etc/nginx/ - - # update redis.conf headers - if [ -f /etc/nginx/common/redis.conf ]; then - sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf - sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf - - fi - - VERIFY_NGINX_CONFIG=$(nginx -t 2>&1 | grep failed) - # check if nginx -t do not return errors - if [ -z "$VERIFY_NGINX_CONFIG" ]; then - systemctl stop nginx - systemctl start nginx - else - VERIFY_NGINX_BUCKET=$(nginx -t 2>&1 | grep "server_names_hash_bucket_size") - if [ -n "$VERIFY_NGINX_BUCKET" ]; then - sed -i "s/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 64;/g" /etc/nginx/nginx.conf - fi - systemctl stop nginx - systemctl start nginx - fi - - # set back apt preference - [ -f "$HOME/nginx-block" ] && { - mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block - } - } >> "$wo_install_log" 2>&1 } diff --git a/wo/cli/templates/upstream.mustache b/wo/cli/templates/upstream.mustache index 8782258..fe3aa45 100644 --- a/wo/cli/templates/upstream.mustache +++ b/wo/cli/templates/upstream.mustache @@ -1,4 +1,5 @@ -# Common upstream settings +# NGINX UPSTREAM CONFIGURATION v3.9.5 +# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE #------------------------------- # PHP 5.6 #------------------------------- From d8db7f6b4c993797d4a724d0adad68596c85e6f0 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:21:13 +0100 Subject: [PATCH 12/16] another fix for maintenance --- wo/cli/plugins/maintenance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wo/cli/plugins/maintenance.py b/wo/cli/plugins/maintenance.py index e352340..666668d 100644 --- a/wo/cli/plugins/maintenance.py +++ b/wo/cli/plugins/maintenance.py @@ -30,7 +30,7 @@ class WOMaintenanceController(CementBaseController): try: Log.info(self, "updating apt-cache, please wait...") - WOShellExec.cmd_exec(self, "apt-get update - qq") + WOShellExec.cmd_exec(self, "apt-get update") Log.info(self, "updating packages, please wait...") WOShellExec.cmd_exec(self, "DEBIAN_FRONTEND=noninteractive " "apt-get -o " @@ -39,7 +39,7 @@ class WOMaintenanceController(CementBaseController): "-y dist-upgrade") Log.info(self, "cleaning-up packages, please wait...") WOShellExec.cmd_exec(self, "apt-get -y --purge autoremove") - WOShellExec.cmd_exec(self, "apt-get - y autoclean") + WOShellExec.cmd_exec(self, "apt-get -y autoclean") except OSError as e: Log.debug(self, str(e)) Log.error(self, "Package updates failed !") From 615d365cb05b4a428a419a16ca96c6ce89c1e7b1 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 10:31:53 +0100 Subject: [PATCH 13/16] [skip travis] update changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99bd06a..6a4eca0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,9 +20,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - stub_status vhost for metrics - opcache optimization for php-fpm - EasyEngine configuration backup before migration -- EasyEngine configuration cleanup +- EasyEngine configuration cleanup after migration - WordOps configuration backup before upgrade - Previous acme.sh certs migration +- "wo maintenance" command to perform server package update & cleanup #### Changed @@ -41,6 +42,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Nginx upgrade from previous WordOps release - Force new Nginx templates during update - Error message about missing my.cnf file during upgrade +- PHP 7.2 & PHP 7.3 pool configuration during upgrade +- WordOps backup directory creation before upgrade +- EasyEngine database sync during migration ### v3.9.4 - 2019-03-15 From 419c6caa0353048ecafd7743830dec5a776490b7 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 11:47:56 +0100 Subject: [PATCH 14/16] remove previous outdated config --- wo/cli/plugins/stack_services.py | 12 ++++-------- wo/cli/plugins/stack_upgrade.py | 10 ++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/wo/cli/plugins/stack_services.py b/wo/cli/plugins/stack_services.py index b161974..358eb85 100644 --- a/wo/cli/plugins/stack_services.py +++ b/wo/cli/plugins/stack_services.py @@ -31,8 +31,7 @@ class WOStackStatusController(CementBaseController): self.app.pargs.mysql = True if self.app.pargs.nginx: - if (WOAptGet.is_installed(self, 'nginx-custom') or - WOAptGet.is_installed(self, 'nginx-mainline')): + if (WOAptGet.is_installed(self, 'nginx-custom')): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") @@ -96,8 +95,7 @@ class WOStackStatusController(CementBaseController): self.app.pargs.mysql = True if self.app.pargs.nginx: - if (WOAptGet.is_installed(self, 'nginx-custom') or - WOAptGet.is_installed(self, 'nginx-mainline')): + if (WOAptGet.is_installed(self, 'nginx-custom')): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") @@ -162,8 +160,7 @@ class WOStackStatusController(CementBaseController): self.app.pargs.mysql = True if self.app.pargs.nginx: - if (WOAptGet.is_installed(self, 'nginx-custom') or - WOAptGet.is_installed(self, 'nginx-mainline')): + if (WOAptGet.is_installed(self, 'nginx-custom')): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") @@ -228,8 +225,7 @@ class WOStackStatusController(CementBaseController): self.app.pargs.mysql = True if self.app.pargs.nginx: - if (WOAptGet.is_installed(self, 'nginx-custom') or - WOAptGet.is_installed(self, 'nginx-mainline')): + if (WOAptGet.is_installed(self, 'nginx-custom')): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index b9aa927..6ac25aa 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -71,14 +71,8 @@ class WOStackUpgradeController(CementBaseController): Log.info(self, "Updating apt-cache, please wait...") WOAptGet.update(self) Log.info(self, "Installing packages, please wait ...") - if (WOVariables.wo_platform_distro == 'ubuntu'): - WOAptGet.install(self, WOVariables.wo_php + + WOAptGet.install(self, WOVariables.wo_php + WOVariables.wo_php_extra) - else: - WOAptGet.install(self, WOVariables.wo_php) - - if WOVariables.wo_platform_distro == "debian": - WOShellExec.cmd_exec(self, "pecl install xdebug") @expose(hide=True) def default(self): @@ -89,7 +83,7 @@ class WOStackUpgradeController(CementBaseController): if ((not self.app.pargs.web) and (not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.mysql) and (not self.app.pargs.all) and (not self.app.pargs.wpcli) and - (not self.app.pargs.redis) and (not self.app.pargs.nginxmainline)): + (not self.app.pargs.redis)): self.app.pargs.web = True if self.app.pargs.all: From 79994a1262b4cced1dd8387162c8a758bd38524a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 25 Mar 2019 12:22:25 +0100 Subject: [PATCH 15/16] increase password size --- CHANGELOG.md | 2 + wo/cli/plugins/secure.py | 2 +- wo/cli/plugins/site_functions.py | 65 ++++++++++++++++---------------- wo/cli/plugins/stack.py | 2 +- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4eca0..f9145ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - "--letsencrypt=subdomain" option - hardened nginx ssl_ecdh_curve - Update phpredisadmin +- Increase MySQL root password size to 16 characters +- Increase MySQL users password size to 16 characters #### Fixed diff --git a/wo/cli/plugins/secure.py b/wo/cli/plugins/secure.py index ae2b9eb..cb6305a 100644 --- a/wo/cli/plugins/secure.py +++ b/wo/cli/plugins/secure.py @@ -50,7 +50,7 @@ class WOSecureController(CementBaseController): """This function secures authentication""" passwd = ''.join([random.choice (string.ascii_letters + string.digits) - for n in range(6)]) + for n in range(16)]) if not self.app.pargs.user_input: username = input("Provide HTTP authentication user " "name [{0}] :".format(WOVariables.wo_user)) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index e84226c..28a3faa 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -306,9 +306,9 @@ def setupwordpress(self, data): "\n\ndefine(\'WP_DEBUG\', false);")) try: if WOShellExec.cmd_exec(self, "bash -c \"php {0} --allow-root" - .format(WOVariables.wo_wpcli_path) - + " core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' " + .format(WOVariables.wo_wpcli_path) + + " core config " + + "--dbname=\'{0}\' --dbprefix=\'{1}\' " "--dbuser=\'{2}\' --dbhost=\'{3}\' " .format(data['wo_db_name'], wo_wp_prefix, data['wo_db_user'], data['wo_db_host'] @@ -330,11 +330,11 @@ def setupwordpress(self, data): else: Log.debug(self, "Generating wp-config for WordPress multisite") Log.debug(self, "bash -c \"php {0} --allow-root " - .format(WOVariables.wo_wpcli_path) - + "core config " - + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' " - .format(data['wo_db_name'], wo_wp_prefix, data['wo_db_host']) - + "--dbuser=\'{0}\' --dbpass=\'{1}\' " + .format(WOVariables.wo_wpcli_path) + + "core config " + + "--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' " + .format(data['wo_db_name'], wo_wp_prefix, data['wo_db_host']) + + "--dbuser=\'{0}\' --dbpass=\'{1}\' " "--extra-php< Date: Mon, 25 Mar 2019 12:25:35 +0100 Subject: [PATCH 16/16] upgrade nginx only if installed --- install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install b/install index 63bcaf2..cb6315b 100644 --- a/install +++ b/install @@ -619,8 +619,10 @@ if [ -x /usr/local/bin/wo ]; then secure_wo_db | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_install >> wo_install_log 2>&1 + if [ -x "$(command -v nginx)" ]; then wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log + fi wo_update_latest | tee -ai $wo_install_log wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log wo_install_acme_sh | tee -ai $wo_install_log @@ -647,8 +649,10 @@ else secure_wo_db | tee -ai $wo_install_log wo_lib_echo "Installing WordOps " | tee -ai $wo_install_log wo_install >> wo_install_log 2>&1 + if [ -x "$(command -v nginx)" ]; then wo_lib_echo "Upgrading Nginx" | tee -ai $wo_install_log wo_upgrade_nginx | tee -ai $wo_install_log + fi wo_update_latest | tee -ai $wo_install_log wo_lib_echo "Installing acme.sh" | tee -ai $wo_install_log wo_install_acme_sh | tee -ai $wo_install_log