diff --git a/.gitignore b/.gitignore
index 41b775b..601587c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,3 +64,5 @@ coverage_report/
include/
local/
man/
+
+\.pytest_cache/
diff --git a/.travis.yml b/.travis.yml
index 5581386..ef0b600 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -27,39 +27,28 @@ script:
- sudo wo stack install --web || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo stack install --admin || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create html.net --html || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create php.com --php || sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create html.net --html && sudo wo site create php.com --php && sudo wo site create mysql.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create mysql.com --mysql || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo site create mysql-php73.com --mysql --php73 || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo site create wp1.com --wp || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo site create wp-php73.com --wp --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsc1.net --wpsc || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpfc1.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log
-
- - sudo wo site create wpsc-php73.net --wpsc --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpfc-php73.net --wpfc --php73 || sudo tail -n50 /var/log/wo/wordops.log
-
- - sudo wo site create wpredis.net --wpredis || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpredis-php73.net --wpredis --php73 || sudo tail -n50 /var/log/wo/wordops.log
-
- - sudo wo site create wpsubdir1.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdir-php73.com --wpsubdir --php73 || sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create wpsc1.net --wpsc && sudo wo site create wpfc1.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create wpsc-php73.net --wpsc --php73 && sudo wo site create wpfc-php73.net --wpfc --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73|| sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create wpredis.net --wpredis && sudo wo site create wpredis-php73.net --wpredis --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdomain1.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdomain1-php73.com --wpsubdomain --php73 || sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create wpsubdir1.com --wpsubdir && sudo wo site create wpsubdir-php73.com --wpsubdir --php73 || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log
- - sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
+ - sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc && sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log
+
+ - sudo wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 && sudo wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73 || sudo tail -n50 /var/log/wo/wordops.log
+
+ - sudo wo site create wpsubdomain1.com --wpsubdomain && sudo wo site create wpsubdomain1-php73.com --wpsubdomain --php73 || sudo tail -n50 /var/log/wo/wordops.log
+
+ - sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc && sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc && sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo site create 1.com --html || sudo tail -n50 /var/log/wo/wordops.log
- sudo wo site create 2.com --php || sudo tail -n50 /var/log/wo/wordops.log
@@ -71,4 +60,6 @@ script:
- sudo ls /var/www/
- sudo wp --allow-root --info
- - sudo bash -c 'cat /var/log/wo/wordops.log | ccze -A'
+ - sudo bash -c 'nginx -T 2>&1 > /var/log/wo/nginx.log'
+ - sudo bash -c 'tar -I pigz -cf wordops.tar.gz /var/log/wo'
+ - sudo curl --progress-bar --upload-file "wordops.tar.gz" https://transfer.vtbox.net/$(basename wordops.tar.gz) && echo ""
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6675bc4..2c7557c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,15 +4,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+## Releases
+
+---
+
### v3.9.5 - [Unreleased]
+### v3.9.4 - 2019-03-15
+
+#### Added
+
+- Nginx module nginx_vts
+- Migration script from nginx-ee to nginx-wo
+- Partial support for Debian 9 (testing)
+- New Nginx build v1.14.2
+
#### Changed
--
+- Update WP-CLI version to 2.1.0
+- Update Adminer to 4.6.2
+- Update predis to v1.1.1
+- Refactored nginx.conf
+- Removed HHVM Stack
+- Removed old linux distro checks
+- Replace wo-acme-sh by acme.sh
#### Fixed
-- Fix Nginx ssl_ciphers
+- Outdated Nginx ssl_ciphers suite
+- Debian 9 nginx build
### v3.9.3 - 2019-03-07
@@ -42,7 +62,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix php services management ([#12](https://github.com/WordOps/WordOps/issues/12))
- Fix WP-CLI install
-
### v3.9.2 - 2018-11-30
#### Changed
diff --git a/README.md b/README.md
index 0fb66b1..d57f89a 100644
--- a/README.md
+++ b/README.md
@@ -10,11 +10,8 @@
-
Key Features •
Getting Started •
@@ -32,15 +29,19 @@
- Easy Migration from EasyEngine v3 (migration script development in progress)
- Automated WordPress, Nginx, PHP, MySQL & Redis installation
- Up-to-date server stack with Nginx 1.14.2, PHP 7.2 & 7.3, MariaDB 10.3 & Redis 5.0
+- Hardened WordPress security with strict Nginx location directives
- Optimized Nginx configurations with multiple cache backends support
- Let's Encrypt SSL certificates
+- Secured SSL/TLS encryption with strong ciphers_suite and modern TLS protocols
## Requirements
### Operating System
-- Ubuntu : 16.04 LTS (Xenial) - 18.04 LTS (Bionic)
-- Debian : 8 (Jessie) - 9 (Stretch) -> **Not fully supported yet**
+- Ubuntu 16.04 LTS (Xenial)
+- Ubuntu 18.04 LTS (Bionic)
+- Debian 8 (Jessie)
+- Debian 9 (Stretch) -> **Not fully supported yet**
### Ports requirements
@@ -60,11 +61,18 @@ sudo wo site create example.com --wp # Install required packages & setup Wor
WordOps made some fundamental changes:
-- We've deprecated the mail stack. Less is more. As an alternative, take a look at [iRedMail](https://www.iredmail.org/) or [Caesonia](https://github.com/vedetta-com/caesonia). And an alternative for Roundcube is [Rainloop](https://www.rainloop.net/).
+- We've deprecated the mail stack. As an alternative, you can take a look at [Mail-in-a-Box](https://github.com/mail-in-a-box/mailinabox), [iRedMail](https://www.iredmail.org/) or [Caesonia](https://github.com/vedetta-com/caesonia). As Roundcube alternative, there is [Rainloop](https://www.rainloop.net/) or [Afterlogic WebMail](https://github.com/afterlogic/webmail-lite-8)
- Support for w3tc is dropped as a security precaution.
-- PHP 5.6 has been replaced by PHP 7.2 and PHP 7.0 will be replaced by PHP 7.3.
+- PHP 5.6 has been replaced by PHP 7.2 and PHP 7.0 has been replaced by PHP 7.3.
+- Nginx-ee package has been replaced by Nginx-wo (based on Nginx stable v1.14.2)
-We will not overwrite previous php versions Nginx upstreams to avoid issues during the migration from EEv3. A step by step guide will be published soon to explain how to fully migrate from EasyEngine v3 to WordOps
+We are still working on the script to migrate from EasyEngine v3 to WordOps. Here some informations about the WordOps install script :
+
+- Previous php upstreams in Nginx will not be overwritted
+- php5.6 and php7.0 will not be removed or uninstalled
+- previous Nginx common configurations will not be overwritted
+
+A tutorial will be available soon to explain how to fully migrate from EasyEngine v3 to WordOps.
## Usage
@@ -78,7 +86,7 @@ wo site create example.com --wpfc # install wordpress + nginx fas
wo site create example.com --wpredis # install wordpress + nginx redis_cache
```
-### WordPress multsite with subdirectory
+### WordPress multisite with subdirectory
```bash
wo site create example.com --wpsubdir # install wpmu-subdirectory without any page caching
@@ -87,7 +95,7 @@ wo site create example.com --wpsubdir --wpfc # install wpmu-subdirectory + n
wo site create example.com --wpsubdir --wpredis # install wpmu-subdirectory + nginx redis_cache
```
-### WordPress multsite with subdomain
+### WordPress multisite with subdomain
```bash
wo site create example.com --wpsubdomain # install wpmu-subdomain without any page caching
@@ -102,25 +110,18 @@ wo site create example.com --wpsubdomain --wpredis # install wpmu-subdomain + n
wo site create example.com --html # create example.com for static/html sites
wo site create example.com --php # create example.com with php support
wo site create example.com --mysql # create example.com with php & mysql support
-```
-
-### HHVM enabled sites
-
-```bash
-wo site create example.com --wp --hhvm # create example.com WordPress site with HHVM support
-wo site create example.com --php --hhvm # create example.com php site with HHVM support
+wo site create example.com --proxy=127.0.0.1:3000 # create example.com with nginx as reverse-proxy
```
## Cheatsheet
-| | single site | multisite w/ subdir | multisite w/ subdom |
+| | single site | multisite w/ subdir | multisite w/ subdom |
|--------------------|---------------|-----------------------|--------------------------|
-| **NO Cache** | --wp | --wpsubdir | --wpsubdomain |
-| **WP Super Cache** | --wpsc | --wpsubdir --wpsc | --wpsubdomain --wpsc |
+| **NO Cache** | --wp | --wpsubdir | --wpsubdomain |
+| **WP Super Cache** | --wpsc | -wpsubdir --wpsc | --wpsubdomain --wpsc |
| **Nginx fastcgi_cache** | --wpfc | --wpsubdir --wpfc | --wpsubdomain --wpfc |
| **Redis cache** | --wpredis | --wpsubdir --wpredis | --wpsubdomain --wpredis |
-
## Update WordOps
```bash
diff --git a/install b/install
index cdb288d..cae8e14 100644
--- a/install
+++ b/install
@@ -7,10 +7,10 @@
# Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T
# -------------------------------------------------------------------------
-# Version 3.9.3 - 2019-03-05
+# Version 3.9.4 - 2019-03-15
# -------------------------------------------------------------------------
readonly wo_version_old="2.2.3"
-readonly wo_version_new="3.9.3.1"
+readonly wo_version_new="3.9.4"
# CONTENTS
# ---
# 1. VARIABLES AND DECLARATIONS
@@ -85,11 +85,17 @@ fi
# 1 - Define variables for later use
###
wo_branch="$1"
-migration=0
readonly wo_log_dir=/var/log/wo/
readonly wo_install_log=/var/log/wo/install.log
-readonly wo_linux_distro=$(lsb_release -i | awk '{print $3}')
+readonly wo_linux_distro=$(lsb_release -is)
readonly wo_distro_version=$(lsb_release -sc)
+readonly wo_distro_id=$(lsb_release -rs)
+
+if [ -x /usr/loca/bin/ee ]; then
+ migration=1
+else
+ migration=0
+fi
###
# 1 - Checking linux distro
@@ -125,16 +131,16 @@ fi
####
wo_install_dep()
{
-
+
{
if [ "$wo_linux_distro" == "Ubuntu" ]; then
- apt-get -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
+ apt-get -y -qq install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 fail2ban > /dev/null 2>&1
else
- apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 > /dev/null 2>&1
+ apt-get -y -qq install build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz gnupg2 fail2ban > /dev/null 2>&1
fi
-
- locale-gen en
- } >> /var/log/wo/install.log 2>&1
+
+ locale-gen en
+ } >> /var/log/wo/install.log 2>&1
# Support PFS
if [ -f /etc/nginx/nginx.conf ]; then
# Replace previous ciphers
@@ -205,7 +211,8 @@ wo_sync_db()
fi
# Check site is enable/live or disable
- for site in $(ls /etc/nginx/sites-available/ | grep -v default);
+ cd /etc/nginx/sites-available || exit 1
+ for site in $(echo \* | grep -v default);
do
if [ -f "/etc/nginx/sites-enabled/$site" ]; then
wo_site_status='1'
@@ -214,7 +221,7 @@ wo_sync_db()
fi
# Acquire information about the current nginx configuration
- wo_site_current_type=$(head -n1 /etc/nginx/sites-available/$site | grep "NGINX CONFIGURATION" | rev | cut -d' ' -f3,4,5,6,7 | rev | cut -d ' ' -f2,3,4,5)
+ wo_site_current_type=$(head -n1 "/etc/nginx/sites-available/$site" | grep "NGINX CONFIGURATION" | rev | cut -d' ' -f3,4,5,6,7 | rev | cut -d ' ' -f2,3,4,5)
# Sniff out the vhost type and cache configuration
if [ "$wo_site_current_type" = "HTML" ]; then
@@ -282,29 +289,6 @@ wo_sync_db()
echo "UPDATE sites SET php_version = REPLACE(php_version, '5.6', '7.2');" | sqlite3 /var/lib/wo/dbase.db
echo "UPDATE sites SET php_version = REPLACE(php_version, '7.0', '7.3');" | sqlite3 /var/lib/wo/dbase.db
- ###
- # ee-acme-sh by VirtuBox, https://virtubox.net/
- ###
- if [ ! -f ~/.acme.sh/acme.sh ]; then
- wget -O - https://get.acme.sh | sh
- BASHRC_EE_ACME_FIRST_RELEASE=$(grep "ee-acme" $HOME/.bashrc)
- BASHRC_EE_ACME_LAST_RELEASE=$(grep "ee-acme.sh" $HOME/.bashrc)
-
- if [ -f $HOME/.ee-acme/ee-acme ] && [ -z "$BASHRC_EE_ACME_LAST_RELEASE" ]; then
- rm -rf $HOME/.ee-acme/*
- echo 'alias ee-acme="/root/.ee-acme/ee-acme.sh"' >> $HOME/.ee-acme/ee-acme
- wget -qO $HOME/.ee-acme/ee-acme.sh https://raw.githubusercontent.com/WordOps/wo-acme-sh/master/script/ee-acme.sh
- chmod +x $HOME/.ee-acme/ee-acme.sh
- elif [ -x $HOME/.ee-acme/ee-acme.sh ]; then
- rm $HOME/.ee-acme/ee-acme.sh
- wget -qO $HOME/.ee-acme/ee-acme.sh https://raw.githubusercontent.com/WordOps/wo-acme-sh/master/script/ee-acme.sh
- chmod +x $HOME/.ee-acme/ee-acme.sh
- elif [ ! -d $HOME/.ee-acme ]; then
- mkdir -p $HOME/.ee-acme
- wget -qO /usr/local/bin/wo-acme https://raw.githubusercontent.com/WordOps/wo-acme-sh/master/script/ee-acme.sh
- chmod +x /usr/local/bin/wo-acme
- fi
- fi
}
# Once again, set the proper ACL on the WordOps configuration directory
@@ -321,23 +305,59 @@ secure_wo_db()
# Update the WP-CLI version
wo_update_wp_cli()
{
-
- WP_CLI_PATH=$(command -v wp)
- if [ "$WP_CLI_PATH" != "/usr/local/bin/wp" ]; then
- rm -rf "$WP_CLI_PATH"
- # Update WP-CLI to the most recent version
- wget -qO /usr/local/bin/wp https://raw.githubusercontent.com/WordOps/wpcli-builds/gh-pages/phar/wp-cli.phar
- chmod +x /usr/local/bin/wp
- else
- wget -qO /usr/local/bin/wp https://raw.githubusercontent.com/WordOps/wpcli-builds/gh-pages/phar/wp-cli.phar
- chmod +x /usr/local/bin/wp
+ {
+ WP_CLI_PATH=$(command -v wp)
+ if [ -n "$WP_CLI_PATH" ]; then
+ rm -rf "$WP_CLI_PATH"
+ # Update WP-CLI to the most recent version
+ wget -qO /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
+ chmod +x /usr/local/bin/wp
+ else
+ wget -qO /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
+ chmod +x /usr/local/bin/wp
+ fi
+ [ ! -h /usr/bin/wp ] && {
+ ln -s /usr/local/bin/wp /usr/bin/
+ }
+ [ ! -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_acme_sh() {
+ # check if acme.sh is already installed
+ if [ ! -d /opt/acme.sh ]; then
+ {
+ # clone the git repository
+ git clone https://github.com/Neilpang/acme.sh.git /opt/acme.sh -q
+ cd /opt/acme.sh || exit 1
+ # create conf directories
+ [ ! -d /etc/letsencrypt/config ] && {
+ mkdir -p /etc/letsencrypt/config
+ }
+ [ ! -d /etc/letsencrypt/live ] && {
+ mkdir -p /etc/letsencrypt/live
+ }
+ [ ! -d /etc/letsencrypt/renewal ] && {
+ mkdir -p /etc/letsencrypt/renewal
+ }
+ # install acme.sh
+ ./acme.sh --install \
+ --home /etc/letsencrypt \
+ --config-home /etc/letsencrypt/config \
+ --cert-home /etc/letsencrypt/renewal
+ # enable auto-upgrade
+ /etc/letsencrypt/acme.sh --upgrade --auto-upgrade
+
+ # Let's Encrypt .well-known folder setup
+ 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
+ fi
+
+ } >> /var/log/wo/install.log
fi
- [ ! -x /usr/bin/wp ] && {
- ln -s /usr/local/bin/wp /usr/bin/
- }
- [ -d /etc/bash_completion.d ] && {
- wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash
- }
}
# Now, finally, let's install WordOps
@@ -355,9 +375,64 @@ wo_install()
cd /tmp/wordops || exit 1
} >> /var/log/wo/install.log 2>&1;
- python3 setup.py install
-
+ python3 setup.py install
+
+
+}
+wo_upgrade_nginx()
+{
+ # chec if the package nginx-ee is installed
+ CHECK_NGINX_EE=$(dpkg --list | grep nginx-ee)
+ if [ -n "$CHECK_NGINX_EE" ]; then
+ {
+ # add new Nginx repository
+ if [ "$wo_linux_distro" = "Ubuntu" ]; then
+ echo "deb http://download.opensuse.org/repositories/home:/virtubox:/WordOps/xUbuntu_${wo_distro_id}/ /" >> /etc/apt/sources.list.d/wo-repo.list
+ wget -qO /tmp/nginx-wo.key "https://download.opensuse.org/repositories/home:virtubox:WordOps/xUbuntu_${wo_distro_id}/Release.key"
+ else
+ if [ "$wo_distro_version" == "jessie" ]; then
+ echo "deb http://download.opensuse.org/repositories/home:/virtubox:/WordOps/Debian_8.0/ /" > /etc/apt/sources.list.d/wo-repo.list
+ wget -qO /tmp/nginx-wo.key https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_8.0/Release.key
+ else
+ echo "deb http://download.opensuse.org/repositories/home:/virtubox:/WordOps/Debian_9.0/ /" > /etc/apt/sources.list.d/wo-repo.list
+ wget -qO /tmp/nginx-wo.key https://download.opensuse.org/repositories/home:virtubox:WordOps/Debian_9.0/Release.key
+ fi
+ fi
+ # prevent apt preference to block install
+ [ -f /etc/apt/preferences.d/nginx-block ] && {
+ mv /etc/apt/preferences.d/nginx-block "$HOME/nginx-block"
+ }
+ # import the respository key for updates
+ apt-key add - < /tmp/nginx-wo.key
+ rm -f /tmp/nginx-wo.key
+ sudo apt-get update
+ # stop nginx
+ service nginx stop
+ # remove previous package
+ apt-mark unhold nginx-ee nginx-common nginx-custom
+ apt-get -y -qq autoremove nginx-ee nginx-common nginx-custom
+ # install new nginx package
+ DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confnew" -y install nginx-custom nginx-wo
+ # set back apt preference
+ [ -f "$HOME/nginx-block" ] && {
+ mv "$HOME/nginx-block" /etc/apt/preferences.d/nginx-block
+ }
+ # update nginx headers and ssl_ciphers
+ if [ -f /etc/nginx/nginx.conf ]; then
+ sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"WordOps $wo_version_new\";/" /etc/nginx/nginx.conf &>> /dev/null
+ new_ciphers="EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES"
+ sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$new_ciphers\";/" /etc/nginx/nginx.conf
+ fi
+ # 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 &>> /dev/null
+ sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf &>> /dev/null
+ fi
+ systemctl enable nginx
+ systemctl restart nginx
+ } >> /var/log/wo/install.log 2>&1
+ fi
}
wo_update_latest()
@@ -408,83 +483,6 @@ wo_update_latest()
fi
fi
-
- if [ -f /etc/nginx/nginx.conf ]; then
- wo_lib_echo "Updating Nginx configuration, please wait..."
-
- elif [ "$wo_distro_version" == "trusty" ]; then
- grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /' /etc/apt/sources.list.d/ &>> /dev/null
- if [[ $? -ne 0 ]]; then
- if [ -f /etc/apt/sources.list.d/rtcamp-nginx-trusty.list ]; then
- rm -rf /etc/apt/sources.list.d/rtcamp-nginx-trusty.list
- fi
- echo -e "\ndeb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/xUbuntu_14.04/ /" >> /etc/apt/sources.list.d/wo-repo.list
- gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03'
- gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add -
- if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
- mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/wo-nginx.conf.old &>> /dev/null
- fi
- mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null
- apt-get update
- service nginx stop &>> /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom nginx-ee
- service nginx restart &>> /dev/null
- fi
- CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
- if [ -n "$CHECK_NGINX_COMMON" ]; then
- apt-get update
- CHECK_NGINX_MAILINE=$(dpkg --get-selections | grep -v deinstall | grep nginx-mainline)
- if [ -n "$CHECK_NGINX_MAILINE" ]; then
- apt-get remove -y nginx-mainline
- fi
- service nginx stop &>> /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom
- service nginx restart &>> /dev/null
- fi
-
- elif [ "$wo_linux_distro" == "Debian" ]; then
- grep -Hr 'http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /' /etc/apt/sources.list.d/ &>> /dev/null
- if [[ $? -ne 0 ]]; then
- echo -e "deb http://download.opensuse.org/repositories/home:/rtCamp:/EasyEngine/Debian_8.0/ /" >> /etc/apt/sources.list.d/wo-repo.list
- gpg --keyserver "hkp://pgp.mit.edu" --recv-keys '3050AC3CD2AE6F03'
- gpg -a --export --armor '3050AC3CD2AE6F03' | apt-key add -
- if [ -f /etc/nginx/conf.d/ee-nginx.conf ]; then
- mv /etc/nginx/conf.d/ee-nginx.conf /etc/nginx/conf.d/ee-nginx.conf.old &>> /dev/null
- fi
- mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old &>> /dev/null
- mv /etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.old &>> /dev/null
- apt-get update
- systemctl stop nginx &>> /dev/null
- apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y install nginx-custom
- systemctl restart nginx &>> /dev/null
- fi
- CHECK_NGINX_COMMON=$(dpkg --get-selections | grep -v deinstall | grep nginx-common)
- if [ -n "$CHECK_NGINX_COMMON" ]; then
- apt-get update
- CHECK_NGINX_MAILINE=$(dpkg --get-selections | grep -v deinstall | grep nginx-mainline)
- if [ -n "$CHECK_NGINX_MAILINE" ]; then
- apt-get remove -y nginx-mainline
- fi
- systemctl stop nginx &>> /dev/null
- DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confmiss" -o Dpkg::Options::="--force-confold" -y --allow-unauthenticated install nginx-ee nginx-custom
- systemctl restart nginx &>> /dev/null
- fi
- fi
-
- if [ -f /etc/nginx/nginx.conf ]; then
- sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"WordOps $wo_version_new\";/" /etc/nginx/nginx.conf &>> /dev/null
- fi
-
- if [ -f /etc/nginx/conf.d/wo-plus.conf ]; then
- sed -i "s/.*X-Powered-By.*/\tadd_header X-Powered-By \"WordOps $wo_version_new\";/" /etc/nginx/conf.d/wo-plus.conf &>> /dev/null
- fi
-
- # Fix HHVM autostart on reboot
- CHECK_HHVM_INSTALL=$(dpkg --get-selections | grep -v deinstall | grep hhvm &>> /dev/null)
- if [ -n "$CHECK_HHVM_INSTALL" ]; then
- update-rc.d hhvm defaults &>> /dev/null
- 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 &>> /dev/null
@@ -492,48 +490,6 @@ wo_update_latest()
cp /usr/lib/wo/templates/locations.mustache /etc/nginx/common/locations.conf &>> /dev/null
fi
- # Fix HHVM upstream issue that was preventing from using EasyEngine for site operations
- if [ -f /etc/nginx/conf.d/upstream.conf ]; then
- grep -Hr hhvm /etc/nginx/conf.d/upstream.conf &>> /dev/null
- if [ $? -ne 0 ]; then
- echo -e "upstream hhvm {\n# HHVM Pool\nserver 127.0.0.1:8000;\nserver 127.0.0.1:9000 backup;\n}\n" >> /etc/nginx/conf.d/upstream.conf
- fi
- fi
-
- # Fix HHVM server IP
- if [ -f /etc/hhvm/server.ini ]; then
- grep -Hr "hhvm.server.ip" /etc/hhvm/server.ini &>> /dev/null
- if [ $? -ne 0 ]; then
- echo -e "hhvm.server.ip = 127.0.0.1\n" >> /etc/hhvm/server.ini
- fi
- fi
-
- # Rename Redis Header
- if [ -f /etc/nginx/common/redis-hhvm.conf ]; then
- sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- fi
-
- if [ -f /etc/nginx/common/redis.conf ]; then
- sed -i "s/X-Cache /X-SRCache-Fetch-Status /g" /etc/nginx/common/redis.conf &>> /dev/null
- sed -i "s/X-Cache-2 /X-SRCache-Store-Status /g" /etc/nginx/common/redis.conf &>> /dev/null
- fi
-
-
- if [ -f /etc/nginx/common/redis-hhvm.conf ]; then
- # Update Timeout redis-hhvm.conf
- grep -0 'redis2_query expire $key 6h' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- if [ $? -eq 0 ]; then
- sed -i 's/redis2_query expire $key 6h/redis2_query expire $key 14400/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- fi
-
- #Fix for 3.3.4 redis-hhvm issue
- grep -0 'HTTP_ACCEPT_ENCODING' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- if [ $? -ne 0 ]; then
- sed -i 's/fastcgi_params;/fastcgi_params;\n fastcgi_param HTTP_ACCEPT_ENCODING "";/g' /etc/nginx/common/redis-hhvm.conf &>> /dev/null
- fi
- fi
-
# Fix Redis-server security issue
# http://redis.io/topics/security
if [ -f /etc/redis/redis.conf ]; then
@@ -547,7 +503,7 @@ wo_update_latest()
# Let's Encrypt .well-known folder setup
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/.well-known
+ chown -R www-data:www-data /var/www/html /var/www/html/.well-known
fi
@@ -573,22 +529,6 @@ wo_update_latest()
fi
fi
- # Support PFS
- if [ -f /etc/nginx/nginx.conf ]; then
- # Replace the default ciphers
- sed -i 's/HIGH:!aNULL:!MD5:!kEDH;/ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;/' /etc/nginx/nginx.conf
- # Replace the EasyEngine ciphers
- sed -i 's/ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;/ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;/' /etc/nginx/nginx.conf
- # Change the TLS protocols
- if [ "$wo_distro_version" == "bionic" ]; then
- # Bionic supports TLSv1.3, so let's enable that
- sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2 TLSv1.3;/g' /etc/nginx/nginx.conf
- else
- # If != Bionic then enable only TLSv1.2
- sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
- fi
- fi
-
# Fix for SSL cert --all
crontab -l | grep -q '\-\-min_expiry_limit'
if [[ $? -eq 0 ]]; then
@@ -608,16 +548,16 @@ wo_git_init()
git init
fi
git add -A .
- git commit -am "Updated Nginx"
+ git commit -am "Updated Nginx"
} >> /var/log/wo/install.log 2>&1
# WordOps under git version control
[ -d /etc/wo ] && {
- cd /etc/wo || exit 1
- [ ! -d /etc/wo/.git ] && {
- git init
- }
- git add -A .
- git commit -am "Installed/Updated to WordOps"
+ cd /etc/wo || exit 1
+ [ ! -d /etc/wo/.git ] && {
+ git init
+ }
+ git add -A .
+ git commit -am "Installed/Updated to WordOps"
} >> /var/log/wo/install.log 2>&1
# PHP under git version control
[ -d /etc/php ] && {
@@ -641,14 +581,13 @@ if [ -x /usr/local/bin/wo ]; then
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
wo_install_dep | tee -ai $wo_install_log
- wo_sync_db >> $EE_INSTALL_LOG 2>&1
- secure_wo_db | tee -ai $EE_INSTALL_LOG
- wo_upgrade_php | tee -ai $wo_install_log
+ wo_sync_db >> $wo_install_log 2>&1
+ secure_wo_db | tee -ai $wo_install_log
wo_install | tee -ai $wo_install_log
+ wo_upgrade_nginx | tee -ai $wo_install_log
wo_update_latest | tee -ai $wo_install_log
+ wo_install_acme_sh | tee -ai $wo_install_log
wo_git_init | tee -ai $wo_install_log
- service nginx reload &>> /dev/null
- service php7.2-fpm restart &>> /dev/null
wo_update_wp_cli | tee -ai $wo_install_log
else
wo_lib_error "Not updating WordOps to $wo_version_new, exit status = " 1
@@ -664,14 +603,14 @@ else
read -p "Update WordOps to $wo_version_new (y/n): " wo_ans
if [ "$wo_ans" = "y" ] || [ "$wo_ans" = "Y" ]; then
wo_install_dep | tee -ai $wo_install_log
- wo_sync_db >> $EE_INSTALL_LOG 2>&1
- secure_wo_db | tee -ai $EE_INSTALL_LOG
- wo_upgrade_php | tee -ai $wo_install_log
+ wo_sync_db >> $wo_install_log 2>&1
+ secure_wo_db | tee -ai $wo_install_log
wo_install | tee -ai $wo_install_log
+ wo_upgrade_nginx | tee -ai $wo_install_log
wo_update_latest | tee -ai $wo_install_log
+ wo_install_acme_sh | tee -ai $wo_install_log
wo_git_init | tee -ai $wo_install_log
service nginx reload &>> /dev/null
- service php7.2-fpm restart &>> /dev/null
wo_update_wp_cli | tee -ai $wo_install_log
else
wo_lib_error "Not updating WordOps to $wo_version_new, exit status = " 1
@@ -688,11 +627,12 @@ else
wo_lib_echo "Running post-install steps " | tee -ai $wo_install_log
secure_wo_db | tee -ai $wo_install_log
wo_git_init | tee -ai $wo_install_log
+ wo_install_acme_sh | tee -ai $wo_install_log
wo_update_wp_cli | tee -ai $wo_install_log
fi
fi
-wo sync | tee -ai $WO_INSTALL_LOG
+wo sync | tee -ai $wo_install_log
if [ "$migration" -eq "1" ]; then
echo
diff --git a/wo/cli/main.py b/wo/cli/main.py
index ccfcefe..e8d9812 100644
--- a/wo/cli/main.py
+++ b/wo/cli/main.py
@@ -1,6 +1,12 @@
"""WordOps main application entry point."""
import sys
import os
+from cement.core import foundation
+from cement.utils.misc import init_defaults
+from cement.core.exc import FrameworkError, CaughtSignal
+from cement.ext.ext_argparse import ArgParseArgumentHandler
+from wo.core import exc
+from wo.cli.ext.wo_outputhandler import WOOutputHandler
# this has to happen after you import sys, but before you import anything
# from Cement "source: https://github.com/datafolklabs/cement/issues/290"
@@ -10,13 +16,6 @@ if '--debug' in sys.argv:
else:
TOGGLE_DEBUG = False
-from cement.core import foundation
-from cement.utils.misc import init_defaults
-from cement.core.exc import FrameworkError, CaughtSignal
-from cement.ext.ext_argparse import ArgParseArgumentHandler
-from wo.core import exc
-from wo.cli.ext.wo_outputhandler import WOOutputHandler
-
# Application default. Should update config/wo.conf to reflect any
# changes, or additions here.
defaults = init_defaults('wo')
diff --git a/wo/cli/plugins/debug.py b/wo/cli/plugins/debug.py
index 57da542..1db6a6a 100644
--- a/wo/cli/plugins/debug.py
+++ b/wo/cli/plugins/debug.py
@@ -188,27 +188,24 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9001')
- if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
- nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9001')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Enable xdebug
- WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
+ WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5") +
"xdebug.ini",
";zend_extension",
"zend_extension")
# Fix slow log is not enabled default in PHP5.6
config = configparser.ConfigParser()
- config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
- 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config['debug']['slowlog'] = '/var/log/{0}/slow.log'.format("php/7.2" if (
- WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
+ WOVariables.wo_platform_distro == 'ubuntu') else "php5")
config['debug']['request_slowlog_timeout'] = '10s'
- with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
+ with open('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as confifile:
Log.debug(self, "Writting debug.conf configuration into "
- "/etc/{0}/fpm/pool.d/debug.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ "/etc/{0}/fpm/pool.d/debug.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(confifile)
self.trigger_php = True
@@ -217,7 +214,7 @@ class WODebugController(CementBaseController):
Log.info(self, "PHP debug is already enabled")
self.msg = self.msg + ['/var/log/{0}/slow.log'.format("php/7.2" if (
- WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
+ WOVariables.wo_platform_distro == 'ubuntu') else "php5")]
# PHP global debug stop
elif (self.app.pargs.php == 'off' and not self.app.pargs.site_name):
@@ -230,12 +227,10 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php',), 'server'], '127.0.0.1:9000')
- if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
- nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:8000')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Disable xdebug
- WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5") +
+ WOFileUtils.searchreplace(self, "/etc/{0}/mods-available/".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5") +
"xdebug.ini",
"zend_extension",
";zend_extension")
@@ -251,43 +246,41 @@ class WODebugController(CementBaseController):
# PHP5-FPM start global debug
if (self.app.pargs.fpm == 'on' and not self.app.pargs.site_name):
if not WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
- "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
+ "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5")):
Log.info(self, "Setting up PHP5-FPM log_level = debug")
config = configparser.ConfigParser()
- config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
- 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.remove_option('global', 'include')
config['global']['log_level'] = 'debug'
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
- WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
- with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
+ WOVariables.wo_platform_distro == 'ubuntu') else "php5")
+ with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as configfile:
Log.debug(self, "Writting php5-FPM configuration into "
- "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(configfile)
self.trigger_php = True
else:
Log.info(self, "PHP5-FPM log_level = debug already setup")
self.msg = self.msg + ['/var/log/{0}/fpm.log'.format("php/7.2" if (
- WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")]
+ WOVariables.wo_platform_distro == 'ubuntu') else "php5")]
# PHP5-FPM stop global debug
elif (self.app.pargs.fpm == 'off' and not self.app.pargs.site_name):
if WOShellExec.cmd_exec(self, "grep \"log_level = debug\" "
- "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")):
+ "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5")):
Log.info(self, "Disabling PHP5-FPM log_level = debug")
config = configparser.ConfigParser()
- config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
- 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ config.read('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.remove_option('global', 'include')
config['global']['log_level'] = 'notice'
config['global']['include'] = '/etc/{0}/fpm/pool.d/*.conf'.format("php/7.2" if (
- WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5")
- with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"),
+ WOVariables.wo_platform_distro == 'ubuntu') else "php5")
+ with open('/etc/{0}/fpm/php-fpm.conf'.format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"),
encoding='utf-8', mode='w') as configfile:
Log.debug(self, "writting php5 configuration into "
- "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
+ "/etc/{0}/fpm/php-fpm.conf".format("php/7.2" if (WOVariables.wo_platform_distro == 'ubuntu') else "php5"))
config.write(configfile)
self.trigger_php = True
@@ -300,8 +293,6 @@ class WODebugController(CementBaseController):
# PHP global debug start
if (self.app.pargs.php73 == 'on' and not self.app.pargs.site_name):
- if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'):
- Log.error(self, "PHP 7.3 not supported.")
if not (WOShellExec.cmd_exec(self, "sed -n \"/upstream php73"
"{/,/}/p \" /etc/nginx/"
"conf.d/upstream.conf "
@@ -313,8 +304,6 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php73',), 'server'], '127.0.0.1:9173')
- if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
- nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:9173')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Enable xdebug
@@ -352,8 +341,6 @@ class WODebugController(CementBaseController):
nc = NginxConfig()
nc.loadf('/etc/nginx/conf.d/upstream.conf')
nc.set([('upstream', 'php72',), 'server'], 'unix:/var/run/php/php72-fpm.sock')
- if os.path.isfile("/etc/nginx/common/wpfc-hhvm.conf"):
- nc.set([('upstream', 'hhvm',), 'server'], '127.0.0.1:8000')
nc.savef('/etc/nginx/conf.d/upstream.conf')
# Disable xdebug
@@ -633,7 +620,7 @@ class WODebugController(CementBaseController):
# Reload PHP
if self.trigger_php:
- if WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic':
+ if WOVariables.wo_platform_distro == 'ubuntu':
if WOAptGet.is_installed(self, 'php7.2-fpm'):
WOService.reload_service(self, 'php7.2-fpm')
if WOAptGet.is_installed(self, 'php7.3-fpm'):
@@ -724,7 +711,7 @@ class WODebugController(CementBaseController):
self.app.pargs.nginx = 'on'
self.app.pargs.php = 'on'
self.app.pargs.fpm = 'on'
- if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
+ if (WOVariables.wo_platform_distro == 'ubuntu') and WOAptGet.is_installed(self, 'php7.2-fpm'):
self.app.pargs.php73 = 'on'
self.app.pargs.fpm73 = 'on'
self.app.pargs.mysql = 'on'
@@ -736,7 +723,7 @@ class WODebugController(CementBaseController):
self.app.pargs.nginx = 'off'
self.app.pargs.php = 'off'
self.app.pargs.fpm = 'off'
- if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') and WOAptGet.is_installed(self, 'php7.2-fpm'):
+ if (WOVariables.wo_platform_distro == 'ubuntu') and WOAptGet.is_installed(self, 'php7.2-fpm'):
self.app.pargs.php73 = 'off'
self.app.pargs.fpm73 = 'off'
self.app.pargs.mysql = 'off'
@@ -781,15 +768,10 @@ class WODebugController(CementBaseController):
WOService.reload_service(self, 'nginx')
# Reload PHP
if self.trigger_php:
- if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
WOService.restart_service(self, 'php7.2-fpm')
if WOAptGet.is_installed(self, 'php7.3-fpm'):
WOService.restart_service(self, 'php7.3-fpm')
- else:
- WOService.restart_service(self, 'php7.2-fpm')
- if WOVariables.wo_platform_codename == 'jessie':
- WOService.restart_service(self, 'php7.2-fpm')
if len(self.msg) > 0:
if not self.app.pargs.interactive:
diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py
index 0978aed..2ae239b 100644
--- a/wo/cli/plugins/site.py
+++ b/wo/cli/plugins/site.py
@@ -131,7 +131,6 @@ class WOSiteController(CementBaseController):
wo_db_name = ''
wo_db_user = ''
wo_db_pass = ''
- hhvm = ''
if not check_domain_exists(self, wo_domain):
Log.error(self, "site {0} does not exist".format(wo_domain))
@@ -148,8 +147,6 @@ class WOSiteController(CementBaseController):
wo_db_user = siteinfo.db_user
wo_db_pass = siteinfo.db_password
wo_db_host = siteinfo.db_host
- if sitetype != "html":
- hhvm = ("enabled" if siteinfo.is_hhvm else "disabled")
if sitetype == "proxy":
access_log = "/var/log/nginx/{0}.access.log".format(wo_domain)
error_log = "/var/log/nginx/{0}.error.log".format(wo_domain)
@@ -167,7 +164,7 @@ class WOSiteController(CementBaseController):
data = dict(domain=wo_domain, webroot=wo_site_webroot,
accesslog=access_log, errorlog=error_log,
dbname=wo_db_name, dbuser=wo_db_user, php_version=php_version,
- dbpass=wo_db_pass, hhvm=hhvm,
+ dbpass=wo_db_pass,
ssl=ssl, sslprovider=sslprovider, sslexpiry=sslexpiry,
type=sitetype + " " + cachetype + " ({0})"
.format("enabled" if siteinfo.is_enabled else
@@ -331,8 +328,6 @@ class WOSiteCreateController(CementBaseController):
(['--wpredis'],
dict(help="create wordpress single/multi site with redis cache",
action='store_true')),
- (['--hhvm'],
- dict(help="create HHVM site", action='store_true')),
(['-le', '--letsencrypt'],
dict(help="configure letsencrypt ssl for the site", action='store_true')),
(['--subdomain'],
@@ -375,8 +370,6 @@ class WOSiteCreateController(CementBaseController):
stype, cache = 'html', 'basic'
elif stype and self.app.pargs.proxy:
Log.error(self, "proxy should not be used with other site types")
- if (self.app.pargs.proxy and self.app.pargs.hhvm):
- Log.error(self, "Proxy site can not run on hhvm")
if not self.app.pargs.site_name:
try:
@@ -452,9 +445,6 @@ class WOSiteCreateController(CementBaseController):
else:
pass
- if stype == "html" and self.app.pargs.hhvm:
- Log.error(self, "Can not create HTML site with HHVM")
-
if data and self.app.pargs.php73:
if (self.app.pargs.experimental):
Log.info(
@@ -478,34 +468,9 @@ class WOSiteCreateController(CementBaseController):
data['php73'] = False
php73 = 0
- if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis) and (not self.app.pargs.hhvm):
+ if (not self.app.pargs.wpfc) and (not self.app.pargs.wpsc) and (not self.app.pargs.wpredis):
data['basic'] = True
- if data and self.app.pargs.hhvm:
- if (not self.app.pargs.experimental):
- Log.info(self, "HHVM is experimental feature and it may not "
- "work with all plugins of your site.\nYou can "
- "disable it by passing --hhvm=off later.\nDo you wish"
- " to enable HHVM now for {0}?".format(wo_domain))
-
- # Check prompt
- check_prompt = input("Type \"y\" to continue [n]:")
- if check_prompt != "Y" and check_prompt != "y":
- Log.info(self, "Not using HHVM for site.")
- data['hhvm'] = False
- hhvm = 0
- self.app.pargs.hhvm = False
- else:
- data['hhvm'] = True
- hhvm = 1
- else:
- data['hhvm'] = True
- hhvm = 1
-
- elif data:
- data['hhvm'] = False
- hhvm = 0
-
if (cache == 'wpredis' and (self.app.pargs.experimental)):
Log.info(self, "Redis is experimental feature and it may not "
"work with all CSS/JS/Cache of your site.\nYou can "
@@ -574,7 +539,7 @@ class WOSiteCreateController(CementBaseController):
php_version = "7.2"
addNewSite(self, wo_domain, stype, cache, wo_site_webroot,
- hhvm=hhvm, php_version=php_version)
+ php_version=php_version)
# Setup database for MySQL site
if 'wo_db_name' in data.keys() and not data['wp']:
@@ -804,10 +769,6 @@ class WOSiteUpdateController(CementBaseController):
dict(help="update to wpsc cache", action='store_true')),
(['--wpredis'],
dict(help="update to redis cache", action='store_true')),
- (['--hhvm'],
- dict(help='Use HHVM for site',
- action='store' or 'store_const',
- choices=('on', 'off'), const='on', nargs='?')),
(['-le', '--letsencrypt'],
dict(help="configure letsencrypt ssl for the site",
action='store' or 'store_const',
@@ -835,7 +796,7 @@ class WOSiteUpdateController(CementBaseController):
if not (pargs.php or pargs.php73 or
pargs.mysql or pargs.wp or pargs.wpsubdir or
pargs.wpsubdomain or pargs.wpfc or pargs.wpsc or
- pargs.hhvm or pargs.wpredis or pargs.letsencrypt):
+ pargs.wpredis or pargs.letsencrypt):
Log.error(self, "Please provide options to update sites.")
if pargs.all:
@@ -858,7 +819,6 @@ class WOSiteUpdateController(CementBaseController):
self.doupdatesite(pargs)
def doupdatesite(self, pargs):
- hhvm = None
letsencrypt = False
php73 = None
@@ -882,8 +842,6 @@ class WOSiteUpdateController(CementBaseController):
stype, cache = 'html', 'basic'
elif stype and pargs.proxy:
Log.error(self, "--proxy can not be used with other site types")
- if (pargs.proxy and pargs.hhvm):
- Log.error(self, "Proxy site can not run on hhvm")
if not pargs.site_name:
try:
@@ -904,7 +862,6 @@ class WOSiteUpdateController(CementBaseController):
else:
oldsitetype = check_site.site_type
oldcachetype = check_site.cache_type
- old_hhvm = check_site.is_hhvm
check_ssl = check_site.is_ssl
check_php_version = check_site.php_version
@@ -924,18 +881,8 @@ class WOSiteUpdateController(CementBaseController):
Log.info(self, "\nPassword Unchanged.")
return 0
- if ((stype == "proxy" and stype == oldsitetype and self.app.pargs.hhvm)
- or (stype == "proxy" and
- stype == oldsitetype)):
- Log.info(self, Log.FAIL +
- "Can not update proxy site to HHVM")
- return 1
- if stype == "html" and stype == oldsitetype and self.app.pargs.hhvm:
- Log.info(self, Log.FAIL + "Can not update HTML site to HHVM")
- return 1
-
- if ((stype == 'php' and oldsitetype not in ['html', 'proxy', 'php73']) or
- # (stype == 'php73' and oldsitetype not in ['html', 'mysql', 'php', 'php73', 'wp', 'wpsubdir', 'wpsubdomain', ]) or
+ if ((stype == 'php' and
+ oldsitetype not in ['html', 'proxy', 'php73']) or
(stype == 'mysql' and oldsitetype not in ['html', 'php',
'proxy', 'php73']) or
(stype == 'wp' and oldsitetype not in ['html', 'php', 'mysql',
@@ -954,7 +901,6 @@ class WOSiteUpdateController(CementBaseController):
data['proxy'] = True
data['host'] = host
data['port'] = port
- hhvm = False
data['webroot'] = wo_site_webroot
data['currsitetype'] = oldsitetype
data['currcachetype'] = oldcachetype
@@ -985,7 +931,7 @@ class WOSiteUpdateController(CementBaseController):
if stype == 'wpsubdir':
data['wpsubdir'] = True
- if pargs.hhvm or pargs.php73:
+ if pargs.php73:
if not data:
data = dict(site_name=wo_domain, www_domain=wo_www_domain,
currsitetype=oldsitetype,
@@ -1040,13 +986,6 @@ class WOSiteUpdateController(CementBaseController):
data['wpsc'] = False
data['wpredis'] = True
- if pargs.hhvm != 'off':
- data['hhvm'] = True
- hhvm = True
- elif pargs.hhvm == 'off':
- data['hhvm'] = False
- hhvm = False
-
if pargs.php73 == 'on':
data['php73'] = True
php73 = True
@@ -1153,25 +1092,6 @@ class WOSiteUpdateController(CementBaseController):
"site")
pargs.letsencrypt = False
- if pargs.hhvm:
- if hhvm is old_hhvm:
- if hhvm is False:
- Log.info(self, "HHVM is allready disabled for given "
- "site")
- elif hhvm is True:
- Log.info(self, "HHVM is allready enabled for given "
- "site")
-
- pargs.hhvm = False
-
- if data and (not pargs.hhvm):
- if old_hhvm is True:
- data['hhvm'] = True
- hhvm = True
- else:
- data['hhvm'] = False
- hhvm = False
-
if data and (not pargs.php73):
if old_php73 is True:
data['php73'] = True
@@ -1180,7 +1100,7 @@ class WOSiteUpdateController(CementBaseController):
data['php73'] = False
php73 = False
- if pargs.hhvm == "on" or pargs.letsencrypt == "on" or pargs.php73 == "on":
+ if pargs.letsencrypt == "on" or pargs.php73 == "on":
if pargs.php73 == "on":
if pargs.experimental:
Log.info(
@@ -1198,26 +1118,6 @@ class WOSiteUpdateController(CementBaseController):
data['php73'] = True
php73 = True
- if pargs.hhvm == "on":
- if pargs.experimental:
- Log.info(self, "HHVM is experimental feature and it may not"
- " work with all plugins of your site.\nYou can "
- "disable it by passing --hhvm=off later.\nDo you wish"
- " to enable HHVM now for {0}?".format(wo_domain))
-
- # Check prompt
- check_prompt = input("Type \"y\" to continue [n]:")
- if check_prompt != "Y" and check_prompt != "y":
- Log.info(self, "Not using HHVM for site")
- data['hhvm'] = False
- hhvm = False
- else:
- data['hhvm'] = True
- hhvm = True
- else:
- data['hhvm'] = True
- hhvm = True
-
if pargs.letsencrypt == "on":
if pargs.experimental:
@@ -1257,8 +1157,7 @@ class WOSiteUpdateController(CementBaseController):
data['basic'] = True
cache = 'basic'
- if ((hhvm is old_hhvm) and (php73 is old_php73) and
- (stype == oldsitetype and cache == oldcachetype)):
+ if (php73 is old_php73) and (stype == oldsitetype and cache == oldcachetype):
return 1
if not data:
@@ -1298,7 +1197,7 @@ class WOSiteUpdateController(CementBaseController):
if 'proxy' in data.keys() and data['proxy']:
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
- hhvm=hhvm, ssl=True if check_site.is_ssl else False)
+ ssl=True if check_site.is_ssl else False)
Log.info(self, "Successfully updated site"
" http://{0}".format(wo_domain))
return 0
@@ -1366,7 +1265,7 @@ class WOSiteUpdateController(CementBaseController):
"check issues with `nginx -t` command")
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
- hhvm=hhvm, ssl=True if check_site.is_ssl else False, php_version=check_php_version)
+ ssl=True if check_site.is_ssl else False, php_version=check_php_version)
Log.info(self, "Successfully updated site"
" http://{0}".format(wo_domain))
@@ -1568,11 +1467,11 @@ class WOSiteUpdateController(CementBaseController):
db_name=data['wo_db_name'],
db_user=data['wo_db_user'],
db_password=data['wo_db_pass'],
- db_host=data['wo_db_host'], hhvm=hhvm,
+ db_host=data['wo_db_host'],
ssl=True if check_site.is_ssl else False, php_version=check_php_version)
else:
updateSiteInfo(self, wo_domain, stype=stype, cache=cache,
- hhvm=hhvm, ssl=True if check_site.is_ssl else False, php_version=check_php_version)
+ ssl=True if check_site.is_ssl else False, php_version=check_php_version)
Log.info(self, "Successfully updated site"
" http://{0}".format(wo_domain))
return 0
diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py
index 1c24911..9e53312 100644
--- a/wo/cli/plugins/site_functions.py
+++ b/wo/cli/plugins/site_functions.py
@@ -306,6 +306,8 @@ def setupwordpress(self, data):
+ "--dbpass=\'{0}\' "
"--extra-php<