Преглед изворни кода

Refactoring of backend code

- Ensure Webalizer is removed
- Rework upgrade script routines
- Enable 4096-bit dhparam for dovecot
- Remove unnecessary OS detection code
- Update version detection in installers
- Add global var for installer files
- Update copyright infomation
Kristan Kenney пре 6 година
родитељ
комит
a0f7e93dc9

+ 2 - 2
bin/v-add-sys-ip

@@ -130,12 +130,12 @@ if [ ! -z "$WEB_SYSTEM" ]; then
             echo "NameVirtualHost $ip:$WEB_PORT" >  $web_conf
         fi
         echo "Listen $ip:$WEB_PORT" >> $web_conf
-        cat $HESTIA/install/deb/apache2/unassigned.conf >> $web_conf
+        cat $HESTIA_INSTALL_DIR/apache2/unassigned.conf >> $web_conf
         sed -i 's/directIP/'$ip'/g' $web_conf
         sed -i 's/directPORT/'$WEB_PORT'/g' $web_conf
 
     elif [ "$WEB_SYSTEM" = 'nginx' ]; then
-        cp -f $HESTIA/install/deb/nginx/unassigned.inc $web_conf
+        cp -f $HESTIA_INSTALL_DIR/nginx/unassigned.inc $web_conf
         sed -i 's/directIP/'$ip'/g' $web_conf
     fi
 

+ 5 - 5
bin/v-add-web-php

@@ -39,7 +39,7 @@ if [ -f "$php_fpm" ] && [ -f "$HESTIA/data/templates/$WEB_SYSTEM/PHP-$version.sh
 fi
 
 # Check if php version is supported
-if [ ! -f "$HESTIA/install/deb/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh" ]; then
+if [ ! -f "$HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh" ]; then
     echo "Version is currently not supported or does not exist..."
     exit
 fi
@@ -100,15 +100,15 @@ fi
 update-rc.d php$version-fpm defaults > /dev/null 2>&1
 v_tpl=$(echo "$version" | sed -e 's/[.]//')
 rm -f /etc/php/$version/fpm/pool.d/*
-cp -f $HESTIA/install/deb/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/
+cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/
 sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf
 
 # Install php templates
-cp -f $HESTIA/install/deb/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh \
+cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.sh \
     $HESTIA/data/templates/web/$WEB_SYSTEM/
-cp -f $HESTIA/install/deb/multiphp/$WEB_SYSTEM/PHP-${version//.}.tpl \
+cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.tpl \
     $HESTIA/data/templates/web/$WEB_SYSTEM/
-cp -f $HESTIA/install/deb/multiphp/$WEB_SYSTEM/PHP-${version//.}.stpl \
+cp -f $HESTIA_INSTALL_DIR/multiphp/$WEB_SYSTEM/PHP-${version//.}.stpl \
     $HESTIA/data/templates/web/$WEB_SYSTEM/
 chmod a+x $HESTIA/data/templates/web/$WEB_SYSTEM/PHP-${version//.}.sh
 

+ 1 - 19
bin/v-update-dns-templates

@@ -16,30 +16,12 @@ restart=$1
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
-# Detect OS
-case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
-    Debian)     type="debian" ;;
-    Ubuntu)     type="ubuntu" ;;
-    *)          type="NoSupport" ;;
-esac
-
-# Detect version
-if [ "$type" = "ubuntu" ] || [ "$type" = "debian" ]; then
-    type="deb"
-else
-    echo "Error: can't detect supported os"
-    log_event "$E_NOTEXIST"
-    exit $E_NOTEXIST
-fi
-
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
 # Update templates
-cp -rf $HESTIA/install/$type/templates/dns $HESTIA/data/templates/
-
+cp -rf $HESTIA_INSTALL_DIR/templates/dns $HESTIA/data/templates/
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 1 - 18
bin/v-update-mail-templates

@@ -16,29 +16,12 @@ restart=$1
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
-# Detect OS
-case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
-    Debian)     type="debian" ;;
-    Ubuntu)     type="ubuntu" ;;
-    *)          type="NoSupport" ;;
-esac
-
-# Detect version
-if [ "$type" = "ubuntu" ] || [ "$type" = "debian" ]; then
-    type="deb"
-else
-    echo "Error: can't detect supported os"
-    log_event "$E_NOTEXIST"
-    exit $E_NOTEXIST
-fi
-
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
 # Update templates
-cp -rf $HESTIA/install/$type/templates/mail $HESTIA/data/templates/
+cp -rf $HESTIA_INSTALL_DIR/templates/mail $HESTIA/data/templates/
 
 # Rebuild mail domains if mail services are enabled
 if [ ! -z $MAIL_SYSTEM ]; then

+ 13 - 37
bin/v-update-web-templates

@@ -16,46 +16,22 @@ restart=$1
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
-# Detect OS
-case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
-    Debian)     type="debian" ;;
-    Ubuntu)     type="ubuntu" ;;
-    *)          type="NoSupport" ;;
-esac
-
-# Detect version
-if [ "$type" = "ubuntu" ] || [ "$type" = "debian" ]; then
-    type="deb"
-else
-    echo "Error: can't detect supported os"
-    log_event "$E_NOTEXIST"
-    exit $E_NOTEXIST
-fi
-
-if [ -z "$WEB_SYSTEM" ]; then
-    echo "Error: Missing Web System"
-    log_event "$E_ARGS"
-    exit $E_ARGS
-fi
-
-HST_WEBTEMPLATES="$HESTIA/data/templates/web"
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
 # Update templates
-if [ -d "${HST_WEBTEMPLATES}" ]; then
-    rm -rf "${HST_WEBTEMPLATES}/skel" 2>/dev/null
-    rm -rf "${HST_WEBTEMPLATES}/suspend" 2>/dev/null
-    rm -rf "${HST_WEBTEMPLATES}/unassigned" 2>/dev/null
+if [ -d "${WEBTPL}" ]; then
+    rm -rf "${WEBTPL}/skel" 2>/dev/null
+    rm -rf "${WEBTPL}/suspend" 2>/dev/null
+    rm -rf "${WEBTPL}/unassigned" 2>/dev/null
 fi
 
-for webtpl_folder in $(ls $HESTIA/install/$type/templates/web/* -d 2>/dev/null | egrep -v '/(nginx)$' ); do
-    cp -rf "${webtpl_folder}" "${HST_WEBTEMPLATES}/"
+for webtpl_folder in $(ls $HESTIA_INSTALL_DIR/templates/web/* -d 2>/dev/null | egrep -v '/(nginx)$' ); do
+    cp -rf "${webtpl_folder}" "${WEBTPL}/"
 done
 
-[ -d "${HST_WEBTEMPLATES}/nginx" ] || mkdir -p "${HST_WEBTEMPLATES}/nginx"
+[ -d "${WEBTPL}/nginx" ] || mkdir -p "${WEBTPL}/nginx"
 
 # Update Multi-PHP templates
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null | wc -l)
@@ -65,20 +41,20 @@ if [ "$php_versions" -gt 1 ]; then
             continue
         fi
         v_tpl=$(echo "$v" | sed -e 's/[.]//')
-        cp -f "$HESTIA/install/$type/multiphp/${WEB_SYSTEM}/PHP-${v_tpl}".* "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/"
+        cp -f "$HESTIA_INSTALL_DIR/multiphp/${WEB_SYSTEM}/PHP-${v_tpl}".* "${WEBTPL}/${WEB_SYSTEM}/"
     done
-    chmod a+x "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/"*.sh 2> /dev/null
+    chmod a+x "${WEBTPL}/${WEB_SYSTEM}/"*.sh 2> /dev/null
 
     # Create default TPL symlink when missing and point to the last php version found
     if [ ! -z $v_tpl ] && [ "$WEB_SYSTEM" = "nginx" ]; then
-        [ -e "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.sh"   ] || ln -s "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/PHP-${v_tpl}.sh" "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.sh"
-        [ -e "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.tpl"  ] || ln -s "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/PHP-${v_tpl}.tpl" "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.tpl"
-        [ -e "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.stpl" ] || ln -s "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/PHP-${v_tpl}.stpl" "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/default.stpl"
+        [ -e "${WEBTPL}/${WEB_SYSTEM}/default.sh"   ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.sh" "${WEBTPL}/${WEB_SYSTEM}/default.sh"
+        [ -e "${WEBTPL}/${WEB_SYSTEM}/default.tpl"  ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.tpl" "${WEBTPL}/${WEB_SYSTEM}/default.tpl"
+        [ -e "${WEBTPL}/${WEB_SYSTEM}/default.stpl" ] || ln -s "${WEBTPL}/${WEB_SYSTEM}/PHP-${v_tpl}.stpl" "${WEBTPL}/${WEB_SYSTEM}/default.stpl"
     fi
 fi
 
 if [ "$PROXY_SYSTEM" = 'nginx' ] || [ "$php_versions" -le 1 ]; then
-    cp -rf "${HESTIA}/install/${type}/templates/web/nginx" "${HST_WEBTEMPLATES}/"
+    cp -rf "${HESTIA_INSTALL_DIR}/templates/web/nginx" "${WEBTPL}/"
 fi
 
 # Rebuilding web domains

+ 2 - 0
func/main.sh

@@ -7,6 +7,8 @@ BACKUP_DISK_LIMIT=95
 BACKUP_LA_LIMIT=`cat /proc/cpuinfo | grep processor | wc -l`
 RRD_STEP=300
 BIN=$HESTIA/bin
+HESTIA_INSTALL_DIR=$HESTIA/install/deb
+HESTIA_BACKUP="/root/hst_backups/$(date +%d%m%Y%H%M)"
 USER_DATA=$HESTIA/data/users/$user
 WEBTPL=$HESTIA/data/templates/web
 MAILTPL=$HESTIA/data/templates/mail

+ 190 - 0
func/upgrade.sh

@@ -0,0 +1,190 @@
+#!/bin/bash
+
+# Hestia Control Panel - Upgrade Control Script
+
+#####################################################################
+#######                Functions & Initialization             #######
+#####################################################################
+
+function upgrade_welcome_message() {
+    echo
+    echo '     _   _           _   _        ____ ____        '
+    echo '    | | | | ___  ___| |_(_) __ _ / ___|  _ \       '
+    echo '    | |_| |/ _ \/ __| __| |/ _` | |   | |_) |      '
+    echo '    |  _  |  __/\__ \ |_| | (_| | |___|  __/       '
+    echo '    |_| |_|\___||___/\__|_|\__,_|\____|_|          '
+    echo ""
+    echo "       Hestia Control Panel Upgrade Script"
+    echo "                 Version: $new_version             "
+    echo "==================================================="
+    echo ""
+    echo "Please note that some configuration and template"
+    echo "files may be replaced during the upgrade process."
+    echo ""
+    echo "Backups of these files will be available under:"
+    echo "$HESTIA_BACKUP/"
+    echo ""
+    echo "This process may take a few minutes, please wait..."
+    echo ""
+}
+
+function upgrade_complete_message() {
+    # Add notification to panel
+    $HESTIA/bin/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to Hestia Control Panel version '$new_version'.<br>Please report any bugs on GitHub at<br><a href="https://github.com/hestiacp/hestiacp/Issues" target="_new">https://github.com/hestiacp/hestiacp/Issues</a><br><br>Have a great day!'
+
+    # Echo message to console output
+    echo ""
+    echo "    Upgrade complete! Please report any bugs or issues to"
+    echo "    https://github.com/hestiacp/hestiacp/issues"
+    echo ""
+    echo "    We hope that you enjoy this release of Hestia Control Panel,"
+    echo "    enjoy your day!"
+    echo ""
+    echo "    Sincerely,"
+    echo "    The Hestia Control Panel development team"
+    echo ""
+    echo "    www.hestiacp.com"
+    echo "    Made with love & pride by the open-source community around the world."
+    echo ""
+    echo ""
+}
+
+function upgrade_init_backup() {
+    # Ensure that backup directories are created
+    mkdir -p $HESTIA_BACKUP/conf/
+    mkdir -p $HESTIA_BACKUP/packages/
+    mkdir -p $HESTIA_BACKUP/templates/
+}
+
+function upgrade_start_routine() {
+
+    #####################################################################
+    #######         Start upgrade for pre-release builds          #######
+    #####################################################################
+
+    if [ $VERSION = "0.9.8-25" ] || [ $VERSION = "0.9.8-26" ] || [ $VERSION = "0.9.8-27" ] || [ $VERSION = "0.9.8-28" ] || [ $VERSION = "0.9.8-29" ] || [ $VERSION = "0.10.0" ] || [ $VERSION = "1.00.0-190618" ] || [ $VERSION = "1.00.0-190621" ]; then
+        source $HESTIA_INSTALL_DIR/upgrade/versions/previous/0.9.8-29.sh
+        source $HESTIA_INSTALL_DIR/upgrade/versions/previous/1.00.0-190618.sh
+        source $HESTIA_INSTALL_DIR/upgrade/versions/previous/1.0.1.sh
+        VERSION="1.0.1"
+    fi
+
+    #####################################################################
+    #######             Start standard upgrade process            #######
+    #####################################################################
+
+    # Upgrade to Version 1.0.2
+    if [ $VERSION = "1.0.1" ]; then
+        source $HESTIA_INSTALL_DIR/upgrade/versions/previous/1.0.2.sh
+        VERSION="1.0.2"
+    fi
+
+    # Upgrade to Version 1.0.3
+    if [ $VERSION = "1.0.2" ]; then
+        source $HESTIA_INSTALL_DIR/upgrade/versions/latest.sh
+        VERSION="$new_version"
+    fi
+
+    # Ensure that latest upgrade commands are processed if version is the same
+    if [ $VERSION = "$new_version" ]; then
+        echo "(!) The latest version of Hestia Control Panel ($new_version) is already installed."
+        echo "    Verifying configuration..."
+        echo ""
+        source $HESTIA_INSTALL_DIR/upgrade/versions/latest.sh
+        VERSION="$new_version"
+    fi
+
+    #####################################################################
+    #######                 End upgrade process                   #######
+    #####################################################################
+}
+
+function upgrade_phpmyadmin() {
+    # Define version check function
+    function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+
+    pma_release_file=$(ls /usr/share/phpmyadmin/RELEASE-DATE-* 2>/dev/null |tail -n 1)
+    if version_ge "${pma_release_file##*-}" "$pma_v"; then
+        echo "(*) phpMyAdmin $pma_v or newer is already installed: ${pma_release_file##*-}, skipping update..."
+    else
+        # Display upgrade information
+        echo "(*) Upgrade phpMyAdmin to v$pma_v..."
+        [ -d /usr/share/phpmyadmin ] || mkdir -p /usr/share/phpmyadmin
+
+        # Download latest phpMyAdmin release
+        wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
+    
+        # Unpack files
+        tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
+
+        # Delete file to prevent error
+        rm -fr /usr/share/phpmyadmin/doc/html
+
+        # Overwrite old files
+        cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
+
+        # Set config and log directory
+        sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+        sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
+
+        # Create temporary folder and change permissions
+        if [ ! -d /usr/share/phpmyadmin/tmp ]; then
+            mkdir /usr/share/phpmyadmin/tmp
+            chmod 777 /usr/share/phpmyadmin/tmp
+        fi
+
+        # Clean up source files
+        rm -fr phpMyAdmin-$pma_v-all-languages
+        rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
+    fi
+}
+
+function upgrade_set_version() {
+    # Set new version number in hestia.conf
+    sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
+    echo "VERSION='$new_version'" >> $HESTIA/conf/hestia.conf
+}
+
+function upgrade_rebuild_users() {
+    for user in `ls /usr/local/hestia/data/users/`; do
+        echo "(*) Rebuilding domains and account for user: $user..."
+        if [ ! -z $WEB_SYSTEM ]; then
+            $BIN/v-rebuild-web-domains $user >/dev/null 2>&1
+        fi
+        if [ ! -z $DNS_SYSTEM ]; then
+            $BIN/v-rebuild-dns-domains $user >/dev/null 2>&1
+        fi
+        if [ ! -z $MAIL_SYSTEM ]; then 
+            $BIN/v-rebuild-mail-domains $user >/dev/null 2>&1
+        fi
+    done
+}
+
+function upgrade_restart_services() {
+    echo "(*) Restarting services..."
+    if [ ! -z $MAIL_SYSTEM ]; then
+        $BIN/v-restart-mail $restart
+    fi
+    if [ ! -z $IMAP_SYSTEM ]; then
+        $BIN/v-restart-service $IMAP_SYSTEM $restart
+    fi
+    if [ ! -z $WEB_SYSTEM ]; then
+        $BIN/v-restart-web $restart
+        $BIN/v-restart-proxy $restart
+    fi
+    if [ ! -z $DNS_SYSTEM ]; then
+        $BIN/v-restart-dns $restart
+    fi
+    for v in `ls /etc/php/`; do
+        if [ -e /etc/php/$v/fpm ]; then
+            $BIN/v-restart-service php$v-fpm $restart
+        fi
+    done
+    if [ ! -z $FTP_SYSTEM ]; then
+        $BIN/v-restart-ftp $restart
+    fi
+
+    # Restart SSH daemon and Hestia Control Panel service
+    $BIN/v-restart-service ssh $restart
+    $BIN/v-restart-service hestia $restart
+}

+ 1 - 1
install/deb/dovecot/conf.d/10-ssl.conf

@@ -7,7 +7,7 @@ ssl_cert = </usr/local/hestia/ssl/certificate.crt
 ssl_key = </usr/local/hestia/ssl/certificate.key
 
 # From and up to version 2.2
-ssl_dh_parameters_length = 2048
+ssl_dh_parameters_length = 4096
 
 # From version 2.3
 #ssl_dh = </etc/ssl/dhparam.pem

+ 1 - 1
install/deb/phpmyadmin/pma.sh

@@ -143,4 +143,4 @@ FLUSH PRIVILEGES;
 MYSQL_PMA3
 
 #MYSQL DB and TABLES ADDITION
-mysql -uroot < $hestiacp/phpmyadmin/create_tables.sql
+mysql -uroot < $HESTIA_INSTALL_DIR/phpmyadmin/create_tables.sql

+ 0 - 110
install/deb/templates/web/webalizer/webalizer.tpl

@@ -1,110 +0,0 @@
-HostName         %domain_idn%
-LogFile          /var/log/%web_system%/domains/%domain%.log
-OutputDir        %home%/%user%/web/%domain%/stats
-HistoryName      %home%/%user%/web/%domain%/stats/%domain%.hist
-Incremental      yes
-IncrementalName  %home%/%user%/web/%domain%/stats/%domain%.current
-PageType         htm*
-PageType         cgi
-PageType         php
-PageType         shtml
-DNSCache         /var/lib/webalizer/dns_cache.db
-DNSChildren      10
-Quiet            yes
-FoldSeqErr       yes
-IndexAlias       index.php
-HideURL          *.gif
-HideURL          *.GIF
-HideURL          *.jpg
-HideURL          *.JPG
-HideURL          *.png
-HideURL          *.PNG
-HideURL          *.ra
-SearchEngine     abcsearch.          terms=
-SearchEngine     alexa.              q=
-SearchEngine     alltheweb.          q=
-SearchEngine     alltheweb.          query=
-SearchEngine     alot.               q=
-SearchEngine     altavista.          q=
-SearchEngine     aolsearch.          query=
-SearchEngine     aport.ru            r=
-SearchEngine     ask.                q=
-SearchEngine     atlas.cz            q=
-SearchEngine     bbc.                q=
-SearchEngine     bing.               q=
-SearchEngine     blingo.             q=
-SearchEngine     blogs.yandex.ru     text=
-SearchEngine     btopenworld         query=
-SearchEngine     buscador.ya.com     q=
-SearchEngine     busca.              q=
-SearchEngine     business.           query=
-SearchEngine     centrum.cz          q=
-SearchEngine     chiff.              q=
-SearchEngine     clusty.             query=
-SearchEngine     comcast.            q=
-SearchEngine     crawler.            q=
-SearchEngine     cuil.               q=
-SearchEngine     dmoz.               search=
-SearchEngine     dogpile.com         q=
-SearchEngine     dpxml               qkw=
-SearchEngine     eureka.             searchword=
-SearchEngine     euroseek.           string=
-SearchEngine     exalead.            q=
-SearchEngine     excite              search=
-SearchEngine     ezilon.             q=
-SearchEngine     fastbrowsersearch.  q=
-SearchEngine     feedster.com        q=
-SearchEngine     fireball.de         q=
-SearchEngine     fireball.           keyword=
-SearchEngine     freeserve.          q=
-SearchEngine     gigablast.          q=
-SearchEngine     gogo.ru             q=
-SearchEngine     go.mail.ru          q=
-SearchEngine     google.             q=
-SearchEngine     hakia.              q=
-SearchEngine     hotbot.             query=
-SearchEngine     infoseek.           qt=
-SearchEngine     iwon                searchfor=
-SearchEngine     ixquick.com         query=
-SearchEngine     joeant.             keywords=
-SearchEngine     jyxo.cz             s=
-SearchEngine     looksmart.          key=
-SearchEngine     lycos.              query=
-SearchEngine     mamma.              q=
-SearchEngine     metacrawler         q=
-SearchEngine     msn.                MT=
-SearchEngine     msxml               qkw=
-SearchEngine     mysearch.           searchfor=
-SearchEngine     mywebsearch.        searchfor=
-SearchEngine     netscape.           q=
-SearchEngine     nigma.ru            q=
-SearchEngine     northernlight.      qr=
-SearchEngine     ntlworld.           q=
-SearchEngine     orange.             q=
-SearchEngine     overture.           Keywords=
-SearchEngine     punto.ru            text=
-SearchEngine     rambler.            keyword=
-SearchEngine     search.aol.         q=
-SearchEngine     search.babylon.     q=
-SearchEngine     search.centrum.     phrase=
-SearchEngine     search.conduit.     q=
-SearchEngine     search.earthlink    q=
-SearchEngine     search.icq.         q=
-SearchEngine     search.live.com     q=
-SearchEngine     search.rambler.ru   words=
-SearchEngine     search.winamp.      q=
-SearchEngine     searchy.            q=
-SearchEngine     seznam.cz           w=
-SearchEngine     snap.               query=
-SearchEngine     teoma.              q=
-SearchEngine     teradex.com         q=
-SearchEngine     ukplus              key=
-SearchEngine     verizon.            q=
-SearchEngine     virginmedia.        q=
-SearchEngine     voila.              rdata=
-SearchEngine     webcrawler          searchText=
-SearchEngine     web.search.naver.   query=
-SearchEngine     wisenut             q=
-SearchEngine     yahoo.              p=
-SearchEngine     yandex.             text=
-SearchEngine     yodao.              q=

+ 48 - 48
install/hst-install-debian.sh

@@ -19,7 +19,7 @@ spinner="/-\|"
 os='debian'
 release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
 codename="$(cat /etc/os-release |grep VERSION= |cut -f 2 -d \(|cut -f 1 -d \))"
-hestiacp="$HESTIA/install/deb"
+HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 
 # Define software versions
 pma_v='4.9.0.1'
@@ -975,7 +975,7 @@ chmod 755 /usr/bin/rssh
 echo "(*) Configuring Hestia Control Panel..."
 # Installing sudo configuration
 mkdir -p /etc/sudoers.d
-cp -f $hestiacp/sudo/admin /etc/sudoers.d/
+cp -f $HESTIA_INSTALL_DIR/sudo/admin /etc/sudoers.d/
 chmod 440 /etc/sudoers.d/admin
 
 # Configuring system env
@@ -986,7 +986,7 @@ chmod 755 /etc/profile.d/hestia.sh
 source /etc/profile.d/hestia.sh
 
 # Configuring logrotate for Hestia logs
-cp -f $hestiacp/logrotate/hestia /etc/logrotate.d/hestia
+cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
 
 # Building directory tree and creating some blank files for Hestia
 mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
@@ -1099,7 +1099,7 @@ echo "VERSION='1.0.3'" >> $HESTIA/conf/hestia.conf
 echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
 
 # Installing hosting packages
-cp -rf $hestiacp/packages $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/packages $HESTIA/data/
 
 # Update nameservers in hosting package
 IFS='.' read -r -a domain_elements <<< "$servername"
@@ -1109,21 +1109,21 @@ if [ ! -z "${domain_elements[-2]}" ] && [ ! -z "${domain_elements[-1]}" ]; then
 fi
 
 # Installing templates
-cp -rf $hestiacp/templates $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/templates $HESTIA/data/
 
 mkdir -p /var/www/html
 mkdir -p /var/www/document_errors
 
 # Installing default themes
 mkdir -p $HESTIA/themes
-cp -rf $hestiacp/themes $HESTIA/themes/
+cp -rf $HESTIA_INSTALL_DIR/themes $HESTIA/themes/
 
 # Install default success page
-cp -rf $hestiacp/templates/web/unassigned/index.html /var/www/html/
-cp -rf $hestiacp/templates/web/skel/document_errors/* /var/www/document_errors/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
 
 # Installing firewall rules
-cp -rf $hestiacp/firewall $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/firewall $HESTIA/data/
 
 # Configuring server hostname
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
@@ -1155,11 +1155,11 @@ rm /tmp/hst.pem
 if [ "$nginx" = 'yes' ]; then
     echo "(*) Configuring NGINX..."
     rm -f /etc/nginx/conf.d/*.conf
-    cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
-    cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
+    cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
@@ -1170,11 +1170,11 @@ if [ "$nginx" = 'yes' ]; then
             cp -r /etc/php/$v/ /root/hst_install_backups/php$v/
             rm -f /etc/php/$v/fpm/pool.d/*
             v_tpl=$(echo "$v" | sed -e 's/[.]//')
-            cp -f $hestiacp/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
-            cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
+            cp -f $HESTIA_INSTALL_DIR/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
+            cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
             sed -i "s/9999/99$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
         done
-        cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
+        cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
         chmod a+x $HESTIA/data/templates/web/nginx/*.sh
         fpm_tpl=$(echo "$fpm_v" | sed -e 's/[.]//')
         ln -s $HESTIA/data/templates/web/nginx/PHP-$fpm_tpl.sh $HESTIA/data/templates/web/nginx/default.sh
@@ -1185,7 +1185,7 @@ if [ "$nginx" = 'yes' ]; then
     fi
 
     # Install dhparam.
-    cp -f $HESTIA/install/deb/ssl/dhparam.pem /etc/ssl
+    cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
 
     # Update dns servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
@@ -1211,9 +1211,9 @@ fi
 
 if [ "$apache" = 'yes' ]; then
     echo "(*) Configuring Apache Web Server..."
-    cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
-    cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
-    cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
+    cp -f $HESTIA_INSTALL_DIR/apache2/apache2.conf /etc/apache2/
+    cp -f $HESTIA_INSTALL_DIR/apache2/status.conf /etc/apache2/mods-enabled/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/apache2 /etc/logrotate.d/
     a2enmod rewrite > /dev/null 2>&1
     a2enmod suexec > /dev/null 2>&1
     a2enmod ssl > /dev/null 2>&1
@@ -1239,7 +1239,7 @@ if [ "$apache" = 'yes' ]; then
             cp -r /etc/php/$v/ /root/hst_install_backups/php$v/
             rm -f /etc/php/$v/fpm/pool.d/*
             v_tpl=$(echo "$v" | sed -e 's/[.]//')
-            cp -f $hestiacp/multiphp/apache2/PHP-$v_tpl.* $HESTIA/data/templates/web/apache2/
+            cp -f $HESTIA_INSTALL_DIR/multiphp/apache2/PHP-$v_tpl.* $HESTIA/data/templates/web/apache2/
         done
         chmod a+x $HESTIA/data/templates/web/apache2/*.sh
         if [ "$release" = '8' ]; then
@@ -1263,7 +1263,7 @@ fi
 
 if [ "$phpfpm" = 'yes' ]; then
     echo "(*) Configuring PHP-FPM..."
-    cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
+    cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
     update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
     systemctl start php$fpm_v-fpm >> $LOG
     check_result $? "php-fpm start failed"
@@ -1297,7 +1297,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
 
 if [ "$vsftpd" = 'yes' ]; then
     echo "(*) Configuring Vsftpd server..."
-    cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
+    cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
     touch /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
     chmod 640 /var/log/vsftpd.log
@@ -1318,7 +1318,7 @@ fi
 if [ "$proftpd" = 'yes' ]; then
     echo "(*) Configuring ProFTPD server..."
     echo "127.0.0.1 $servername" >> /etc/hosts
-    cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
+    cp -f $HESTIA_INSTALL_DIR/proftpd/proftpd.conf /etc/proftpd/
     update-rc.d proftpd defaults > /dev/null 2>&1
     systemctl start proftpd >> $LOG
     check_result $? "proftpd start failed"
@@ -1340,7 +1340,7 @@ if [ "$mysql" = 'yes' ]; then
     fi
 
    # Configuring MariaDB
-    cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
+    cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
     mysql_install_db >> $LOG
 
     update-rc.d mysql defaults > /dev/null 2>&1
@@ -1362,10 +1362,10 @@ if [ "$mysql" = 'yes' ]; then
 
     # Configuring phpMyAdmin
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/pma/apache.conf /etc/phpmyadmin/
+        cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/phpmyadmin/
         ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
     fi
-    cp -f $hestiacp/pma/config.inc.php /etc/phpmyadmin/
+    cp -f $HESTIA_INSTALL_DIR/pma/config.inc.php /etc/phpmyadmin/
     chmod 777 /var/lib/phpmyadmin/tmp
 fi
 
@@ -1411,15 +1411,15 @@ fi
 if [ "$postgresql" = 'yes' ]; then
     echo "(*) Configuring PostgreSQL database server..."
     ppass=$(gen_pass)
-    cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
+    cp -f $HESTIA_INSTALL_DIR/postgresql/pg_hba.conf /etc/postgresql/*/main/
     systemctl restart postgresql
     sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
 
     # Configuring phpPgAdmin
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/pga/phppgadmin.conf /etc/apache2/conf.d/
+        cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/apache2/conf.d/
     fi
-    cp -f $hestiacp/pga/config.inc.php /etc/phppgadmin/
+    cp -f $HESTIA_INSTALL_DIR/pga/config.inc.php /etc/phppgadmin/
 fi
 
 
@@ -1429,8 +1429,8 @@ fi
 
 if [ "$named" = 'yes' ]; then
     echo "(*) Configuring Bind DNS server..."
-    cp -f $hestiacp/bind/named.conf /etc/bind/
-    cp -f $hestiacp/bind/named.conf.options /etc/bind/
+    cp -f $HESTIA_INSTALL_DIR/bind/named.conf /etc/bind/
+    cp -f $HESTIA_INSTALL_DIR/bind/named.conf.options /etc/bind/
     chown root:bind /etc/bind/named.conf
     chown root:bind /etc/bind/named.conf.options
     chown bind:bind /var/cache/bind
@@ -1462,9 +1462,9 @@ fi
 if [ "$exim" = 'yes' ]; then
     echo "(*) Configuring Exim mail server..."
     gpasswd -a Debian-exim mail > /dev/null 2>&1
-    cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
-    cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
-    cp -f $hestiacp/exim/spam-blocks.conf /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/dnsbl.conf /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/spam-blocks.conf /etc/exim4/
     touch /etc/exim4/white-blocks.conf
 
     if [ "$spamd" = 'yes' ]; then
@@ -1497,8 +1497,8 @@ fi
 if [ "$dovecot" = 'yes' ]; then
     echo "(*) Configuring Dovecot POP/IMAP mail server..."
     gpasswd -a dovecot mail > /dev/null 2>&1
-    cp -rf $hestiacp/dovecot /etc/
-    cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
+    cp -rf $HESTIA_INSTALL_DIR/dovecot /etc/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/dovecot /etc/logrotate.d/
     chown -R root:root /etc/dovecot*
     if [ "$release" -eq 9 ]; then
         rm -f /etc/dovecot/conf.d/15-mailboxes.conf
@@ -1516,7 +1516,7 @@ fi
 if [ "$clamd" = 'yes' ]; then
     gpasswd -a clamav mail > /dev/null 2>&1
     gpasswd -a clamav Debian-exim > /dev/null 2>&1
-    cp -f $hestiacp/clamav/clamd.conf /etc/clamav/
+    cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf /etc/clamav/
     update-rc.d clamav-daemon defaults
     if [ ! -d "/var/run/clamav" ]; then
         mkdir /var/run/clamav
@@ -1567,16 +1567,16 @@ fi
 if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     echo "(*) Configuring Roundcube webmail client..."
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
+        cp -f $HESTIA_INSTALL_DIR/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
     if [ "$nginx" = 'yes' ]; then
-        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+        cp -f $HESTIA_INSTALL_DIR/nginx/webmail.inc /etc/nginx/conf.d/
     fi
-    cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
-    cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
-    cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
-    cp -f $hestiacp/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
+    cp -f $HESTIA_INSTALL_DIR/roundcube/main.inc.php /etc/roundcube/config.inc.php
+    cp -f $HESTIA_INSTALL_DIR/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
+    cp -f $HESTIA_INSTALL_DIR/roundcube/config.inc.php /etc/roundcube/plugins/password/
+    cp -f $HESTIA_INSTALL_DIR/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
     touch /var/log/roundcube/errors
     chmod 640 /etc/roundcube/config.inc.php
     chown root:www-data /etc/roundcube/config.inc.php
@@ -1595,7 +1595,7 @@ if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
 
     if [ "$release" -eq 8 ]; then
         # RoundCube tinyMCE fix
-        tinymceFixArchiveURL=$hestiacp/roundcube/roundcube-tinymce.tar.gz
+        tinymceFixArchiveURL=$HESTIA_INSTALL_DIR/roundcube/roundcube-tinymce.tar.gz
         tinymceParentFolder=/usr/share/roundcube/program/js
         tinymceFolder=$tinymceParentFolder/tinymce
         tinymceBadJS=$tinymceFolder/tiny_mce.js
@@ -1636,7 +1636,7 @@ fi
 
 if [ "$fail2ban" = 'yes' ]; then
     echo "(*) Configuring fail2ban access monitor..."
-    cp -rf $hestiacp/fail2ban /etc/
+    cp -rf $HESTIA_INSTALL_DIR/fail2ban /etc/
     if [ "$dovecot" = 'no' ]; then
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
         fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
@@ -1687,7 +1687,7 @@ fi
 # https://github.com/skurudo/phpmyadmin-fixer
 
 if [ "$mysql" = 'yes' ]; then
-    source $hestiacp/phpmyadmin/pma.sh > /dev/null 2>&1
+    source $HESTIA_INSTALL_DIR/phpmyadmin/pma.sh > /dev/null 2>&1
 fi
 
 

+ 47 - 47
install/hst-install-ubuntu.sh

@@ -19,7 +19,7 @@ spinner="/-\|"
 os='ubuntu'
 release="$(lsb_release -s -r)"
 codename="$(lsb_release -s -c)"
-hestiacp="$HESTIA/install/deb"
+HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 
 # Define software versions
 pma_v='4.9.0.1'
@@ -943,7 +943,7 @@ chmod 755 /usr/bin/rssh
 echo "(*) Configuring Hestia Control Panel..."
 # Installing sudo configuration
 mkdir -p /etc/sudoers.d
-cp -f $hestiacp/sudo/admin /etc/sudoers.d/
+cp -f $HESTIA_INSTALL_DIR/sudo/admin /etc/sudoers.d/
 chmod 440 /etc/sudoers.d/admin
 
 # Configuring system env
@@ -954,7 +954,7 @@ chmod 755 /etc/profile.d/hestia.sh
 source /etc/profile.d/hestia.sh
 
 # Configuring logrotate for Hestia logs
-cp -f $hestiacp/logrotate/hestia /etc/logrotate.d/hestia
+cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
 
 # Building directory tree and creating some blank files for Hestia
 mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
@@ -1062,7 +1062,7 @@ echo "VERSION='1.0.3'" >> $HESTIA/conf/hestia.conf
 echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
 
 # Installing hosting packages
-cp -rf $hestiacp/packages $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/packages $HESTIA/data/
 
 # Update nameservers in hosting package
 IFS='.' read -r -a domain_elements <<< "$servername"
@@ -1072,21 +1072,21 @@ if [ ! -z "${domain_elements[-2]}" ] && [ ! -z "${domain_elements[-1]}" ]; then
 fi
 
 # Installing templates
-cp -rf $hestiacp/templates $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/templates $HESTIA/data/
 
 mkdir -p /var/www/html
 mkdir -p /var/www/document_errors
 
 # Installing default themes
 mkdir -p $HESTIA/themes
-cp -rf $hestiacp/themes $HESTIA/themes/
+cp -rf $HESTIA_INSTALL_DIR/themes $HESTIA/themes/
 
 # Install default success page
-cp -rf $hestiacp/templates/web/unassigned/index.html /var/www/html/
-cp -rf $hestiacp/templates/web/skel/document_errors/* /var/www/document_errors/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
 
 # Installing firewall rules
-cp -rf $hestiacp/firewall $HESTIA/data/
+cp -rf $HESTIA_INSTALL_DIR/firewall $HESTIA/data/
 
 # Configuring server hostname
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
@@ -1123,11 +1123,11 @@ fi
 if [ "$nginx" = 'yes' ]; then
     echo "(*) Configuring NGINX..."
     rm -f /etc/nginx/conf.d/*.conf
-    cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
-    cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/phpmyadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
+    cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
@@ -1138,11 +1138,11 @@ if [ "$nginx" = 'yes' ]; then
             cp -r /etc/php/$v/ /root/hst_install_backups/php$v/
             rm -f /etc/php/$v/fpm/pool.d/*
             v_tpl=$(echo "$v" | sed -e 's/[.]//')
-            cp -f $hestiacp/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
-            cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
+            cp -f $HESTIA_INSTALL_DIR/multiphp/nginx/PHP-$v_tpl.* $HESTIA/data/templates/web/nginx/
+            cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
             sed -i "s/9999/99$v_tpl/g" /etc/php/$v/fpm/pool.d/dummy.conf
         done
-        cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
+        cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/
         chmod a+x $HESTIA/data/templates/web/nginx/*.sh
         fpm_tpl=$(echo "$fpm_v" | sed -e 's/[.]//')
         ln -s $HESTIA/data/templates/web/nginx/PHP-$fpm_tpl.sh $HESTIA/data/templates/web/nginx/default.sh
@@ -1153,7 +1153,7 @@ if [ "$nginx" = 'yes' ]; then
     fi
 
     # Install dhparam.
-    cp -f $HESTIA/install/deb/ssl/dhparam.pem /etc/ssl
+    cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl
 
     # Update dns servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
@@ -1179,9 +1179,9 @@ fi
 
 if [ "$apache" = 'yes' ]; then
     echo "(*) Configuring Apache Web Server..."
-    cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
-    cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
-    cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
+    cp -f $HESTIA_INSTALL_DIR/apache2/apache2.conf /etc/apache2/
+    cp -f $HESTIA_INSTALL_DIR/apache2/status.conf /etc/apache2/mods-enabled/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/apache2 /etc/logrotate.d/
     a2enmod rewrite > /dev/null 2>&1
     a2enmod suexec > /dev/null 2>&1
     a2enmod ssl > /dev/null 2>&1
@@ -1207,7 +1207,7 @@ if [ "$apache" = 'yes' ]; then
             cp -r /etc/php/$v/ /root/hst_install_backups/php$v/
             rm -f /etc/php/$v/fpm/pool.d/*
             v_tpl=$(echo "$v" | sed -e 's/[.]//')
-            cp -f $hestiacp/multiphp/apache2/PHP-$v_tpl.* $HESTIA/data/templates/web/apache2/
+            cp -f $HESTIA_INSTALL_DIR/multiphp/apache2/PHP-$v_tpl.* $HESTIA/data/templates/web/apache2/
         done
         chmod a+x $HESTIA/data/templates/web/apache2/*.sh
     fi
@@ -1227,7 +1227,7 @@ fi
 
 if [ "$phpfpm" = 'yes' ]; then
     echo "(*) Configuring PHP-FPM..."
-    cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
+    cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
     update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
     systemctl start php$fpm_v-fpm >> $LOG
     check_result $? "php-fpm start failed"
@@ -1261,7 +1261,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
 
 if [ "$vsftpd" = 'yes' ]; then
     echo "(*) Configuring Vsftpd server..."
-    cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
+    cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
     touch /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
     chmod 640 /var/log/vsftpd.log
@@ -1282,7 +1282,7 @@ fi
 if [ "$proftpd" = 'yes' ]; then
     echo "(*) Configuring ProFTPD server..."
     echo "127.0.0.1 $servername" >> /etc/hosts
-    cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
+    cp -f $HESTIA_INSTALL_DIR/proftpd/proftpd.conf /etc/proftpd/
     update-rc.d proftpd defaults > /dev/null 2>&1
     systemctl start proftpd >> $LOG
     check_result $? "proftpd start failed"
@@ -1304,7 +1304,7 @@ if [ "$mysql" = 'yes' ]; then
     fi
 
     # Configuring MariaDB
-    cp -f $hestiacp/mysql/$mycnf /etc/mysql/my.cnf
+    cp -f $HESTIA_INSTALL_DIR/mysql/$mycnf /etc/mysql/my.cnf
     mysql_install_db >> $LOG
 
     update-rc.d mysql defaults > /dev/null 2>&1
@@ -1326,10 +1326,10 @@ if [ "$mysql" = 'yes' ]; then
 
     # Configuring phpMyAdmin
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/pma/apache.conf /etc/phpmyadmin/
+        cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/phpmyadmin/
         ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf
     fi
-    cp -f $hestiacp/pma/config.inc.php /etc/phpmyadmin/
+    cp -f $HESTIA_INSTALL_DIR/pma/config.inc.php /etc/phpmyadmin/
     chmod 777 /var/lib/phpmyadmin/tmp
 fi
 
@@ -1375,15 +1375,15 @@ fi
 if [ "$postgresql" = 'yes' ]; then
     echo "(*) Configuring PostgreSQL database server..."
     ppass=$(gen_pass)
-    cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
+    cp -f $HESTIA_INSTALL_DIR/postgresql/pg_hba.conf /etc/postgresql/*/main/
     systemctl restart postgresql
     sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD '$ppass'"
 
     # Configuring phpPgAdmin
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/pga/phppgadmin.conf /etc/apache2/conf.d/
+        cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/apache2/conf.d/
     fi
-    cp -f $hestiacp/pga/config.inc.php /etc/phppgadmin/
+    cp -f $HESTIA_INSTALL_DIR/pga/config.inc.php /etc/phppgadmin/
 fi
 
 
@@ -1393,8 +1393,8 @@ fi
 
 if [ "$named" = 'yes' ]; then
     echo "(*) Configuring Bind DNS server..."
-    cp -f $hestiacp/bind/named.conf /etc/bind/
-    cp -f $hestiacp/bind/named.conf.options /etc/bind/
+    cp -f $HESTIA_INSTALL_DIR/bind/named.conf /etc/bind/
+    cp -f $HESTIA_INSTALL_DIR/bind/named.conf.options /etc/bind/
     chown root:bind /etc/bind/named.conf
     chown root:bind /etc/bind/named.conf.options
     chown bind:bind /var/cache/bind
@@ -1426,9 +1426,9 @@ fi
 if [ "$exim" = 'yes' ]; then
     echo "(*) Configuring Exim mail server..."
     gpasswd -a Debian-exim mail > /dev/null 2>&1
-    cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
-    cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
-    cp -f $hestiacp/exim/spam-blocks.conf /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/dnsbl.conf /etc/exim4/
+    cp -f $HESTIA_INSTALL_DIR/exim/spam-blocks.conf /etc/exim4/
     touch /etc/exim4/white-blocks.conf
 
     if [ "$spamd" = 'yes' ]; then
@@ -1462,8 +1462,8 @@ fi
 if [ "$dovecot" = 'yes' ]; then
     echo "(*) Configuring Dovecot POP/IMAP mail server..."
     gpasswd -a dovecot mail > /dev/null 2>&1
-    cp -rf $hestiacp/dovecot /etc/
-    cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
+    cp -rf $HESTIA_INSTALL_DIR/dovecot /etc/
+    cp -f $HESTIA_INSTALL_DIR/logrotate/dovecot /etc/logrotate.d/
     if [ "$release" = '18.04' ]; then
         rm -f /etc/dovecot/conf.d/15-mailboxes.conf
     fi
@@ -1481,7 +1481,7 @@ fi
 if [ "$clamd" = 'yes' ]; then
     gpasswd -a clamav mail > /dev/null 2>&1
     gpasswd -a clamav Debian-exim > /dev/null 2>&1
-    cp -f $hestiacp/clamav/clamd.conf /etc/clamav/
+    cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf /etc/clamav/
     update-rc.d clamav-daemon defaults
     echo -ne "(*) Installing ClamAV anti-virus definitions... "
     /usr/bin/freshclam >> $LOG &
@@ -1521,16 +1521,16 @@ fi
 if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     echo "(*) Configuring Roundcube webmail client..."
     if [ "$apache" = 'yes' ]; then
-        cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
+        cp -f $HESTIA_INSTALL_DIR/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
     if [ "$nginx" = 'yes' ]; then
-        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+        cp -f $HESTIA_INSTALL_DIR/nginx/webmail.inc /etc/nginx/conf.d/
     fi
-    cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
-    cp -f $hestiacp/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
-    cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
-    cp -f $hestiacp/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
+    cp -f $HESTIA_INSTALL_DIR/roundcube/main.inc.php /etc/roundcube/config.inc.php
+    cp -f $HESTIA_INSTALL_DIR/roundcube/db.inc.php /etc/roundcube/debian-db-roundcube.php
+    cp -f $HESTIA_INSTALL_DIR/roundcube/config.inc.php /etc/roundcube/plugins/password/
+    cp -f $HESTIA_INSTALL_DIR/roundcube/hestia.php /usr/share/roundcube/plugins/password/drivers/
     touch /var/log/roundcube/errors
     chmod 640 /etc/roundcube/config.inc.php
     chown root:www-data /etc/roundcube/config.inc.php
@@ -1568,7 +1568,7 @@ fi
 
 if [ "$fail2ban" = 'yes' ]; then
     echo "(*) Configuring fail2ban access monitor..."
-    cp -rf $hestiacp/fail2ban /etc/
+    cp -rf $HESTIA_INSTALL_DIR/fail2ban /etc/
     if [ "$dovecot" = 'no' ]; then
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
         fline=$(echo "$fline" |grep enabled |tail -n1 |cut -f 1 -d -)
@@ -1613,7 +1613,7 @@ fi
 # https://github.com/skurudo/phpmyadmin-fixer
 
 if [ "$mysql" = 'yes' ]; then
-    source $hestiacp/phpmyadmin/pma.sh > /dev/null 2>&1
+    source $HESTIA_INSTALL_DIR/phpmyadmin/pma.sh > /dev/null 2>&1
 fi
 
 

+ 11 - 13
install/hst-install.sh

@@ -36,19 +36,17 @@ if [ ! -z "$(grep ^admin: /etc/group)" ] && [ -z "$1" ]; then
 fi
 
 # Detect OS
-case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
-    Debian)     type="debian" ;;
-    Ubuntu)     type="ubuntu" ;;
-    *)          type="NoSupport" ;;
-esac
-
-# Detect release for Debian
-if [ "$type" = "debian" ]; then
-    release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
-    VERSION='debian'
-elif [ "$type" = "ubuntu" ]; then
-    release="$(lsb_release -s -r)"
-    VERSION='ubuntu'
+if [ -e "/etc/os-release" ]; then
+    type=$(grep "^ID=" /etc/os-release | cut -f 2 -d '=')
+    if [ "$type" = "ubuntu" ]; then
+        release="$(lsb_release -s -r)"
+        VERSION='ubuntu'
+    elif [ "$type" = "debian" ]; then
+        release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
+        VERSION='debian'
+    fi
+else
+    type="NoSupport"
 fi
 
 no_support_message(){

+ 0 - 36
install/upgrade/messages.sh

@@ -1,36 +0,0 @@
-#!/bin/bash
-function welcome_message() {
-    echo
-    echo '     _   _           _   _        ____ ____        '
-    echo '    | | | | ___  ___| |_(_) __ _ / ___|  _ \       '
-    echo '    | |_| |/ _ \/ __| __| |/ _` | |   | |_) |      '
-    echo '    |  _  |  __/\__ \ |_| | (_| | |___|  __/       '
-    echo '    |_| |_|\___||___/\__|_|\__,_|\____|_|          '
-    echo ""
-    echo "       Hestia Control Panel Upgrade Script"
-    echo "                 Version: $version                 "
-    echo "==================================================="
-    echo ""
-    echo "Existing files will be backed up to the following location:"
-    echo "$HESTIA_BACKUP/"
-    echo ""
-    echo "This process may take a few moments, please wait..."
-    echo ""
-}
-
-function upgrade_complete() {
-    echo ""
-    echo "    Upgrade complete! Please report any bugs or issues to"
-    echo "    https://github.com/hestiacp/hestiacp/issues"
-    echo ""
-    echo "    We hope that you enjoy this release of Hestia Control Panel,"
-    echo "    enjoy your day!"
-    echo ""
-    echo "    Sincerely,"
-    echo "    The Hestia Control Panel development team"
-    echo ""
-    echo "    www.hestiacp.com"
-    echo "    Made with love & pride by the open-source community around the world."
-    echo ""
-    echo ""
-}

+ 0 - 42
install/upgrade/phpmyadmin.sh

@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Define version check function
-function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
-
-# Set phpMyAdmin version for upgrade
-pma_v='4.9.0.1'
-
-pma_release_file=$(ls /usr/share/phpmyadmin/RELEASE-DATE-* 2>/dev/null |tail -n 1)
-if version_ge "${pma_release_file##*-}" "$pma_v"; then
-    echo "(*) phpMyAdmin $pma_v or newer is already installed: ${pma_release_file##*-}, skipping update..."
-else
-    # Display upgrade information
-    echo "(*) Upgrade phpMyAdmin to v$pma_v..."
-    [ -d /usr/share/phpmyadmin ] || mkdir -p /usr/share/phpmyadmin
-
-    # Download latest phpMyAdmin release
-    wget --quiet https://files.phpmyadmin.net/phpMyAdmin/$pma_v/phpMyAdmin-$pma_v-all-languages.tar.gz
- 
-    # Unpack files
-    tar xzf phpMyAdmin-$pma_v-all-languages.tar.gz
-
-    # Delete file to prevent error
-    rm -fr /usr/share/phpmyadmin/doc/html
-
-    # Overwrite old files
-    cp -rf phpMyAdmin-$pma_v-all-languages/* /usr/share/phpmyadmin
-
-    # Set config and log directory
-    sed -i "s|define('CONFIG_DIR', '');|define('CONFIG_DIR', '/etc/phpmyadmin/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-    sed -i "s|define('TEMP_DIR', './tmp/');|define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');|" /usr/share/phpmyadmin/libraries/vendor_config.php
-
-    # Create temporary folder and change permissions
-    if [ ! -d /usr/share/phpmyadmin/tmp ]; then
-        mkdir /usr/share/phpmyadmin/tmp
-        chmod 777 /usr/share/phpmyadmin/tmp
-    fi
-
-    # Clean up source files
-    rm -fr phpMyAdmin-$pma_v-all-languages
-    rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
-fi

+ 0 - 42
install/upgrade/restart.sh

@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Rebuild users and domains
-for user in `ls /usr/local/hestia/data/users/`; do
-    echo "(*) Rebuilding domains and account for user: $user..."
-    if [ ! -z $WEB_SYSTEM ]; then
-        $BIN/v-rebuild-web-domains $user >/dev/null 2>&1
-    fi
-    if [ ! -z $DNS_SYSTEM ]; then
-        $BIN/v-rebuild-dns-domains $user >/dev/null 2>&1
-    fi
-    if [ ! -z $MAIL_SYSTEM ]; then 
-        $BIN/v-rebuild-mail-domains $user >/dev/null 2>&1
-    fi
-done
-
-echo "(*) Restarting services..."
-if [ ! -z $MAIL_SYSTEM ]; then
-    $BIN/v-restart-mail $restart
-fi
-if [ ! -z $IMAP_SYSTEM ]; then
-    $BIN/v-restart-service $IMAP_SYSTEM $restart
-fi
-if [ ! -z $WEB_SYSTEM ]; then
-    $BIN/v-restart-web $restart
-    $BIN/v-restart-proxy $restart
-fi
-if [ ! -z $DNS_SYSTEM ]; then
-    $BIN/v-restart-dns $restart
-fi
-for v in `ls /etc/php/`; do
-	if [ -e /etc/php/$v/fpm ]; then
-		$BIN/v-restart-service php$v-fpm $restart
-	fi
-done
-if [ ! -z $FTP_SYSTEM ]; then
-    $BIN/v-restart-ftp $restart
-fi
-
-# Restart SSH daemon and Hestia Control Panel service
-$BIN/v-restart-service ssh $restart
-$BIN/v-restart-service hestia $restart

+ 0 - 39
install/upgrade/version.sh

@@ -1,39 +0,0 @@
-#!/bin/bash
-
-# Add release branch system configuration if non-existent
-release_branch_check=$(cat $HESTIA/conf/hestia.conf | grep RELEASE_BRANCH)
-if [ -z "$release_branch_check" ]; then
-    echo "(*) Adding global release branch variable to system configuration..."
-    sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
-    echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
-fi
-
-# Step through version upgrade scripts in order as necessary to ensure that systems
-# are properly upgraded if skipping versions.
-if [ $VERSION = "$version" ]; then
-    echo "(!) The latest version of Hestia Control Panel ($version) is already installed."
-    echo "    Verifying configuration..."
-    echo ""
-    source /usr/local/hestia/install/upgrade/versions/$version.sh
-    VERSION="$version"
-fi
-if [ $VERSION = "0.9.8-27" ] || [ $VERSION = "0.9.8-28" ]; then
-    source /usr/local/hestia/install/upgrade/versions/0.9.8-29.sh
-    VERSION="0.9.8-29"
-fi
-if [ $VERSION = "0.9.8-29" ]; then
-    source /usr/local/hestia/install/upgrade/versions/1.00.0-190618.sh
-    VERSION="1.00.0-190618"
-fi
-if [ $VERSION = "0.10.00" ] || [ $VERSION = "1.00.0-190618" ] || [ $VERSION = "1.00.0-190621" ]; then
-    source /usr/local/hestia/install/upgrade/versions/1.0.1.sh
-    VERSION="1.0.1"
-fi
-if [ $VERSION = "1.0.1" ]; then
-    source /usr/local/hestia/install/upgrade/versions/1.0.2.sh
-    VERSION="1.0.2"
-fi
-if [ $VERSION = "1.0.2" ]; then
-    source /usr/local/hestia/install/upgrade/versions/$version.sh
-    VERSION="$version"
-fi

+ 0 - 0
install/upgrade/versions/1.0.2.sh


+ 16 - 8
install/upgrade/versions/1.0.3.sh → install/upgrade/versions/latest.sh

@@ -15,18 +15,18 @@ fi
 # Replace dhparam 1024 with dhparam 4096
 echo "(*) Installing 4096-bit SSL security certificate..."
 mv /etc/ssl/dhparam.pem $HESTIA_BACKUP/conf/
-cp -f $hestiacp/ssl/dhparam.pem /etc/ssl/
+cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl/
 chmod 600 /etc/ssl/dhparam.pem
 
 # Enhance Vsftpd security
-echo "(*) Modifying Vsftpd SSL configuration..."
+echo "(*) Hardening Vsftpd SSL configuration..."
 cp -f /etc/vsftpd.conf $HESTIA_BACKUP/conf/
 sed -i "s|ssl_tlsv1=YES|ssl_tlsv1=NO|g" /etc/vsftpd.conf
 
 # Enhance Dovecot security
-echo "(*) Modifying Dovecot SSL configuration..."
+echo "(*) Hardening Dovecot SSL configuration..."
 mv /etc/dovecot/conf.d/10-ssl.conf $HESTIA_BACKUP/conf/
-cp -f $hestiacp/dovecot/conf.d/10-ssl.conf /etc/dovecot/conf.d/
+cp -f $HESTIA_INSTALL_DIR/dovecot/conf.d/10-ssl.conf /etc/dovecot/conf.d/
 
 # Update DNS resolvers in hestia-nginx's configuration
 echo "(*) Updating DNS resolvers for Hestia Internal Web Server..."
@@ -45,13 +45,21 @@ WEBALIZER_CHECK=$(cat $HESTIA/conf/hestia.conf | grep webalizer)
 if [ ! -z "$WEBALIZER_CHECK" ]; then
     echo "(*) Removing Webalizer and setting AWStats as default web statistics backend..."
     apt purge webalizer -y > /dev/null 2>&1
-    rm -fr $HESTIA/data/templates/web/webalizer
-    rm -fr $HESTIA/install/deb/templates/web/webalizer
-    rm -fr /var/www/webalizer
+    if [ -d "$HESTIA/data/templates/web/webalizer" ]; then
+        rm -rf $HESTIA/data/templates/web/webalizer
+    fi
+    if [ -d "/var/www/webalizer" ]; then
+        rm -rf /var/www/webalizer
+    fi
     sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
 fi
 
-# Remove hestia.conf in nginx.d
+# Remove old hestia.conf files from Apache & NGINX if they exist
+if [ -f "/etc/nginx/conf.d/hestia.conf" ]; then
+    echo "(*) Removing Apache configuration file from previous version of Hestia Control Panel..."
+    rm -f /etc/apache2/conf.d/hestia.conf
+fi
 if [ -f "/etc/nginx/conf.d/hestia.conf" ]; then
+    echo "(*) Removing old NGINX configuration file from previous version of Hestia Control Panel..."
     rm -f /etc/nginx/conf.d/hestia.conf
 fi

+ 0 - 0
install/upgrade/versions/0.9.8-29.sh → install/upgrade/versions/previous/0.9.8-29.sh


+ 0 - 0
install/upgrade/versions/1.0.1.sh → install/upgrade/versions/previous/1.0.1.sh


+ 7 - 0
install/upgrade/versions/previous/1.0.2.sh

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Hestia Control Panel upgrade script for target version 1.0.2
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################

+ 12 - 20
install/upgrade/versions/1.00.0-190618.sh → install/upgrade/versions/previous/1.00.0-190618.sh

@@ -18,22 +18,22 @@ fi
 if [ -f /etc/apache2/apache.conf ]; then
     echo "(*) Updating Apache configuration..."
     mv  /etc/apache2/apache.conf $HESTIA_BACKUP/conf/
-    cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
+    cp -f $HESTIA_INSTALL_DIR/apache2/apache.conf /etc/apache2/apache.conf
 fi
 if [ -f /etc/nginx/nginx.conf ]; then
     echo "(*) Updating NGINX configuration..."
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
-    cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
+    cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/nginx.conf
 fi
 
 # Generate dhparam
 if [ ! -e /etc/ssl/dhparam.pem ]; then
     echo "(*) Enabling HTTPS Strict Transport Security (HSTS) support..."
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
-    cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
+    cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
 
     # Copy dhparam
-    cp -f $hestiacp/ssl/dhparam.pem /etc/ssl/
+    cp -f $HESTIA_INSTALL_DIR/ssl/dhparam.pem /etc/ssl/
 
     # Update DNS servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
@@ -74,8 +74,8 @@ if [ ! -d /var/www/document_errors/ ]; then
     mkdir -p /var/www/document_errors/
 fi
 
-cp -rf $HESTIA/install/deb/templates/web/unassigned/* /var/www/html/
-cp -rf $HESTIA/install/deb/templates/web/skel/document_errors/* /var/www/document_errors/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/* /var/www/html/
+cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
 chmod 644 /var/www/html/*
 chmod 644 /var/www/document_errors/*
 
@@ -139,7 +139,7 @@ for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
             echo "NameVirtualHost $ipaddr:$WEB_PORT" >  $web_conf
         fi
         echo "Listen $ipaddr:$WEB_PORT" >> $web_conf
-        cat $HESTIA/install/deb/apache2/unassigned.conf >> $web_conf
+        cat $HESTIA_INSTALL_DIR/apache2/unassigned.conf >> $web_conf
         sed -i 's/directIP/'$ipaddr'/g' $web_conf
         sed -i 's/directPORT/'$WEB_PORT'/g' $web_conf
 
@@ -152,7 +152,7 @@ for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
         fi
     
     elif [ "$WEB_SYSTEM" = "nginx" ]; then
-        cp -f $HESTIA/install/deb/nginx/unassigned.inc $web_conf
+        cp -f $HESTIA_INSTALL_DIR/nginx/unassigned.inc $web_conf
         sed -i 's/directIP/'$ipaddr'/g' $web_conf
     fi
 
@@ -172,7 +172,7 @@ if [ ! -f /etc/cron.daily/php-session-cleanup ]; then
     echo "find -O3 /home/*/tmp/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
     echo "find -O3 $HESTIA/data/sessions/ -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin '+10080' -delete > /dev/null 2>&1" >> /etc/cron.daily/php-session-cleanup
 fi
-    chmod 755 /etc/cron.daily/php-session-cleanup
+chmod 755 /etc/cron.daily/php-session-cleanup
 
 # Fix empty pool error message for MultiPHP
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
@@ -182,7 +182,7 @@ if [ "$php_versions" -gt 1 ]; then
         if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
             continue
         fi
-        cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
+        cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
         v1=$(echo "$v" | sed -e 's/[.]//')
         sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
     done
@@ -218,7 +218,7 @@ fi
 if [ -f /etc/dovecot/dovecot.conf ]; then
     # Update Dovecot configuration and restart Dovecot service
     mv  /etc/dovecot/dovecot.conf $HESTIA_BACKUP/conf/
-    cp -f $HESTIA/install/deb/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
+    cp -f $HESTIA_INSTALL_DIR/dovecot/dovecot.conf /etc/dovecot/dovecot.conf
     systemctl restart dovecot
     sleep 0.5
 fi
@@ -227,7 +227,7 @@ fi
 if [ -f /etc/exim4/exim4.conf.template ]; then
     echo "(*) Updating Exim SMTP server configuration..."
     mv  /etc/exim4/exim4.conf.template $HESTIA_BACKUP/conf/
-    cp -f $HESTIA/install/deb/exim/exim4.conf.template /etc/exim4/exim4.conf.template
+    cp -f $HESTIA_INSTALL_DIR/exim/exim4.conf.template /etc/exim4/exim4.conf.template
     # Reconfigure spam filter and virus scanning
     if [ ! -z "$ANTISPAM_SYSTEM" ]; then
         sed -i "s/#SPAM/SPAM/g" /etc/exim4/exim4.conf.template
@@ -246,14 +246,6 @@ if [ -z "$IMAP_SYSTEM" ]; then
     fi
 fi
 
-# Remove Webalizer and set AWStats as default
-WEBALIAZER_CHECK=$(cat $HESTIA/conf/hestia.conf | grep webalizer)
-if [ ! -z "$WEBALIZER_CHECK" ]; then
-    echo "(*) Removing Webalizer and setting AWStats as default web statistics backend..."
-    apt purge webalizer -y > /dev/null 2>&1
-    sed -i "s/STATS_SYSTEM='webalizer,awstats'/STATS_SYSTEM='awstats'/g" $HESTIA/conf/hestia.conf
-fi
-
 # Run sftp jail once
 $HESTIA/bin/v-add-sys-sftp-jail
 

+ 2 - 2
src/deb/hestia/copyright

@@ -3,9 +3,9 @@ Upstream-Name: hestia
 Source: https://www.hestiacp.com
 
 Files: *
-Copyright: 2018 HestiaCP <info@hestiacp.com>
+Copyright: 2018-2019, Hestia Control Panel <info@hestiacp.com>
 License: GPL-3.0+
-Remarks: Hestia is a fork from VestaCP, special thanks to vestacp.com and Serghey Rodin
+Remarks: Hestia Control Panel is a fork from VestaCP, special thanks to vestacp.com and Serghey Rodin
 
 License: GPL-3.0+
  This program is free software: you can redistribute it and/or modify

+ 16 - 51
src/deb/hestia/postinst

@@ -1,64 +1,29 @@
 #!/bin/bash
 
-# Configure apt to retry downloading on error
-if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
-    echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
-fi
+# Define global functions, upgrade functions, and necessary variables
+source $HESTIA/func/main.sh
+source $HESTIA/func/upgrade.sh
 
-# Define version check function
-function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+# Initialize backup directories
+upgrade_init_backup
 
-# Get package version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
-
-# Define global variables
-source /usr/local/hestia/func/main.sh
-
-# Load message variables
-source /usr/local/hestia/install/upgrade/messages.sh
-
-# Set backup folder
-HESTIA_BACKUP="/root/hst_upgrade_backups/$(date +%d%m%Y%H%M)"
-
-# Initialize backup folders
-mkdir -p $HESTIA_BACKUP/conf/
-mkdir -p $HESTIA_BACKUP/packages/
-mkdir -p $HESTIA_BACKUP/templates/
-
-# Set installation source folder
-hestiacp="$HESTIA/install/deb"
-
-# Run triggers only on updates
-if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
-    exit
-fi
-
-# Clear the screen from apt output to prepare for upgrade installer experience
+# Set up console display and welcome message
 clear
-welcome_message
+upgrade_welcome_message
 
-# Load hestia.conf
-source /usr/local/hestia/conf/hestia.conf
-
-# Perform necessary upgrade steps
-source /usr/local/hestia/install/upgrade/version.sh
+# Execute version-specific upgrade scripts
+upgrade_start_routine
 
 # Upgrade phpMyAdmin if applicable
-if [ "$DB_SYSTEM" = 'mysql' ]; then
-    source /usr/local/hestia/install/upgrade/phpmyadmin.sh
-fi
-
-# Set new version
-sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
-echo "VERSION='$version'" >> $HESTIA/conf/hestia.conf
+upgrade_phpmyadmin
 
-# Add upgrade notification to admin user's panel
-$HESTIA/bin/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to Hestia Control Panel version '$version'.<br>Please report any bugs on GitHub at<br><a href="https://github.com/hestiacp/hestiacp/Issues" target="_new">https://github.com/hestiacp/hestiacp/Issues</a><br><br>Have a great day!'
+# Perform account and domain rebuild to ensure configuration files are correct
+upgrade_rebuild_users
 
-# Restart services for changes to take full effect
-source /usr/local/hestia/install/upgrade/restart.sh
+# Restart necessary services for changes to take full effect
+upgrade_restart_services
 
-# Display completion message
-upgrade_complete
+# Add upgrade notification to admin user's panel and display completion message
+upgrade_message_complete
 
 exit 0

+ 19 - 8
src/deb/hestia/preinst

@@ -5,13 +5,24 @@ if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
     exit
 fi
 
-# Load hestia.conf
-source /usr/local/hestia/conf/hestia.conf
+# Configure apt to retry downloading on error
+if [ ! -f /etc/apt/apt.conf.d/80-retries ]; then
+    echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries
+fi
+
+# Add release branch system configuration if non-existent
+release_branch_check=$(cat $HESTIA/conf/hestia.conf | grep RELEASE_BRANCH)
+if [ -z "$release_branch_check" ]; then
+    echo "(*) Adding global release branch variable to system configuration..."
+    sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
+    echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
+fi
+
+# Set new version number for Hestia Control Panel
+new_version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
 
-# Get hestia version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+# Set new version number for phpMyAdmin
+pma_v='4.9.0.1'
 
-# Set hestia version if different.
-if [ "$VERSION" != "$version" ]; then
-    sed -i "s/VERSION='$VERSION'/VERSION='$version'/g" /usr/local/hestia/conf/hestia.conf
-fi
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf