Browse Source

Merge branch 'bugfix-backend-0306'

Kristan Kenney 6 years ago
parent
commit
1042896b83
3 changed files with 47 additions and 24 deletions
  1. 6 1
      bin/v-restart-system
  2. 35 18
      bin/v-update-sys-hestia-git
  3. 6 5
      install/upgrade/versions/latest.sh

+ 6 - 1
bin/v-restart-system

@@ -11,6 +11,7 @@
 
 # Argument definition
 restart=$1
+delay=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -20,7 +21,7 @@ source $HESTIA/func/main.sh
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '1' "$#" 'RESTART'
+check_args '1' "$#" 'RESTART [DELAY]'
 
 
 # Perform verification if read-only mode is enabled
@@ -31,6 +32,10 @@ check_hestia_demo_mode
 #----------------------------------------------------------#
 
 if [  "$restart" = 'yes' ]; then
+    if [ "$delay" ]; then
+        echo "The server will restart in $delay seconds..."
+        sleep $delay
+    fi
     /sbin/reboot
 fi
 

+ 35 - 18
bin/v-update-sys-hestia-git

@@ -90,19 +90,13 @@ if [ ! -z "$1" ]; then
         exit 1
     else
         /usr/local/hestia/bin/v-change-sys-config-value 'RELEASE_BRANCH' "$branch"
-        echo "Changed update release branch to $branch from GitHub repository."
+        echo "Changed release branch to $branch."
     fi
 else
     source /usr/local/hestia/conf/hestia.conf
     branch=$RELEASE_BRANCH
 fi
 
-if [ ! -z "$2" ]; then
-    install=$2
-else
-    install="y"
-fi
-
 if [ -z "$branch" ]; then
     echo "No branch detected, please provide one using: v-update-sys-hestia-git branch"
     exit
@@ -373,19 +367,42 @@ fi
 #
 #################################################################################
 
-if [ "$install" = 'yes' ] || [ "$install" = 'y' ]; then
-    echo "!!! Development builds should not be installed on systems with live production data without understanding the potential risks involved. !!!"
-    read -p 'Do you want to proceed the package installation? [y/n] ' answer
+# Define package installation functions
+warning_message() {
+    echo ""
+    echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+    echo "WARNING - Development builds should not be installed on"
+    echo "systems with live production data without understanding"
+    echo "the potential risks that are involved!"
+    echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+    echo ""
+}
+
+install_build() {
+    echo "Installing packages..."
+    for i in $DEB_DIR/*.deb; do
+        # Install all available packages
+        dpkg -i $i
+    done
+    # Remove temporary files
+    rm -rf $BUILD_DIR
+}
+
+# Define installation routine
+
+if [ "$install" = "yes" ]; then 
+    install_build
+else
+    warning_message
+    read -p "Do you wish to proceed with the installation? [y/n] " answer
     if [ "$answer" = 'y' ] || [ "$answer" = 'Y'  ]; then
-        echo "Installing packages..."
-        for i in $DEB_DIR/*.deb; do
-            # Install all available packages
-            dpkg -i $i
-        done
+        install_build
         unset $answer
-        # Remove temporary files
-        rm -rf $BUILD_DIR
     else
-        check_result 1 "Package installation cancelled..."
+        echo "Installation of development build aborted."
+        echo "Removing temporary files..."
+        rm -rf $BUILD_DIR
+        unset $answer
+        echo ""
     fi
 fi

+ 6 - 5
install/upgrade/versions/latest.sh

@@ -140,6 +140,7 @@ fi
 
 # Installing postgresql repo
 if [ -e "/etc/postgresql" ]; then
+    echo "(*) Enabling native PostgreSQL APT repository..."
     osname="$(cat /etc/os-release | grep "^ID\=" | sed "s/ID\=//g")"
     if [ "$osname" = "ubuntu" ]; then
         codename="$(lsb_release -s -c)"
@@ -165,7 +166,7 @@ fi
 if [ -e "/etc/nginx/nginx.conf" ]; then
     nginx_tls_check=$(grep TLSv1.1 /etc/nginx/nginx.conf)
     if [ ! -z "$nginx_tls_check" ]; then
-        echo "(*) Hardening nginx configuration, drop TLSv1.1 support..."
+        echo "(*) Updating nginx security settings - disabling TLS v1.1..."
         sed -i 's/TLSv1.1 //g' /etc/nginx/nginx.conf
     fi
 fi
@@ -193,8 +194,8 @@ done
 chown root:root /var/log/$WEB_SYSTEM/domains/$WEBMAIL_ALIAS* > /dev/null 2>&1
 
 # Enable IMAP/POP3 quota information
-if [ -z "$IMAP_SYSTEM" ]; then
-    echo "(*) Enabling IMAP quota information reporting ..."
+if [ "$IMAP_SYSTEM" = "dovecot" ]; then
+    echo "(*) Enabling IMAP quota information reporting..."
     if [ -e /etc/dovecot/conf.d/20-pop3.conf ]; then
         cp -f $HESTIA/install/deb/dovecot/conf.d/20-pop3.conf /etc/dovecot/conf.d/20-pop3.conf
     fi
@@ -209,7 +210,7 @@ fi
 # Trigger multiphp legacy migration script
 num_php_versions=$(ls -d /etc/php/*/fpm/pool.d 2>/dev/null |wc -l)
 if [ "$num_php_versions" -gt 1 ] && [ -z "$WEB_BACKEND" ]; then
-    echo "(*) Migrate to new multiphp backend system..."
+    echo "(*) Enabling modular Multi-PHP backend..."
     cp -rf $HESTIA/data/templates/web $HESTIA_BACKUP/templates/web
     bash $HESTIA/install/upgrade/manual/migrate_multiphp.sh > /dev/null 2>&1
-fi
+fi