Fixes to the installation and Python installers

This commit is contained in:
jeroenlaylo
2018-12-05 18:25:45 +01:00
parent fe263de838
commit 02cb6b7d73
2 changed files with 38 additions and 36 deletions

62
install
View File

@@ -66,7 +66,7 @@ fi
wo_branch=$1
migration=0
readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.2"
readonly wo_version_new="3.9.2.3"
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}')
@@ -111,9 +111,9 @@ fi
function 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 postfix pigz || wo_lib_error "There was an error during dependency installation, exit status " 1
apt-get -y install build-essential curl gzip python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz || wo_lib_error "There was an error during dependency installation, exit status " 1
elif [ "$wo_linux_distro" == "Debian" ]; then
apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python-setuptools python3-dev sqlite3 git tar software-properties-common postfix pigz || wo_lib_error "There was an error during dependency installation, exit status " 1
apt-get -y install build-essential curl gzip dirmngr python3 python3-apt python3-setuptools python3-dev sqlite3 git tar software-properties-common pigz || wo_lib_error "There was an error during dependency installation, exit status " 1
fi
locale-gen en &>> /dev/null
@@ -143,7 +143,7 @@ function wo_sync_db()
###
# Clean WO installation
###
elif [ ! -f /var/lib/wo/dbase.db ]; then
elif [ ! -d /var/lib/wo ]; then
# Create the directory holding the WordOps database
mkdir -p /var/lib/wo
@@ -254,11 +254,11 @@ function wo_sync_db()
# Copy the previous upstream.conf
cp /etc/nginx/conf.d/upstream.conf /etc/nginx/conf.d/upstream.bak
# Replace the ports for PHP 7.2
sed -i "s/9000/9072/" /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i "s/9070/9072/" /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i 's/9000/9072/g' /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i 's/9070/9072/g' /etc/nginx/conf.d/upstream.conf &>> /dev/null
# Replace the ports for debug PHP 7.2
sed -i "s/9001/9172/" /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i "s/9170/9172/" /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i 's/9001/9172/g' /etc/nginx/conf.d/upstream.conf &>> /dev/null
sed -i 's/9170/9172/g' /etc/nginx/conf.d/upstream.conf &>> /dev/null
fi
echo "UPDATE sites SET php_version = REPLACE(php_version, '5.6', '7.2');" | sqlite3 /var/lib/wo/dbase.db
@@ -342,10 +342,10 @@ if [ -f /etc/nginx/fastcgi_params ]
then
cat /etc/nginx/fastcgi_params| grep -q 'HTTP_PROXY'
if [[ $? -ne 0 ]]; then
echo "fastcgi_param HTTP_PROXY \"\";" >> /etc/nginx/fastcgi_params
echo "fastcgi_param HTTP_PROXY \"\";" >> /etc/nginx/fastcgi_params
echo "fastcgi_param HTTP_PROXY \"\";" >> /etc/nginx/fastcgi.conf
service nginx restart &>> /dev/null
fi
fi
fi
if [ -f /etc/ImageMagick/policy.xml ]
@@ -407,13 +407,13 @@ if [ -f /etc/ImageMagick/policy.xml ]
fi
dpkg --get-selections | grep -v deinstall | grep nginx-common
if [ $? -eq 0 ]; then
apt-get update
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
if [ $? -eq 0 ]; then
apt-get update
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
if [ $? -eq 0 ]; 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
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
@@ -435,13 +435,13 @@ if [ -f /etc/ImageMagick/policy.xml ]
fi
dpkg --get-selections | grep -v deinstall | grep nginx-common
if [ $? -eq 0 ]; then
apt-get update
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
if [ $? -eq 0 ]; then
apt-get update
dpkg --get-selections | grep -v deinstall | grep nginx-mainline
if [ $? -eq 0 ]; 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
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
@@ -566,10 +566,10 @@ if [ -f /etc/ImageMagick/policy.xml ]
# 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;/' /etc/nginx/nginx.conf
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;/' /etc/nginx/nginx.conf
sed -i 's/TLSv1 TLSv1.1 TLSv1.2;/TLSv1.2;/g' /etc/nginx/nginx.conf
fi
fi
@@ -634,36 +634,30 @@ function wo_git_init()
}
# Update WordOps
if [ ! -f /usr/local/bin/wo ]; then
wo_lib_echo "Installing depedencies" | tee -ai $wo_install_log
wo_install_dep | tee -ai $wo_install_log
wo_lib_echo "Installing WordOps $wo_branch" | tee -ai $wo_install_log
secure_wo_db | tee -ai $WO_INSTALL_LOG
wo_install | tee -ai $wo_install_log
wo_update_latest | tee -ai $wo_install_log
wo_lib_echo "Running post-install steps" | tee -ai $wo_install_log
wo_sync_db 2&>>1 $WO_INSTALL_LOG
secure_wo_db | tee -ai $EE_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
ln -sf /usr/local/bin/wo /usr/local/sbin/ee
else
wo -v 2>&1 | grep $wo_version_new &>> /dev/null
ee -v 2>&1 | grep $wo_version_new &>> /dev/null
if [[ $? -ne 0 ]];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 2&>>1 $WO_INSTALL_LOG
secure_wo_db | tee -ai $WO_INSTALL_LOG
wo_sync_db 2&>>1 $EE_INSTALL_LOG
secure_wo_db | tee -ai $EE_INSTALL_LOG
wo_upgrade_php | tee -ai $wo_install_log
wo_install | tee -ai $wo_install_log
wo_update_latest | 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
ln -sf /usr/local/bin/wo /usr/local/sbin/ee
else
wo_lib_error "Not updating WordOps to $wo_version_new, exit status = " 1
fi
@@ -691,6 +685,4 @@ else
echo
wo_lib_echo "Yay! WordOps (wo) installed/updated successfully"
wo_lib_echo "WordOps (wo) help: https://wordops.org/docs"
fi
V
fi

View File

@@ -12,7 +12,7 @@ class WOVariables():
"""Intialization of core variables"""
# WordOps version
wo_version = "3.9.1"
wo_version = "3.9.2"
# WordOps packages versions
wo_wp_cli = "2.0.1"
wo_adminer = "4.6.3"
@@ -104,6 +104,10 @@ class WOVariables():
if wo_platform_distro == 'ubuntu':
if (wo_platform_codename == 'trusty' or wo_platform_codename == 'xenial' or wo_platform_codename == 'bionic'):
wo_php_repo = "ppa:ondrej/php"
wo_php = ["php7.2-fpm", "php-sodium", "php7.2-curl", "php7.2-gd", "php7.2-imap",
"php7.2-readline", "php7.2-common", "php7.2-recode",
"php7.2-cli", "php7.2-mbstring",
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache", "php7.2-zip", "php7.2-xml", "php7.2-soap"]
wo_php72 = ["php7.2-fpm", "php-sodium", "php7.2-curl", "php7.2-gd", "php7.2-imap",
"php7.2-readline", "php7.2-common", "php7.2-recode",
"php7.2-cli", "php7.2-mbstring",
@@ -112,6 +116,12 @@ class WOVariables():
"graphviz", "php-pear", "php-xdebug", "php-msgpack", "php-redis"]
elif wo_platform_distro == 'debian':
wo_php_repo = ("deb http://packages.dotdeb.org {codename} all".format(codename=wo_platform_codename))
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
"php-sodium", "php7.2-common", "php7.2-readline", "php7.2-redis",
"php7.2-mysql", "php7.2-cli", "php7.2-memcache", "php7.2-imagick",
"php7.2-mbstring", "php7.2-recode", "php7.2-bcmath", "php7.2-opcache", "php7.2-zip", "php7.2-xml",
"php7.2-soap", "php7.2-msgpack",
"memcached", "graphviz", "php-pear", "php7.2-xdebug"]
wo_php72 = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
"php-sodium", "php7.2-common", "php7.2-readline", "php7.2-redis",
"php7.2-mysql", "php7.2-cli", "php7.2-memcache", "php7.2-imagick",