Revert Commit

This commit is contained in:
VirtuBox
2019-08-15 17:19:52 +02:00
parent aa10b89b6b
commit cdb195bd03
5 changed files with 73 additions and 17 deletions

View File

@@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased]
### v3.9.7.3 - 2019-08-15
#### Added
- Allow web browser caching for json and webmanifest files
@@ -17,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- WP-Rocket support with the flag `--wprocket`
- Install unattended-upgrade and enable automated security updates
- Enable time synchronization with ntp
- Additional cache exception for woocommerce
#### Changed

60
install
View File

@@ -10,7 +10,7 @@
# Version 3.9.7.2 - 2019-08-12
# -------------------------------------------------------------------------
readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.7.2"
readonly wo_version_new="3.9.7.3"
# CONTENTS
# ---
# 1. VARIABLES AND DECLARATIONS
@@ -124,11 +124,11 @@ readonly wo_install_log=/var/log/wo/install.log
readonly wo_linux_distro=$(lsb_release -is)
readonly wo_distro_version=$(lsb_release -sc)
readonly wo_distro_id=$(lsb_release -rs)
TIME_FORMAT='%d-%b-%Y-%H%M%S'
TIME=$(date +"$TIME_FORMAT")
NGINX_BACKUP_FILE="/var/lib/wo-backup/nginx-backup.$TIME.tar.gz"
EE_BACKUP_FILE="/var/lib/wo-backup/ee-backup.$TIME.tar.gz"
WO_BACKUP_FILE="/var/lib/wo-backup/wo-backup.$TIME.tar.gz"
readonly TIME_FORMAT='%d-%b-%Y-%H%M%S'
readonly TIME=$(date +"$TIME_FORMAT")
readonly NGINX_BACKUP_FILE="/var/lib/wo-backup/nginx-backup.$TIME.tar.gz"
readonly EE_BACKUP_FILE="/var/lib/wo-backup/ee-backup.$TIME.tar.gz"
readonly WO_BACKUP_FILE="/var/lib/wo-backup/wo-backup.$TIME.tar.gz"
WO_ARCH="$(uname -m)"
if [ -x /usr/local/bin/ee ]; then
@@ -183,13 +183,13 @@ wo_install_dep() {
if [ "$wo_linux_distro" == "Ubuntu" ]; then
# install dependencies
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-requests python3-dev sqlite3 git tar software-properties-common pigz \
gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
build-essential curl gzip python3 python3-apt python3-setuptools python3-requests python3-dev sqlite3 git tar software-properties-common pigz \
gnupg2 cron ccze rsync tree haveged ufw unattended-upgrades tzdata ntp > /dev/null 2>&1
else
# install dependencies
apt-get -option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold --assume-yes install \
build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-requests 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
build-essential curl gzip dirmngr sudo python3 python3-apt python3-setuptools python3-requests 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
# add php repository gpg key
[ -d /etc/apt/trusted.gpg.d ] && { wget -qO /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg; }
# add nginx repository gpg key
@@ -696,6 +696,46 @@ wo_uninstall() {
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 >> /var/log/wo/install.log 2>&1
}
wo_ufw_setup() {
CURRENT_SSH_PORT=$(grep "Port" /etc/ssh/sshd_config | awk -F " " '{print $2}')
if [ ! -d /etc/ufw ]; then
apt-get install ufw -y
fi
# define firewall rules
ufw logging low
ufw default allow outgoing
ufw default deny incoming
# default ssh port
ufw allow 22
# custom ssh port
if [ "$CURRENT_SSH_PORT" != "22" ]; then
ufw allow "$CURRENT_SSH_PORT"
fi
# dns
ufw allow 53
# nginx
ufw allow http
ufw allow https
# ntp
ufw allow 123
# wordops backend
ufw allow 22222
# enable ufw
echo "y" | ufw enable
} >> $wo_install_log
###
# 4 - WO MAIN SETUP
###

View File

@@ -9,9 +9,10 @@ import shutil
conf = []
templates = []
long_description = '''WordOps is the commandline tool to manage your
Websites based on WordPress and Nginx with easy to use
commands'''
long_description = '''WordOps An essential toolset that eases WordPress
site and server administration. It provide the ability
to Install a high performance WordPress stack
with a few keystrokes'''
for name in glob.glob('config/plugins.d/*.conf'):
conf.insert(1, name)
@@ -56,7 +57,7 @@ if not os.path.isfile('/root/.gitconfig'):
shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
setup(name='wo',
version='3.9.7.2',
version='3.9.7.3',
description=long_description,
long_description=long_description,
classifiers=[],

View File

@@ -593,6 +593,19 @@ def post_pref(self, apt_packages, packages):
else:
WOService.restart_service(self, 'nginx')
# add rule for Nginx with UFW
if WOAptGet.is_installed(self, 'ufw'):
try:
WOShellExec.cmd_exec(self, "/usr/bin/ufw allow "
"http")
WOShellExec.cmd_exec(self, "/usr/bin/ufw allow "
"https")
WOShellExec.cmd_exec(self, "/usr/bin/ufw allow "
"22222")
except CommandExecutionError as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to add UFW rule")
# create nginx configuration for redis
if set(WOVariables.wo_redis).issubset(set(apt_packages)):
if os.path.isdir('/etc/nginx/common'):
@@ -1070,7 +1083,6 @@ def post_pref(self, apt_packages, packages):
comment='MySQL optimization cronjob '
'added by WordOps')
WOGit.add(self, ["/etc/mysql"], msg="Adding MySQL into Git")
WOService.restart_service(self, 'mysql')
# create fail2ban configuration files
if set(WOVariables.wo_fail2ban).issubset(set(apt_packages)):
@@ -1166,7 +1178,7 @@ def post_pref(self, apt_packages, packages):
# add rule for proftpd with UFW
if WOAptGet.is_installed(self, 'ufw'):
try:
WOShellExec.cmd_exec(self, "ufw allow "
WOShellExec.cmd_exec(self, "/usr/bin/ufw allow "
"49000:50000/tcp")
except CommandExecutionError as e:
Log.debug(self, "{0}".format(e))

View File

@@ -10,7 +10,7 @@ class WOVariables():
"""Intialization of core variables"""
# WordOps version
wo_version = "3.9.7.2"
wo_version = "3.9.7.3"
# WordOps packages versions
wo_wp_cli = "2.2.0"
wo_adminer = "4.7.2"