Merge pull request #174 from WordOps/updating-configuration
Updating configuration
This commit is contained in:
39
.gitattributes
vendored
Normal file
39
.gitattributes
vendored
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Documents
|
||||||
|
*.md text
|
||||||
|
*.tex text diff=tex
|
||||||
|
*.adoc text
|
||||||
|
*.textile text
|
||||||
|
*.mustache text
|
||||||
|
*.csv text
|
||||||
|
*.tab text
|
||||||
|
*.tsv text
|
||||||
|
*.txt text
|
||||||
|
*.sql text
|
||||||
|
|
||||||
|
# Scripts
|
||||||
|
*.bash text eol=lf
|
||||||
|
*.fish text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
|
||||||
|
# Source files
|
||||||
|
# ============
|
||||||
|
*.pxd text diff=python
|
||||||
|
*.py text diff=python
|
||||||
|
*.py3 text diff=python
|
||||||
|
*.pyc text diff=python
|
||||||
|
*.pyd text diff=python
|
||||||
|
*.pyo text diff=python
|
||||||
|
*.pyw text diff=python
|
||||||
|
*.pyx text diff=python
|
||||||
|
*.pyz text diff=python
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Exclude files from exporting
|
||||||
|
#
|
||||||
|
|
||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
25
.github/workflows/main.yml
vendored
25
.github/workflows/main.yml
vendored
@@ -1,25 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Prepare VM
|
|
||||||
run: |
|
|
||||||
unset LANG
|
|
||||||
sudo apt update -qq
|
|
||||||
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
|
|
||||||
sudo apt-get -qq purge graphviz* redis*
|
|
||||||
sudo apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
|
|
||||||
sudo apt-get -qq autoremove --purge
|
|
||||||
sudo mkdir -p /etc/mysql/conf.d
|
|
||||||
echo -e '[client]\nuser = root\npassword = root\n' | sudo tee /etc/mysql/conf.d/my.cnf
|
|
||||||
- name: Install WordOps
|
|
||||||
run: sudo timeout 1800 bash install --travis
|
|
||||||
- name: Run tests
|
|
||||||
run: sudo timeout 1800 bash tests/travis.sh --actions
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
dist: xenial
|
dist: bionic
|
||||||
|
|
||||||
language: bash
|
language: bash
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
slack: wordops:MyZBNbI7JfhbAi3YyFckMdaa
|
|
||||||
webhooks:
|
webhooks:
|
||||||
secure: "JiGtzYplTyFg/L6Rsi7ptEQIV29O5qCWU2Zf5pLITsQrBrQO4cIXXp9G4Z+cenXjfIiqbqIgU0US3zXeIAl4g14xdfzmMYeMMwuKBpI8afMYv8MD6ldoP0MTFHQfROE6OXxKLVUvZn1R0oLLU1fzVSI0qGjNkt20cf/Lrt/reH/zS5hAI92kWI3u2zPu7Zn/g/a8MO/Y3Iv7v1PSQaVkVJVqtOK3U2GJqhIv2G1AVcaPb7Nh/V2zm2dDYBVT0UotBnlBUcUXbEMP77D9pjtWXd1/0rWuJIHixMjwUybpZqY75UMee5INynU6OZRsv029LRHAIMkWhfBkdVN/U5jhQJzui14+vRQrb5nfUMG8Cd8INojDlu6dk/ps2GzTCCXBITeMQKAouUoHD2LEbsNp17xi1K4ZlKb3+0lrOAiS4JYFE6wOo4yMlLTYoquYSqk7AuxuUS8A5OD5MYxhk9uafiTSxKFOo39KYWTSaACsPD8q1swaTSjoYm9skyZvIkIFq5bHBCYEGFe6X/NY9l5tz3hSe+TJOerCHsg+dXVuQl+pIp5nw2as9TH9ox5Vgqc9Zh4GbTDQVvdAmUpmlsZ/SKoOMCkmkB1aRNFq/7RnERIJyAEGJbauHWmjtOM4cCxesl0L0b2Eab89zQpSn7pzE8JTiJgpzCUc22p653PTaqM="
|
secure: "JiGtzYplTyFg/L6Rsi7ptEQIV29O5qCWU2Zf5pLITsQrBrQO4cIXXp9G4Z+cenXjfIiqbqIgU0US3zXeIAl4g14xdfzmMYeMMwuKBpI8afMYv8MD6ldoP0MTFHQfROE6OXxKLVUvZn1R0oLLU1fzVSI0qGjNkt20cf/Lrt/reH/zS5hAI92kWI3u2zPu7Zn/g/a8MO/Y3Iv7v1PSQaVkVJVqtOK3U2GJqhIv2G1AVcaPb7Nh/V2zm2dDYBVT0UotBnlBUcUXbEMP77D9pjtWXd1/0rWuJIHixMjwUybpZqY75UMee5INynU6OZRsv029LRHAIMkWhfBkdVN/U5jhQJzui14+vRQrb5nfUMG8Cd8INojDlu6dk/ps2GzTCCXBITeMQKAouUoHD2LEbsNp17xi1K4ZlKb3+0lrOAiS4JYFE6wOo4yMlLTYoquYSqk7AuxuUS8A5OD5MYxhk9uafiTSxKFOo39KYWTSaACsPD8q1swaTSjoYm9skyZvIkIFq5bHBCYEGFe6X/NY9l5tz3hSe+TJOerCHsg+dXVuQl+pIp5nw2as9TH9ox5Vgqc9Zh4GbTDQVvdAmUpmlsZ/SKoOMCkmkB1aRNFq/7RnERIJyAEGJbauHWmjtOM4cCxesl0L0b2Eab89zQpSn7pzE8JTiJgpzCUc22p653PTaqM="
|
||||||
|
|
||||||
@@ -22,15 +21,15 @@ before_script:
|
|||||||
- sudo rm -rf /etc/mysql
|
- sudo rm -rf /etc/mysql
|
||||||
- sudo bash -c 'echo example.com > /etc/hostname'
|
- sudo bash -c 'echo example.com > /etc/hostname'
|
||||||
- unset LANG
|
- unset LANG
|
||||||
|
- sudo apt-get update --allow-releaseinfo-change -qq
|
||||||
- sudo apt-get -qq purge mysql* graphviz* redis*
|
- sudo apt-get -qq purge mysql* graphviz* redis*
|
||||||
- sudo apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
|
- sudo apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
|
||||||
- sudo apt-get -qq autoremove --purge
|
- sudo apt-get -qq autoremove --purge
|
||||||
|
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- sudo cat /var/log/wo/test.log | ccze -A -p syslog
|
- sudo cat /var/log/wo/install.log | ccze -A -p syslog
|
||||||
- sudo bash install --purge
|
- sudo bash install --purge
|
||||||
- sudo curl --progress-bar --upload-file /var/log/wo/wordops.log https://transfer.vtbox.net/"$(basename wordops.log)" && echo "" | sudo tee -a $HOME/.transfer.log && echo ""
|
|
||||||
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|||||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -8,6 +8,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
### v3.9.x - [Unreleased]
|
### v3.9.x - [Unreleased]
|
||||||
|
|
||||||
|
### v3.9.9.3 - [Unreleased]
|
||||||
|
|
||||||
|
#### Added
|
||||||
|
|
||||||
|
- [STACK] Add Nginx TLS 1.3 0-RTT configuration
|
||||||
|
|
||||||
|
#### Changed
|
||||||
|
|
||||||
|
- [STACK] New Nginx package built with OpenSSL_1.1.1d and the latest ngx_brotli module
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
|
||||||
|
- `wo stack upgrade` when using nginx-ee
|
||||||
|
- `wo secure --auth`
|
||||||
|
- `wo secure --sshport` not working with default ssh config
|
||||||
|
- Issues after APT repositories informations changed
|
||||||
|
- `www` was added to WordPress site url with subdomains [Issue #178](https://github.com/WordOps/WordOps/issues/178)
|
||||||
|
- Issuing certificate with acme.sh for sub.sub-domains not working
|
||||||
|
|
||||||
### v3.9.9.2 - 2019-10-04
|
### v3.9.9.2 - 2019-10-04
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|||||||
180
install
180
install
@@ -9,7 +9,7 @@
|
|||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# wget -qO wo wops.cc && sudo bash wo
|
# wget -qO wo wops.cc && sudo bash wo
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Version 3.9.9.1 - 2019-09-27
|
# Version 3.9.9.3 - 2019-10-14
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
|
|
||||||
# CONTENTS
|
# CONTENTS
|
||||||
@@ -62,8 +62,9 @@ while [ "$#" -gt 0 ]; do
|
|||||||
wo_branch="$2"
|
wo_branch="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-p | --preserve)
|
-v | --version)
|
||||||
wo_preserve_config="y"
|
wo_version="$2"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
--force)
|
--force)
|
||||||
wo_force_install="y"
|
wo_force_install="y"
|
||||||
@@ -78,10 +79,6 @@ while [ "$#" -gt 0 ]; do
|
|||||||
--purge | --uninstall)
|
--purge | --uninstall)
|
||||||
wo_purge="y"
|
wo_purge="y"
|
||||||
;;
|
;;
|
||||||
-v | --version)
|
|
||||||
wo_version="$2"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*) # positional args
|
*) # positional args
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -97,14 +94,15 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
|
||||||
# 1- Update the apt sewers with fresh info
|
|
||||||
###
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
unset LANG
|
unset LANG
|
||||||
export LANG='en_US.UTF-8'
|
export LANG='en_US.UTF-8'
|
||||||
export LC_ALL='C.UTF-8'
|
export LC_ALL='C.UTF-8'
|
||||||
|
|
||||||
|
###
|
||||||
|
# 1- Main functions
|
||||||
|
###
|
||||||
|
|
||||||
# check if a command exist
|
# check if a command exist
|
||||||
command_exists() {
|
command_exists() {
|
||||||
command -v "$@" > /dev/null 2>&1
|
command -v "$@" > /dev/null 2>&1
|
||||||
@@ -121,19 +119,18 @@ _run() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_path() {
|
###
|
||||||
if [ -d "$1" ]; then
|
# 1- Update the apt sewers with fresh info
|
||||||
return 0
|
###
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -z "$wo_travis" ]; then
|
if [ -z "$wo_travis" ]; then
|
||||||
if command_exists curl; then
|
if ! {
|
||||||
apt-get update -qq
|
apt-get update --allow-releaseinfo-change -qq > /dev/null 2>&1
|
||||||
else
|
}; then
|
||||||
apt-get update -qq && apt-get -y install curl -qq > /dev/null 2>&1
|
apt-get update -qq > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
if ! command_exists curl; then
|
||||||
|
apt-get -y install curl -qq > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -167,7 +164,6 @@ readonly wo_tmp_dir=/var/lib/wo/tmp
|
|||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
readonly wo_linux_distro=$(lsb_release -is)
|
readonly wo_linux_distro=$(lsb_release -is)
|
||||||
readonly wo_distro_version=$(lsb_release -sc)
|
readonly wo_distro_version=$(lsb_release -sc)
|
||||||
readonly wo_distro_id=$(lsb_release -rs)
|
|
||||||
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'
|
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'
|
||||||
readonly TIME=$(date +"$TIME_FORMAT")
|
readonly TIME=$(date +"$TIME_FORMAT")
|
||||||
readonly NGINX_BACKUP_FILE="/var/lib/wo-backup/nginx-backup.$TIME.tar.gz"
|
readonly NGINX_BACKUP_FILE="/var/lib/wo-backup/nginx-backup.$TIME.tar.gz"
|
||||||
@@ -179,13 +175,8 @@ WO_ARCH="$(uname -m)"
|
|||||||
|
|
||||||
if [ -x /usr/local/bin/ee ]; then
|
if [ -x /usr/local/bin/ee ]; then
|
||||||
ee_migration=1
|
ee_migration=1
|
||||||
ufw="n"
|
|
||||||
elif [ -x /usr/local/bin/wo ]; then
|
elif [ -x /usr/local/bin/wo ]; then
|
||||||
wo_upgrade=1
|
wo_upgrade=1
|
||||||
ufw="n"
|
|
||||||
fi
|
|
||||||
if [ -z "$ufw" ]; then
|
|
||||||
ufw="y"
|
|
||||||
fi
|
fi
|
||||||
###
|
###
|
||||||
# 1 - Checking linux distro
|
# 1 - Checking linux distro
|
||||||
@@ -232,13 +223,13 @@ wo_install_dep() {
|
|||||||
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
if [ "$wo_linux_distro" == "Ubuntu" ]; then
|
||||||
# install dependencies
|
# install dependencies
|
||||||
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
||||||
build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz \
|
build-essential curl gzip python3-pip python3-wheel python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz \
|
||||||
gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
gnupg2 cron ccze rsync apt-transport-https tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
||||||
add-apt-repository ppa:wordops/nginx-wo -yn
|
add-apt-repository ppa:wordops/nginx-wo -yn
|
||||||
else
|
else
|
||||||
# install dependencies
|
# install dependencies
|
||||||
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
|
||||||
build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-requests python3-dev ca-certificates sqlite3 git tar \
|
build-essential curl gzip dirmngr sudo python3-pip python3-wheel python3-apt python3-setuptools python3-dev ca-certificates sqlite3 git tar \
|
||||||
software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
software-properties-common pigz apt-transport-https gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
|
||||||
# add php repository gpg key
|
# add php repository gpg key
|
||||||
[ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; }
|
[ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; }
|
||||||
@@ -318,16 +309,6 @@ wo_sync_db() {
|
|||||||
|
|
||||||
wo_site_current_type=$(grep "common/" "/etc/nginx/sites-available/$site" | awk -F "/" '{print $2}')
|
wo_site_current_type=$(grep "common/" "/etc/nginx/sites-available/$site" | awk -F "/" '{print $2}')
|
||||||
|
|
||||||
if echo "$wo_site_current_type" | grep -q "php"; then
|
|
||||||
if echo "$wo_site_current_type" | grep -q "php7"; then
|
|
||||||
wo_php_version="7.0"
|
|
||||||
else
|
|
||||||
wo_php_version="5.6"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
wo_php_version=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
if echo "$wo_site_current_type" | grep -q "redis"; then
|
if echo "$wo_site_current_type" | grep -q "redis"; then
|
||||||
wo_site_current_cache="wpredis"
|
wo_site_current_cache="wpredis"
|
||||||
elif echo "$wo_site_current_type" | grep -q wpsc; then
|
elif echo "$wo_site_current_type" | grep -q wpsc; then
|
||||||
@@ -458,6 +439,18 @@ wo_install_acme_sh() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wo_git_config() {
|
||||||
|
|
||||||
|
if [ "$wo_force_install" = "y" ]; then
|
||||||
|
[ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
# .gitconfig inital setup
|
||||||
|
cd /var/lib/wo/tmp/WordOps-install || exit 1
|
||||||
|
python3 gitconfig.py
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Download WordOps
|
# Download WordOps
|
||||||
wo_download() {
|
wo_download() {
|
||||||
rm -f /etc/bash_completion.d/wo_auto.rc
|
rm -f /etc/bash_completion.d/wo_auto.rc
|
||||||
@@ -471,18 +464,6 @@ wo_download() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_git_config() {
|
|
||||||
|
|
||||||
if [ "$wo_force_install" = "y" ]; then
|
|
||||||
[ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; }
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .gitconfig inital setup
|
|
||||||
cd /var/lib/wo/tmp/WordOps-install || exit 1
|
|
||||||
python3 gitconfig.py
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# WordOps install
|
# WordOps install
|
||||||
wo_install() {
|
wo_install() {
|
||||||
|
|
||||||
@@ -492,7 +473,7 @@ wo_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Clone Github repository if it doesn't exist
|
# Clone Github repository if it doesn't exist
|
||||||
wo_install_travis() {
|
wo_travis_install() {
|
||||||
|
|
||||||
if [ "$wo_force_install" = "y" ]; then
|
if [ "$wo_force_install" = "y" ]; then
|
||||||
[ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; }
|
[ ! -f "$HOME/.gitconfig" ] && { bash -c 'echo -e "[user]\n\tname = $USER\n\temail = root@$HOSTNAME.local" > $HOME/.gitconfig'; }
|
||||||
@@ -610,32 +591,20 @@ wo_update_latest() {
|
|||||||
chmod 600 /root/.my.cnf
|
chmod 600 /root/.my.cnf
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix Redis-server security issue
|
|
||||||
# http://redis.io/topics/security
|
|
||||||
if [ -f /etc/redis/redis.conf ]; then
|
|
||||||
CHECK_REDIS_BIND=$(grep -0 -v "#" /etc/redis/redis.conf | grep 'bind' >> /dev/null 2>&1)
|
|
||||||
|
|
||||||
if [ -z "$CHECK_REDIS_BIND" ]; then
|
|
||||||
echo 'bind 127.0.0.1 ::1' >> /etc/redis/redis.conf
|
|
||||||
|
|
||||||
service redis-server restart
|
|
||||||
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_backup_ee() {
|
wo_backup_ee() {
|
||||||
local BACKUP_EE=""
|
local BACKUP_EE=""
|
||||||
[ -d /etc/nginx ] && { BACKUP_EE="$BACKUP_EE /etc/nginx"; }
|
[ -d /etc/nginx ] && { BACKUP_EE="$BACKUP_EE /etc/nginx"; }
|
||||||
[ -d /etc/letsencrypt ] && { BACKUP_EE="$BACKUP_EE /etc/letsencrypt"; }
|
[ -d /etc/letsencrypt ] && { BACKUP_EE="$BACKUP_EE /etc/letsencrypt"; }
|
||||||
/bin/tar -I pigz -cf "$EE_BACKUP_FILE" /usr/local/bin/ee /usr/lib/ee/templates /usr/local/lib/python3.*/dist-packages/ee-*.egg /etc/ee /var/lib/ee "$BACKUP_EE"
|
/bin/tar -I pigz -cf "$EE_BACKUP_FILE" /usr/local/bin/ee /usr/lib/ee/templates /etc/ee /var/lib/ee "$BACKUP_EE"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_backup_wo() {
|
wo_backup_wo() {
|
||||||
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /etc/wo /var/lib/wo "$WO_LE"
|
if [ -d /etc/nginx ] && [ -d /etc/wo ] && [ -d /var/lib/wo ]; then
|
||||||
|
/bin/tar -I pigz -cf "$WO_BACKUP_FILE" /etc/nginx /etc/wo /var/lib/wo
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -686,7 +655,7 @@ wo_systemd_tweak() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wo_domain_suffix() {
|
wo_domain_suffix() {
|
||||||
curl -sL https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat | sed '/^\/\//d' | sed '/^$/d' | sed 's/^\s+//g' > /var/lib/wo/public_suffix_list.dat
|
curl -m 10 --retry 3 -sL https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat | sed '/^\/\//d' | sed '/^$/d' | sed 's/^\s+//g' > /var/lib/wo/public_suffix_list.dat
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_mariadb_tweak() {
|
wo_mariadb_tweak() {
|
||||||
@@ -715,69 +684,10 @@ wo_clean() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wo_uninstall() {
|
wo_uninstall() {
|
||||||
|
python3 -m pip uninstall wordops -y
|
||||||
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates
|
rm -rf /usr/local/lib/python3.*/dist-packages/{pystache-*,cement-2.*,wo-*} /usr/local/bin/wo /etc/bash_completion.d/wo_auto.rc /var/lib/wo /etc/wo /usr/lib/wo/templates
|
||||||
}
|
}
|
||||||
|
|
||||||
wo_ufw_setup() {
|
|
||||||
if ! grep -q "ENABLED=yes" /etc/ufw/ufw.conf; then
|
|
||||||
# get custom ssh port
|
|
||||||
if [ -f /etc/ssh/sshd_config ]; then
|
|
||||||
CURRENT_SSH_PORT=$(grep "Port" /etc/ssh/sshd_config | awk -F " " '{print $2}')
|
|
||||||
fi
|
|
||||||
# define firewall rules
|
|
||||||
if ! grep -q "LOGLEVEL=low" /etc/ufw/ufw.conf; then
|
|
||||||
ufw logging low
|
|
||||||
fi
|
|
||||||
if ! grep -q 'DEFAULT_OUTPUT_POLICY="ACCEPT"' /etc/default/ufw; then
|
|
||||||
ufw default allow outgoing
|
|
||||||
fi
|
|
||||||
if ! grep -q 'DEFAULT_INPUT_POLICY="DROP"' /etc/default/ufw; then
|
|
||||||
ufw default deny incoming
|
|
||||||
fi
|
|
||||||
if ! grep -q "\-\-dport 22 -j" /etc/ufw/user.rules; then
|
|
||||||
# default ssh port
|
|
||||||
ufw limit 22
|
|
||||||
fi
|
|
||||||
|
|
||||||
# custom ssh port
|
|
||||||
if [ "$CURRENT_SSH_PORT" != "22" ]; then
|
|
||||||
if ! grep -q "\-\-dport $CURRENT_SSH_PORT -j" /etc/ufw/user.rules; then
|
|
||||||
ufw limit "$CURRENT_SSH_PORT"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nginx
|
|
||||||
if ! grep -q "\-\-dport 80 -j" /etc/ufw/user.rules; then
|
|
||||||
# http
|
|
||||||
ufw allow http
|
|
||||||
fi
|
|
||||||
if ! grep -q "\-\-dport 443 -j" /etc/ufw/user.rules; then
|
|
||||||
# https
|
|
||||||
ufw allow https
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ntp
|
|
||||||
if ! grep -q "\-\-dport 123 -j" /etc/ufw/user.rules; then
|
|
||||||
ufw allow 123
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! grep -q "\-\-dport 22222 -j" /etc/ufw/user.rules; then
|
|
||||||
# wordops backend
|
|
||||||
ufw limit 22222
|
|
||||||
fi
|
|
||||||
# enable ufw
|
|
||||||
if [ -n "$CURRENT_SSH_PORT" ]; then
|
|
||||||
ufw --force enable
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove ufw from syslog
|
|
||||||
if [ -f /etc/rsyslog.d/20-ufw.conf ]; then
|
|
||||||
sed -i 's/\#\& stop/\& stop/' /etc/rsyslog.d/20-ufw.conf
|
|
||||||
service rsyslog restart
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
wo_cheat_install() {
|
wo_cheat_install() {
|
||||||
curl -sL https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
|
curl -sL https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
|
||||||
chmod +x /usr/local/bin/cht.sh
|
chmod +x /usr/local/bin/cht.sh
|
||||||
@@ -822,17 +732,14 @@ else
|
|||||||
fi
|
fi
|
||||||
_run wo_install_dep "Installing wo dependencies"
|
_run wo_install_dep "Installing wo dependencies"
|
||||||
_run wo_timesync
|
_run wo_timesync
|
||||||
#if [ "$ufw" = "y" ]; then
|
|
||||||
# _run wo_ufw_setup "Configuring UFW"
|
|
||||||
#fi
|
|
||||||
# skip steps if travis
|
# skip steps if travis
|
||||||
if [ -z "$wo_travis" ]; then
|
if [ -z "$wo_travis" ]; then
|
||||||
_run wo_download "Downloading WordOps"
|
|
||||||
_run wo_dist_upgrade
|
_run wo_dist_upgrade
|
||||||
|
_run wo_download "Downloading WordOps"
|
||||||
wo_git_config
|
wo_git_config
|
||||||
_run wo_install "Installing WordOps"
|
_run wo_install "Installing WordOps"
|
||||||
else
|
else
|
||||||
_run wo_install_travis "Installing WordOps"
|
_run wo_travis_install "Installing WordOps"
|
||||||
fi
|
fi
|
||||||
if [ -x /usr/local/bin/ee ]; then
|
if [ -x /usr/local/bin/ee ]; then
|
||||||
_run wo_upgrade_nginx "Upgrading Nginx"
|
_run wo_upgrade_nginx "Upgrading Nginx"
|
||||||
@@ -889,6 +796,3 @@ else
|
|||||||
wo_lib_echo "Give WordOps a GitHub star : https://github.com/WordOps/WordOps/"
|
wo_lib_echo "Give WordOps a GitHub star : https://github.com/WordOps/WordOps/"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
# if [ -z "$wo_travis" ]; then
|
|
||||||
# /bin/bash --init-file "/var/lib/wo/tmp/WordOps-$wo_branch/tests/init-file"
|
|
||||||
# fi
|
|
||||||
|
|||||||
@@ -7,4 +7,3 @@ sh>=1.12.14
|
|||||||
SQLAlchemy>=1.3.8
|
SQLAlchemy>=1.3.8
|
||||||
requests>=2.22.0
|
requests>=2.22.0
|
||||||
distro>=1.4.0
|
distro>=1.4.0
|
||||||
apt-mirror-updater>=6.1
|
|
||||||
@@ -10,3 +10,6 @@ cover-erase=1
|
|||||||
cover-html=1
|
cover-html=1
|
||||||
cover-html-dir=coverage_report/
|
cover-html-dir=coverage_report/
|
||||||
where=tests/
|
where=tests/
|
||||||
|
|
||||||
|
[metadata]
|
||||||
|
license-file = LICENSE
|
||||||
10
setup.py
10
setup.py
@@ -4,8 +4,8 @@ import os
|
|||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
with open("README.md", "r") as fh:
|
with open("README.md", "r", encoding="utf-8") as fh:
|
||||||
long_description = fh.read()
|
LONG = fh.read()
|
||||||
|
|
||||||
conf = []
|
conf = []
|
||||||
templates = []
|
templates = []
|
||||||
@@ -24,10 +24,9 @@ if os.geteuid() == 0:
|
|||||||
os.makedirs('/var/lib/wo/tmp/')
|
os.makedirs('/var/lib/wo/tmp/')
|
||||||
|
|
||||||
setup(name='wordops',
|
setup(name='wordops',
|
||||||
version='3.9.9.2',
|
version='3.9.9.3',
|
||||||
description='WordPress & server administration toolset',
|
description='WordPress & server administration toolset',
|
||||||
long_description=long_description,
|
long_description=LONG,
|
||||||
long_description_content_type='text/markdown',
|
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
@@ -61,7 +60,6 @@ setup(name='wordops',
|
|||||||
'SQLAlchemy >= 1.3.8',
|
'SQLAlchemy >= 1.3.8',
|
||||||
'requests >= 2.22.0',
|
'requests >= 2.22.0',
|
||||||
'distro >= 1.4.0',
|
'distro >= 1.4.0',
|
||||||
'apt-mirror-updater >= 6.1',
|
|
||||||
],
|
],
|
||||||
extras_require={ # Optional
|
extras_require={ # Optional
|
||||||
'testing': ['nose', 'coverage'],
|
'testing': ['nose', 'coverage'],
|
||||||
|
|||||||
@@ -14,13 +14,9 @@
|
|||||||
|
|
||||||
if [ -f /var/log/wo/wordops.log ]; then
|
if [ -f /var/log/wo/wordops.log ]; then
|
||||||
cd /var/log/wo/ || exit 1
|
cd /var/log/wo/ || exit 1
|
||||||
if {
|
wo_link=$(curl -sL --upload-file wordops.log https://transfer.vtbox.net/wordops.txt)
|
||||||
tar -I pigz -cf wordops.tar.gz wordops.log
|
echo
|
||||||
}; then
|
echo "Here the link to provide in your github issue : $wo_link"
|
||||||
wo_link=$(curl -sL --upload-file wordops.tar.gz https://transfer.sh/wordops.tar.gz)
|
echo
|
||||||
echo
|
|
||||||
echo "Here the link to provide in your github issue : $wo_link"
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
cd || exit 1
|
cd || exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ if [ -z "$1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
exit_script() {
|
exit_script() {
|
||||||
curl --progress-bar --upload-file /var/log/wo/wordops.log https://transfer.vtbox.net/"$(basename wordops.log)" && echo ""
|
curl --progress-bar --upload-file /var/log/wo/wordops.log https://transfer.vtbox.net/"$(basename wordops.txt)" && echo ""
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ done
|
|||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
echo -e ' Simple site create '
|
echo -e ' Simple site create '
|
||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
site_types='html php php73 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir'
|
site_types='html php php73 mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
|
||||||
for site in $site_types; do
|
for site in $site_types; do
|
||||||
echo -ne " Creating $site [..]\r"
|
echo -ne " Creating $site [..]\r"
|
||||||
if {
|
if {
|
||||||
@@ -65,7 +65,7 @@ done
|
|||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
echo -e ' wo site update --php73 '
|
echo -e ' wo site update --php73 '
|
||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir'
|
other_site_types='html mysql wp wpfc wpsc wpredis wpce wprocket wpsubdomain wpsubdir ngxblocker'
|
||||||
for site in $other_site_types; do
|
for site in $other_site_types; do
|
||||||
echo -ne " Updating site to $site php73 [..]\r"
|
echo -ne " Updating site to $site php73 [..]\r"
|
||||||
if {
|
if {
|
||||||
@@ -180,6 +180,46 @@ for stack in $stack_clean; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
|
echo -e ' wo secure '
|
||||||
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
|
echo -ne " wo secure --auth [..]\r"
|
||||||
|
if {
|
||||||
|
wo secure --auth wordops mypassword
|
||||||
|
} >> /var/log/wo/test.log; then
|
||||||
|
echo -ne " wo secure --auth [${CGREEN}OK${CEND}]\\r"
|
||||||
|
echo -ne '\n'
|
||||||
|
else
|
||||||
|
echo -e " wo secure --auth [${CRED}FAIL${CEND}]"
|
||||||
|
echo -ne '\n'
|
||||||
|
exit_script
|
||||||
|
|
||||||
|
fi
|
||||||
|
echo -ne " wo secure --sshport [..]\r"
|
||||||
|
if {
|
||||||
|
wo secure --sshport 2022
|
||||||
|
} >> /var/log/wo/test.log; then
|
||||||
|
echo -ne " wo secure --sshport [${CGREEN}OK${CEND}]\\r"
|
||||||
|
echo -ne '\n'
|
||||||
|
else
|
||||||
|
echo -e " wo secure --sshport [${CRED}FAIL${CEND}]"
|
||||||
|
echo -ne '\n'
|
||||||
|
exit_script
|
||||||
|
|
||||||
|
fi
|
||||||
|
echo -ne " wo secure --ssh [..]\r"
|
||||||
|
if {
|
||||||
|
wo secure --ssh --force
|
||||||
|
} >> /var/log/wo/test.log; then
|
||||||
|
echo -ne " wo secure --ssh [${CGREEN}OK${CEND}]\\r"
|
||||||
|
echo -ne '\n'
|
||||||
|
else
|
||||||
|
echo -e " wo secure --ssh [${CRED}FAIL${CEND}]"
|
||||||
|
echo -ne '\n'
|
||||||
|
exit_script
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
echo -e ' various informations '
|
echo -e ' various informations '
|
||||||
echo -e "${CGREEN}#############################################${CEND}"
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import os
|
|||||||
|
|
||||||
from cement.core import handler, hook
|
from cement.core import handler, hook
|
||||||
from cement.core.controller import CementBaseController, expose
|
from cement.core.controller import CementBaseController, expose
|
||||||
|
|
||||||
from wo.core.fileutils import WOFileUtils
|
from wo.core.fileutils import WOFileUtils
|
||||||
from wo.core.git import WOGit
|
from wo.core.git import WOGit
|
||||||
from wo.core.logging import Log
|
from wo.core.logging import Log
|
||||||
@@ -70,7 +69,7 @@ class WOSecureController(CementBaseController):
|
|||||||
WOGit.add(self, ["/etc/nginx"],
|
WOGit.add(self, ["/etc/nginx"],
|
||||||
msg="Add Nginx to into Git")
|
msg="Add Nginx to into Git")
|
||||||
pargs = self.app.pargs
|
pargs = self.app.pargs
|
||||||
passwd = RANDOM.gen(self, length='24')
|
passwd = RANDOM.long(self)
|
||||||
if not pargs.user_input:
|
if not pargs.user_input:
|
||||||
username = input("Provide HTTP authentication user "
|
username = input("Provide HTTP authentication user "
|
||||||
"name [{0}] :".format(WOVar.wo_user))
|
"name [{0}] :".format(WOVar.wo_user))
|
||||||
@@ -109,11 +108,12 @@ class WOSecureController(CementBaseController):
|
|||||||
Log.info(self, "Please enter a valid port number ")
|
Log.info(self, "Please enter a valid port number ")
|
||||||
pargs.user_input = input("WordOps "
|
pargs.user_input = input("WordOps "
|
||||||
"admin port [22222]:")
|
"admin port [22222]:")
|
||||||
if not pargs.user_input:
|
else:
|
||||||
port = input("WordOps admin port [22222]:")
|
port = input("WordOps admin port [22222]:")
|
||||||
if port == "":
|
if port == "":
|
||||||
port = 22222
|
port = 22222
|
||||||
while (not port.isdigit()) and (port != "") and (not port < 65536):
|
while ((not port.isdigit()) and (not port != "") and
|
||||||
|
(not port < 65536)):
|
||||||
Log.info(self, "Please Enter valid port number :")
|
Log.info(self, "Please Enter valid port number :")
|
||||||
port = input("WordOps admin port [22222]:")
|
port = input("WordOps admin port [22222]:")
|
||||||
pargs.user_input = port
|
pargs.user_input = port
|
||||||
@@ -220,9 +220,14 @@ class WOSecureController(CementBaseController):
|
|||||||
Log.info(self, "Please Enter valid port number :")
|
Log.info(self, "Please Enter valid port number :")
|
||||||
port = input("Server SSH port [22]:")
|
port = input("Server SSH port [22]:")
|
||||||
pargs.user_input = port
|
pargs.user_input = port
|
||||||
WOShellExec.cmd_exec(self, "sed -i \"s/Port.*/Port "
|
if WOFileUtils.grepcheck(self, '/etc/ssh/sshd_config', '#Port'):
|
||||||
"{port}/\" /etc/ssh/sshd_config"
|
WOShellExec.cmd_exec(self, "sed -i \"s/#Port.*/Port "
|
||||||
.format(port=pargs.user_input))
|
"{port}/\" /etc/ssh/sshd_config"
|
||||||
|
.format(port=pargs.user_input))
|
||||||
|
else:
|
||||||
|
WOShellExec.cmd_exec(self, "sed -i \"s/Port.*/Port "
|
||||||
|
"{port}/\" /etc/ssh/sshd_config"
|
||||||
|
.format(port=pargs.user_input))
|
||||||
# allow new ssh port if ufw is enabled
|
# allow new ssh port if ufw is enabled
|
||||||
if os.path.isfile('/etc/ufw/ufw.conf'):
|
if os.path.isfile('/etc/ufw/ufw.conf'):
|
||||||
# add rule for proftpd with UFW
|
# add rule for proftpd with UFW
|
||||||
|
|||||||
@@ -301,10 +301,9 @@ def setupwordpress(self, data, vhostonly=False):
|
|||||||
"--dbhost=\'{3}\' "
|
"--dbhost=\'{3}\' "
|
||||||
.format(data['wo_db_name'], wo_wp_prefix,
|
.format(data['wo_db_name'], wo_wp_prefix,
|
||||||
data['wo_db_user'], data['wo_db_host']) +
|
data['wo_db_user'], data['wo_db_host']) +
|
||||||
"--dbpass=\'{0}\' "
|
"--dbpass= "
|
||||||
"--extra-php<<PHP \n {1}\nPHP\""
|
"--extra-php<<PHP \n {0}\nPHP\""
|
||||||
.format(data['wo_db_pass'],
|
.format("\n\ndefine(\'WP_DEBUG\', false);"))
|
||||||
"\n\ndefine(\'WP_DEBUG\', false);"))
|
|
||||||
try:
|
try:
|
||||||
if WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root"
|
if WOShellExec.cmd_exec(self, "/bin/bash -c \"{0} --allow-root"
|
||||||
.format(WOVar.wo_wpcli_path) +
|
.format(WOVar.wo_wpcli_path) +
|
||||||
@@ -335,9 +334,9 @@ def setupwordpress(self, data, vhostonly=False):
|
|||||||
"--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' "
|
"--dbname=\'{0}\' --dbprefix=\'{1}\' --dbhost=\'{2}\' "
|
||||||
.format(data['wo_db_name'],
|
.format(data['wo_db_name'],
|
||||||
wo_wp_prefix, data['wo_db_host']) +
|
wo_wp_prefix, data['wo_db_host']) +
|
||||||
"--dbuser=\'{0}\' --dbpass=\'{1}\' "
|
"--dbuser=\'{0}\' --dbpass= "
|
||||||
"--extra-php<<PHP \n {2} {3} {4} \nPHP\""
|
"--extra-php<<PHP \n {1} {2} {3} \nPHP\""
|
||||||
.format(data['wo_db_user'], data['wo_db_pass'],
|
.format(data['wo_db_user'],
|
||||||
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
"\ndefine(\'WPMU_ACCEL_REDIRECT\',"
|
||||||
" true);",
|
" true);",
|
||||||
"\ndefine(\'CONCATENATE_SCRIPTS\',"
|
"\ndefine(\'CONCATENATE_SCRIPTS\',"
|
||||||
@@ -462,19 +461,20 @@ def setupwordpress(self, data, vhostonly=False):
|
|||||||
Log.debug(self, "{0} --allow-root core install "
|
Log.debug(self, "{0} --allow-root core install "
|
||||||
.format(WOVar.wo_wpcli_path) +
|
.format(WOVar.wo_wpcli_path) +
|
||||||
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
|
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
|
||||||
.format(data['www_domain'], wo_wp_user) +
|
.format(data['site_name'], wo_wp_user) +
|
||||||
"--admin_password= --admin_email=\'{1}\'"
|
"--admin_password= --admin_email=\'{0}\'"
|
||||||
.format(wo_wp_pass, wo_wp_email))
|
.format(wo_wp_email))
|
||||||
try:
|
try:
|
||||||
if WOShellExec.cmd_exec(self, "{0} --allow-root core "
|
if WOShellExec.cmd_exec(
|
||||||
.format(WOVar.wo_wpcli_path) +
|
self, "{0} --allow-root core "
|
||||||
"install --url=\'{0}\' --title=\'{0}\' "
|
.format(WOVar.wo_wpcli_path) +
|
||||||
"--admin_name=\'{1}\' "
|
"install --url=\'{0}\' --title=\'{0}\' "
|
||||||
.format(data['www_domain'], wo_wp_user) +
|
"--admin_name=\'{1}\' "
|
||||||
"--admin_password=\'{0}\' "
|
.format(data['site_name'], wo_wp_user) +
|
||||||
"--admin_email=\'{1}\'"
|
"--admin_password=\'{0}\' "
|
||||||
.format(wo_wp_pass, wo_wp_email),
|
"--admin_email=\'{1}\'"
|
||||||
log=False):
|
.format(wo_wp_pass, wo_wp_email),
|
||||||
|
log=False):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise SiteError(
|
raise SiteError(
|
||||||
@@ -487,26 +487,27 @@ def setupwordpress(self, data, vhostonly=False):
|
|||||||
.format(WOVar.wo_wpcli_path) +
|
.format(WOVar.wo_wpcli_path) +
|
||||||
"core multisite-install "
|
"core multisite-install "
|
||||||
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
|
"--url=\'{0}\' --title=\'{0}\' --admin_name=\'{1}\' "
|
||||||
.format(data['www_domain'], wo_wp_user) +
|
.format(data['site_name'], wo_wp_user) +
|
||||||
"--admin_password= --admin_email=\'{1}\' "
|
"--admin_password= --admin_email=\'{0}\' "
|
||||||
"{subdomains}"
|
"{subdomains}"
|
||||||
.format(wo_wp_pass, wo_wp_email,
|
.format(wo_wp_email,
|
||||||
subdomains='--subdomains'
|
subdomains='--subdomains'
|
||||||
if not data['wpsubdir'] else ''))
|
if not data['wpsubdir'] else ''))
|
||||||
try:
|
try:
|
||||||
if WOShellExec.cmd_exec(self, "{0} --allow-root "
|
if WOShellExec.cmd_exec(
|
||||||
.format(WOVar.wo_wpcli_path) +
|
self, "{0} --allow-root "
|
||||||
"core multisite-install "
|
.format(WOVar.wo_wpcli_path) +
|
||||||
"--url=\'{0}\' --title=\'{0}\' "
|
"core multisite-install "
|
||||||
"--admin_name=\'{1}\' "
|
"--url=\'{0}\' --title=\'{0}\' "
|
||||||
.format(data['www_domain'], wo_wp_user) +
|
"--admin_name=\'{1}\' "
|
||||||
"--admin_password=\'{0}\' "
|
.format(data['site_name'], wo_wp_user) +
|
||||||
"--admin_email=\'{1}\' "
|
"--admin_password=\'{0}\' "
|
||||||
"{subdomains}"
|
"--admin_email=\'{1}\' "
|
||||||
.format(wo_wp_pass, wo_wp_email,
|
"{subdomains}"
|
||||||
subdomains='--subdomains'
|
.format(wo_wp_pass, wo_wp_email,
|
||||||
if not data['wpsubdir'] else ''),
|
subdomains='--subdomains'
|
||||||
log=False):
|
if not data['wpsubdir'] else ''),
|
||||||
|
log=False):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise SiteError(
|
raise SiteError(
|
||||||
@@ -1053,7 +1054,7 @@ def logwatch(self, logfiles):
|
|||||||
import zlib
|
import zlib
|
||||||
import base64
|
import base64
|
||||||
import time
|
import time
|
||||||
from wo.core import logwatch
|
from wo.core.logwatch import LogWatcher
|
||||||
|
|
||||||
def callback(filename, lines):
|
def callback(filename, lines):
|
||||||
for line in lines:
|
for line in lines:
|
||||||
@@ -1070,7 +1071,7 @@ def logwatch(self, logfiles):
|
|||||||
'caught exception rendering a new log line in %s'
|
'caught exception rendering a new log line in %s'
|
||||||
% filename)
|
% filename)
|
||||||
|
|
||||||
logl = logwatch.LogWatcher(logfiles, callback)
|
logl = LogWatcher(logfiles, callback)
|
||||||
logl.loop()
|
logl.loop()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -168,14 +168,14 @@ class WOStackController(CementBaseController):
|
|||||||
if WOAptGet.is_installed(self, 'nginx-plus'):
|
if WOAptGet.is_installed(self, 'nginx-plus'):
|
||||||
Log.info(self, "NGINX PLUS Detected ...")
|
Log.info(self, "NGINX PLUS Detected ...")
|
||||||
apt = ["nginx-plus"] + WOVar.wo_nginx
|
apt = ["nginx-plus"] + WOVar.wo_nginx
|
||||||
self.post_pref(apt, empty_packages)
|
post_pref(self, apt, empty_packages)
|
||||||
elif WOAptGet.is_installed(self, 'nginx'):
|
elif WOAptGet.is_installed(self, 'nginx'):
|
||||||
Log.info(self, "WordOps detected an already "
|
Log.info(self, "WordOps detected an already "
|
||||||
"installed nginx package."
|
"installed nginx package."
|
||||||
"It may or may not have "
|
"It may or may not have "
|
||||||
"required modules.\n")
|
"required modules.\n")
|
||||||
apt = ["nginx"] + WOVar.wo_nginx
|
apt = ["nginx"] + WOVar.wo_nginx
|
||||||
self.post_pref(apt, empty_packages)
|
post_pref(self, apt, empty_packages)
|
||||||
else:
|
else:
|
||||||
Log.debug(self, "Nginx already installed")
|
Log.debug(self, "Nginx already installed")
|
||||||
|
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ def pre_pref(self, apt_packages):
|
|||||||
mysql_pref_file.write(mysql_pref)
|
mysql_pref_file.write(mysql_pref)
|
||||||
WORepo.add(self, repo_url=WOVar.wo_mysql_repo)
|
WORepo.add(self, repo_url=WOVar.wo_mysql_repo)
|
||||||
WORepo.add_key(self, '0xcbcb082a1bb943db',
|
WORepo.add_key(self, '0xcbcb082a1bb943db',
|
||||||
keyserver='keys.gnupg.net')
|
keyserver='keyserver.ubuntu.com')
|
||||||
WORepo.add_key(self, '0xF1656F24C74CD1D8',
|
WORepo.add_key(self, '0xF1656F24C74CD1D8',
|
||||||
keyserver='keys.gnupg.net')
|
keyserver='keyserver.ubuntu.com')
|
||||||
if "mariadb-server" in apt_packages:
|
if "mariadb-server" in apt_packages:
|
||||||
# generate random 24 characters root password
|
# generate random 24 characters root password
|
||||||
chars = ''.join(random.sample(string.ascii_letters, 24))
|
chars = ''.join(random.sample(string.ascii_letters, 24))
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
if WOAptGet.is_installed(self, 'nginx-custom'):
|
if WOAptGet.is_installed(self, 'nginx-custom'):
|
||||||
apt_packages = apt_packages + WOVar.wo_nginx
|
apt_packages = apt_packages + WOVar.wo_nginx
|
||||||
else:
|
else:
|
||||||
if os.path.isfile(self, '/usr/sbin/nginx'):
|
if os.path.isfile('/usr/sbin/nginx'):
|
||||||
Log.info(self, "Updating Nginx templates")
|
Log.info(self, "Updating Nginx templates")
|
||||||
post_pref(self, WOVar.wo_nginx, [])
|
post_pref(self, WOVar.wo_nginx, [])
|
||||||
else:
|
else:
|
||||||
@@ -186,15 +186,14 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
self.app.args.print_help()
|
self.app.args.print_help()
|
||||||
else:
|
else:
|
||||||
if (apt_packages):
|
if (apt_packages):
|
||||||
if not (set(["php7.2-fpm"]).issubset(set(apt_packages)) and
|
if (("php7.2-fpm" not in apt_packages) and
|
||||||
set(["php7.3-fpm"]).issubset(set(apt_packages)) and
|
("php7.3-fpm" not in apt_packages) and
|
||||||
set(["nginx-custom",
|
("nginx-custom" not in apt_packages) and
|
||||||
"nginx-wo"]).issubset(set(apt_packages)) and
|
("mariadb-server" not in apt_packages)):
|
||||||
set(['mariadb-server']).issubset(set(apt_packages))):
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
Log.info(
|
Log.info(
|
||||||
self, "Your site may be down for few seconds if "
|
self, "Your sites may be down for few seconds if "
|
||||||
"you are upgrading Nginx, PHP-FPM, MariaDB or Redis")
|
"you are upgrading Nginx, PHP-FPM, MariaDB or Redis")
|
||||||
# Check prompt
|
# Check prompt
|
||||||
if ((not pargs.no_prompt) and (not pargs.force)):
|
if ((not pargs.no_prompt) and (not pargs.force)):
|
||||||
@@ -219,7 +218,6 @@ class WOStackUpgradeController(CementBaseController):
|
|||||||
# check if nginx upgrade is blocked
|
# check if nginx upgrade is blocked
|
||||||
if os.path.isfile(
|
if os.path.isfile(
|
||||||
'/etc/apt/preferences.d/nginx-block'):
|
'/etc/apt/preferences.d/nginx-block'):
|
||||||
apt_packages.remove(WOVar.wo_nginx)
|
|
||||||
post_pref(self, WOVar.wo_nginx, [], True)
|
post_pref(self, WOVar.wo_nginx, [], True)
|
||||||
# upgrade packages
|
# upgrade packages
|
||||||
WOAptGet.install(self, apt_packages)
|
WOAptGet.install(self, apt_packages)
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ http {
|
|||||||
ssl_session_cache shared:SSL:50m;
|
ssl_session_cache shared:SSL:50m;
|
||||||
ssl_session_tickets off;
|
ssl_session_tickets off;
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
|
ssl_early_data on;
|
||||||
{{#tls13}}ssl_ciphers 'TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+AESGCM:EECDH+CHACHA20';
|
{{#tls13}}ssl_ciphers 'TLS13+AESGCM+AES256:TLS13+AESGCM+AES128:TLS13+CHACHA20:EECDH+AESGCM:EECDH+CHACHA20';
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;{{/tls13}}
|
ssl_protocols TLSv1.2 TLSv1.3;{{/tls13}}
|
||||||
ssl_ecdh_curve X25519:P-521:P-384:P-256;
|
ssl_ecdh_curve X25519:P-521:P-384:P-256;
|
||||||
|
|||||||
@@ -27,3 +27,8 @@
|
|||||||
open_file_cache_min_uses 2;
|
open_file_cache_min_uses 2;
|
||||||
open_file_cache_valid 120s;
|
open_file_cache_valid 120s;
|
||||||
open_log_file_cache max=10000 inactive=30s min_uses=2;
|
open_log_file_cache max=10000 inactive=30s min_uses=2;
|
||||||
|
|
||||||
|
ssl_dyn_rec_size_hi 4229;
|
||||||
|
ssl_dyn_rec_size_lo 1369;
|
||||||
|
ssl_dyn_rec_threshold 40;
|
||||||
|
ssl_dyn_rec_timeout 1000;
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ class WORepo():
|
|||||||
Log.debug(self, "{0}".format(e))
|
Log.debug(self, "{0}".format(e))
|
||||||
Log.error(self, "Unable to add repo")
|
Log.error(self, "Unable to add repo")
|
||||||
if ppa is not None:
|
if ppa is not None:
|
||||||
WOShellExec.cmd_exec(
|
if WOShellExec.cmd_exec(
|
||||||
self, "LC_ALL=C.UTF-8 add-apt-repository -yu '{ppa_name}'"
|
self, "LC_ALL=C.UTF-8 add-apt-repository -yu '{ppa_name}'"
|
||||||
.format(ppa_name=ppa))
|
.format(ppa_name=ppa)):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def remove(self, ppa=None, repo_url=None):
|
def remove(self, ppa=None, repo_url=None):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -18,14 +18,22 @@ class WOAptGet():
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||||
proc = subprocess.Popen('apt-mirror-updater -u',
|
proc = subprocess.Popen(
|
||||||
shell=True,
|
'DEBIAN_FRONTEND=noninteractive apt-get update -qq '
|
||||||
stdin=None, stdout=f,
|
'--allow-releaseinfo-change',
|
||||||
stderr=subprocess.PIPE,
|
shell=True, stdin=None, stdout=f,
|
||||||
executable="/bin/bash")
|
stderr=subprocess.PIPE, executable="/bin/bash")
|
||||||
proc.wait()
|
proc.wait()
|
||||||
output, error_output = proc.communicate()
|
output, error_output = proc.communicate()
|
||||||
|
|
||||||
|
if "--allow-releaseinfo-change" in str(error_output):
|
||||||
|
proc = subprocess.Popen(
|
||||||
|
'DEBIAN_FRONTEND=noninteractive apt-get update -qq',
|
||||||
|
shell=True,
|
||||||
|
stdin=None, stdout=f, stderr=f,
|
||||||
|
executable="/bin/bash")
|
||||||
|
proc.wait()
|
||||||
|
output, error_output = proc.communicate()
|
||||||
# Check what is error in error_output
|
# Check what is error in error_output
|
||||||
if "NO_PUBKEY" in str(error_output):
|
if "NO_PUBKEY" in str(error_output):
|
||||||
# Split the output
|
# Split the output
|
||||||
@@ -39,10 +47,11 @@ class WOAptGet():
|
|||||||
WORepo.add_key(
|
WORepo.add_key(
|
||||||
self, key, keyserver="hkp://pgp.mit.edu")
|
self, key, keyserver="hkp://pgp.mit.edu")
|
||||||
|
|
||||||
proc = subprocess.Popen('apt-get update',
|
proc = subprocess.Popen(
|
||||||
shell=True,
|
'DEBIAN_FRONTEND=noninteractive apt-get update -qq',
|
||||||
stdin=None, stdout=f, stderr=f,
|
shell=True,
|
||||||
executable="/bin/bash")
|
stdin=None, stdout=f, stderr=f,
|
||||||
|
executable="/bin/bash")
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
@@ -83,18 +92,16 @@ class WOAptGet():
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||||
proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive "
|
proc = subprocess.Popen(
|
||||||
"apt-get dist-upgrade "
|
"DEBIAN_FRONTEND=noninteractive "
|
||||||
"--option=Dpkg::options::="
|
"apt-get "
|
||||||
"--force-confdef "
|
"--option=Dpkg::options::=--force-confdef "
|
||||||
"--option=Dpkg::options::="
|
"--option=Dpkg::options::=--force-unsafe-io "
|
||||||
"--force-unsafe-io "
|
"--option=Dpkg::options::=--force-confold "
|
||||||
"--option=Dpkg::options::="
|
"--assume-yes --quiet dist-upgrade",
|
||||||
"--force-confold "
|
shell=True, stdin=None,
|
||||||
"--assume-yes --quiet ",
|
stdout=f, stderr=f,
|
||||||
shell=True, stdin=None,
|
executable="/bin/bash")
|
||||||
stdout=f, stderr=f,
|
|
||||||
executable="/bin/bash")
|
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
@@ -114,17 +121,15 @@ class WOAptGet():
|
|||||||
all_packages = ' '.join(packages)
|
all_packages = ' '.join(packages)
|
||||||
try:
|
try:
|
||||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||||
proc = subprocess.Popen("DEBIAN_FRONTEND=noninteractive "
|
proc = subprocess.Popen(
|
||||||
"apt-get install "
|
"DEBIAN_FRONTEND=noninteractive "
|
||||||
"--option=Dpkg::options::="
|
"apt-get install "
|
||||||
"--force-confdef "
|
"--option=Dpkg::options::=--force-confdef "
|
||||||
"--option=Dpkg::options::="
|
"--option=Dpkg::options::=--force-confold "
|
||||||
"--force-confold "
|
"--assume-yes --allow-unauthenticated {0}"
|
||||||
"--assume-yes "
|
.format(all_packages), shell=True,
|
||||||
"--allow-unauthenticated {0}"
|
stdin=None, stdout=f, stderr=f,
|
||||||
.format(all_packages), shell=True,
|
executable="/bin/bash")
|
||||||
stdin=None, stdout=f, stderr=f,
|
|
||||||
executable="/bin/bash")
|
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
@@ -149,19 +154,19 @@ class WOAptGet():
|
|||||||
try:
|
try:
|
||||||
with open('/var/log/wo/wordops.log', 'a') as f:
|
with open('/var/log/wo/wordops.log', 'a') as f:
|
||||||
if purge:
|
if purge:
|
||||||
proc = subprocess.Popen('DEBIAN_FRONTEND=noninteractive '
|
proc = subprocess.Popen(
|
||||||
'apt-get autoremove --purge '
|
'DEBIAN_FRONTEND=noninteractive '
|
||||||
'-qq {0}'
|
'apt-get autoremove --purge -qq {0}'
|
||||||
.format(all_packages), shell=True,
|
.format(all_packages), shell=True,
|
||||||
stdin=None, stdout=f, stderr=f,
|
stdin=None, stdout=f, stderr=f,
|
||||||
executable="/bin/bash")
|
executable="/bin/bash")
|
||||||
else:
|
else:
|
||||||
proc = subprocess.Popen('DEBIAN_FRONTEND=noninteractive '
|
proc = subprocess.Popen(
|
||||||
'apt-get autoremove '
|
'DEBIAN_FRONTEND=noninteractive '
|
||||||
'-qq {0}'
|
'apt-get autoremove -qq {0}'
|
||||||
.format(all_packages), shell=True,
|
.format(all_packages), shell=True,
|
||||||
stdin=None, stdout=f, stderr=f,
|
stdin=None, stdout=f, stderr=f,
|
||||||
executable="/bin/bash")
|
executable="/bin/bash")
|
||||||
proc.wait()
|
proc.wait()
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
return True
|
return True
|
||||||
@@ -228,16 +233,18 @@ class WOAptGet():
|
|||||||
WORepo.add(self, repo_url=repo_url)
|
WORepo.add(self, repo_url=repo_url)
|
||||||
if repo_key is not None:
|
if repo_key is not None:
|
||||||
WORepo.add_key(self, repo_key)
|
WORepo.add_key(self, repo_key)
|
||||||
proc = subprocess.Popen("apt-get update && "
|
proc = subprocess.Popen(
|
||||||
"DEBIAN_FRONTEND=noninteractive "
|
"DEBIAN_FRONTEND=noninteractive apt-get update "
|
||||||
"apt-get install -o "
|
"-qq && "
|
||||||
"Dpkg::Options::=\"--force-confdef\""
|
"DEBIAN_FRONTEND=noninteractive "
|
||||||
" -o "
|
"apt-get install -o "
|
||||||
"Dpkg::Options::=\"--force-confold\""
|
"Dpkg::Options::=\"--force-confdef\""
|
||||||
" -y --download-only {0}"
|
" -o "
|
||||||
.format(packages), shell=True,
|
"Dpkg::Options::=\"--force-confold\""
|
||||||
stdin=None, stdout=f, stderr=f,
|
" -y --download-only {0}"
|
||||||
executable="/bin/bash")
|
.format(packages), shell=True,
|
||||||
|
stdin=None, stdout=f, stderr=f,
|
||||||
|
executable="/bin/bash")
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ class WODomain():
|
|||||||
final_domain = ''
|
final_domain = ''
|
||||||
if www_domain_name[0] == 'www':
|
if www_domain_name[0] == 'www':
|
||||||
final_domain = '.'.join(www_domain_name[1:])
|
final_domain = '.'.join(www_domain_name[1:])
|
||||||
else:
|
return final_domain
|
||||||
final_domain = domain_name
|
return domain_name
|
||||||
|
|
||||||
|
|
||||||
return final_domain
|
|
||||||
|
|
||||||
def getlevel(self, domain):
|
def getlevel(self, domain):
|
||||||
"""
|
"""
|
||||||
@@ -37,16 +37,17 @@ class WODomain():
|
|||||||
if os.path.isfile("/var/lib/wo/public_suffix_list.dat"):
|
if os.path.isfile("/var/lib/wo/public_suffix_list.dat"):
|
||||||
# Read mode opens a file for reading only.
|
# Read mode opens a file for reading only.
|
||||||
suffix_file = open(
|
suffix_file = open(
|
||||||
"/var/lib/wo/public_suffix_list.dat", encoding='utf-8', )
|
"/var/lib/wo/public_suffix_list.dat", encoding='utf-8')
|
||||||
# Read all the lines into a list.
|
# Read all the lines into a list.
|
||||||
for domain_suffix in suffix_file:
|
for domain_suffix in suffix_file:
|
||||||
if (str(domain_suffix).strip()) == ('.'.join(domain_name[1:])):
|
if (str(domain_suffix).strip()) == ('.'.join(domain_name[1:])):
|
||||||
domain_type = 'domain'
|
domain_type = 'domain'
|
||||||
root_domain = ('.'.join(domain_name[0:]))
|
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
domain_type = 'subdomain'
|
domain_type = 'subdomain'
|
||||||
root_domain = ('.'.join(domain_name[1:]))
|
|
||||||
suffix_file.close()
|
suffix_file.close()
|
||||||
return (domain_type, root_domain)
|
if domain_type == 'domain':
|
||||||
return ('other', domain)
|
root_domain = ('.'.join(domain_name[0:]))
|
||||||
|
else:
|
||||||
|
root_domain = ('.'.join(domain_name[1:]))
|
||||||
|
return (domain_type, root_domain)
|
||||||
|
|||||||
@@ -5,8 +5,14 @@ import string
|
|||||||
class RANDOM:
|
class RANDOM:
|
||||||
"""Random strings generator"""
|
"""Random strings generator"""
|
||||||
|
|
||||||
def gen(self, length='24'):
|
def long(self):
|
||||||
|
long_random = ''.join([random.choice
|
||||||
|
(string.ascii_letters + string.digits)
|
||||||
|
for n in range(24)])
|
||||||
|
return long_random
|
||||||
|
|
||||||
|
def short(self):
|
||||||
short_random = ''.join([random.choice
|
short_random = ''.join([random.choice
|
||||||
(string.ascii_letters + string.digits)
|
(string.ascii_letters + string.digits)
|
||||||
for n in range(length)])
|
for n in range(24)])
|
||||||
return short_random
|
return short_random
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ class WOShellExec():
|
|||||||
stderr=subprocess.PIPE, shell=True) as proc:
|
stderr=subprocess.PIPE, shell=True) as proc:
|
||||||
(cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate()
|
(cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate()
|
||||||
(cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8',
|
(cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8',
|
||||||
"replace"),
|
"replace"),
|
||||||
cmd_stderr_bytes.decode('utf-8',
|
cmd_stderr_bytes.decode('utf-8',
|
||||||
"replace"))
|
"replace"))
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
||||||
@@ -60,9 +60,9 @@ class WOShellExec():
|
|||||||
stderr=subprocess.PIPE, shell=True) as proc:
|
stderr=subprocess.PIPE, shell=True) as proc:
|
||||||
(cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate()
|
(cmd_stdout_bytes, cmd_stderr_bytes) = proc.communicate()
|
||||||
(cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8',
|
(cmd_stdout, cmd_stderr) = (cmd_stdout_bytes.decode('utf-8',
|
||||||
"replace"),
|
"replace"),
|
||||||
cmd_stderr_bytes.decode('utf-8',
|
cmd_stderr_bytes.decode('utf-8',
|
||||||
"replace"))
|
"replace"))
|
||||||
|
|
||||||
if proc.returncode == 0:
|
if proc.returncode == 0:
|
||||||
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
Log.debug(self, "Command Output: {0}, \nCommand Error: {1}"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Render Templates
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class WOTemplate():
|
class WOTemplate:
|
||||||
"""WordOps template utilities"""
|
"""WordOps template utilities"""
|
||||||
|
|
||||||
def deploy(self, fileconf, template, data, overwrite=True):
|
def deploy(self, fileconf, template, data, overwrite=True):
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class WOVar():
|
|||||||
"""Intialization of core variables"""
|
"""Intialization of core variables"""
|
||||||
|
|
||||||
# WordOps version
|
# WordOps version
|
||||||
wo_version = "3.9.9.2"
|
wo_version = "3.9.9.3"
|
||||||
# WordOps packages versions
|
# WordOps packages versions
|
||||||
wo_wp_cli = "2.3.0"
|
wo_wp_cli = "2.3.0"
|
||||||
wo_adminer = "4.7.3"
|
wo_adminer = "4.7.3"
|
||||||
@@ -140,21 +140,20 @@ class WOVar():
|
|||||||
wo_php_extra = ["php-memcached", "php-imagick",
|
wo_php_extra = ["php-memcached", "php-imagick",
|
||||||
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
||||||
|
|
||||||
if not wo_distro == 'raspbian':
|
wo_mysql = ["mariadb-server", "percona-toolkit"]
|
||||||
if (not wo_platform_codename == 'jessie'):
|
if wo_distro == 'raspbian':
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
wo_mysql = wo_mysql + ["python3-mysqldb"]
|
||||||
"python3-mysqldb", "mariadb-backup"]
|
else:
|
||||||
|
if wo_platform_codename == 'jessie':
|
||||||
|
wo_mysql = wo_mysql + ["python3-mysql.connector"]
|
||||||
else:
|
else:
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
wo_mysql = wo_mysql + ["python3-mysqldb", "mariadb-backup"]
|
||||||
"python3-mysql.connector"]
|
|
||||||
else:
|
|
||||||
wo_mysql = ["mariadb-server", "percona-toolkit",
|
|
||||||
"python3-mysqldb"]
|
|
||||||
|
|
||||||
|
wo_mysql_client = ["mariadb-client"]
|
||||||
if wo_platform_codename == 'jessie':
|
if wo_platform_codename == 'jessie':
|
||||||
wo_mysql_client = ["mariadb-client", "python3-mysqldb"]
|
wo_mysql_client = wo_mysql_client + ["python3-mysqldb"]
|
||||||
else:
|
else:
|
||||||
wo_mysql_client = ["mariadb-client", "python3-mysql.connector"]
|
wo_mysql_client = wo_mysql_client + ["python3-mysql.connector"]
|
||||||
|
|
||||||
wo_fail2ban = ["fail2ban"]
|
wo_fail2ban = ["fail2ban"]
|
||||||
wo_clamav = ["clamav", "clamav-freshclam"]
|
wo_clamav = ["clamav", "clamav-freshclam"]
|
||||||
@@ -165,7 +164,7 @@ class WOVar():
|
|||||||
wo_redis_repo = ("ppa:chris-lea/redis-server")
|
wo_redis_repo = ("ppa:chris-lea/redis-server")
|
||||||
wo_goaccess_repo = ("ppa:alex-p/goaccess")
|
wo_goaccess_repo = ("ppa:alex-p/goaccess")
|
||||||
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
||||||
"http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
||||||
"10.3/ubuntu {codename} main"
|
"10.3/ubuntu {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
|
|
||||||
@@ -177,7 +176,7 @@ class WOVar():
|
|||||||
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
wo_mysql_repo = ("deb [arch=amd64,ppc64el] "
|
||||||
"http://sfo1.mirrors.digitalocean.com/mariadb/repo/"
|
"http://mariadb.mirrors.ovh.net/MariaDB/repo/"
|
||||||
"10.3/debian {codename} main"
|
"10.3/debian {codename} main"
|
||||||
.format(codename=wo_platform_codename))
|
.format(codename=wo_platform_codename))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user