last modification to install script
This commit is contained in:
@@ -28,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
- Support for Netdata on backend : https://server.hostname:22222/netdata/
|
- Support for Netdata on backend : https://server.hostname:22222/netdata/
|
||||||
- New Stacks : composer and netdata
|
- New Stacks : composer and netdata
|
||||||
- additional argument for letsencrypt : --hsts
|
- additional argument for letsencrypt : --hsts
|
||||||
- wo.sh installer downloader script
|
- refactor install script
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
|
|||||||
67
install
67
install
@@ -7,10 +7,10 @@
|
|||||||
# Copyright (c) 2019 - WordOps
|
# Copyright (c) 2019 - WordOps
|
||||||
# This script is licensed under M.I.T
|
# This script is licensed under M.I.T
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
# Version 3.9.5 - 2019-04-05
|
# Version 3.9.5 - 2019-04-10
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
readonly wo_version_old="2.2.3"
|
readonly wo_version_old="2.2.3"
|
||||||
readonly wo_version_new="3.9.4.4"
|
readonly wo_version_new="3.9.4.5"
|
||||||
# CONTENTS
|
# CONTENTS
|
||||||
# ---
|
# ---
|
||||||
# 1. VARIABLES AND DECLARATIONS
|
# 1. VARIABLES AND DECLARATIONS
|
||||||
@@ -81,11 +81,6 @@ fi
|
|||||||
###
|
###
|
||||||
# 1 - Define variables for later use
|
# 1 - Define variables for later use
|
||||||
###
|
###
|
||||||
if [ -n "$1" ]; then
|
|
||||||
wo_branch="$1"
|
|
||||||
else
|
|
||||||
wo_branch="master"
|
|
||||||
fi
|
|
||||||
readonly wo_log_dir=/var/log/wo/
|
readonly wo_log_dir=/var/log/wo/
|
||||||
readonly wo_backup_dir=/var/lib/wo-backup/
|
readonly wo_backup_dir=/var/lib/wo-backup/
|
||||||
readonly wo_install_log=/var/log/wo/install.log
|
readonly wo_install_log=/var/log/wo/install.log
|
||||||
@@ -99,9 +94,9 @@ EE_BACKUP_FILE="/var/lib/wo-backup/ee-backup.$TIME.tar.gz"
|
|||||||
WO_BACKUP_FILE="/var/lib/wo-backup/wo-backup.$TIME.tar.gz"
|
WO_BACKUP_FILE="/var/lib/wo-backup/wo-backup.$TIME.tar.gz"
|
||||||
|
|
||||||
if [ -x /usr/local/bin/ee ]; then
|
if [ -x /usr/local/bin/ee ]; then
|
||||||
migration=1
|
ee_migration=1
|
||||||
else
|
elif [ -x /usr/local/bin/wo ]; then
|
||||||
migration=0
|
wo_upgrade=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -158,20 +153,20 @@ wo_install_dep() {
|
|||||||
locale-gen en
|
locale-gen en
|
||||||
} >> "$wo_install_log" 2>&1
|
} >> "$wo_install_log" 2>&1
|
||||||
# Support PFS
|
# Support PFS
|
||||||
if [ -f /etc/nginx/nginx.conf ]; then
|
# if [ -f /etc/nginx/nginx.conf ]; then
|
||||||
# Replace previous ciphers
|
# # Replace previous ciphers
|
||||||
new_ciphers="EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES"
|
# new_ciphers="EECDH+CHACHA20:EECDH+AESGCM:EECDH+AES"
|
||||||
sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$new_ciphers\";/" /etc/nginx/nginx.conf
|
# sed -i "s/ssl_ciphers\ \(\"\|.\|'\)\(.*\)\(\"\|.\|'\);/ssl_ciphers \"$new_ciphers\";/" /etc/nginx/nginx.conf
|
||||||
# Change the TLS protocols
|
# # Change the TLS protocols
|
||||||
sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf
|
# sed -i "s/ssl_protocols\ \(.*\);/ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
# Let's Encrypt .well-known folder setup
|
# # Let's Encrypt .well-known folder setup
|
||||||
if [ ! -d /var/www/html/.well-known/acme-challenge ]; then
|
# if [ ! -d /var/www/html/.well-known/acme-challenge ]; then
|
||||||
mkdir -p /var/www/html/.well-known/acme-challenge
|
# mkdir -p /var/www/html/.well-known/acme-challenge
|
||||||
chown -R www-data:www-data /var/www/html /var/www/html/.well-known
|
# chown -R www-data:www-data /var/www/html /var/www/html/.well-known
|
||||||
chmod 750 /var/www/html /var/www/html/.well-known
|
# chmod 750 /var/www/html /var/www/html/.well-known
|
||||||
fi
|
# fi
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
@@ -382,7 +377,6 @@ wo_install_acme_sh() {
|
|||||||
# Now, finally, let's install WordOps
|
# Now, finally, let's install WordOps
|
||||||
wo_install() {
|
wo_install() {
|
||||||
{
|
{
|
||||||
|
|
||||||
cd /tmp/WordOps || exit 1
|
cd /tmp/WordOps || exit 1
|
||||||
} >> "$wo_install_log" 2>&1
|
} >> "$wo_install_log" 2>&1
|
||||||
python3 setup.py install
|
python3 setup.py install
|
||||||
@@ -687,22 +681,19 @@ fi
|
|||||||
|
|
||||||
wo sync | tee -ai $wo_install_log
|
wo sync | tee -ai $wo_install_log
|
||||||
|
|
||||||
if [ "$migration" -eq "1" ]; then
|
if [ "$ee_migration" -eq "1" ]; then
|
||||||
echo
|
echo
|
||||||
wo_lib_echo "The migration from EasyEngine to WordOps was succesfull!"
|
wo_lib_echo "The migration from EasyEngine to WordOps was succesfull!"
|
||||||
wo_lib_echo "The EasyEngine backup files can be found in /var/lib/wo-backup/ee-backup.tgz"
|
wo_lib_echo "The EasyEngine backup files can be found in /var/lib/wo-backup/ee-backup.tgz"
|
||||||
echo
|
echo
|
||||||
wo_lib_echo_info "For autocompletion, run the following command:"
|
elif [ "$wo_upgrade" = "1" ]; then
|
||||||
wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc"
|
wo_lib_echo "WordOps (wo) upgrade to $wo_version_new was succesfull!"
|
||||||
echo
|
else
|
||||||
wo_lib_echo "WordOps Documentation : https://docs.wordops.net"
|
wo_lib_echo "WordOps (wo) installed successfully"
|
||||||
wo_lib_echo "WordOps Community Forum : https://community.wordops.net"
|
|
||||||
echo
|
|
||||||
wo_lib_echo "For WordOps (wo) auto completion, run the following command"
|
|
||||||
echo
|
|
||||||
wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc"
|
|
||||||
echo
|
|
||||||
wo_lib_echo "Yay! WordOps (wo) installed/updated successfully"
|
|
||||||
wo_lib_echo "WordOps Documentation : https://docs.wordops.net"
|
|
||||||
wo_lib_echo "WordOps Community Forum : https://community.wordops.net"
|
|
||||||
fi
|
fi
|
||||||
|
wo_lib_echo_info "For autocompletion, run the following command:"
|
||||||
|
wo_lib_echo_info "source /etc/bash_completion.d/wo_auto.rc"
|
||||||
|
echo
|
||||||
|
wo_lib_echo "WordOps Documentation : https://docs.wordops.net"
|
||||||
|
wo_lib_echo "WordOps Community Forum : https://community.wordops.net"
|
||||||
|
echo
|
||||||
|
|||||||
15
wo.sh
15
wo.sh
@@ -19,24 +19,29 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check if git is installed
|
||||||
[ -z "$(command -v git)" ] && {
|
[ -z "$(command -v git)" ] && {
|
||||||
apt-get update -qq && apt-get install git -qq
|
apt-get update -qq && apt-get install git -qq
|
||||||
} > /dev/null 2>&1
|
} > /dev/null 2>&1
|
||||||
|
|
||||||
if [ "${#}" = "0" ]; then
|
# set github repository branch
|
||||||
wo_branch=master
|
if [ -n "$1" ]; then
|
||||||
|
wo_branch="$1"
|
||||||
else
|
else
|
||||||
wo_branch="$@"
|
wo_branch=master
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# update or clone wordops repositoru
|
# update or clone wordops repositoru
|
||||||
if [ -d /tmp/WordOps/.git ]; then
|
if [ -d /tmp/WordOps/.git ]; then
|
||||||
git -C /tmp/WordOps pull origin master -q
|
git -C /tmp/WordOps fetch --all
|
||||||
|
git -C /tmp/WordOps reset --hard origin/${wo_branch}
|
||||||
|
git -C /tmp/WordOps clean -f
|
||||||
else
|
else
|
||||||
rm -rf /tmp/WordOps
|
rm -rf /tmp/WordOps
|
||||||
git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$wo_branch" -q
|
git clone https://github.com/WordOps/WordOps.git /tmp/WordOps -b "$wo_branch" -q
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# execute install script
|
||||||
if [ -x /tmp/WordOps/install ]; then
|
if [ -x /tmp/WordOps/install ]; then
|
||||||
/tmp/WordOps/install "$wo_branch"
|
/tmp/WordOps/install
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user