Kaynağa Gözat

Merge branch 'release-1.0.1'

Kristan Kenney 6 yıl önce
ebeveyn
işleme
bdab1ca56a
82 değiştirilmiş dosya ile 978 ekleme ve 461 silme
  1. 1 1
      README.md
  2. 81 0
      bin/v-add-letsencrypt-host
  3. 6 2
      bin/v-add-mail-domain
  4. 6 4
      bin/v-add-sys-sftp-jail
  5. 8 3
      bin/v-add-user-sftp-jail
  6. 7 1
      bin/v-add-web-domain
  7. 32 26
      bin/v-add-webmail
  8. 3 1
      bin/v-change-sys-port
  9. 4 4
      bin/v-change-sys-release
  10. 75 0
      bin/v-change-web-domain-hsts
  11. 15 10
      bin/v-delete-webmail
  12. 3 0
      bin/v-generate-ssl-cert
  13. 4 2
      bin/v-rebuild-mail-domain
  14. 4 2
      bin/v-rebuild-mail-domains
  15. 1 1
      bin/v-restore-user
  16. 3 2
      bin/v-unsuspend-mail-domain
  17. 63 57
      bin/v-update-sys-hestia-git
  18. 29 12
      bin/v-update-web-templates
  19. 1 1
      func/domain.sh
  20. 4 0
      install/deb/multiphp/nginx/PHP-56.stpl
  21. 4 0
      install/deb/multiphp/nginx/PHP-70.stpl
  22. 4 0
      install/deb/multiphp/nginx/PHP-71.stpl
  23. 4 0
      install/deb/multiphp/nginx/PHP-72.stpl
  24. 4 0
      install/deb/multiphp/nginx/PHP-73.stpl
  25. 1 5
      install/deb/nginx/nginx.conf
  26. 11 0
      install/deb/templates/dns/default-nomail.tpl
  27. 4 0
      install/deb/templates/web/nginx/caching.stpl
  28. 4 0
      install/deb/templates/web/nginx/default.stpl
  29. 4 0
      install/deb/templates/web/nginx/hosting.stpl
  30. 4 0
      install/deb/templates/web/nginx/php-fpm/cms_made_simple.stpl
  31. 4 0
      install/deb/templates/web/nginx/php-fpm/codeigniter2.stpl
  32. 4 0
      install/deb/templates/web/nginx/php-fpm/codeigniter3.stpl
  33. 4 0
      install/deb/templates/web/nginx/php-fpm/datalife_engine.stpl
  34. 4 0
      install/deb/templates/web/nginx/php-fpm/default.stpl
  35. 4 0
      install/deb/templates/web/nginx/php-fpm/dokuwiki.stpl
  36. 4 0
      install/deb/templates/web/nginx/php-fpm/drupal6.stpl
  37. 4 0
      install/deb/templates/web/nginx/php-fpm/drupal7.stpl
  38. 4 0
      install/deb/templates/web/nginx/php-fpm/drupal8.stpl
  39. 4 0
      install/deb/templates/web/nginx/php-fpm/joomla.stpl
  40. 4 1
      install/deb/templates/web/nginx/php-fpm/laravel.stpl
  41. 4 0
      install/deb/templates/web/nginx/php-fpm/magento.stpl
  42. 5 0
      install/deb/templates/web/nginx/php-fpm/modx.stpl
  43. 4 0
      install/deb/templates/web/nginx/php-fpm/moodle.stpl
  44. 4 0
      install/deb/templates/web/nginx/php-fpm/no-php.stpl
  45. 4 0
      install/deb/templates/web/nginx/php-fpm/odoo.stpl
  46. 4 0
      install/deb/templates/web/nginx/php-fpm/opencart.stpl
  47. 4 0
      install/deb/templates/web/nginx/php-fpm/owncloud.stpl
  48. 4 0
      install/deb/templates/web/nginx/php-fpm/piwik.stpl
  49. 4 0
      install/deb/templates/web/nginx/php-fpm/pyrocms.stpl
  50. 4 0
      install/deb/templates/web/nginx/php-fpm/sendy.stpl
  51. 4 0
      install/deb/templates/web/nginx/php-fpm/wordpress.stpl
  52. 51 13
      install/hst-install-debian.sh
  53. 46 13
      install/hst-install-ubuntu.sh
  54. 1 1
      install/hst-install.sh
  55. 0 67
      install/upgrade/0.9.8-28.sh
  56. 36 0
      install/upgrade/messages.sh
  57. 42 0
      install/upgrade/phpmyadmin.sh
  58. 41 0
      install/upgrade/restart.sh
  59. 31 0
      install/upgrade/version.sh
  60. 31 0
      install/upgrade/versions/0.9.8-28.sh
  61. 30 0
      install/upgrade/versions/1.0.1.sh
  62. 12 168
      install/upgrade/versions/1.00.0-190618.sh
  63. 1 1
      src/deb/hestia/control
  64. 49 9
      src/deb/hestia/postinst
  65. 14 1
      src/deb/nginx/postinst
  66. 2 2
      src/hst_autocompile.sh
  67. 3 2
      web/css/styles.min.css
  68. 7 2
      web/edit/package/index.php
  69. 1 0
      web/inc/i18n/en.php
  70. 3 3
      web/js/app.js
  71. 13 0
      web/js/events.js
  72. 1 0
      web/js/i18n.js.php
  73. 5 1
      web/js/pages/add_web.js
  74. 34 29
      web/templates/admin/list_backup_detail.html
  75. 1 1
      web/templates/admin/list_server_info.html
  76. 30 3
      web/templates/admin/list_services.html
  77. 2 1
      web/templates/admin/list_stats.html
  78. 2 4
      web/templates/admin/list_updates.html
  79. 1 1
      web/templates/admin/list_user.html
  80. 6 2
      web/templates/admin/panel.html
  81. 2 1
      web/templates/user/list_stats.html
  82. 1 1
      web/templates/user/panel.html

+ 1 - 1
README.md

@@ -117,4 +117,4 @@ If you would like to help our developers cover their time and infrastucture cost
 
 
 License
 License
 =============================
 =============================
-Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/master/LICENSE) license, and is based on the [VestaCP](https://www.vestacp.com/) project.<br>
+Hestia Control Panel is licensed under [GPL v3](https://github.com/hestiacp/hestiacp/blob/master/LICENSE) license, and is based on the [VestaCP](https://www.vestacp.com/) project.<br>

+ 81 - 0
bin/v-add-letsencrypt-host

@@ -0,0 +1,81 @@
+#!/bin/bash
+# info: add letsencrypt for host and backend
+# options:
+#
+# The function check and validates the backend certificate and generate
+# a new let's encrypt certificate.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument definition
+user="admin"
+domain=$HOSTNAME
+
+# Includes
+source $HESTIA/func/main.sh
+source $HESTIA/func/domain.sh
+source $HESTIA/conf/hestia.conf
+
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+is_format_valid 'user' 'domain' 'aliases'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
+
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Check if hostname already exists as domain
+if [ "$($BIN/v-list-web-domain $user $domain plain |cut -f 1)" != "$domain" ]; then
+    # Create web domain for hostname
+    $BIN/v-add-web-domain $user $domain
+fi
+
+# Validate web domain
+is_object_valid 'web' 'DOMAIN' "$domain"
+is_object_unsuspended 'web' 'DOMAIN' "$domain"
+get_domain_values 'web'
+
+# Load domain data
+eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
+
+# Set ssl installation to yes
+add_ssl="yes"
+
+if [ "$SSL" = "yes" ]; then
+    # Valildate SSL Certificate
+    if [ -e "$USER_DATA/ssl/$domain.ca" ]; then
+        if openssl verify -CAfile $USER_DATA/ssl/$domain.ca $USER_DATA/ssl/$domain.pem | grep -q "$domain.pem: OK"; then
+            add_ssl="no"
+        fi
+    else
+        if openssl verify $USER_DATA/ssl/$domain.pem | grep -q "$domain.pem: OK"; then
+            add_ssl="no"
+        fi
+    fi
+fi
+
+# Add let's encrypt ssl if needed
+if [ "$add_ssl" = "yes" ]; then
+    # Add let's encrypt ssl
+    $BIN/v-add-letsencrypt-domain $user $domain
+fi
+
+# Add certificate to backend
+$BIN/v-update-host-certificate $user $domain
+
+
+#----------------------------------------------------------#
+#                        Hestia                            #
+#----------------------------------------------------------#
+
+exit

+ 6 - 2
bin/v-add-mail-domain

@@ -108,7 +108,9 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
 
 
     # Set ownership
     # Set ownership
     chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
     chown -R $MAIL_USER:mail $HOMEDIR/$user/conf/mail/$domain
-    chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
+    if [ "$IMAP_SYSTEM" = 'dovecot' ]; then
+        chown -R dovecot:mail $HOMEDIR/$user/conf/mail/$domain/passwd
+    fi
     chown $user:mail $HOMEDIR/$user/mail/$domain_idn
     chown $user:mail $HOMEDIR/$user/mail/$domain_idn
 fi
 fi
 
 
@@ -129,7 +131,9 @@ fi
 
 
 # Add webmail configuration to mail domain
 # Add webmail configuration to mail domain
 if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
 if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
-    $BIN/v-add-webmail $user $domain '' 
+    if [ ! -z "$IMAP_SYSTEM" ]; then
+        $BIN/v-add-webmail $user $domain ''
+    fi
 fi
 fi
     
     
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 6 - 4
bin/v-add-sys-sftp-jail

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 # info: add system sftp jail
 # info: add system sftp jail
-# options: NONE
+# options: [RESTART]
 #
 #
 # The script enables sftp jailed environment
 # The script enables sftp jailed environment
 
 
@@ -14,6 +14,7 @@ source /etc/profile
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 source $HESTIA/conf/hestia.conf
 
 
+restart=$1
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                    Verifications                         #
 #                    Verifications                         #
@@ -45,11 +46,13 @@ if [ -z "$sftp_i" ]; then
     echo "    X11Forwarding no" >> $config
     echo "    X11Forwarding no" >> $config
     echo "    AllowTCPForwarding no" >> $config
     echo "    AllowTCPForwarding no" >> $config
     echo "    ForceCommand internal-sftp" >> $config
     echo "    ForceCommand internal-sftp" >> $config
-    restart='yes'
 fi
 fi
 
 
 # Validating opensshd config
 # Validating opensshd config
-if [ "$restart" = 'yes' ]; then
+if [ "$restart" = 'no' ]; then
+   # Skipping SSH Restart
+   echo "" >  /dev/null 2>&1
+else
     subj="OpenSSH restart failed"
     subj="OpenSSH restart failed"
     email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
     email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
     /usr/sbin/sshd -t >/dev/null 2>&1
     /usr/sbin/sshd -t >/dev/null 2>&1
@@ -59,7 +62,6 @@ if [ "$restart" = 'yes' ]; then
         echo -e "$mail_text" |$SENDMAIL -s "$subj" $email
         echo -e "$mail_text" |$SENDMAIL -s "$subj" $email
     else
     else
         service ssh restart >/dev/null 2>&1
         service ssh restart >/dev/null 2>&1
-        service sshd restart >/dev/null 2>&1
     fi
     fi
 fi
 fi
 
 

+ 8 - 3
bin/v-add-user-sftp-jail

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 # info: add user sftp jail
 # info: add user sftp jail
-# options: USER
+# options: USER [RESTART]
 #
 #
 # The script enables sftp jailed environment
 # The script enables sftp jailed environment
 
 
@@ -11,6 +11,7 @@
 
 
 # Argument definition
 # Argument definition
 user=$1
 user=$1
+restart=$2
 
 
 # Includes
 # Includes
 source $HESTIA/func/main.sh
 source $HESTIA/func/main.sh
@@ -62,8 +63,12 @@ chown root:root /home/$user
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Restart ssh service
 # Restart ssh service
-service ssh restart > /dev/null 2>&1
-service sshd restart > /dev/null 2>&1
+if [ "$restart" = 'no' ]; then
+    # Skip restart of SSH daemon
+    echo "" > /dev/null 2>&1
+else
+    service ssh restart > /dev/null 2>&1
+fi
 
 
 # Logging
 # Logging
 log_event "$OK" "$ARGUMENTS"
 log_event "$OK" "$ARGUMENTS"

+ 7 - 1
bin/v-add-web-domain

@@ -114,7 +114,13 @@ if [ "$aliases" = 'none' ]; then
 else
 else
     ALIAS="www.$domain"
     ALIAS="www.$domain"
     if [ -z "$aliases" ]; then
     if [ -z "$aliases" ]; then
-        ALIAS="www.$domain"
+        # Check and skip www alias for subdomains.
+        IFS='.' read -r -a domain_elements <<< "$domain"
+        if [ "${#domain_elements[@]}" -gt 2 ]; then
+            ALIAS=""
+        else
+            ALIAS="www.$domain"
+        fi
     else
     else
         ALIAS="$aliases"
         ALIAS="$aliases"
     fi
     fi

+ 32 - 26
bin/v-add-webmail

@@ -45,6 +45,7 @@ check_args '2' "$#" 'USER DOMAIN [RESTART]'
 is_format_valid 'user' 'domain'
 is_format_valid 'user' 'domain'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
+is_system_enabled "$IMAP_SYSTEM" 'IMAP_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_valid 'mail' 'DOMAIN' "$domain"
@@ -54,39 +55,44 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-# Ensure DNS record exists if Hestia is hosting DNS zones
-if [ ! -z "$DNS_SYSTEM" ]; then
-    dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
-    webmail_record=$($BIN/v-list-dns-records $user $domain | grep -i $WEBMAIL_ALIAS | cut -d' ' -f1)
-
-    if [ "$dns_domain" = "$domain" ]; then
-        if [ -z "$webmail_record" ]; then
-            $BIN/v-add-dns-record $user $domain $WEBMAIL_ALIAS A $ip
-        else
-            $BIN/v-delete-dns-record $user $domain $webmail_record
-            $BIN/v-add-dns-record $user $domain $WEBMAIL_ALIAS A $ip
+# Verify that webmail alias variable exists
+if [ ! -z "$WEBMAIL_ALIAS" ]; then
+    # Ensure DNS record exists if Hestia is hosting DNS zones
+    if [ ! -z "$DNS_SYSTEM" ]; then
+        dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
+        webmail_record=$($BIN/v-list-dns-records $user $domain | grep -i $WEBMAIL_ALIAS | cut -d' ' -f1)
+
+        if [ "$dns_domain" = "$domain" ]; then
+            if [ -z "$webmail_record" ]; then
+                $BIN/v-add-dns-record $user $domain $WEBMAIL_ALIAS A $ip
+            else
+                $BIN/v-delete-dns-record $user $domain $webmail_record
+                $BIN/v-add-dns-record $user $domain $WEBMAIL_ALIAS A $ip
+            fi
         fi
         fi
     fi
     fi
-fi
 
 
-# Add webmail configuration to mail domain
-WEBMAIL_TEMPLATE="default"
-if [ "$WEB_SYSTEM" = "nginx" ]; then
-    WEBMAIL_TEMPLATE="web_system"
-fi
-add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.tpl"
+    # Add webmail configuration to mail domain
+    WEBMAIL_TEMPLATE="default"
+    if [ "$WEB_SYSTEM" = "nginx" ]; then
+        WEBMAIL_TEMPLATE="web_system"
+    fi
+    add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.tpl"
 
 
-if [ ! -z "$PROXY_SYSTEM" ]; then
-    add_webmail_config "$PROXY_SYSTEM" "default.tpl"
-fi
+    if [ ! -z "$PROXY_SYSTEM" ]; then
+        add_webmail_config "$PROXY_SYSTEM" "default.tpl"
+    fi
 
 
-# Enable SSL for webmail if available
-if [ -f $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.crt ] || [ "$SSL" = 'yes' ]; then
-    add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.stpl"
+    # Enable SSL for webmail if available
+    if [ -f $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.crt ] || [ "$SSL" = 'yes' ]; then
+        add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.stpl"
 
 
-    if [ ! -z "$PROXY_SYSTEM" ]; then
-        add_webmail_config "$PROXY_SYSTEM" "default.stpl"
+        if [ ! -z "$PROXY_SYSTEM" ]; then
+            add_webmail_config "$PROXY_SYSTEM" "default.stpl"
+        fi
     fi
     fi
+else
+    echo "Error: WEBMAIL_ALIAS is not defined in hestia.conf"
 fi
 fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 3 - 1
bin/v-change-sys-port

@@ -72,7 +72,9 @@ if [ "$ORIGINAL_PORT" = "$PORT" ]; then
 else
 else
     # Replace port in config files.
     # Replace port in config files.
     sed -i "/listen/c\        listen          $PORT ssl;" $HESTIA/nginx/conf/nginx.conf
     sed -i "/listen/c\        listen          $PORT ssl;" $HESTIA/nginx/conf/nginx.conf
-    sed -i "/password_hestia_port/c\$rcmail_config['password_hestia_port'] = '$PORT';" /etc/roundcube/plugins/password/config.inc.php
+    if [ -d /etc/roundcube/ ]; then
+        sed -i "/password_hestia_port/c\$rcmail_config['password_hestia_port'] = '$PORT';" /etc/roundcube/plugins/password/config.inc.php
+    fi
     sed -i "/COMMENT='HESTIA'/c\RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='$PORT' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'" $HESTIA/data/firewall/rules.conf
     sed -i "/COMMENT='HESTIA'/c\RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='$PORT' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'" $HESTIA/data/firewall/rules.conf
     
     
     # Restart services
     # Restart services

+ 4 - 4
bin/v-change-sys-release

@@ -27,9 +27,9 @@ if [ -z "$branch" ]; then
     echo "Usage: v-change-sys-release branchname"
     echo "Usage: v-change-sys-release branchname"
     echo ""
     echo ""
     echo "Common release branches:"
     echo "Common release branches:"
-    echo "(*) master:   Stable releases only"
-    echo "(*) beta:     Beta builds which are being prepared for release"
-    echo "(*) develop:  Daily development builds"
+    echo "(*) release:      The latest stable release available via APT"
+    echo "(*) prerelease:   Beta/release candidate releases"
+    echo "(*) master:       The latest development code from GitHub"
     echo ""
     echo ""
     echo "You can also specify another branch name from the"
     echo "You can also specify another branch name from the"
     echo "GitHub repository to install the code from that branch."
     echo "GitHub repository to install the code from that branch."
@@ -49,7 +49,7 @@ else
     
     
     # Set new branch variable
     # Set new branch variable
     echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
     echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
-    echo "Changed system release to update from Git branch: $branch"
+    echo "Changed system release to update from branch: $branch"
 fi
 fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 75 - 0
bin/v-change-web-domain-hsts

@@ -0,0 +1,75 @@
+#!/bin/bash
+# info: add/remove HSTS support from a domain
+# options: USER DOMAIN STATUS
+#
+# This function will enable or disable HSTS (HTTP Strict Transport Security)
+# for a web domain.
+
+
+#----------------------------------------------------------#
+#                    Variable&Function                     #
+#----------------------------------------------------------#
+
+# Argument definition
+user=$1
+domain=$2
+domain_idn=$2
+status=$3
+
+# Includes
+source $HESTIA/func/main.sh
+source $HESTIA/func/domain.sh
+source $HESTIA/conf/hestia.conf
+
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER DOMAIN'
+is_format_valid 'user' 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+is_object_valid 'web' 'DOMAIN' "$domain"
+is_object_unsuspended 'web' 'DOMAIN' "$domain"
+
+#----------------------------------------------------------#
+#                       Action                             #
+#----------------------------------------------------------#
+
+# Load domain data
+eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
+
+# Check if SSL is enabled
+if [ "$SSL" != 'yes' ]; then
+    echo "Error: SSL is not enabled"
+    exit $E_NOTEXIST
+fi
+
+# Check for Apache/Nginx or Nginx/PHP-FPM configuration
+if [ -z $PROXY_SYSTEM ]; then
+    hstsconf="$HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.hsts.conf"
+else
+    hstsconf="$HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.hsts.conf"
+fi
+
+if [ "$status" = "on" ]; then
+    echo 'add_header Strict-Transport-Security "max-age=15768000;" always;' > $hstsconf
+    echo "HTTP Strict Transport Security (HSTS) turned on for $domain."
+elif [ "$status" = "off" ]; then
+    rm -f $hstsconf
+    nginx -s reload
+    echo "HTTP Strict Transport Security (HSTS) turned off for $domain."
+else
+    echo "Error: Invalid mode specified."
+    echo "Usage: v-change-web-domain-hsts USER DOMAIN [ON / OFF]"
+fi
+
+#----------------------------------------------------------#
+#                       Hestia                             #
+#----------------------------------------------------------#
+
+# Logging
+log_history "Enabled HTTP Strict Transport Security on $domain."
+log_event "$OK" "$ARGUMENTS"
+
+exit

+ 15 - 10
bin/v-delete-webmail

@@ -30,6 +30,7 @@ check_args '2' "$#" 'USER DOMAIN [RESTART]'
 is_format_valid 'user' 'domain'
 is_format_valid 'user' 'domain'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
+is_system_enabled "$IMAP_SYSTEM" 'IMAP_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_valid 'mail' 'DOMAIN' "$domain"
@@ -39,20 +40,24 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 #                       Action                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-# Delete webmail configuration
-del_webmail_config
-del_webmail_ssl_config
+if [ ! -z "$WEBMAIL_ALIAS" ]; then
+    # Delete webmail configuration
+    del_webmail_config
+    del_webmail_ssl_config
 
 
-# Ensure that corresponding DNS records are removed
-if [ ! -z "$DNS_SYSTEM" ]; then
-    dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
-    webmail_record=$($BIN/v-list-dns-records $user $domain | grep -i $WEBMAIL_ALIAS | cut -d' ' -f1)
+    # Ensure that corresponding DNS records are removed
+    if [ ! -z "$DNS_SYSTEM" ]; then
+        dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
+        webmail_record=$($BIN/v-list-dns-records $user $domain | grep -i $WEBMAIL_ALIAS | cut -d' ' -f1)
 
 
-    if [ "$dns_domain" = "$domain" ]; then
-        if [ ! -z "$webmail_record" ]; then
-            $BIN/v-delete-dns-record $user $domain $webmail_record
+        if [ "$dns_domain" = "$domain" ]; then
+            if [ ! -z "$webmail_record" ]; then
+                $BIN/v-delete-dns-record $user $domain $webmail_record
+            fi
         fi
         fi
     fi
     fi
+else
+    echo "Error: WEBMAIL_ALIAS is not defined in hestia.conf."
 fi
 fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 3 - 0
bin/v-generate-ssl-cert

@@ -69,6 +69,9 @@ args_usage='DOMAIN EMAIL COUNTRY STATE CITY ORG UNIT [ALIASES] [FORMAT]'
 check_args '7' "$#" "$args_usage"
 check_args '7' "$#" "$args_usage"
 is_format_valid 'domain_alias' 'format'
 is_format_valid 'domain_alias' 'format'
 
 
+if [ ! -f /root/.rnd ]; then
+    touch /root/.rnd
+fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                       Action                             #
 #                       Action                             #

+ 4 - 2
bin/v-rebuild-mail-domain

@@ -45,8 +45,10 @@ rebuild_mail_domain_conf
 
 
 # Rebuild webmail configuration
 # Rebuild webmail configuration
 if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
 if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
-    $BIN/v-delete-webmail $user $domain ''
-    $BIN/v-add-webmail $user $domain ''
+    if [ ! -z "$IMAP_SYSTEM" ]; then
+        $BIN/v-delete-webmail $user $domain ''
+        $BIN/v-add-webmail $user $domain ''
+    fi
 fi
 fi
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#

+ 4 - 2
bin/v-rebuild-mail-domains

@@ -49,8 +49,10 @@ U_DISK_MAIL=0
 for domain in $(search_objects 'mail' 'SUSPENDED' "*" 'DOMAIN'); do
 for domain in $(search_objects 'mail' 'SUSPENDED' "*" 'DOMAIN'); do
     rebuild_mail_domain_conf
     rebuild_mail_domain_conf
     if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
     if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
-        $BIN/v-delete-webmail $user $domain ''
-        $BIN/v-add-webmail $user $domain ''
+        if [ ! -z "$IMAP_SYSTEM" ]; then
+            $BIN/v-delete-webmail $user $domain ''
+            $BIN/v-add-webmail $user $domain ''
+        fi
     fi
     fi
 done
 done
 
 

+ 1 - 1
bin/v-restore-user

@@ -588,7 +588,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then
         cp -f $tmpdir/mail/$domain/$backup_system/$domain.conf $USER_DATA/mail/
         cp -f $tmpdir/mail/$domain/$backup_system/$domain.conf $USER_DATA/mail/
 
 
         # Rebuilding mail config
         # Rebuilding mail config
-        v-rebuild-mail-domains $user
+        $BIN/v-rebuild-mail-domains $user
         
         
         domain_idn=$domain
         domain_idn=$domain
         format_domain_idn
         format_domain_idn

+ 3 - 2
bin/v-unsuspend-mail-domain

@@ -56,8 +56,9 @@ sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/mail/$domain.conf
 decrease_user_value "$user" '$SUSPENDED_MAIL'
 decrease_user_value "$user" '$SUSPENDED_MAIL'
 
 
 # Enable webmail access
 # Enable webmail access
-$BIN/v-add-webmail $user $domain 'yes'
-
+if [ ! -z "$IMAP_SYSTEM" ]; then
+    $BIN/v-add-webmail $user $domain 'yes'
+fi
 # Logging
 # Logging
 log_event "$OK" "$ARGUMENTS"
 log_event "$OK" "$ARGUMENTS"
 
 

+ 63 - 57
bin/v-update-sys-hestia-git

@@ -4,49 +4,49 @@
 
 
 # Define download function
 # Define download function
 download_file() {
 download_file() {
-  local url=$1
-  local destination=$2
-  local force=$3
-
-  # Default destination is the curent working directory
-  local dstopt=""
-
-  if [ ! -z "$(echo "$url" | grep -E "\.(gz|gzip|bz2|zip|xz)$")" ]; then
-    # When an archive file is downloaded it will be first saved localy
-    dstopt="--directory-prefix=$ARCHIVE_DIR"
-    local is_archive="true"
-    local filename="${url##*/}"
-    if [ -z "$filename" ]; then
-      >&2 echo "[!] No filename was found in url, exiting ($url)"
-      exit 1
+    local url=$1
+    local destination=$2
+    local force=$3
+
+    # Default destination is the curent working directory
+    local dstopt=""
+
+    if [ ! -z "$(echo "$url" | grep -E "\.(gz|gzip|bz2|zip|xz)$")" ]; then
+        # When an archive file is downloaded it will be first saved localy
+        dstopt="--directory-prefix=$ARCHIVE_DIR"
+        local is_archive="true"
+        local filename="${url##*/}"
+        if [ -z "$filename" ]; then
+            >&2 echo "[!] No filename was found in url, exiting ($url)"
+            exit 1
+        fi
+            if [ ! -z "$force" ] && [ -f "$ARCHIVE_DIR/$filename" ]; then
+            rm -f $ARCHIVE_DIR/$filename
+        fi
+        elif [ ! -z "$destination" ]; then
+            # Plain files will be written to specified location
+            dstopt="-O $destination"
+        fi
+        # check for corrupted archive
+        if [ -f "$ARCHIVE_DIR/$filename" ] && [ "$is_archive" = "true" ]; then
+        tar -tzf "$ARCHIVE_DIR/$filename" > /dev/null 2>&1
+        if [ $? -ne 0 ]; then
+            >&2 echo "[!] Archive $ARCHIVE_DIR/$filename is corrupted, redownloading"
+            rm -f $ARCHIVE_DIR/$filename
+        fi
     fi
     fi
-    if [ ! -z "$force" ] && [ -f "$ARCHIVE_DIR/$filename" ]; then
-      rm -f $ARCHIVE_DIR/$filename
-    fi
-  elif [ ! -z "$destination" ]; then
-    # Plain files will be written to specified location
-    dstopt="-O $destination"
-  fi
-  # check for corrupted archive
-  if [ -f "$ARCHIVE_DIR/$filename" ] && [ "$is_archive" = "true" ]; then
-    tar -tzf "$ARCHIVE_DIR/$filename" > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-      >&2 echo "[!] Archive $ARCHIVE_DIR/$filename is corrupted, redownloading"
-      rm -f $ARCHIVE_DIR/$filename
-    fi
-  fi
 
 
-  if [ ! -f "$ARCHIVE_DIR/$filename" ]; then
-    wget $url -q $dstopt --show-progress --progress=bar:force --limit-rate=3m
-  fi
+    if [ ! -f "$ARCHIVE_DIR/$filename" ]; then
+        wget $url -q $dstopt --show-progress --progress=bar:force --limit-rate=3m
+    fi
 
 
-  if [ ! -z "$destination" ] && [ "$is_archive" = "true" ]; then
-    if [ "$destination" = "-" ]; then
-      cat "$ARCHIVE_DIR/$filename"
-    elif [ -d "$(dirname $destination)" ]; then
-      cp "$ARCHIVE_DIR/$filename" "$destination"
+    if [ ! -z "$destination" ] && [ "$is_archive" = "true" ]; then
+        if [ "$destination" = "-" ]; then
+            cat "$ARCHIVE_DIR/$filename"
+        elif [ -d "$(dirname $destination)" ]; then
+            cp "$ARCHIVE_DIR/$filename" "$destination"
+        fi
     fi
     fi
-  fi
 }
 }
 
 
 # Set compiling directory
 # Set compiling directory
@@ -87,19 +87,23 @@ if [ ! -z "$1" ]; then
         echo "Error: invalid branch name specified."
         echo "Error: invalid branch name specified."
         exit 1
         exit 1
     else
     else
-      branch=$1
+        branch=$1
     fi
     fi
 else
 else
-  source /usr/local/hestia/conf/hestia.conf
-  branch=$RELEASE_BRANCH
+    source /usr/local/hestia/conf/hestia.conf
+    branch=$RELEASE_BRANCH
 fi
 fi
 
 
 if [ ! -z "$2" ]; then
 if [ ! -z "$2" ]; then
-  install=$2
+    install=$2
 else
 else
-  install="y"
+    install="y"
 fi
 fi
 
 
+if [ -z "$branch" ]; then
+    echo "No branch detected, please provide one using: v-update-sys-hestia-git branch"
+    exit
+fi
 
 
 # Install needed software
 # Install needed software
 echo "Updating system APT repositories..."
 echo "Updating system APT repositories..."
@@ -122,7 +126,7 @@ HESTIA_B='true'
 GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
 GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
 
 
 # Generate Links for sourcecode
 # Generate Links for sourcecode
-HESTIA='https://github.com/hestiacp/hestiacp/archive/'$branch'.zip'
+HESTIA_ARCHIVE_LINK='https://github.com/hestiacp/hestiacp/archive/'$branch'.zip'
 NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
 NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
@@ -174,7 +178,7 @@ if [ "$NGINX_B" = true ] ; then
 
 
     # Check install directory and remove if exists
     # Check install directory and remove if exists
     if [ -d "$BUILD_DIR$INSTALL_DIR" ]; then
     if [ -d "$BUILD_DIR$INSTALL_DIR" ]; then
-          rm -r "$BUILD_DIR$INSTALL_DIR"
+        rm -r "$BUILD_DIR$INSTALL_DIR"
     fi
     fi
 
 
     # Create the files and install them
     # Create the files and install them
@@ -253,14 +257,14 @@ if [ "$PHP_B" = true ] ; then
     cd php-$PHP_V
     cd php-$PHP_V
 
 
     # Configure PHP
     # Configure PHP
-    ./configure   --prefix=/usr/local/hestia/php \
-                --enable-fpm \
-                --with-fpm-user=admin \
-                --with-fpm-group=admin \
-                --with-libdir=lib/x86_64-linux-gnu \
-                --with-mysqli \
-                --with-curl \
-                --enable-mbstring
+    ./configure     --prefix=/usr/local/hestia/php \
+                    --enable-fpm \
+                    --with-fpm-user=admin \
+                    --with-fpm-group=admin \
+                    --with-libdir=lib/x86_64-linux-gnu \
+                    --with-mysqli \
+                    --with-curl \
+                    --enable-mbstring
 
 
     # Create the files and install them
     # Create the files and install them
     make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
     make -j $NUM_CPUS && make INSTALL_ROOT=$BUILD_DIR install
@@ -323,7 +327,7 @@ if [ "$HESTIA_B" = true ] ; then
     mkdir $BUILD_DIR/hestia_$HESTIA_V
     mkdir $BUILD_DIR/hestia_$HESTIA_V
 
 
     # Download and unpack source files
     # Download and unpack source files
-    download_file $HESTIA
+    download_file $HESTIA_ARCHIVE_LINK
     unzip -q $branch.zip
     unzip -q $branch.zip
     rm $branch.zip
     rm $branch.zip
 
 
@@ -369,8 +373,10 @@ fi
 if [ "$install" = 'yes' ] || [ "$install" = 'y' ]; then
 if [ "$install" = 'yes' ] || [ "$install" = 'y' ]; then
     echo "Installing packages..."
     echo "Installing packages..."
     for i in $DEB_DIR/*.deb; do
     for i in $DEB_DIR/*.deb; do
-      # Install all available packages
-      dpkg -i $i
+        # Install all available packages
+        dpkg -i $i
     done
     done
     unset $answer
     unset $answer
+    # Remove temporary files
+    rm -rf $BUILD_DIR
 fi
 fi

+ 29 - 12
bin/v-update-web-templates

@@ -32,36 +32,53 @@ else
     exit $E_NOTEXIST
     exit $E_NOTEXIST
 fi
 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                             #
 #                       Action                             #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 # Update templates
 # Update templates
-if [ -d $HESTIA/data/templates/web ]; then
-    rm -rf $HESTIA/data/templates/web/skel 2>/dev/null  
-    rm -rf $HESTIA/data/templates/web/suspend 2>/dev/null
-    rm -rf $HESTIA/data/templates/web/unassigned 2>/dev/null
+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
 fi
 fi
 
 
-cp -rf $HESTIA/install/$type/templates/web $HESTIA/data/templates/
+for webtpl_folder in $(ls $HESTIA/install/$type/templates/web/* -d 2>/dev/null | egrep -v '/(nginx)$' ); do
+    cp -rf "${webtpl_folder}" "${HST_WEBTEMPLATES}/"
+done
+
+[ -d "${HST_WEBTEMPLATES}/nginx" ] || mkdir -p "${HST_WEBTEMPLATES}/nginx"
 
 
 # Update Multi-PHP templates
 # Update Multi-PHP templates
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null | wc -l)
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null | wc -l)
 if [ "$php_versions" -gt 1 ]; then
 if [ "$php_versions" -gt 1 ]; then
-    if [ "$WEB_SYSTEM" = "nginx" ]; then
-        for tplname in $(ls $HESTIA/data/templates/web/$WEB_SYSTEM/ | grep -v 'default'); do
-            rm -fr $HESTIA/data/templates/web/$WEB_SYSTEM/$tplname
-        done
-    fi
     for v in $(ls /etc/php/); do
     for v in $(ls /etc/php/); do
         if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
         if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
             continue
             continue
         fi
         fi
         v_tpl=$(echo "$v" | sed -e 's/[.]//')
         v_tpl=$(echo "$v" | sed -e 's/[.]//')
-        cp -f $HESTIA/install/$type/multiphp/$WEB_SYSTEM/PHP-$v_tpl.* $HESTIA/data/templates/web/$WEB_SYSTEM/
+        cp -f "$HESTIA/install/$type/multiphp/${WEB_SYSTEM}/PHP-${v_tpl}".* "${HST_WEBTEMPLATES}/${WEB_SYSTEM}/"
     done
     done
-    chmod a+x $HESTIA/data/templates/web/$WEB_SYSTEM/*.sh
+    chmod a+x "${HST_WEBTEMPLATES}/${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"
+    fi
+fi
+
+if [ "$PROXY_SYSTEM" = 'nginx' ] || [ "$php_versions" -le 1 ]; then
+    cp -rf "${HESTIA}/install/${type}/templates/web/nginx" "${HST_WEBTEMPLATES}/"
 fi
 fi
 
 
 # Rebuilding web domains
 # Rebuilding web domains

+ 1 - 1
func/domain.sh

@@ -341,7 +341,7 @@ del_web_config() {
     fi
     fi
 
 
     # Remove domain configuration files and clean up symbolic links
     # Remove domain configuration files and clean up symbolic links
-    rm -f "$conf" "${conf}"_*
+    rm -f "$conf"
 
 
     if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" = "$1" ]; then
     if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" = "$1" ]; then
         rm -f "/etc/$WEB_SYSTEM/conf.d/domains/$confname"
         rm -f "/etc/$WEB_SYSTEM/conf.d/domains/$confname"

+ 4 - 0
install/deb/multiphp/nginx/PHP-56.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 4 - 0
install/deb/multiphp/nginx/PHP-70.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 4 - 0
install/deb/multiphp/nginx/PHP-71.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 4 - 0
install/deb/multiphp/nginx/PHP-72.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 4 - 0
install/deb/multiphp/nginx/PHP-73.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 1 - 5
install/deb/nginx/nginx.conf

@@ -112,12 +112,8 @@ http {
     ssl_dhparam         /etc/ssl/dhparam.pem;
     ssl_dhparam         /etc/ssl/dhparam.pem;
     ssl_ecdh_curve      secp384r1;
     ssl_ecdh_curve      secp384r1;
     ssl_session_tickets off;
     ssl_session_tickets off;
-    ssl_stapling        on;
-    ssl_stapling_verify on;
-    resolver 1.0.0.1 1.1.1.1 valid=300s;
+    resolver 1.0.0.1 1.1.1.1 valid=300s ipv6=off;
     resolver_timeout    5s;
     resolver_timeout    5s;
-    add_header          X-Frame-Options SAMEORIGIN;
-    add_header          X-Content-Type-Options nosniff;
 
 
     # Error pages
     # Error pages
     error_page 403 /error/404.html;
     error_page 403 /error/404.html;

+ 11 - 0
install/deb/templates/dns/default-nomail.tpl

@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns3%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns4%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns5%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns6%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns7%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns8%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'

+ 4 - 0
install/deb/templates/web/nginx/caching.stpl

@@ -3,8 +3,12 @@ server {
     server_name %domain_idn% %alias_idn%;
     server_name %domain_idn% %alias_idn%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
 
 
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
     location / {
     location / {
         proxy_pass      https://%ip%:%web_ssl_port%;
         proxy_pass      https://%ip%:%web_ssl_port%;
 
 

+ 4 - 0
install/deb/templates/web/nginx/default.stpl

@@ -3,8 +3,12 @@ server {
     server_name %domain_idn% %alias_idn%;
     server_name %domain_idn% %alias_idn%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
 
 
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
     location / {
     location / {
         proxy_pass      https://%ip%:%web_ssl_port%;
         proxy_pass      https://%ip%:%web_ssl_port%;
         location ~* ^.+\.(%proxy_extentions%)$ {
         location ~* ^.+\.(%proxy_extentions%)$ {

+ 4 - 0
install/deb/templates/web/nginx/hosting.stpl

@@ -3,8 +3,12 @@ server {
     server_name %domain_idn% %alias_idn%;
     server_name %domain_idn% %alias_idn%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
     error_log  /var/log/%web_system%/domains/%domain%.error.log error;
 
 
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
     location / {
     location / {
         proxy_pass      https://%ip%:%web_ssl_port%;
         proxy_pass      https://%ip%:%web_ssl_port%;
         location ~* ^.+\.(%proxy_extentions%)$ {
         location ~* ^.+\.(%proxy_extentions%)$ {

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/cms_made_simple.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         try_files $uri $uri/ /index.php?page=$request_uri;
         try_files $uri $uri/ /index.php?page=$request_uri;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/codeigniter2.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         try_files $uri $uri/ /index.php;
         try_files $uri $uri/ /index.php;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/codeigniter3.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         try_files $uri $uri/ /index.php;
         try_files $uri $uri/ /index.php;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/datalife_engine.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
         rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/default.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
 
 

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/dokuwiki.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         index doku.php;
         index doku.php;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/drupal6.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         log_not_found off;
         log_not_found off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/drupal7.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         log_not_found off;
         log_not_found off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/drupal8.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         log_not_found off;
         log_not_found off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/joomla.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         try_files $uri $uri/ /index.php?$args;
         try_files $uri $uri/ /index.php?$args;

+ 4 - 1
install/deb/templates/web/nginx/php-fpm/laravel.stpl

@@ -7,10 +7,13 @@ server {
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
 
-
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
     
     
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
     location / {
     location / {
         try_files $uri $uri/ /index.php?$query_string;
         try_files $uri $uri/ /index.php?$query_string;
         location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
         location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/magento.stpl

@@ -11,6 +11,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     access_log  /var/log/nginx/domains/%domain%.log combined;
     access_log  /var/log/nginx/domains/%domain%.log combined;
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;

+ 5 - 0
install/deb/templates/web/nginx/php-fpm/modx.stpl

@@ -9,6 +9,11 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
 #   if you need to rewrite www to non-www uncomment bellow
 #   if you need to rewrite www to non-www uncomment bellow
 #   if ($host != '%domain%' ) {
 #   if ($host != '%domain%' ) {
 #       rewrite      ^/(.*)$  https://%domain%/$1  permanent;
 #       rewrite      ^/(.*)$  https://%domain%/$1  permanent;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/moodle.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
     rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
 
 

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/no-php.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     types {
     types {
             text/html   html htm shtml php php5;
             text/html   html htm shtml php php5;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/odoo.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
     proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
     proxy_redirect          off;
     proxy_redirect          off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/opencart.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location / {
     location / {
         try_files $uri $uri/ @opencart;
         try_files $uri $uri/ @opencart;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/owncloud.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         log_not_found off;
         log_not_found off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/piwik.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         try_files /favicon.ico =204;
         try_files /favicon.ico =204;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/pyrocms.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location /installer {
     location /installer {
             try_files $uri $uri/ /installer/index.php?$query_string;
             try_files $uri $uri/ /installer/index.php?$query_string;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/sendy.stpl

@@ -3,12 +3,16 @@ server {
     server_name %domain_idn% %alias_idn%;
     server_name %domain_idn% %alias_idn%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
     root        %docroot%;
     root        %docroot%;
     index       index.php index.html index.htm;
     index       index.php index.html index.htm;
     access_log  /var/log/nginx/domains/%domain%.log combined;
     access_log  /var/log/nginx/domains/%domain%.log combined;
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     access_log  /var/log/nginx/domains/%domain%.bytes bytes;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
     error_log   /var/log/nginx/domains/%domain%.error.log error;
 
 
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
+
      location = /favicon.ico {
      location = /favicon.ico {
         log_not_found off;
         log_not_found off;
         access_log off;
         access_log off;

+ 4 - 0
install/deb/templates/web/nginx/php-fpm/wordpress.stpl

@@ -9,6 +9,10 @@ server {
 
 
     ssl_certificate      %ssl_pem%;
     ssl_certificate      %ssl_pem%;
     ssl_certificate_key  %ssl_key%;
     ssl_certificate_key  %ssl_key%;
+    ssl_stapling on;
+    ssl_stapling_verify on;
+
+    include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
     location = /favicon.ico {
     location = /favicon.ico {
         log_not_found off;
         log_not_found off;

+ 51 - 13
install/hst-install-debian.sh

@@ -588,7 +588,7 @@ APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/php_signing.key > /dev/n
 
 
 # Installing MariaDB repo
 # Installing MariaDB repo
 echo "(*) MariaDB"
 echo "(*) MariaDB"
-echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/$VERSION $codename main" > $apt/mariadb.list
+echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/$VERSION $codename main" > $apt/mariadb.list
 if [ "$release" -eq 8 ]; then
 if [ "$release" -eq 8 ]; then
     APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
     APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com CBCB082A1BB943DB > /dev/null 2>&1
 else
 else
@@ -597,7 +597,7 @@ fi
 
 
 # Installing Backport repo for debian 8
 # Installing Backport repo for debian 8
 if [ "$release" -eq 8 ]; then
 if [ "$release" -eq 8 ]; then
-    echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
+    echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
 fi
 fi
 
 
 # Installing Backport repo for debian 10
 # Installing Backport repo for debian 10
@@ -888,13 +888,13 @@ rm -f /usr/sbin/policy-rc.d
 #                     Configure system                     #
 #                     Configure system                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+echo "Configure System"
 # Enable SSH password authentication
 # Enable SSH password authentication
 sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 
 
 # Enable SFTP subsystem for SSH
 # Enable SFTP subsystem for SSH
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 if [ ! -z "$sftp_subsys_enabled" ]; then
 if [ ! -z "$sftp_subsys_enabled" ]; then
-    echo "(*) Updating SFTP subsystem configuration..."
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
 fi
 fi
 
 
@@ -944,6 +944,7 @@ chmod 755 /usr/bin/rssh
 #                     Configure Hestia                     #
 #                     Configure Hestia                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+echo "Configure Hestia"
 # Installing sudo configuration
 # Installing sudo configuration
 mkdir -p /etc/sudoers.d
 mkdir -p /etc/sudoers.d
 cp -f $hestiacp/sudo/admin /etc/sudoers.d/
 cp -f $hestiacp/sudo/admin /etc/sudoers.d/
@@ -1032,7 +1033,6 @@ fi
 # Mail stack
 # Mail stack
 if [ "$exim" = 'yes' ]; then
 if [ "$exim" = 'yes' ]; then
     echo "MAIL_SYSTEM='exim4'" >> $HESTIA/conf/hestia.conf
     echo "MAIL_SYSTEM='exim4'" >> $HESTIA/conf/hestia.conf
-    echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
     if [ "$clamd" = 'yes'  ]; then
     if [ "$clamd" = 'yes'  ]; then
         echo "ANTIVIRUS_SYSTEM='clamav-daemon'" >> $HESTIA/conf/hestia.conf
         echo "ANTIVIRUS_SYSTEM='clamav-daemon'" >> $HESTIA/conf/hestia.conf
     fi
     fi
@@ -1067,8 +1067,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 
 
 # Version & Release Branch
 # Version & Release Branch
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
-echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
+echo "VERSION='1.0.1'" >> $HESTIA/conf/hestia.conf
+echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
 
 
 # Installing hosting packages
 # Installing hosting packages
 cp -rf $hestiacp/packages $HESTIA/data/
 cp -rf $hestiacp/packages $HESTIA/data/
@@ -1090,6 +1090,7 @@ cp -rf $hestiacp/firewall $HESTIA/data/
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
 
 
 # Generating SSL certificate
 # Generating SSL certificate
+echo "Generate ssl certificate"
 $HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
 $HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
      'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
      'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
 
 
@@ -1099,6 +1100,7 @@ key_start=$(grep -n "BEGIN RSA" /tmp/hst.pem |cut -f 1 -d:)
 key_end=$(grep -n  "END RSA" /tmp/hst.pem |cut -f 1 -d:)
 key_end=$(grep -n  "END RSA" /tmp/hst.pem |cut -f 1 -d:)
 
 
 # Adding SSL certificate
 # Adding SSL certificate
+echo "Add ssl certificate to Hestia"
 cd $HESTIA/ssl
 cd $HESTIA/ssl
 sed -n "1,${crt_end}p" /tmp/hst.pem > certificate.crt
 sed -n "1,${crt_end}p" /tmp/hst.pem > certificate.crt
 sed -n "$key_start,${key_end}p" /tmp/hst.pem > certificate.key
 sed -n "$key_start,${key_end}p" /tmp/hst.pem > certificate.key
@@ -1112,16 +1114,17 @@ rm /tmp/hst.pem
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$nginx" = 'yes' ]; then
 if [ "$nginx" = 'yes' ]; then
+    echo "Configure Nginx Webserver"
     rm -f /etc/nginx/conf.d/*.conf
     rm -f /etc/nginx/conf.d/*.conf
     cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
     cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phpmyadmin.inc /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/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
     mkdir -p /var/log/nginx/domains
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
+        echo "Configure Nginx MultiPHP"
         rm -fr $HESTIA/data/templates/web/nginx/*
         rm -fr $HESTIA/data/templates/web/nginx/*
         for v in "${multiphp_v[@]}"; do
         for v in "${multiphp_v[@]}"; do
             update-rc.d php$v-fpm defaults > /dev/null 2>&1
             update-rc.d php$v-fpm defaults > /dev/null 2>&1
@@ -1147,7 +1150,14 @@ if [ "$nginx" = 'yes' ]; then
 
 
     # Update dns servers in nginx.conf
     # Update dns servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
-    sed -i "s/1.0.0.1 1.1.1.1/$dns_resolver/g" /etc/nginx/nginx.conf
+    for ip in $dns_resolver; do
+        if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+            resolver="$ip $resolver"
+        fi
+    done
+    if [ ! -z "$resolver" ]; then
+        sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
+    fi
 
 
     update-rc.d nginx defaults > /dev/null 2>&1
     update-rc.d nginx defaults > /dev/null 2>&1
     service nginx start >> $LOG
     service nginx start >> $LOG
@@ -1160,6 +1170,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$apache" = 'yes' ]; then
 if [ "$apache" = 'yes' ]; then
+    echo "Configure Apache Webserver"
     cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
     cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
     cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
     cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
     cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
     cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
@@ -1180,6 +1191,7 @@ if [ "$apache" = 'yes' ]; then
     chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
     chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
     chmod 751 /var/log/apache2/domains
     chmod 751 /var/log/apache2/domains
     if [ "$multiphp" = 'yes' ] ; then
     if [ "$multiphp" = 'yes' ] ; then
+        echo "Configure Apache MultiPHP"
         a2enmod proxy_fcgi setenvif > /dev/null 2>&1
         a2enmod proxy_fcgi setenvif > /dev/null 2>&1
         for v in "${multiphp_v[@]}"; do
         for v in "${multiphp_v[@]}"; do
             a2enconf php$v-fpm-fpm > /dev/null 2>&1
             a2enconf php$v-fpm-fpm > /dev/null 2>&1
@@ -1210,6 +1222,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$phpfpm" = 'yes' ]; then
 if [ "$phpfpm" = 'yes' ]; then
+    echo "Configure PHP-FPM"
     cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
     cp -f $hestiacp/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
     update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
     service php$fpm_v-fpm start >> $LOG
     service php$fpm_v-fpm start >> $LOG
@@ -1221,6 +1234,7 @@ fi
 #                     Configure PHP                        #
 #                     Configure PHP                        #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+echo "Configure PHP Timezone"
 ZONE=$(timedatectl > /dev/null 2>&1|grep Timezone|awk '{print $2}')
 ZONE=$(timedatectl > /dev/null 2>&1|grep Timezone|awk '{print $2}')
 if [ -z "$ZONE" ]; then
 if [ -z "$ZONE" ]; then
     ZONE='UTC'
     ZONE='UTC'
@@ -1242,6 +1256,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$vsftpd" = 'yes' ]; then
 if [ "$vsftpd" = 'yes' ]; then
+    echo "Configure Vsftpd"
     cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
     cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
     touch /var/log/vsftpd.log
     touch /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
@@ -1261,6 +1276,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$proftpd" = 'yes' ]; then
 if [ "$proftpd" = 'yes' ]; then
+    echo "Configure ProFTPD server"
     echo "127.0.0.1 $servername" >> /etc/hosts
     echo "127.0.0.1 $servername" >> /etc/hosts
     cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
     cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
     update-rc.d proftpd defaults > /dev/null 2>&1
     update-rc.d proftpd defaults > /dev/null 2>&1
@@ -1274,6 +1290,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$mysql" = 'yes' ]; then
 if [ "$mysql" = 'yes' ]; then
+    echo "Configure MariaDB server"
     mycnf="my-small.cnf"
     mycnf="my-small.cnf"
     if [ $memory -gt 1200000 ]; then
     if [ $memory -gt 1200000 ]; then
         mycnf="my-medium.cnf"
         mycnf="my-medium.cnf"
@@ -1352,6 +1369,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$postgresql" = 'yes' ]; then
 if [ "$postgresql" = 'yes' ]; then
+    echo "Configure PostgreSQL database server"
     ppass=$(gen_pass)
     ppass=$(gen_pass)
     cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
     cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
     service postgresql restart
     service postgresql restart
@@ -1370,6 +1388,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$named" = 'yes' ]; then
 if [ "$named" = 'yes' ]; then
+    echo "Configure Bind DNS server"
     cp -f $hestiacp/bind/named.conf /etc/bind/
     cp -f $hestiacp/bind/named.conf /etc/bind/
     cp -f $hestiacp/bind/named.conf.options /etc/bind/
     cp -f $hestiacp/bind/named.conf.options /etc/bind/
     chown root:bind /etc/bind/named.conf
     chown root:bind /etc/bind/named.conf
@@ -1401,6 +1420,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$exim" = 'yes' ]; then
 if [ "$exim" = 'yes' ]; then
+    echo "Configure Exim mail server"
     gpasswd -a Debian-exim mail > /dev/null 2>&1
     gpasswd -a Debian-exim mail > /dev/null 2>&1
     cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
     cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
     cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
     cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
@@ -1436,6 +1456,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$dovecot" = 'yes' ]; then
 if [ "$dovecot" = 'yes' ]; then
+    echo "Configure Dovecot"
     gpasswd -a dovecot mail > /dev/null 2>&1
     gpasswd -a dovecot mail > /dev/null 2>&1
     cp -rf $hestiacp/dovecot /etc/
     cp -rf $hestiacp/dovecot /etc/
     cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
     cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
@@ -1488,6 +1509,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$spamd" = 'yes' ]; then
 if [ "$spamd" = 'yes' ]; then
+    echo "Configure SpamAssassin"
     update-rc.d spamassassin defaults > /dev/null 2>&1
     update-rc.d spamassassin defaults > /dev/null 2>&1
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     service spamassassin start >> $LOG
     service spamassassin start >> $LOG
@@ -1503,11 +1525,15 @@ fi
 #                   Configure Roundcube                    #
 #                   Configure Roundcube                    #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+    echo "Configure Roundcube"
     if [ "$apache" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
     fi
+    if [ "$nginx" = 'yes' ]; then
+        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+    fi
     cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
     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/db.inc.php /etc/roundcube/debian-db-roundcube.php
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1552,6 +1578,16 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
             fi
             fi
         fi
         fi
     fi
     fi
+    # Configure webmail alias
+    echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
+
+    # Restart services
+    if [ "$apache" = 'yes' ]; then
+        service apache2 restart
+    fi
+    if [ "$nginx" = 'yes' ]; then
+        service nginx restart
+    fi
 fi
 fi
 
 
 
 
@@ -1560,6 +1596,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$fail2ban" = 'yes' ]; then
 if [ "$fail2ban" = 'yes' ]; then
+    echo "Configure Fail2Ban"
     cp -rf $hestiacp/fail2ban /etc/
     cp -rf $hestiacp/fail2ban /etc/
     if [ "$dovecot" = 'no' ]; then
     if [ "$dovecot" = 'no' ]; then
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
@@ -1737,9 +1774,6 @@ service hestia start
 check_result $? "hestia start failed"
 check_result $? "hestia start failed"
 chown admin:admin $HESTIA/data/sessions
 chown admin:admin $HESTIA/data/sessions
 
 
-# Adding cronjob for autoupdates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
-
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
 #                   Hestia Access Info                     #
@@ -1793,13 +1827,17 @@ echo
 cat $tmpfile
 cat $tmpfile
 rm -f $tmpfile
 rm -f $tmpfile
 
 
+# Add welcome message to notification panel
+$HESTIA/bin/v-add-user-notification admin 'Welcome!' 'For more information on how to use Hestia Control Panel, click on the Help icon in the top right corner of the toolbar.<br><br>Please report any bugs or issues on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
+
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
+echo ""
 if [ "$interactive" = 'yes' ]; then
 if [ "$interactive" = 'yes' ]; then
     echo -n " Do you want to logout now? [Y/N] "
     echo -n " Do you want to logout now? [Y/N] "
     read resetshell
     read resetshell
 
 
     if [ "$resetshell" = "Y" ] || [ "$resetshell" = "y" ]; then
     if [ "$resetshell" = "Y" ] || [ "$resetshell" = "y" ]; then
-        logout
+        exit
     fi
     fi
 fi
 fi
 
 

+ 46 - 13
install/hst-install-ubuntu.sh

@@ -564,7 +564,7 @@ LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php > /dev/null 2>&1
 
 
 # Installing MariaDB repo
 # Installing MariaDB repo
 echo "(*) MariaDB"
 echo "(*) MariaDB"
-echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.3/$VERSION $codename main" > $apt/mariadb.list
+echo "deb [arch=amd64] http://ams2.mirrors.digitalocean.com/mariadb/repo/10.4/$VERSION $codename main" > $apt/mariadb.list
 APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
 APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 > /dev/null 2>&1
 
 
 # Installing hestia repo
 # Installing hestia repo
@@ -862,13 +862,13 @@ rm -f /usr/sbin/policy-rc.d
 #                     Configure system                     #
 #                     Configure system                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+echo "Configure System"
 # Enable SSH password authentication
 # Enable SSH password authentication
 sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
 
 
 # Enable SFTP subsystem for SSH
 # Enable SFTP subsystem for SSH
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 sftp_subsys_enabled=$(grep -iE "^#?.*subsystem.+(sftp )?sftp-server" /etc/ssh/sshd_config)
 if [ ! -z "$sftp_subsys_enabled" ]; then
 if [ ! -z "$sftp_subsys_enabled" ]; then
-    echo "(*) Updating SFTP subsystem configuration..."
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
     sed -i -E "s/^#?.*Subsystem.+(sftp )?sftp-server/Subsystem sftp internal-sftp/g" /etc/ssh/sshd_config
 fi
 fi
 
 
@@ -914,6 +914,7 @@ chmod 755 /usr/bin/rssh
 #                     Configure Hestia                     #
 #                     Configure Hestia                     #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
+echo "Configure Hestia"
 # Installing sudo configuration
 # Installing sudo configuration
 mkdir -p /etc/sudoers.d
 mkdir -p /etc/sudoers.d
 cp -f $hestiacp/sudo/admin /etc/sudoers.d/
 cp -f $hestiacp/sudo/admin /etc/sudoers.d/
@@ -1031,8 +1032,8 @@ echo "BACKUP_SYSTEM='local'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 echo "LANGUAGE='$lang'" >> $HESTIA/conf/hestia.conf
 
 
 # Version & Release Branch
 # Version & Release Branch
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
-echo "RELEASE='develop'" >> $HESTIA/conf/hestia.conf
+echo "VERSION='1.0.1'" >> $HESTIA/conf/hestia.conf
+echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
 
 
 # Installing hosting packages
 # Installing hosting packages
 cp -rf $hestiacp/packages $HESTIA/data/
 cp -rf $hestiacp/packages $HESTIA/data/
@@ -1054,6 +1055,7 @@ cp -rf $hestiacp/firewall $HESTIA/data/
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
 $HESTIA/bin/v-change-sys-hostname $servername > /dev/null 2>&1
 
 
 # Generating SSL certificate
 # Generating SSL certificate
+echo "Generate ssl certificate"
 $HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
 $HESTIA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \
      'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
      'San Francisco' 'Hestia Control Panel' 'IT' > /tmp/hst.pem
 
 
@@ -1063,6 +1065,7 @@ key_start=$(grep -n "BEGIN RSA" /tmp/hst.pem |cut -f 1 -d:)
 key_end=$(grep -n  "END RSA" /tmp/hst.pem |cut -f 1 -d:)
 key_end=$(grep -n  "END RSA" /tmp/hst.pem |cut -f 1 -d:)
 
 
 # Adding SSL certificate
 # Adding SSL certificate
+echo "Add ssl certificate to Hestia"
 cd $HESTIA/ssl
 cd $HESTIA/ssl
 sed -n "1,${crt_end}p" /tmp/hst.pem > certificate.crt
 sed -n "1,${crt_end}p" /tmp/hst.pem > certificate.crt
 sed -n "$key_start,${key_end}p" /tmp/hst.pem > certificate.key
 sed -n "$key_start,${key_end}p" /tmp/hst.pem > certificate.key
@@ -1081,16 +1084,17 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$nginx" = 'yes' ]; then
 if [ "$nginx" = 'yes' ]; then
+    echo "Configure Nginx Webserver"
     rm -f /etc/nginx/conf.d/*.conf
     rm -f /etc/nginx/conf.d/*.conf
     cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
     cp -f $hestiacp/nginx/nginx.conf /etc/nginx/
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/status.conf /etc/nginx/conf.d/
     cp -f $hestiacp/nginx/phpmyadmin.inc /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/nginx/phppgadmin.inc /etc/nginx/conf.d/
-    cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     cp -f $hestiacp/logrotate/nginx /etc/logrotate.d/
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /etc/nginx/conf.d/domains
     mkdir -p /var/log/nginx/domains
     mkdir -p /var/log/nginx/domains
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
     if [ "$apache" = 'no' ] && [ "$multiphp" = 'yes' ]; then
+        echo "Configure Nginx MultiPHP"
         rm -fr $HESTIA/data/templates/web/nginx/*
         rm -fr $HESTIA/data/templates/web/nginx/*
         for v in "${multiphp_v[@]}"; do
         for v in "${multiphp_v[@]}"; do
             update-rc.d php$v-fpm defaults > /dev/null 2>&1
             update-rc.d php$v-fpm defaults > /dev/null 2>&1
@@ -1116,7 +1120,14 @@ if [ "$nginx" = 'yes' ]; then
 
 
     # Update dns servers in nginx.conf
     # Update dns servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
-    sed -i "s/1.0.0.1 1.1.1.1/$dns_resolver/g" /etc/nginx/nginx.conf
+    for ip in $dns_resolver; do
+        if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+            resolver="$ip $resolver"
+        fi
+    done
+    if [ ! -z "$resolver" ]; then
+        sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /etc/nginx/nginx.conf
+    fi
 
 
     update-rc.d nginx defaults > /dev/null 2>&1
     update-rc.d nginx defaults > /dev/null 2>&1
     service nginx start >> $LOG
     service nginx start >> $LOG
@@ -1129,6 +1140,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$apache" = 'yes' ]; then
 if [ "$apache" = 'yes' ]; then
+    echo "Configure Apache Webserver"
     cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
     cp -f $hestiacp/apache2/apache2.conf /etc/apache2/
     cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
     cp -f $hestiacp/apache2/status.conf /etc/apache2/mods-enabled/
     cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
     cp -f $hestiacp/logrotate/apache2 /etc/logrotate.d/
@@ -1149,6 +1161,7 @@ if [ "$apache" = 'yes' ]; then
     chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
     chmod 640 /var/log/apache2/access.log /var/log/apache2/error.log
     chmod 751 /var/log/apache2/domains
     chmod 751 /var/log/apache2/domains
     if [ "$multiphp" = 'yes' ] ; then
     if [ "$multiphp" = 'yes' ] ; then
+        echo "Configure Apache MultiPHP"
         a2enmod proxy_fcgi setenvif > /dev/null 2>&1
         a2enmod proxy_fcgi setenvif > /dev/null 2>&1
         for v in "${multiphp_v[@]}"; do
         for v in "${multiphp_v[@]}"; do
             a2enconf php$v-fpm-fpm > /dev/null 2>&1
             a2enconf php$v-fpm-fpm > /dev/null 2>&1
@@ -1175,6 +1188,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$phpfpm" = 'yes' ]; then
 if [ "$phpfpm" = 'yes' ]; then
+    echo "Configure PHP-FPM"
     cp -f $hestiacp/php-fpm/www.conf /etc/php/$fpm_v/fpm/pool.d/www.conf
     cp -f $hestiacp/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
     update-rc.d php$fpm_v-fpm defaults > /dev/null 2>&1
     service php$fpm_v-fpm start >> $LOG
     service php$fpm_v-fpm start >> $LOG
@@ -1185,7 +1199,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                     Configure PHP                        #
 #                     Configure PHP                        #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-
+echo "Configure PHP Timezone"
 ZONE=$(timedatectl > /dev/null 2>&1|grep Timezone|awk '{print $2}')
 ZONE=$(timedatectl > /dev/null 2>&1|grep Timezone|awk '{print $2}')
 if [ -z "$ZONE" ]; then
 if [ -z "$ZONE" ]; then
     ZONE='UTC'
     ZONE='UTC'
@@ -1207,6 +1221,7 @@ chmod 755 /etc/cron.daily/php-session-cleanup
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$vsftpd" = 'yes' ]; then
 if [ "$vsftpd" = 'yes' ]; then
+    echo "Configure Vsftpd"
     cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
     cp -f $hestiacp/vsftpd/vsftpd.conf /etc/
     touch /var/log/vsftpd.log
     touch /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
     chown root:adm /var/log/vsftpd.log
@@ -1226,6 +1241,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$proftpd" = 'yes' ]; then
 if [ "$proftpd" = 'yes' ]; then
+    echo "Configure ProFTPD server"
     echo "127.0.0.1 $servername" >> /etc/hosts
     echo "127.0.0.1 $servername" >> /etc/hosts
     cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
     cp -f $hestiacp/proftpd/proftpd.conf /etc/proftpd/
     update-rc.d proftpd defaults > /dev/null 2>&1
     update-rc.d proftpd defaults > /dev/null 2>&1
@@ -1239,6 +1255,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$mysql" = 'yes' ]; then
 if [ "$mysql" = 'yes' ]; then
+    echo "Configure MariaDB server"
     mycnf="my-small.cnf"
     mycnf="my-small.cnf"
     if [ $memory -gt 1200000 ]; then
     if [ $memory -gt 1200000 ]; then
         mycnf="my-medium.cnf"
         mycnf="my-medium.cnf"
@@ -1279,7 +1296,7 @@ fi
 
 
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
-#                    Configure phpMyAdmin                     #
+#                    Configure phpMyAdmin                  #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$mysql" = 'yes' ]; then
 if [ "$mysql" = 'yes' ]; then
@@ -1317,6 +1334,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$postgresql" = 'yes' ]; then
 if [ "$postgresql" = 'yes' ]; then
+    echo "Configure PostgreSQL database server"
     ppass=$(gen_pass)
     ppass=$(gen_pass)
     cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
     cp -f $hestiacp/postgresql/pg_hba.conf /etc/postgresql/*/main/
     service postgresql restart
     service postgresql restart
@@ -1335,6 +1353,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$named" = 'yes' ]; then
 if [ "$named" = 'yes' ]; then
+    echo "Configure Bind DNS server"
     cp -f $hestiacp/bind/named.conf /etc/bind/
     cp -f $hestiacp/bind/named.conf /etc/bind/
     cp -f $hestiacp/bind/named.conf.options /etc/bind/
     cp -f $hestiacp/bind/named.conf.options /etc/bind/
     chown root:bind /etc/bind/named.conf
     chown root:bind /etc/bind/named.conf
@@ -1366,6 +1385,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$exim" = 'yes' ]; then
 if [ "$exim" = 'yes' ]; then
+    echo "Configure Exim mail server"
     gpasswd -a Debian-exim mail > /dev/null 2>&1
     gpasswd -a Debian-exim mail > /dev/null 2>&1
     cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
     cp -f $hestiacp/exim/exim4.conf.template /etc/exim4/
     cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
     cp -f $hestiacp/exim/dnsbl.conf /etc/exim4/
@@ -1401,6 +1421,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$dovecot" = 'yes' ]; then
 if [ "$dovecot" = 'yes' ]; then
+    echo "Configure Dovecot"
     gpasswd -a dovecot mail > /dev/null 2>&1
     gpasswd -a dovecot mail > /dev/null 2>&1
     cp -rf $hestiacp/dovecot /etc/
     cp -rf $hestiacp/dovecot /etc/
     cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
     cp -f $hestiacp/logrotate/dovecot /etc/logrotate.d/
@@ -1442,6 +1463,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$spamd" = 'yes' ]; then
 if [ "$spamd" = 'yes' ]; then
+    echo "Configure SpamAssassin"
     update-rc.d spamassassin defaults > /dev/null 2>&1
     update-rc.d spamassassin defaults > /dev/null 2>&1
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     sed -i "s/ENABLED=0/ENABLED=1/" /etc/default/spamassassin
     service spamassassin start >> $LOG
     service spamassassin start >> $LOG
@@ -1457,11 +1479,15 @@ fi
 #                   Configure Roundcube                    #
 #                   Configure Roundcube                    #
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
-if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+if [ "$dovecot" = 'yes' ] && [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
+    echo "Configure Roundcube"
     if [ "$apache" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         cp -f $hestiacp/roundcube/apache.conf /etc/roundcube/
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
         ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/roundcube.conf
     fi
     fi
+    if [ "$nginx" = 'yes' ]; then
+        cp -f $hestiacp/nginx/webmail.inc /etc/nginx/conf.d/
+    fi
     cp -f $hestiacp/roundcube/main.inc.php /etc/roundcube/config.inc.php
     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/db.inc.php /etc/roundcube/debian-db-roundcube.php
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
     cp -f $hestiacp/roundcube/config.inc.php /etc/roundcube/plugins/password/
@@ -1482,7 +1508,12 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then
     sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
     sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
     mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
 
 
+    # Configure webmail alias
+    echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
+
     phpenmod mcrypt > /dev/null 2>&1
     phpenmod mcrypt > /dev/null 2>&1
+
+    # Restart services
     if [ "$apache" = 'yes' ]; then
     if [ "$apache" = 'yes' ]; then
         service apache2 restart
         service apache2 restart
     fi
     fi
@@ -1497,6 +1528,7 @@ fi
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 
 
 if [ "$fail2ban" = 'yes' ]; then
 if [ "$fail2ban" = 'yes' ]; then
+    echo "Configure Fail2ban"
     cp -rf $hestiacp/fail2ban /etc/
     cp -rf $hestiacp/fail2ban /etc/
     if [ "$dovecot" = 'no' ]; then
     if [ "$dovecot" = 'no' ]; then
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
         fline=$(cat /etc/fail2ban/jail.local |grep -n dovecot-iptables -A 2)
@@ -1639,9 +1671,6 @@ service hestia start
 check_result $? "hestia start failed"
 check_result $? "hestia start failed"
 chown admin:admin $HESTIA/data/sessions
 chown admin:admin $HESTIA/data/sessions
 
 
-# Adding cronjob for autoupdates
-$HESTIA/bin/v-add-cron-hestia-autoupdate
-
 
 
 #----------------------------------------------------------#
 #----------------------------------------------------------#
 #                   Hestia Access Info                     #
 #                   Hestia Access Info                     #
@@ -1695,13 +1724,17 @@ echo
 cat $tmpfile
 cat $tmpfile
 rm -f $tmpfile
 rm -f $tmpfile
 
 
+# Add welcome message to notification panel
+$HESTIA/bin/v-add-user-notification admin 'Welcome!' 'For more information on how to use Hestia Control Panel, click on the Help icon in the top right corner of the toolbar.<br><br>Please report any bugs or issues on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
+
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
 echo "(!) IMPORTANT: You must logout or restart the server before continuing."
+echo ""
 if [ "$interactive" = 'yes' ]; then
 if [ "$interactive" = 'yes' ]; then
     echo -n " Do you want to logout now? [Y/N] "
     echo -n " Do you want to logout now? [Y/N] "
     read resetshell
     read resetshell
 
 
     if [ "$resetshell" = "Y" ] || [ "$resetshell" = "y" ]; then
     if [ "$resetshell" = "Y" ] || [ "$resetshell" = "y" ]; then
-        logout
+        exit
     fi
     fi
 fi
 fi
 
 

+ 1 - 1
install/hst-install.sh

@@ -95,7 +95,7 @@ check_wget_curl(){
 # Check for supported operating system before proceeding with download
 # Check for supported operating system before proceeding with download
 # of OS-specific installer, and throw error message if unsupported OS detected.
 # of OS-specific installer, and throw error message if unsupported OS detected.
 if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
 if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
-    check_wget_curl
+    check_wget_curl $*
 else
 else
     no_support_message
     no_support_message
 fi
 fi

+ 0 - 67
install/upgrade/0.9.8-28.sh

@@ -1,67 +0,0 @@
-#!/bin/bash
-HESTIA="/usr/local/hestia"
-HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
-spinner="/-\|"
-
-# Set version(s)
-pma_v='4.8.5'
-
-# Upgrade phpMyAdmin
-if [ "$DB_SYSTEM" = 'mysql' ]; then
-    # Display upgrade information
-    echo "(*) Upgrading phpMyAdmin to v$pma_v..."
-
-    # 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
-    rm -fr phpMyAdmin-$pma_v-all-languages
-    rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
-fi
-
-# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
-if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
-    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
-fi
-if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
-    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
-fi
-
-# Fix named rule for AppArmor - https://goo.gl/SPqHdq
-if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
-        echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
-fi
-
-# Remove obsolete ports.conf if exists.
-if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
-    rm -f /usr/local/hestia/data/firewall/ports.conf
-fi
-
-# Reset backend port
-if [ ! -z "$BACKEND_PORT" ]; then
-    /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
-fi
-
-# Move clamav to proper location - https://goo.gl/zNuM11
-if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
-    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
-fi

+ 36 - 0
install/upgrade/messages.sh

@@ -0,0 +1,36 @@
+#!/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 ""
+}

+ 42 - 0
install/upgrade/phpmyadmin.sh

@@ -0,0 +1,42 @@
+#!/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

+ 41 - 0
install/upgrade/restart.sh

@@ -0,0 +1,41 @@
+#!/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..."
+sleep 3
+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
+		sleep 5
+		$BIN/v-restart-service php$v-fpm $restart
+	fi
+done
+
+# Restart SSH daemon and Hestia Control Panel service
+$BIN/v-restart-service ssh $restart
+$BIN/v-restart-service hestia $restart

+ 31 - 0
install/upgrade/version.sh

@@ -0,0 +1,31 @@
+#!/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" ]; then
+    source /usr/local/hestia/install/upgrade/versions/0.9.8-28.sh
+    VERSION="0.9.8-28"
+fi
+if [ $VERSION = "0.9.8-28" ]; 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/$version.sh
+    VERSION="$version"
+fi

+ 31 - 0
install/upgrade/versions/0.9.8-28.sh

@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 0.9.8-28
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+
+
+# Add amd64 to repositories to prevent notifications - https://goo.gl/hmsSV7
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/nginx.list; then
+    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/nginx.list
+fi
+if ! grep -q 'arch=amd64' /etc/apt/sources.list.d/mariadb.list; then
+    sed -i s/"deb "/"deb [arch=amd64] "/g /etc/apt/sources.list.d/mariadb.list
+fi
+
+# Fix named rule for AppArmor - https://goo.gl/SPqHdq
+if [ "$DNS_SYSTEM" = 'bind9' ] && [ ! -f /etc/apparmor.d/local/usr.sbin.named ]; then
+        echo "/home/** rwm," >> /etc/apparmor.d/local/usr.sbin.named 2> /dev/null
+fi
+
+# Remove obsolete ports.conf if exists.
+if [ -f /usr/local/hestia/data/firewall/ports.conf ]; then
+    rm -f /usr/local/hestia/data/firewall/ports.conf
+fi
+
+# Move clamav to proper location - https://goo.gl/zNuM11
+if [ ! -d /usr/local/hestia/web/edit/server/clamav-daemon ]; then
+    mv /usr/local/hestia/web/edit/server/clamd /usr/local/web/edit/server/clamav-daemon
+fi

+ 30 - 0
install/upgrade/versions/1.0.1.sh

@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 1.0.1
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+
+# Ensure that users from previous releases are set to the correct stable release branch
+if [ $RELEASE_BRANCH = "master" ] || [ $RELEASE_BRANCH = "develop" ]; then
+    echo "(*) Updating default release branch configuration..."
+    sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
+    echo "RELEASE_BRANCH='release'" >> $HESTIA/conf/hestia.conf
+fi
+
+# Back up old template files and install the latest versions
+if [ -d $HESTIA/data/templates/ ]; then
+    echo "(*) Updating web templates to enable per-domain HSTS/OCSP SSL support..."
+    cp -rf $HESTIA/data/templates $HESTIA_BACKUP/templates/
+    $HESTIA/bin/v-update-web-templates >/dev/null 2>&1
+fi
+
+# Remove global options from nginx.conf to prevent conflicts with other web packages
+# and remove OCSP SSL stapling from global configuration as it has moved to per-domain availability in this release.
+if [ -e /etc/nginx/nginx.conf ]; then
+    sed -i "/add_header          X-Frame-Options SAMEORIGIN;/d" /etc/nginx/nginx.conf
+    sed -i "/add_header          X-Content-Type-Options nosniff;/d" /etc/nginx/nginx.conf
+    sed -i "/ssl_stapling        on;/d" /etc/nginx/nginx.conf
+    sed -i "/ssl_stapling_verify on;/d" /etc/nginx/nginx.conf
+fi

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

@@ -1,12 +1,10 @@
 #!/bin/bash
 #!/bin/bash
 
 
-# Define vars
-if [ -z "$HESTIA" ]; then
-    export HESTIA="/usr/local/hestia"
-fi
-HESTIA_BACKUP="/root/hst_upgrade/$(date +%d%m%Y%H%M)"
-hestiacp="$HESTIA/install/deb"
-pma_v='4.9.0.1'
+# Hestia Control Panel upgrade script for target version 1.00.0-190618
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
 
 
 # Add webmail alias variable to system configuration if non-existent
 # Add webmail alias variable to system configuration if non-existent
 WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
 WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
@@ -16,68 +14,6 @@ if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
     echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
 fi
 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='develop'" >> $HESTIA/conf/hestia.conf
-fi
-
-# Load hestia.conf
-source $HESTIA/conf/hestia.conf
-
-# Load hestia main functions
-source /usr/local/hestia/func/main.sh
-
-# Initialize backup directory
-mkdir -p $HESTIA_BACKUP/conf/
-mkdir -p $HESTIA_BACKUP/packages/
-mkdir -p $HESTIA_BACKUP/templates/
-
-# Detect OS
-case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
-    Debian)     os="debian" ;;
-    Ubuntu)     os="ubuntu" ;;
-esac
-
-# Detect release for Debian
-if [ "$os" = "debian" ]; then
-    release=$(cat /etc/debian_version|grep -o [0-9]|head -n1)
-    VERSION='debian'
-elif [ "$os" = "ubuntu" ]; then
-    release="$(lsb_release -s -r)"
-    VERSION='ubuntu'
-fi
-
-# 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
-
-# Clear the screen from apt output to prepare for upgrade installer experience
-clear
-echo
-echo '     _   _           _   _        ____ ____  '
-echo '    | | | | ___  ___| |_(_) __ _ / ___|  _ \ '
-echo '    | |_| |/ _ \/ __| __| |/ _` | |   | |_) |'
-echo '    |  _  |  __/\__ \ |_| | (_| | |___|  __/ '
-echo '    |_| |_|\___||___/\__|_|\__,_|\____|_|    '
-echo ""
-echo "       Hestia Control Panel Upgrade Script"
-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 ""
-
-# Set new version
-sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
-# Set new branch variable
-echo "VERSION='0.10.0'" >> $HESTIA/conf/hestia.conf
-
 # Update Apache and Nginx configuration to support new file structure
 # Update Apache and Nginx configuration to support new file structure
 if [ -f /etc/apache2/apache.conf ]; then
 if [ -f /etc/apache2/apache.conf ]; then
     echo "(*) Updating Apache configuration..."
     echo "(*) Updating Apache configuration..."
@@ -85,7 +21,7 @@ if [ -f /etc/apache2/apache.conf ]; then
     cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
     cp -f $HESTIA/install/deb/apache2/apache.conf /etc/apache2/apache.conf
 fi
 fi
 if [ -f /etc/nginx/nginx.conf ]; then
 if [ -f /etc/nginx/nginx.conf ]; then
-    echo "(*) Updating Nginx configuration..."
+    echo "(*) Updating NGINX configuration..."
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
     mv  /etc/nginx/nginx.conf $HESTIA_BACKUP/conf/
     cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
     cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/nginx.conf
 fi
 fi
@@ -102,25 +38,21 @@ if [ ! -e /etc/ssl/dhparam.pem ]; then
     # Update DNS servers in nginx.conf
     # Update DNS servers in nginx.conf
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
     dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
     sed -i "s/1.0.0.1 1.1.1.1/$dns_resolver/g" /etc/nginx/nginx.conf
     sed -i "s/1.0.0.1 1.1.1.1/$dns_resolver/g" /etc/nginx/nginx.conf
-
-    # Restart Nginx service
-    systemctl restart nginx >/dev/null 2>&1
 fi
 fi
 
 
-# Update default page templates
-echo "(*) Replacing default templates and packages..."
-
 # Back up default package and install latest version
 # Back up default package and install latest version
 if [ -d $HESTIA/data/packages/ ]; then
 if [ -d $HESTIA/data/packages/ ]; then
+    echo "(*) Replacing default packages..."
     cp -f $HESTIA/data/packages/default.pkg $HESTIA_BACKUP/packages/
     cp -f $HESTIA/data/packages/default.pkg $HESTIA_BACKUP/packages/
 fi
 fi
 
 
 # Back up old template files and install the latest versions
 # Back up old template files and install the latest versions
 if [ -d $HESTIA/data/templates/ ]; then
 if [ -d $HESTIA/data/templates/ ]; then
+    echo "(*) Replacing default Web, DNS, and Mail templates..."
     cp -rf $HESTIA/data/templates $HESTIA_BACKUP/templates/
     cp -rf $HESTIA/data/templates $HESTIA_BACKUP/templates/
-    $HESTIA/bin/v-update-web-templates
-    $HESTIA/bin/v-update-dns-templates
-	$HESTIA/bin/v-update-mail-templates
+    $HESTIA/bin/v-update-web-templates >/dev/null 2>&1
+    $HESTIA/bin/v-update-dns-templates >/dev/null 2>&1
+	$HESTIA/bin/v-update-mail-templates >/dev/null 2>&1
 fi
 fi
 
 
 # Remove old Office 365 template as there is a newer version with an updated name
 # Remove old Office 365 template as there is a newer version with an updated name
@@ -245,11 +177,11 @@ fi
 # Fix empty pool error message for MultiPHP
 # Fix empty pool error message for MultiPHP
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
 php_versions=$(ls /etc/php/*/fpm -d 2>/dev/null |wc -l)
 if [ "$php_versions" -gt 1 ]; then
 if [ "$php_versions" -gt 1 ]; then
+    echo "(*) Updating Multi-PHP configuration..."
     for v in $(ls /etc/php/); do
     for v in $(ls /etc/php/); do
         if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
         if [ ! -d "/etc/php/$v/fpm/pool.d/" ]; then
             continue
             continue
         fi
         fi
-        echo "(*) Updating Multi-PHP configuration..."
         cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
         cp -f $hestiacp/php-fpm/dummy.conf /etc/php/$v/fpm/pool.d/
         v1=$(echo "$v" | sed -e 's/[.]//')
         v1=$(echo "$v" | sed -e 's/[.]//')
         sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
         sed -i "s/9999/99$v1/g" /etc/php/$v/fpm/pool.d/dummy.conf
@@ -352,91 +284,3 @@ for user in `ls /usr/local/hestia/data/users/`; do
     done
     done
     sed -i "s/\sFORCESSL=''//g" $USER_DATA/web.conf
     sed -i "s/\sFORCESSL=''//g" $USER_DATA/web.conf
 done
 done
-
-# Rebuild user
-for user in `ls /usr/local/hestia/data/users/`; do
-    echo "(*) Rebuilding domains and account for user: $user..."
-    if [ ! -z $WEB_SYSTEM ]; then
-		v-rebuild-web-domains $user >/dev/null 2>&1
-	fi
-    if [ ! -z $DNS_SYSTEM ]; then
-		v-rebuild-dns-domains $user >/dev/null 2>&1
-    fi
-	if [ ! -z $MAIL_SYSTEM ]; then 
-		v-rebuild-mail-domains $user >/dev/null 2>&1
-	fi
-done
-
-# Upgrade phpMyAdmin if applicable
-if [ "$DB_SYSTEM" = 'mysql' ]; then
-    if [ -e "/usr/share/phpmyadmin/RELEASE-DATE-$pma_v" ]; then
-        echo "(*) phpMyAdmin $pma_v is already installed, skipping update..."
-    else
-        # Display upgrade information
-        echo "(*) Upgrade phpMyAdmin to v$pma_v..."
-
-        # 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
-
-        # Clear up
-        rm -fr phpMyAdmin-$pma_v-all-languages
-        rm -f phpMyAdmin-$pma_v-all-languages.tar.gz
-    fi
-fi
-
-# Add upgrade notification to admin user's panel
-$BIN/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to v0.10.0.<br>Please report any bugs on GitHub at<br>https://github.com/hestiacp/hestiacp/Issues<br><br>Have a great day!'
-
-# Restart services for changes to take full effect
-echo "(*) Restarting services..."
-sleep 3
-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
-
-# restart Hestia services (nginx,php-fpm)
-systemctl restart hestia
-
-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 ""

+ 1 - 1
src/deb/hestia/control

@@ -1,7 +1,7 @@
 Source: hestia
 Source: hestia
 Package: hestia
 Package: hestia
 Priority: optional
 Priority: optional
-Version: 1.00.0-190618
+Version: 1.0.1
 Section: admin
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com
 Homepage: https://www.hestiacp.com

+ 49 - 9
src/deb/hestia/postinst

@@ -1,24 +1,64 @@
 #!/bin/bash
 #!/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 version check function
+function version_ge(){ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -o ! -z "$1" -a "$1" = "$2"; }
+
+# 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
 # Run triggers only on updates
 if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
 if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
     exit
     exit
 fi
 fi
 
 
+# Clear the screen from apt output to prepare for upgrade installer experience
+clear
+welcome_message
+
 # Load hestia.conf
 # Load hestia.conf
 source /usr/local/hestia/conf/hestia.conf
 source /usr/local/hestia/conf/hestia.conf
 
 
-# Get hestia version
-version=$(dpkg -l | awk '$2=="hestia" { print $3 }')
+# Perform necessary upgrade steps
+source /usr/local/hestia/install/upgrade/version.sh
 
 
-# Check if upgrade routine exists for target version
-if [ -f "/usr/local/hestia/install/upgrade/$version.sh" ]; then
-    source /usr/local/hestia/install/upgrade/$version.sh
+# Upgrade phpMyAdmin if applicable
+if [ "$DB_SYSTEM" = 'mysql' ]; then
+    source /usr/local/hestia/install/upgrade/phpmyadmin.sh
 fi
 fi
 
 
-# Set new hestia version in conf file
-if [ "$VERSION" != "$version" ]; then
-    sed -i "s/VERSION='$VERSION'/VERSION='$version'/g" /usr/local/hestia/conf/hestia.conf
-fi
+# Set new version
+sed -i "/VERSION/d" $HESTIA/conf/hestia.conf
+echo "VERSION='$version'" >> $HESTIA/conf/hestia.conf
+
+# 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!'
+
+# Restart services for changes to take full effect
+source /usr/local/hestia/install/upgrade/restart.sh
+
+# Display completion message
+upgrade_complete
 
 
 exit 0
 exit 0

+ 14 - 1
src/deb/nginx/postinst

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 
 set -e
 set -e
 
 
@@ -9,3 +9,16 @@ fi
 # Touch and set permisions on default log files on installation
 # Touch and set permisions on default log files on installation
 update-rc.d hestia defaults >/dev/null
 update-rc.d hestia defaults >/dev/null
 invoke-rc.d hestia start || true
 invoke-rc.d hestia start || true
+
+# Run triggers only on updates
+if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
+    exit
+fi
+
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf
+
+# Reset backend port
+if [ ! -z "$BACKEND_PORT" ]; then
+    /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
+fi

+ 2 - 2
src/hst_autocompile.sh

@@ -175,7 +175,7 @@ fi
 GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
 GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
 
 
 # Generate Links for sourcecode
 # Generate Links for sourcecode
-HESTIA='https://github.com/hestiacp/hestiacp/archive/'$branch'.tar.gz'
+HESTIA_ARCHIVE_LINK='https://github.com/hestiacp/hestiacp/archive/'$branch'.tar.gz'
 NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
 NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
 PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
@@ -424,7 +424,7 @@ if [ "$HESTIA_B" = true ] ; then
 
 
     # Download and unpack source files
     # Download and unpack source files
     if [ -z "$use_src_folder" ]; then
     if [ -z "$use_src_folder" ]; then
-      download_file $HESTIA '-' 'fresh' | tar xz
+      download_file $HESTIA_ARCHIVE_LINK '-' 'fresh' | tar xz
     elif [ -d $SRC_DIR ]; then
     elif [ -d $SRC_DIR ]; then
       cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch
       cp -rf "$SRC_DIR/" $BUILD_DIR/hestiacp-$branch
     fi
     fi

+ 3 - 2
web/css/styles.min.css

@@ -768,7 +768,7 @@ body {
 
 
 .body-login, .body-reset {
 .body-login, .body-reset {
   height: auto;
   height: auto;
-  padding-top: 13%;
+  padding-top: 10%;
   background-color: #336699;
   background-color: #336699;
   background: linear-gradient(to bottom, rgba(44,92,147,1) 0%,rgba(72,136,186,1) 40%,rgba(127,186,232,1) 100%);
   background: linear-gradient(to bottom, rgba(44,92,147,1) 0%,rgba(72,136,186,1) 40%,rgba(127,186,232,1) 100%);
 }
 }
@@ -1109,7 +1109,7 @@ a {
   position: fixed;
   position: fixed;
   background-color: #fff;
   background-color: #fff;
   z-index: 100;
   z-index: 100;
-  padding-top: 34px;
+  padding-top: 36px;
   overflow: hidden;
   overflow: hidden;
   text-align: center;
   text-align: center;
   display: flex;
   display: flex;
@@ -1223,6 +1223,7 @@ div.l-content > div.l-separator:nth-of-type(4) {
   background-color: #fff;
   background-color: #fff;
   z-index: 120;
   z-index: 120;
   margin-top: 181px;
   margin-top: 181px;
+  height: 44px;
 }
 }
 
 
 .l-sort__create-btn {
 .l-sort__create-btn {

+ 7 - 2
web/edit/package/index.php

@@ -119,8 +119,13 @@ if (!empty($_POST['save'])) {
     if (!isset($_POST['v_backups'])) $errors[] = __('backups');
     if (!isset($_POST['v_backups'])) $errors[] = __('backups');
     if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota');
     if (!isset($_POST['v_disk_quota'])) $errors[] = __('quota');
     if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth');
     if (!isset($_POST['v_bandwidth'])) $errors[] = __('bandwidth');
-    if (empty($_POST['v_ns1'])) $errors[] = __('ns1');
-    if (empty($_POST['v_ns2'])) $errors[] = __('ns2');
+
+    // Check if name server entries are blank if DNS server is installed
+    if ((isset($_SESSION['DNS_SYSTEM'])) && (!empty($_SESSION['DNS_SYSTEM']))) {
+        if (empty($_POST['v_ns1'])) $errors[] = __('ns1');
+        if (empty($_POST['v_ns2'])) $errors[] = __('ns2');
+    }
+
     if (!empty($errors[0])) {
     if (!empty($errors[0])) {
         foreach ($errors as $i => $error) {
         foreach ($errors as $i => $error) {
             if ( $i == 0 ) {
             if ( $i == 0 ) {

+ 1 - 0
web/inc/i18n/en.php

@@ -487,6 +487,7 @@ $LANG['en'] = array(
     'DELETE_RULE_CONFIRMATION' => 'Are you sure you want to delete rule #%s?',
     'DELETE_RULE_CONFIRMATION' => 'Are you sure you want to delete rule #%s?',
     'SUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to suspend rule  #%s?',
     'SUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to suspend rule  #%s?',
     'UNSUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to unsuspend rule #%s?',
     'UNSUSPEND_RULE_CONFIRMATION' => 'Are you sure you want to unsuspend rule #%s?',
+    'Are you sure you want to stop service' => 'Are you sure you want to stop service %s?',
     'LEAVE_PAGE_CONFIRMATION' => 'Leave Page?',
     'LEAVE_PAGE_CONFIRMATION' => 'Leave Page?',
     'RESTART_CONFIRMATION' => 'Are you sure you want to restart %s?',
     'RESTART_CONFIRMATION' => 'Are you sure you want to restart %s?',
     'Welcome'  => 'Welcome',
     'Welcome'  => 'Welcome',

+ 3 - 3
web/js/app.js

@@ -1003,7 +1003,7 @@ hover_menu = function() {
     var st = $(window).scrollTop();
     var st = $(window).scrollTop();
 
 
     if (st <= 112) {
     if (st <= 112) {
-        sep_1.css({'margin-top': 178 - st + 'px'});
+        sep_1.css({'margin-top': 180 - st + 'px'});
         sep_2.css({'margin-top': 225 - st + 'px'});
         sep_2.css({'margin-top': 225 - st + 'px'});
         nav_a.css({'height': 111 - st + 'px'});
         nav_a.css({'height': 111 - st + 'px'});
         nav_a.css({'min-height': 111 - st + 'px'});
         nav_a.css({'min-height': 111 - st + 'px'});
@@ -1033,11 +1033,11 @@ hover_menu = function() {
 
 
     if(st < 109 ){
     if(st < 109 ){
         nav_a.find('ul').css({'visibility': 'visible'});
         nav_a.find('ul').css({'visibility': 'visible'});
-        nav_main.css({'padding-top': 34 + 'px'});
+        nav_main.css({'padding-top': 36 + 'px'});
     }
     }
 
 
     if (st <= 112 && st > 110 ) {
     if (st <= 112 && st > 110 ) {
-        nav_main.css({'padding-top': 34 - st + 109  + 'px'});
+        nav_main.css({'padding-top': 36 - st + 109  + 'px'});
     }
     }
 
 
     lastScrollTop = st;
     lastScrollTop = st;

+ 13 - 0
web/js/events.js

@@ -99,6 +99,19 @@ VE.callbacks.click.do_delete = function(evt, elm) {
      VE.helpers.createConfirmationDialog(dialog_elm, '', url);
      VE.helpers.createConfirmationDialog(dialog_elm, '', url);
 }
 }
 
 
+VE.callbacks.click.do_servicerestart = function(evt, elm) {
+    var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
+    var url = $('input[name="servicerestart_url"]', ref).val();
+    var dialog_elm = ref.find('.confirmation-text-servicerestart');
+    VE.helpers.createConfirmationDialog(dialog_elm, '', url);
+}
+
+VE.callbacks.click.do_servicestop = function(evt, elm) {
+    var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
+    var url = $('input[name="servicestop_url"]', ref).val();
+    var dialog_elm = ref.find('.confirmation-text-servicestop');
+    VE.helpers.createConfirmationDialog(dialog_elm, '', url);
+}
 
 
 /*
 /*
  * Create dialog box on the fly
  * Create dialog box on the fly

+ 1 - 0
web/js/i18n.js.php

@@ -1,4 +1,5 @@
 <?php
 <?php
+header("Content-Type: text/javascript");
 session_start();
 session_start();
 
 
 require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n.php');
 require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n.php');

+ 5 - 1
web/js/pages/add_web.js

@@ -174,7 +174,11 @@ App.Listeners.WEB.keypress_domain_name();
 $(function() {
 $(function() {
     $('#v_domain').change(function() {
     $('#v_domain').change(function() {
         var prefix = 'www.';
         var prefix = 'www.';
-        document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
+        if (((document.getElementById('v_domain').value).split(".")).length > 2) {
+            document.getElementById('v_aliases').value = "";
+        } else {
+            document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
+        }
     });
     });
     App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'))
     App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'))
 
 

+ 34 - 29
web/templates/admin/list_backup_detail.html

@@ -14,10 +14,6 @@
                   <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
                   <button type="submit" class="l-sort-toolbar__filter-apply" onclick="return doSearch('/search/')" value=""><i class="fas fa-search"></i></button>
                 </form>
                 </form>
               </td>
               </td>
-              <td class="toggle-all">
-                <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" onchange="checkedAll('objects');">
-                <label for="toggle-all" class="check-label toggle-all"><?=__('toggle all')?></label>
-              </td>
               <td>
               <td>
                 <form action="/bulk/restore/" method="post" id="objects">
                 <form action="/bulk/restore/" method="post" id="objects">
                 <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
                 <input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
@@ -39,10 +35,19 @@
     <div class="l-separator"></div>
     <div class="l-separator"></div>
 
 
     <div class="l-center units animated fadeIn">
     <div class="l-center units animated fadeIn">
-    <div class="header">
-      <div class="subtitle"><?=__('Listing')?>  <?=htmlentities($_GET['backup'])?></div>
-    </div>
-
+      <div class="header table-header">
+          <div class="l-unit__col l-unit__col--right step-top">
+            <div>
+                <div class="clearfix l-unit__stat-col--left super-compact">
+                  <input id="toggle-all" type="checkbox" name="toggle-all" value="toggle-all" onchange="checkedAll('objects');">
+                </div>
+                <div class="clearfix l-unit__stat-col--left compact-4"><b><?php print __('Type');?></b></div>
+                <div class="clearfix l-unit__stat-col--left wide-4"><b><?php print __('Details');?></b></div>
+                <div class="clearfix l-unit__stat-col--left text-right compact-4"><b><?php print __('Restore');?></b></div>
+            </div>
+           </div>
+        </div>
+      
       <?
       <?
         $backup = $_GET['backup'];
         $backup = $_GET['backup'];
         $web = explode(',',$data[$backup]['WEB']);
         $web = explode(',',$data[$backup]['WEB']);
@@ -58,10 +63,10 @@
               <label for="check<?=$i++?>" class="check-label"></label>
               <label for="check<?=$i++?>" class="check-label"></label>
             </div>
             </div>
 
 
-            <div class="clearfix l-unit__stat-col--left">
-                <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?='WEB ' . __('domain')?></div>
+            <div class="clearfix l-unit__stat-col--left compact-4">
+                <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Web domain')?></div>
             </div>
             </div>
-            <div class="clearfix l-unit__stat-col--left wide-3">
+            <div class="clearfix l-unit__stat-col--left wide-4">
                 <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
                 <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
             </div>
             </div>
 
 
@@ -96,10 +101,10 @@
                   <label for="check2<?=$i++?>" class="check-label"></label>
                   <label for="check2<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?='MAIL ' . __('domain')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Mail domain')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
               </div>
               </div>
   
   
@@ -134,10 +139,10 @@
                 <label for="check3<?=$i++?>" class="check-label"></label>
                 <label for="check3<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?='DNS ' . __('domain')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('DNS domain')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
               </div>
               </div>
   
   
@@ -172,10 +177,10 @@
                 <label for="check4<?=$i++?>" class="check-label"></label>
                 <label for="check4<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?=__('database')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Database')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
               </div>
               </div>
   
   
@@ -210,10 +215,10 @@
                 <label for="check5<?=$i++?>" class="check-label"></label>
                 <label for="check5<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?=__('cron')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Cron Records')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?='cron '.__('records')?></b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?='cron '.__('records')?></b></div>
               </div>
               </div>
   
   
@@ -247,10 +252,10 @@
                 <label for="check6<?=$i++?>" class="check-label"></label>
                 <label for="check6<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?=__('user dir')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('user dir')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b><?=$key?></b></div>
               </div>
               </div>
   
   
@@ -279,10 +284,10 @@
                 <label for="check7<?=$i++?>" class="check-label"></label>
                 <label for="check7<?=$i++?>" class="check-label"></label>
               </div>
               </div>
   
   
-              <div class="clearfix l-unit__stat-col--left">
-                  <div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?=__('cron')?></div>
+              <div class="clearfix l-unit__stat-col--left compact-4">
+                  <div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Cron')?></div>
               </div>
               </div>
-              <div class="clearfix l-unit__stat-col--left wide-3">
+              <div class="clearfix l-unit__stat-col--left wide-4">
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b>&nbsp;</b></div>
                   <div class="l-unit__stat-col l-unit__stat-col--left wide-4"><b>&nbsp;</b></div>
               </div>
               </div>
   
   

+ 1 - 1
web/templates/admin/list_server_info.html

@@ -37,7 +37,7 @@
       <!-- /.l-menu -->
       <!-- /.l-menu -->
       <div class="l-profile noselect">
       <div class="l-profile noselect">
         <div class="l-menu__item"><a href="javascript:location.reload();"><i class="fas fa-redo"></i></a></div>
         <div class="l-menu__item"><a href="javascript:location.reload();"><i class="fas fa-redo"></i></a></div>
-        <div class="l-menu__item"><a href="/logout/" alt="<?=__('Log out')?>"> <?=__('Log out')?>&nbsp;&nbsp;&nbsp;<i class="fas fa-sign-out-alt"></i></a></div>
+        <div class="l-menu__item"><a href="/logout/" alt="<?=__('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
       </div>
       </div>
       <!-- /.l-profile -->
       <!-- /.l-profile -->
     </div>
     </div>

+ 30 - 3
web/templates/admin/list_services.html

@@ -6,7 +6,16 @@
           <a href="/list/ip/" class="ui-button cancel" title="<?=__('IP')?>"><i class="fas fa-ethernet status-icon blue"></i> <?=__('IP')?></a>
           <a href="/list/ip/" class="ui-button cancel" title="<?=__('IP')?>"><i class="fas fa-ethernet status-icon blue"></i> <?=__('IP')?></a>
           <?php if ((isset($_SESSION['FIREWALL_SYSTEM'])) && (!empty($_SESSION['FIREWALL_SYSTEM']))) {?><a href="/list/firewall/" class="ui-button cancel" title="<?=__('Firewall')?>"><i class="fas fa-shield-alt status-icon red"></i> <?=__('Firewall')?></a><?php }?>
           <?php if ((isset($_SESSION['FIREWALL_SYSTEM'])) && (!empty($_SESSION['FIREWALL_SYSTEM']))) {?><a href="/list/firewall/" class="ui-button cancel" title="<?=__('Firewall')?>"><i class="fas fa-shield-alt status-icon red"></i> <?=__('Firewall')?></a><?php }?>
           <a href="/list/updates/" class="ui-button cancel" title="<?=__('Updates')?>"><i class="fas fa-sync status-icon green"></i> <?=__('Updates')?></a>
           <a href="/list/updates/" class="ui-button cancel" title="<?=__('Updates')?>"><i class="fas fa-sync status-icon green"></i> <?=__('Updates')?></a>
-          <a href="/restart/system/?hostname=<?php echo $sys['sysinfo']['HOSTNAME'] ?>&token=<?=$_SESSION['token']?>" class="ui-button danger cancel" title="<?=__('Restart')?>"><i class="fas fa-undo status-icon red"></i> <?=__('Restart')?></a>
+          <div class="actions-panel display-inline-block" key-action="js">
+              <a class="data-controls do_servicerestart ui-button danger cancel" title="<?=__('Restart')?>">
+                <i class="do_servicerestart fas fa-undo status-icon red"></i>
+                <?=__('Restart')?>
+                <input type="hidden" name="servicerestart_url" value="/restart/system/?hostname=<?php echo $sys['sysinfo']['HOSTNAME'] ?>&token=<?=$_SESSION['token']?>" />
+                  <div class="confirmation-text-servicerestart hidden" title="<?=__('Confirmation')?>">
+                    <p class="confirmation"><?=__('RESTART_CONFIRMATION', 'Server')?></p>
+                  </div>
+              </a>
+          </div>
         </div>
         </div>
         <div class="l-sort-toolbar clearfix">
         <div class="l-sort-toolbar clearfix">
           <table>
           <table>
@@ -106,12 +115,30 @@
           </div>
           </div>
           <div class="clearfix l-unit__stat-col--left wide-2"><b><a href="/edit/server/<? echo $key ?>/" title="<?=__('edit')?>"><?=$key?></a></b></div>
           <div class="clearfix l-unit__stat-col--left wide-2"><b><a href="/edit/server/<? echo $key ?>/" title="<?=__('edit')?>"><?=$key?></a></b></div>
           <div class="clearfix l-unit__stat-col--left text-center compact-2">
           <div class="clearfix l-unit__stat-col--left text-center compact-2">
+            <div class="actions-panel clearfix">
               <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href">
               <div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href">
                   <a href="/edit/server/<? echo $key ?>/" title="<?=__('edit')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim icon-large"></i></a>
                   <a href="/edit/server/<? echo $key ?>/" title="<?=__('edit')?>"><i class="fas fa-pencil-alt status-icon orange status-icon dim icon-large"></i></a>
               </div>
               </div>
-                  <a href="/restart/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__('restart')?>"><i class="data-controls fas fa-undo status-icon highlight status-icon dim icon-large"></i></a>
-                  <a href="/<?php echo $action ?>/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__($action)?>"><i class="fas fa-pause status-icon red status-icon dim icon-large"></i></a>
+              <div class="actions-panel__col actions-panel__stop shortcut-s" key-action="js">
+                  <a id="<?=$spnd_action ?>_link_<?=$i?>" class="data-controls do_servicerestart" title="<?=__('restart')?>">
+                    <i class="do_servicerestart data-controls fas fa-undo status-icon highlight status-icon dim icon-large"></i>
+                  <input type="hidden" name="servicerestart_url" value="/restart/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
+                  <div id="<?=$spnd_action?>_dialog_<?=$i?>" class="confirmation-text-servicerestart hidden" title="<?=__('Confirmation')?>">
+                    <p class="confirmation"><?=__('RESTART_CONFIRMATION',$key)?></p>
+                  </div>
+                </a>
+              </div>
+              <div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
+                <a id="delete_link_<?=$i?>" class="data-controls do_servicestop" title="<?=__($action)?>">
+                  <i class="do_servicestop fas fa-pause status-icon red status-icon dim icon-large"></i>
+                  <input type="hidden" name="servicestop_url" value="/<?php echo $action ?>/service/?srv=<?=$key?>&token=<?=$_SESSION['token']?>" />
+                    <div id="delete_dialog_<?=$i?>" class="confirmation-text-servicestop hidden" title="<?=__('Confirmation')?>">
+                      <p class="confirmation"><?=__('Are you sure you want to stop service',$key)?></p>
+                    </div>
+                </a>
+              </div>
             </div>
             </div>
+          </div>
           <div class="clearfix l-unit__stat-col--left wide-3"><?=__($data[$key]['SYSTEM'])?></div>
           <div class="clearfix l-unit__stat-col--left wide-3"><?=__($data[$key]['SYSTEM'])?></div>
           <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_time($data[$key]['RTIME'])?></b></div>
           <div class="clearfix l-unit__stat-col--left text-center"><b><?=humanize_time($data[$key]['RTIME'])?></b></div>
           <div class="clearfix l-unit__stat-col--left text-center"><b><?=$cpu?></b></div>
           <div class="clearfix l-unit__stat-col--left text-center"><b><?=$cpu?></b></div>

+ 2 - 1
web/templates/admin/list_stats.html

@@ -50,7 +50,8 @@
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print __('Mail Domains');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print __('Mail Domains');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?php print __('Mail Accounts');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?php print __('Mail Accounts');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print __('Databases');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print __('Databases');?>"></i></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print __('Backups');?>"></i></b></div>
+            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print __('Cron Jobs');?>"></i></b></div>
+            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-undo" title="<?php print __('Backups');?>"></i></b></div>
          </div>
          </div>
         </div>
         </div>
       </div>
       </div>

+ 2 - 4
web/templates/admin/list_updates.html

@@ -39,8 +39,7 @@
                     </div>
                     </div>
                   <div class="clearfix l-unit__stat-col--left wide"><b><?php print __('Package');?></b></div>
                   <div class="clearfix l-unit__stat-col--left wide"><b><?php print __('Package');?></b></div>
                   <div class="clearfix l-unit__stat-col--left wide-5"><b><?php print __('Description');?></b></div>
                   <div class="clearfix l-unit__stat-col--left wide-5"><b><?php print __('Description');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Version');?></b></div>
-                  <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Release');?></b></div>
+                  <div class="clearfix l-unit__stat-col--left text-center wide"><b><?php print __('Version');?></b></div>
                   <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Status');?></b></div>
                   <div class="clearfix l-unit__stat-col--left text-center"><b><?php print __('Status');?></b></div>
               </div>
               </div>
             </div>
             </div>
@@ -71,8 +70,7 @@
                 </div>
                 </div>
               <div class="clearfix l-unit__stat-col--left wide"><b><?=$key?></b></div>
               <div class="clearfix l-unit__stat-col--left wide"><b><?=$key?></b></div>
               <div class="clearfix l-unit__stat-col--left wide-5"><b><?=__($data[$key]['DESCR'])?></b></div>
               <div class="clearfix l-unit__stat-col--left wide-5"><b><?=__($data[$key]['DESCR'])?></b></div>
-              <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['VERSION'] ?> (<?=$data[$key]['ARCH']?>)</div>
-              <div class="clearfix l-unit__stat-col--left text-center"><?=$data[$key]['RELEASE']?></div>
+              <div class="clearfix l-unit__stat-col--left text-center wide"><?=$data[$key]['VERSION'] ?> (<?=$data[$key]['ARCH']?>)</div>
               <div class="clearfix l-unit__stat-col--left text-center">
               <div class="clearfix l-unit__stat-col--left text-center">
                   <? if ($data[$key]['UPDATED'] == 'no') {
                   <? if ($data[$key]['UPDATED'] == 'no') {
                     echo '
                     echo '

+ 1 - 1
web/templates/admin/list_user.html

@@ -100,7 +100,7 @@ sort-bandwidth="<?=$data[$key]['U_BANDWIDTH']?>" sort-disk="<?=$data[$key]['U_DI
           <div class="clearfix l-unit__stat-col--left super-compact">
           <div class="clearfix l-unit__stat-col--left super-compact">
             <input id="check<?=$i?>" class="ch-toggle" type="checkbox" name="user[]" value="<?=$key?>">
             <input id="check<?=$i?>" class="ch-toggle" type="checkbox" name="user[]" value="<?=$key?>">
           </div>
           </div>
-              <div class="clearfix l-unit__stat-col--left wide-3"><b><a href="/login/?loginas=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__('login as')?>"><?=$data[$key]['FNAME']?> <?=$data[$key]['LNAME']?> <span style="font-weight: normal !important;">(<?=$key?>)</span></b></a>
+              <div class="clearfix l-unit__stat-col--left wide-3"><b><a href="/edit/user/?user=<?=$key?>&token=<?=$_SESSION['token']?>" title="<?=__('login as')?>"><?=$data[$key]['FNAME']?> <?=$data[$key]['LNAME']?> <span style="font-weight: normal !important;">(<?=$key?>)</span></b></a>
                 <br />
                 <br />
                 <span style="font-size: 0.8rem;"><b><?=__('Email')?>:</b> <?=$data[$key]['CONTACT']?></span>
                 <span style="font-size: 0.8rem;"><b><?=__('Email')?>:</b> <?=$data[$key]['CONTACT']?></span>
               </div>
               </div>

+ 6 - 2
web/templates/admin/panel.html

@@ -25,7 +25,11 @@
 					<i class="fas fa-exchange-alt"></i>&nbsp;&nbsp;<b><?=humanize_usage_size($panel[$user]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($panel[$user]['U_BANDWIDTH'])?>
 					<i class="fas fa-exchange-alt"></i>&nbsp;&nbsp;<b><?=humanize_usage_size($panel[$user]['U_BANDWIDTH'])?></b> <?=humanize_usage_measure($panel[$user]['U_BANDWIDTH'])?>
 				</span>
 				</span>
 			</div>
 			</div>
-			<div class="l-menu__item"><a alt="<?=__('Notifications')?>" class="l-profile__notifications <? if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " updates"; ?>"><i class="fas fa-bell <?if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " animated extended swing status-icon orange"; ?>"></i></a></div>
+			<div class="l-menu__item">
+				<a alt="<?=__('Notifications')?>" class="l-profile__notifications <? if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " updates"; ?>">
+					<i class="fas fa-bell <?if($panel[$user]['NOTIFICATIONS'] == 'yes') echo " animated extended swing status-icon orange"; ?>"></i>
+				</a>
+			</div>
 			<div class="l-menu__item"><a href="https://docs.hestiacp.com/" alt="<?=__('Help')?>" class="l-profile__help" target="_blank"><i class="fas fa-question-circle"></i></a></div>
 			<div class="l-menu__item"><a href="https://docs.hestiacp.com/" alt="<?=__('Help')?>" class="l-profile__help" target="_blank"><i class="fas fa-question-circle"></i></a></div>
 			<div class="l-menu__item"><a href="/edit/user/?user=<?php echo $user; ?>" alt="<?=$user?>" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
 			<div class="l-menu__item"><a href="/edit/user/?user=<?php echo $user; ?>" alt="<?=$user?>" class="l-profile__username"><i class="fas fa-user-circle"></i></a></div>
 			<div class="l-menu__item"><a href="/logout/" alt="<?=__('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
 			<div class="l-menu__item"><a href="/logout/" alt="<?=__('Log out')?>" class="l-profile__logout"><i class="fas fa-sign-out-alt"></i></a></div>
@@ -68,7 +72,7 @@
 		<?php } ?>
 		<?php } ?>
 	<?php } ?>
 	<?php } ?>
 
 
-	<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>			
+	<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?>
 		<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
 		<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
 					<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
 					<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
 						<a href="/list/mail/">
 						<a href="/list/mail/">

+ 2 - 1
web/templates/user/list_stats.html

@@ -37,7 +37,8 @@
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print __('Mail Domains');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-mail-bulk" title="<?php print __('Mail Domains');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?php print __('Mail Accounts');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-inbox" title="<?php print __('Mail Accounts');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print __('Databases');?>"></i></b></div>
             <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-database" title="<?php print __('Databases');?>"></i></b></div>
-            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print __('Backups');?>"></i></b></div>
+            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-clock" title="<?php print __('Cron Jobs');?>"></i></b></div>
+            <div class="clearfix l-unit__stat-col--left text-center super-compact"><b><i class="fas fa-undo" title="<?php print __('Backups');?>"></i></b></div>
          </div>
          </div>
         </div>
         </div>
       </div>
       </div>

+ 1 - 1
web/templates/user/panel.html

@@ -67,7 +67,7 @@
 		<?php } ?>
 		<?php } ?>
 	<?php } ?>
 	<?php } ?>
 
 
-	<?php if ((isset($_SESSION['IMAP_SYSTEM'])) && (!empty($_SESSION['IMAP_SYSTEM']))) {?>			
+	<?php if ((isset($_SESSION['MAIL_SYSTEM'])) && (!empty($_SESSION['MAIL_SYSTEM']))) {?>
 		<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
 		<?php if($panel[$user]['MAIL_DOMAINS'] != "0") { ?>
 					<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
 					<div class="l-stat__col <?php if($TAB == 'MAIL' ) echo 'l-stat__col--active' ?>">
 						<a href="/list/mail/">
 						<a href="/list/mail/">