Browse Source

Merge branch 'main' into release

Jaap Marcus 3 years ago
parent
commit
676eb76770
45 changed files with 414 additions and 555 deletions
  1. 25 0
      CHANGELOG.md
  2. 1 1
      README.md
  3. 42 9
      SECURITY.md
  4. 5 2
      bin/v-add-letsencrypt-domain
  5. 8 4
      bin/v-add-mail-domain
  6. 1 1
      bin/v-add-web-domain-backend
  7. 1 1
      bin/v-change-mail-domain-rate-limit
  8. 13 7
      bin/v-change-sys-hostname
  9. 11 0
      bin/v-change-sys-php
  10. 12 1
      bin/v-change-web-domain-backend-tpl
  11. 5 4
      bin/v-change-web-domain-docroot
  12. 11 2
      bin/v-delete-web-domain
  13. 12 1
      bin/v-delete-web-domain-backend
  14. 2 2
      bin/v-generate-ssl-cert
  15. 2 0
      bin/v-list-mail-domains
  16. 12 1
      bin/v-restart-proxy
  17. 9 3
      bin/v-restart-service
  18. 19 3
      bin/v-restart-web
  19. 23 9
      bin/v-restart-web-backend
  20. 0 3
      bin/v-stop-firewall
  21. 0 3
      bin/v-update-firewall
  22. 1 1
      func/main.sh
  23. 17 5
      func/syshealth.sh
  24. 1 0
      func/upgrade.sh
  25. 1 1
      install/deb/exim/exim4.conf.4.94.template
  26. 1 1
      install/deb/exim/exim4.conf.template
  27. 87 90
      install/deb/filemanager/filegator/composer.lock
  28. 3 3
      install/hst-install-debian.sh
  29. 3 3
      install/hst-install-ubuntu.sh
  30. 1 1
      install/hst-install.sh
  31. 2 2
      install/upgrade/upgrade.conf
  32. 51 0
      install/upgrade/versions/1.6.1.sh
  33. 1 1
      src/deb/hestia/control
  34. 5 5
      src/deb/hestia/postinst
  35. 1 1
      src/deb/nginx/control
  36. 7 0
      src/deb/nginx/nginx.conf
  37. 0 22
      test/ssl/crt
  38. 0 27
      test/ssl/key
  39. 0 319
      test/test_actions.sh
  40. 1 3
      web/edit/web/index.php
  41. 11 7
      web/inc/composer.lock
  42. 1 1
      web/login/index.php
  43. 3 3
      web/templates/includes/panel.html
  44. 1 1
      web/templates/pages/edit_dns_rec.html
  45. 1 1
      web/templates/pages/edit_mail.html

+ 25 - 0
CHANGELOG.md

@@ -1,6 +1,31 @@
 # Changelog
 All notable changes to this project will be documented in this file.
 
+## [1.6.1] - Major Release (Feature / Quality Update)
+
+### Bugfixes
+
+- Fixed an issue with rate limit and alias domains (#2676, #2666)
+- Fixed an issue with reject spam option (#2687, #2864)
+- Fixed an issue in the installer when sieve is enabled (#2675, #2668)
+- Fixed an issue with File manager in development mode (#2682 #2644) 
+- Fixed multiple small in templates (#2659 @ledoktre, #2680, #2671, #2679, #2670, #2681, #2699)
+- Fixed add second check if DNS resolving fails (#2678)
+- Fixed an issue where v-change-sys-hostname does not update host file (#2688 #2683)
+- Fixed an issue with IDN conversions not working on new server installs (#2692 @wojsmol)
+
+### Enchantments
+
+- Improve restart behaviour php-fpm
+- Improve updating process to make it faster. 
+- Removed outdated / never used test scripts (#2685)
+
+### Dependencies
+
+- Update hestia-nginx to 1.23.0
+- Update PHPmailer to 6.6.3
+- Update Roundcube to 1.5.3
+
 ## [1.6.0] - Major Release (Feature / Quality Update)
 
 ### Important Notes

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.6.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
+**Latest stable release:** Version 1.6.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
 
 **Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
 **Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

+ 42 - 9
SECURITY.md

@@ -1,18 +1,51 @@
-# Security Policy
+# Hestia CP Security policy
 
-## Supported Versions
+Welcome and thanks for taking interest in Hestia CP!
+
+We are mostly interested in reports by actual Hestia CP users but  all high quality contributions are welcome.
+
+If you believe that you have have discovered a vulnerability in Hestia Control Panel,
+please let our development team know by submitting a report [Huntr.dev](https://huntr.dev/bounties/disclose/?target=https://github.com/hestiacp/hestiacp) Bounties and CVEs are automatically managed and allocated via the platform.
+
+If you are unable to use [Huntr.dev](https://huntr.dev/bounties/disclose/?target=https://github.com/hestiacp/hestiacp) please send an email to support@hestiacp.com
+
+We ask you to include a detailed description of the vulnerability, a list of services involved (e.g. exim, dovecot) and the versions which you've tested, full steps to reproduce the vulnerability, and include your findings and expected results.
+
+Please do not open any public issue on Github or any other social media before the report has been published and a fix has been released. 
+
+With that, good luck hacking us ;)
+
+## Supported versions
 
 | Version | Supported          |
 | ------- | ------------------ |
 | Latest  | :white_check_mark: |
 
+## Qualifying Vulnerabilities
 
-## Reporting a Vulnerability
+### Vulnerabilities we really care about!
+- Remote command execution
+- Code/SQL Injection
+- Authentication bypass
+- Privilege Escalation
+- Cross-site scripting (XSS)
+- Performing limited admin actions without authorization
+- CSRF
 
-If you believe that you have have discovered a vulnerability in Hestia Control Panel,
-please let our development team know by submitting a report [Huntr.dev](https://huntr.dev/bounties/disclose/?target=https://github.com/hestiacp/hestiacp) Bounties and CVEs are automatically managed and allocated via the platform.
+### Vulnerabilities we accept
+
+- Open redirects
+- Password brute-forcing that circumvents rate limiting
+
+## Non-Qualifying Vulnerabilities
+
+- Theoretical attacks without proof of exploitability
+- Attacks that are the result of a third party library should be reported to the library maintainers
+- Social engineering
+- Reflected file download
+- Physical attacks
+- Weak SSL/TLS/SSH algorithms or protocols
+- Attacks involving physical access to a user’s device, or involving a device or network that’s already seriously compromised (eg man-in-the-middle).
+- The user attacks themselves
+- anything in `/test/` folder
 
-If you are unable to [Huntr.dev](https://huntr.dev/bounties/disclose/?target=https://github.com/hestiacp/hestiacp) please send an email to support@hestiacp.com
-We ask that you please include a detailed description of the vulnerability,
-a list of services involved (e.g. exim, dovecot) and the versions which you've tested,
-full steps to reproduce the vulnerability, and include your findings and expected results.

+ 5 - 2
bin/v-add-letsencrypt-domain

@@ -187,7 +187,10 @@ if [ "$proto" = "http-01" ]; then
             identifier=$(idn2 --quiet $identifier)
         fi
         if ! nslookup "${identifier}" > /dev/null 2>&1 ; then
-            check_result "$E_NOTEXIST" "DNS record for $identifier doesn't exist"
+            # Attempt against Cloudflare DNS
+            if ! nslookup "${identifier}" 1.1.1.1 > /dev/null 2>&1 ; then
+                check_result "$E_NOTEXIST" "DNS record for $identifier doesn't exist"
+            fi
         fi
     done
 fi
@@ -230,7 +233,7 @@ url="$LE_API/acme/new-order"
 payload='{"identifiers":['
 for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
     if [[ "$identifier" = *[![:ascii:]]* ]]; then
-        identifier=$(idn -t --quiet -a $identifier)
+        identifier=$(idn2 --quiet $identifier)
     fi
     payload=$payload'{"type":"dns","value":"'$identifier'"},'
 done

+ 8 - 4
bin/v-add-mail-domain

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add mail domain
-# options: USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE]
+# options: USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE] [RESTART] [REJECT_SPAM]
 #
 # example: v-add-mail-domain admin mydomain.tld
 #
@@ -18,6 +18,7 @@ antivirus=${4-yes}
 dkim=${5-yes}
 dkim_size=${6-1024}
 restart=${7-yes}
+reject=${8-yes}
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -49,8 +50,8 @@ domain_utf=$(idn2 --quiet -d "$domain_idn")
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '2' "$#" 'USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE]'
-is_format_valid 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size' 'restart'
+check_args '2' "$#" 'USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE] [RESTART] [REJECT_SPAM]'
+is_format_valid 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size' 'restart' 'reject'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -93,7 +94,7 @@ fi
 new_timestamp
 
 # Adding domain to mail.conf
-s="DOMAIN='$domain' ANTIVIRUS='$antivirus' ANTISPAM='$antispam' DKIM='$dkim' WEBMAIL=''"
+s="DOMAIN='$domain' ANTIVIRUS='$antivirus' ANTISPAM='$antispam' REJECT='$reject' DKIM='$dkim' WEBMAIL=''"
 s="$s SSL='no' LETSENCRYPT='no' CATCHALL='' ACCOUNTS='0' U_DISK='0' SUSPENDED='no' TIME='$time'"
 s="$s DATE='$date'"
 echo $s >> $USER_DATA/mail.conf
@@ -133,6 +134,9 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
         if [ "$antispam" = 'yes' ]; then
             touch "$HOMEDIR/$user/conf/mail/$domain/antispam"
         fi
+        if [ "$reject" = 'yes' ]; then
+            touch "$HOMEDIR/$user/conf/mail/$domain/reject_spam"
+        fi
     fi
     
     if [ -n "$ANTIVIRUS_SYSTEM" ]; then

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

@@ -84,7 +84,7 @@ fi
 #----------------------------------------------------------#
 
 # Restart backend server
-$BIN/v-restart-web-backend "$restart"
+$BIN/v-restart-web-backend "$restart" "$backend_version"
 check_result $? "Web backend restart failed" >/dev/null
 
 # Logging

+ 1 - 1
bin/v-change-mail-domain-rate-limit

@@ -62,9 +62,9 @@ if [[ "$rate" = "system" ]]; then
     rate=''
 fi
 
-$HESTIA/bin/v-rebuild-mail-domain "$user" "$domain"
 # Update quota
 update_object_value "mail" 'DOMAIN' "$domain" '$RATE_LIMIT' "$rate"
+$HESTIA/bin/v-rebuild-mail-domain "$user" "$domain"
 
 # Logging
 $BIN/v-log-action "$user" "Info" "Mail" "Mail domain rate limit has changed ($rate)"

+ 13 - 7
bin/v-change-sys-hostname

@@ -49,15 +49,21 @@ else
     # Debian/Ubuntu
     hostnamectl set-hostname "$domain"
     echo "$domain" > /etc/hostname
+fi
 
-    # Update Roundcube password plugin configuration
-    if [ -d /etc/roundcube/ ]; then
-        sed -i "/password_hestia_host/c\$rcmail_config['password_hestia_host'] = '$domain';" /etc/roundcube/plugins/password/config.inc.php
-    fi
-    if [ -d /etc/rainloop/ ]; then
-        sed -i "/hestia_host/c\hestia_host = \"$domain\"" /etc/rainloop/data/_data_/_default_/configs/plugin-hestia-change-password.ini 
-    fi
+# Update Roundcube password plugin configuration
+if [ -d /etc/roundcube/ ]; then
+    sed -i "/password_hestia_host/c\$rcmail_config['password_hestia_host'] = '$domain';" /etc/roundcube/plugins/password/config.inc.php
 fi
+if [ -d /etc/rainloop/ ]; then
+    sed -i "/hestia_host/c\hestia_host = \"$domain\"" /etc/rainloop/data/_data_/_default_/configs/plugin-hestia-change-password.ini 
+fi
+
+if [ -f /etc/hosts ];then
+    if ! cat /etc/hosts | grep $domain > /dev/null ; then
+        echo "127.0.0.1 $domain" >> /etc/hosts
+    fi
+fi 
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 11 - 0
bin/v-change-sys-php

@@ -48,7 +48,18 @@ php_fpm="/etc/init.d/php$version-fpm"
 
 rm -f /etc/php/*/fpm/pool.d/www.conf
 cp -f $HESTIA/install/deb/php-fpm/www.conf /etc/php/$version/fpm/pool.d/www.conf
+
+for user in $($HESTIA/bin/v-list-sys-users plain); do
+    $BIN/v-rebuild-web-domains "$user" 'no' >/dev/null 2>&1
+    $BIN/v-rebuild-mail-domains "$user" 'no' >/dev/null 2>&1
+done;
+
+# restart
 $HESTIA/bin/v-restart-web-backend
+$HESTIA/bin/v-restart-web
+$HESTIA/bin/v-restart-proxy
+
+
 
 update-alternatives --set php /usr/bin/php$version
 

+ 12 - 1
bin/v-change-web-domain-backend-tpl

@@ -165,7 +165,18 @@ fi
 $BIN/v-restart-web "$restart"
 check_result $? "Web restart failed" >/dev/null
 
-$BIN/v-restart-web-backend "$restart"
+# Detect prev version
+if [[ $BACKEND =~ ^.*PHP-([0-9])\_([0-9])$ ]]; then
+    version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
+else
+    version=$(multiphp_default_version)
+fi
+
+$BIN/v-restart-web-backend "$restart" "$version"
+if [ "$version" != "$backend_version" ]; then
+    $BIN/v-restart-web-backend "$restart" "$backend_version"
+fi
+
 check_result $? "Web backend restart failed" >/dev/null
 
 # Logging

+ 5 - 4
bin/v-change-web-domain-docroot

@@ -26,6 +26,7 @@ domain=$2
 export target_domain=$3
 export target_directory=$4
 export php=$5
+restart=$6
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -44,15 +45,15 @@ format_domain
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '2' "$#" 'USER DOMAIN TARGET_DOMAIN [DIRECTORY]'
+check_args '2' "$#" 'USER DOMAIN [TARGET_DOMAIN] [DIRECTORY] [PHP-DOCROOT] [RESTART]'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 # Check to ensure that target domain is valid if we're
 # not setting the docroot value back to defaults
 if [ "$target_domain" != "default" ]; then
-    is_format_valid 'user' 'domain' 'target_domain'
+    is_format_valid 'user' 'domain' 'target_domain' 'restart'
     is_object_valid 'web' 'DOMAIN' "$target_domain"
 else
-    is_format_valid 'user' 'domain'
+    is_format_valid 'user' 'domain' 'restart'
 fi
 is_object_valid 'user' 'USER' "$user" "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -121,7 +122,7 @@ fi
 #----------------------------------------------------------#
 
 # Rebuild domain configuration
-$BIN/v-rebuild-web-domain "$user" "$domain"
+$BIN/v-rebuild-web-domain "$user" "$domain" "$restart"
 
 # Logging
 if [ "$target_domain" = "default" ]; then

+ 11 - 2
bin/v-delete-web-domain

@@ -58,6 +58,8 @@ check_hestia_demo_mode
 get_domain_values 'web'
 local_ip=$(get_real_ip "$IP")
 
+
+
 # Deleting ftp users
 if [ -n "$FTP_USER" ]; then
     for ftp_user in ${FTP_USER//:/ }; do
@@ -138,8 +140,15 @@ if [ -n "$SUSPENDED" ]; then
     fi
 fi
 
-# Restarting web server
-$BIN/v-restart-web "$restart"
+# Detect php version
+
+if [[ $BACKEND =~ ^.*PHP-([0-9])\_([0-9])$ ]]; then
+    version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
+else
+    version=$(multiphp_default_version)
+fi
+# Restarting backend server
+$BIN/v-restart-web-backend "$restart" "$version"
 check_result $? "Web restart failed" >/dev/null
 
 # Restarting proxy server

+ 12 - 1
bin/v-delete-web-domain-backend

@@ -49,6 +49,10 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
+get_domain_values 'web'
+BACKEND="$template"
+
+
 # Defining pool directory
 pool=$(find -L /etc/php/ -name "$domain.conf" -exec dirname {} \;)
 if [ ! -e "$pool" ]; then
@@ -77,8 +81,15 @@ delete_web_backend
 #                       Hestia                             #
 #----------------------------------------------------------#
 
+
+# Detect prev version
+if [[ $BACKEND =~ ^.*PHP-([0-9])\_([0-9])$ ]]; then
+    version="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
+else
+    version=$(multiphp_default_version)
+fi
 # Restarting backend server
-$BIN/v-restart-web-backend "$restart"
+$BIN/v-restart-web-backend "$restart" "$version"
 check_result $? "Backend restart failed" >/dev/null
 
 # Logging

+ 2 - 2
bin/v-generate-ssl-cert

@@ -62,7 +62,7 @@ shell_list_ssl() {
 # Additional argument formatting
 format_domain_idn
 if [[ "$email" = *[![:ascii:]]* ]]; then
-    email=$(idn -t --quiet -a $email)
+    email=$(idn2 --quiet $email)
 fi
 
 #----------------------------------------------------------#
@@ -121,7 +121,7 @@ if [ -z "$aliases" ]; then
 else
     for alias in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
         if [[ "$alias" = *[![:ascii:]]* ]]; then
-            alias=$(idn -t --quiet -a $alias)
+            alias=$(idn2 --quiet $alias)
         fi
         dns_aliases="${dns_aliases}DNS:$alias,"
     done

+ 2 - 0
bin/v-list-mail-domains

@@ -33,6 +33,8 @@ json_list() {
         echo -n '    "'$DOMAIN'": {
         "ANTIVIRUS": "'$ANTIVIRUS'",
         "ANTISPAM": "'$ANTISPAM'",
+        "REJECT": "'$REJECT'",
+        "RATE_LIMIT": "'$RATE_LIMIT'",
         "DKIM": "'$DKIM'",
         "CATCHALL": "'$CATCHALL'",
         "ACCOUNTS": "'$ACCOUNTS'",

+ 12 - 1
bin/v-restart-proxy

@@ -18,6 +18,8 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
+date=$(date +"%Y-%m-%d %H:%M:%S");
+
 send_email_report() {
     email=$(grep CONTACT $HESTIA/data/users/admin/user.conf)
     email=$(echo "$email" | cut -f 2 -d "'")
@@ -26,6 +28,10 @@ send_email_report() {
     nginx -t >> $tmpfile 2>&1
     service "$PROXY_SYSTEM" restart >> $tmpfile 2>&1
     cat "$tmpfile" |$SENDMAIL -s "$subj" "$email"
+    if [ "$DEBUG_MODE" = "true" ]; then 
+        echo "[ $date | $PROXY_SYSTEM | PROXY ]"  >> /var/log/hestia/debug.log 2>&1
+        cat "$tmpfile" >> /var/log/hestia/debug.log 2>&1
+    fi
     rm -f $tmpfile
 }
 
@@ -76,7 +82,12 @@ if [ -f "$HESTIA/web/inc/nginx_proxy" ]; then
     # Default behaviour
     
     # Preform an check if Nginx is valid as reload doesn't throw an error / exit
-    service $PROXY_SYSTEM configtest > /dev/null 2>&1
+    if [ "$DEBUG_MODE" = "true" ]; then 
+        echo "[ $date | $PROXY_SYSTEM ]"  >> /var/log/hestia/debug.log 2>&1
+        service $PROXY_SYSTEM configtest > /var/log/hestia/debug.log 2>&1
+    else
+        service $PROXY_SYSTEM configtest > /dev/null 2>&1
+    fi
     if [ $? -ne 0 ]; then
         send_email_report
         check_result "$E_RESTART" "$PROXY_SYSTEM restart failed"

+ 9 - 3
bin/v-restart-service

@@ -31,6 +31,12 @@ is_format_valid 'service' 'restart'
 #                       Action                             #
 #----------------------------------------------------------#
 
+log="/dev/null"
+if [ "$DEBUG_MODE" = "true" ]; then 
+    
+    log="/var/log/hestia/debug.log"
+fi
+
 # Multi-instance service restart request handling
 if [ "$service" = "php-fpm" ];then
     service_list=''
@@ -51,7 +57,7 @@ for service in $service_list; do
         $BIN/v-stop-firewall
         $BIN/v-update-firewall
     elif [ "$restart" = "ssl" ] && [ "$service" = "nginx" ]; then
-        service $service upgrade > /dev/null 2>&1
+        service $service upgrade >> $log 2>&1
     elif [ -z "$restart" -o "$restart" = "no" ] && [ \
             "$service" = "nginx" -o     \
             "$service" = "apache2" -o   \
@@ -73,8 +79,8 @@ for service in $service_list; do
             "$service" = "fail2ban" ]; then
         systemctl reload-or-restart "$service" > /dev/null 2>&1
     else
-        systemctl reset-failed "$service "> /dev/null 2>&1
-        systemctl restart "$service" > /dev/null 2>&1
+        systemctl reset-failed "$service" >> $log 2>&1
+        systemctl restart "$service" >> $log 2>&1
     fi
 
     # Check the result of the service restart and report whether it failed.

+ 19 - 3
bin/v-restart-web

@@ -18,6 +18,8 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
+date=$(date +"%Y-%m-%d %H:%M:%S");
+
 send_email_report() {
     email=$(grep CONTACT $HESTIA/data/users/admin/user.conf)
     email=$(echo "$email" | cut -f 2 -d "'")
@@ -26,10 +28,14 @@ send_email_report() {
     if [ "$WEB_SYSTEM" = "apache2" ]; then 
         apache2ctl configtest >> "$tmpfile" 2>&1
     else 
-        nginx -t >> $tmpfile 2>&1
+        service $WEB_SYSTEM configtest >> "$tmpfile" 2>&1
     fi
     service "$WEB_SYSTEM" restart >> "$tmpfile" 2>&1
     cat "$tmpfile" |$SENDMAIL -s "$subj"  "$email"
+    if [ "$DEBUG_MODE" = "true" ]; then 
+        echo "[ $date | $WEB_SYSTEM | WEB ]"  >> /var/log/hestia/debug.log 2>&1
+        cat $tmpfile >> /var/log/hestia/debug.log 2>&1
+    fi
     rm -f $tmpfile
 }
 
@@ -64,13 +70,23 @@ if [ $WEB_SYSTEM = 'nginx' ]; then
     if [ "$1" = "ssl" ]; then
         restart="ssl"
     fi
-    service $WEB_SYSTEM configtest > /dev/null 2>&1
+    if [ "$DEBUG_MODE" = "true" ]; then 
+        echo "[  $date | $WEB_SYSTEM | WEB ]"  >> /var/log/hestia/debug.log 2>&1
+        service $WEB_SYSTEM configtest >> /var/log/hestia/debug.log 2>&1
+    else
+        service $WEB_SYSTEM configtest > /dev/null 2>&1
+    fi
     if [ $? -ne 0 ]; then
         send_email_report
         check_result "$E_RESTART" "$WEB_SYSTEM restart failed"
     fi
 elif [ $WEB_SYSTEM = 'apache2' ]; then
-    apache2ctl configtest > /dev/null 2>&1
+    if [ "$DEBUG_MODE" = "true" ]; then 
+        echo "[  $date | $WEB_SYSTEM | WEB ]"  >> /var/log/hestia/debug.log 2>&1
+        apache2ctl configtest >> /var/log/hestia/debug.log 2>&1
+    else
+        apache2ctl configtest > /dev/null 2>&1
+    fi
     if [ $? -ne 0 ]; then
         send_email_report
         check_result "$E_RESTART" "$WEB_SYSTEM restart failed"

+ 23 - 9
bin/v-restart-web-backend

@@ -6,6 +6,10 @@
 #
 # This function reloads backend server configuration.
 
+restart=$1
+# For backward compatibility might change in the feature
+version=$2
+
 #----------------------------------------------------------#
 #                Variables & Functions                     #
 #----------------------------------------------------------#
@@ -47,20 +51,30 @@ if [ "$1" = 'scheduled' ] || [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; th
 fi
 
 tmpfile=$(mktemp)
-# Substitute php-fpm service name formats
-for version in $($BIN/v-list-sys-php plain); do
-    v_php="php$version-fpm"
-    if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then
-        cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/"
-        sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf"
-    fi
 
-    $BIN/v-restart-service "$v_php" "$1" >> $tmpfile 2>&1
+if [ -z "$version" ]; then
+    # Substitute php-fpm service name formats
+    for version in $($BIN/v-list-sys-php plain); do
+        v_php="php$version-fpm"
+        if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then
+            cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/"
+            sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf"
+        fi
+    
+        $BIN/v-restart-service "$v_php" "$restart" 
+        if [ $? -ne 0 ]; then
+            send_email_report
+            check_result "$E_RESTART" "$v_php restart failed"
+        fi
+    done
+else
+    v_php="php$version-fpm"
+    $BIN/v-restart-service "$v_php" "$restart" 
     if [ $? -ne 0 ]; then
         send_email_report
         check_result "$E_RESTART" "$v_php restart failed"
     fi
-done
+fi
 
 # Update restart queue
 if [ -e "$HESTIA/data/queue/restart.pipe" ]; then

+ 0 - 3
bin/v-stop-firewall

@@ -68,9 +68,6 @@ rm -f $tmp
 # Saving rules to the master iptables file
 if [ -d "/etc/sysconfig" ]; then
     /sbin/iptables-save > /etc/sysconfig/iptables
-    if [ -z "$(ls /etc/rc3.d/S*iptables 2>/dev/null)" ]; then
-        /sbin/chkconfig iptables off
-    fi
 else
     /sbin/iptables-save > /etc/iptables.rules
     iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .);

+ 0 - 3
bin/v-update-firewall

@@ -179,9 +179,6 @@ fi
 # Saving rules to the master iptables file
 if [ -d "/etc/sysconfig" ]; then
     /sbin/iptables-save > /etc/sysconfig/iptables
-    if [ -z "$(ls /etc/rc3.d/S*iptables 2>/dev/null)" ]; then
-        /sbin/chkconfig iptables on
-    fi
 else
     /sbin/iptables-save > /etc/iptables.rules
     iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .);

+ 1 - 1
func/main.sh

@@ -1186,8 +1186,8 @@ is_format_valid() {
                 proxy_ext)      is_extention_format_valid "$arg" ;;
                 quota)          is_int_format_valid "$arg" 'quota' ;;
                 rate)           is_int_format_valid "$arg" 'rate' ;;
-
                 record)         is_common_format_valid "$arg" 'record';;
+                reject)       is_boolean_format_valid "$arg" 'reject' ;;
                 restart)        is_restart_format_valid "$arg" 'restart' ;;
                 role)           is_role_valid "$arg" 'role' ;;
                 rtype)          is_dns_type_format_valid "$arg" ;;

+ 17 - 5
func/syshealth.sh

@@ -464,8 +464,7 @@ function syshealth_repair_system_config() {
         $BIN/v-change-sys-config-value "POLICY_CSRF_STRICTNESS" "1"
     fi
     
-    mv $HESTIA/conf/hestia.conf $HESTIA/conf/hestia.old.conf
-    touch $HESTIA/conf/hestia.conf 
+    touch $HESTIA/conf/hestia.conf.new
     while IFS='= ' read -r lhs rhs
       do
           if [[ ! $lhs =~ ^\ *# && -n $lhs ]]; then
@@ -473,10 +472,23 @@ function syshealth_repair_system_config() {
               rhs="${rhs%%*( )}"   # Del trailing spaces
               rhs="${rhs%\'*}"     # Del opening string quotes
               rhs="${rhs#\'*}"     # Del closing string quotes
-              $BIN/v-change-sys-config-value "$lhs" "$rhs"
+              
           fi
-      done < $HESTIA/conf/hestia.old.conf
-      rm $HESTIA/conf/hestia.old.conf
+          check_ckey=$(grep "^$lhs='" "$HESTIA/conf/hestia.conf.new")
+            if [ -z "$check_ckey" ]; then
+                echo "$lhs='$rhs'" >> "$HESTIA/conf/hestia.conf.new"
+            else
+                sed -i "s|^$lhs=.*|$lhs='$rhs'|g" "$HESTIA/conf/hestia.conf.new"
+            fi
+      done < $HESTIA/conf/hestia.conf
+      
+      cmp --silent $HESTIA/conf/hestia.conf $HESTIA/conf/hestia.conf.new
+      if [ $? -ne 0 ]; then 
+        echo "[ ! ] Duplicated keys found repair config"
+        rm  $HESTIA/conf/hestia.conf
+        cp $HESTIA/conf/hestia.conf.new $HESTIA/conf/hestia.conf
+        rm $HESTIA/conf/hestia.conf.new 
+      fi 
 }
 
 # Repair System Cron Jobs

+ 1 - 0
func/upgrade.sh

@@ -380,6 +380,7 @@ upgrade_init_logging() {
 }
 
 upgrade_start_backup() {
+    echo "============================================================================="
     echo "[ * ] Backing up existing templates and configuration files..."
     if [ "$DEBUG_MODE" = "true" ]; then
         echo "      - Packages"

+ 1 - 1
install/deb/exim/exim4.conf.4.94.template

@@ -134,7 +134,7 @@ acl_check_rcpt:
 
 # Limit per email account for SMTP auhenticated users
   deny    message       = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
-          set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
+          set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$authenticated_id}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
           ratelimit     = $acl_c_msg_limit / 1h / strict/ $authenticated_id
   
   warn    ratelimit     = ${eval:$acl_c_msg_limit / 2} / 1h / strict / $authenticated_id

+ 1 - 1
install/deb/exim/exim4.conf.template

@@ -138,7 +138,7 @@ acl_check_rcpt:
 
 # Limit per email account for SMTP auhenticated users
   deny    message       = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
-          set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
+          set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$authenticated_id}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
           ratelimit     = $acl_c_msg_limit / 1h / strict/ $authenticated_id
 
   warn    ratelimit     = ${eval:$acl_c_msg_limit / 2} / 1h / strict / $authenticated_id

+ 87 - 90
install/deb/filemanager/filegator/composer.lock

@@ -339,16 +339,16 @@
         },
         {
             "name": "monolog/monolog",
-            "version": "1.27.0",
+            "version": "1.27.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/Seldaek/monolog.git",
-                "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a"
+                "reference": "904713c5929655dc9b97288b69cfeedad610c9a1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/52ebd235c1f7e0d5e1b16464b695a28335f8e44a",
-                "reference": "52ebd235c1f7e0d5e1b16464b695a28335f8e44a",
+                "url": "https://api.github.com/repos/Seldaek/monolog/zipball/904713c5929655dc9b97288b69cfeedad610c9a1",
+                "reference": "904713c5929655dc9b97288b69cfeedad610c9a1",
                 "shasum": ""
             },
             "require": {
@@ -409,7 +409,7 @@
             ],
             "support": {
                 "issues": "https://github.com/Seldaek/monolog/issues",
-                "source": "https://github.com/Seldaek/monolog/tree/1.27.0"
+                "source": "https://github.com/Seldaek/monolog/tree/1.27.1"
             },
             "funding": [
                 {
@@ -421,7 +421,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-03-13T20:29:46+00:00"
+            "time": "2022-06-09T08:53:42+00:00"
         },
         {
             "name": "nikic/fast-route",
@@ -1154,16 +1154,16 @@
         },
         {
             "name": "symfony/http-foundation",
-            "version": "v4.4.42",
+            "version": "v4.4.43",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/http-foundation.git",
-                "reference": "8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3"
+                "reference": "4441dada27f9208e03f449d73cb9253c639e53c5"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3",
-                "reference": "8e87b3ec23ebbcf7440d91dec8f7ca70dd591eb3",
+                "url": "https://api.github.com/repos/symfony/http-foundation/zipball/4441dada27f9208e03f449d73cb9253c639e53c5",
+                "reference": "4441dada27f9208e03f449d73cb9253c639e53c5",
                 "shasum": ""
             },
             "require": {
@@ -1202,7 +1202,7 @@
             "description": "Defines an object-oriented layer for the HTTP specification",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/http-foundation/tree/v4.4.42"
+                "source": "https://github.com/symfony/http-foundation/tree/v4.4.43"
             },
             "funding": [
                 {
@@ -1218,20 +1218,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-17T11:15:18+00:00"
+            "time": "2022-06-19T13:07:44+00:00"
         },
         {
             "name": "symfony/mime",
-            "version": "v5.4.9",
+            "version": "v5.4.10",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/mime.git",
-                "reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e"
+                "reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/mime/zipball/2b3802a24e48d0cfccf885173d2aac91e73df92e",
-                "reference": "2b3802a24e48d0cfccf885173d2aac91e73df92e",
+                "url": "https://api.github.com/repos/symfony/mime/zipball/02265e1e5111c3cd7480387af25e82378b7ab9cc",
+                "reference": "02265e1e5111c3cd7480387af25e82378b7ab9cc",
                 "shasum": ""
             },
             "require": {
@@ -1285,7 +1285,7 @@
                 "mime-type"
             ],
             "support": {
-                "source": "https://github.com/symfony/mime/tree/v5.4.9"
+                "source": "https://github.com/symfony/mime/tree/v5.4.10"
             },
             "funding": [
                 {
@@ -1301,20 +1301,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-21T10:24:18+00:00"
+            "time": "2022-06-09T12:22:40+00:00"
         },
         {
             "name": "symfony/polyfill-intl-idn",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-intl-idn.git",
-                "reference": "749045c69efb97c70d25d7463abba812e91f3a44"
+                "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/749045c69efb97c70d25d7463abba812e91f3a44",
-                "reference": "749045c69efb97c70d25d7463abba812e91f3a44",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8",
+                "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8",
                 "shasum": ""
             },
             "require": {
@@ -1328,7 +1328,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -1372,7 +1372,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -1388,20 +1388,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-09-14T14:02:44+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/polyfill-intl-normalizer",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
-                "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8"
+                "reference": "219aa369ceff116e673852dce47c3a41794c14bd"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8",
-                "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd",
+                "reference": "219aa369ceff116e673852dce47c3a41794c14bd",
                 "shasum": ""
             },
             "require": {
@@ -1413,7 +1413,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -1456,7 +1456,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -1472,20 +1472,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-02-19T12:13:01+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/polyfill-mbstring",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+                "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
-                "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+                "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
                 "shasum": ""
             },
             "require": {
@@ -1500,7 +1500,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -1539,7 +1539,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -1555,20 +1555,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-11-30T18:21:41+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/polyfill-php72",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-php72.git",
-                "reference": "9a142215a36a3888e30d0a9eeea9766764e96976"
+                "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976",
-                "reference": "9a142215a36a3888e30d0a9eeea9766764e96976",
+                "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2",
+                "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2",
                 "shasum": ""
             },
             "require": {
@@ -1577,7 +1577,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -1615,7 +1615,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -1631,20 +1631,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-05-27T09:17:38+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/polyfill-php80",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-php80.git",
-                "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
+                "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
-                "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+                "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
                 "shasum": ""
             },
             "require": {
@@ -1653,7 +1653,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -1698,7 +1698,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -1714,7 +1714,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-03-04T08:16:47+00:00"
+            "time": "2022-05-10T07:21:04+00:00"
         },
         {
             "name": "symfony/security-core",
@@ -2913,16 +2913,16 @@
         },
         {
             "name": "nikic/php-parser",
-            "version": "v4.13.2",
+            "version": "v4.14.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/nikic/PHP-Parser.git",
-                "reference": "210577fe3cf7badcc5814d99455df46564f3c077"
+                "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
-                "reference": "210577fe3cf7badcc5814d99455df46564f3c077",
+                "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1",
+                "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1",
                 "shasum": ""
             },
             "require": {
@@ -2963,9 +2963,9 @@
             ],
             "support": {
                 "issues": "https://github.com/nikic/PHP-Parser/issues",
-                "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
+                "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0"
             },
-            "time": "2021-11-30T19:35:32+00:00"
+            "time": "2022-05-31T20:59:12+00:00"
         },
         {
             "name": "phar-io/manifest",
@@ -3747,16 +3747,16 @@
         },
         {
             "name": "phpunit/phpunit",
-            "version": "8.5.26",
+            "version": "8.5.27",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "ef117c59fc4c54a979021b26d08a3373e386606d"
+                "reference": "df70070f2711b8fe8dcca0797c1239ede8c94be6"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef117c59fc4c54a979021b26d08a3373e386606d",
-                "reference": "ef117c59fc4c54a979021b26d08a3373e386606d",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/df70070f2711b8fe8dcca0797c1239ede8c94be6",
+                "reference": "df70070f2711b8fe8dcca0797c1239ede8c94be6",
                 "shasum": ""
             },
             "require": {
@@ -3786,9 +3786,6 @@
                 "sebastian/type": "^1.1.3",
                 "sebastian/version": "^2.0.1"
             },
-            "require-dev": {
-                "ext-pdo": "*"
-            },
             "suggest": {
                 "ext-soap": "*",
                 "ext-xdebug": "*",
@@ -3828,7 +3825,7 @@
             ],
             "support": {
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
-                "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.26"
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.27"
             },
             "funding": [
                 {
@@ -3840,7 +3837,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2022-04-01T12:34:39+00:00"
+            "time": "2022-06-19T12:11:16+00:00"
         },
         {
             "name": "sebastian/code-unit-reverse-lookup",
@@ -4573,16 +4570,16 @@
         },
         {
             "name": "symfony/console",
-            "version": "v4.4.42",
+            "version": "v4.4.43",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "cce7a9f99e22937a71a16b23afa762558808d587"
+                "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/cce7a9f99e22937a71a16b23afa762558808d587",
-                "reference": "cce7a9f99e22937a71a16b23afa762558808d587",
+                "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
+                "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
                 "shasum": ""
             },
             "require": {
@@ -4643,7 +4640,7 @@
             "description": "Eases the creation of beautiful and testable command line interfaces",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/console/tree/v4.4.42"
+                "source": "https://github.com/symfony/console/tree/v4.4.43"
             },
             "funding": [
                 {
@@ -4659,7 +4656,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-05-14T12:35:33+00:00"
+            "time": "2022-06-23T12:22:25+00:00"
         },
         {
             "name": "symfony/finder",
@@ -4725,16 +4722,16 @@
         },
         {
             "name": "symfony/polyfill-ctype",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-ctype.git",
-                "reference": "30885182c981ab175d4d034db0f6f469898070ab"
+                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
-                "reference": "30885182c981ab175d4d034db0f6f469898070ab",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+                "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
                 "shasum": ""
             },
             "require": {
@@ -4749,7 +4746,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -4787,7 +4784,7 @@
                 "portable"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -4803,20 +4800,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-10-20T20:35:02+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/polyfill-php73",
-            "version": "v1.25.0",
+            "version": "v1.26.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-php73.git",
-                "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
+                "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
-                "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
+                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
+                "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
                 "shasum": ""
             },
             "require": {
@@ -4825,7 +4822,7 @@
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-main": "1.23-dev"
+                    "dev-main": "1.26-dev"
                 },
                 "thanks": {
                     "name": "symfony/polyfill",
@@ -4866,7 +4863,7 @@
                 "shim"
             ],
             "support": {
-                "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0"
+                "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
             },
             "funding": [
                 {
@@ -4882,7 +4879,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-06-05T21:20:04+00:00"
+            "time": "2022-05-24T11:49:31+00:00"
         },
         {
             "name": "symfony/var-dumper",
@@ -5088,5 +5085,5 @@
     "platform-overrides": {
         "php": "7.2.5"
     },
-    "plugin-api-version": "2.1.0"
-}
+    "plugin-api-version": "2.3.0"
+}

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

@@ -31,10 +31,10 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.0'
+HESTIA_INSTALL_VER='1.6.1'
 # Dependencies
 pma_v='5.2.0'
-rc_v="1.6.0"
+rc_v="1.5.3"
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
 fpm_v="8.0"
 mariadb_v="10.6"
@@ -1838,7 +1838,7 @@ if [ "$sieve" = 'yes' ]; then
         # Modify Roundcube config 
         mkdir -p $RC_CONFIG_DIR/plugins/managesieve
         cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_managesieve.inc.php $RC_CONFIG_DIR/plugins/managesieve/config.inc.php
-        ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php\
+        ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php
         chown -R root:www-data $RC_CONFIG_DIR/
         chmod 751 -R $RC_CONFIG_DIR
         chmod 644 $RC_CONFIG_DIR/*.php

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

@@ -31,10 +31,10 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.0'
+HESTIA_INSTALL_VER='1.6.1'
 # Dependencies
 pma_v='5.2.0'
-rc_v="1.5.2"
+rc_v="1.5.3"
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
 fpm_v="8.0"
 mariadb_v="10.6"
@@ -1902,7 +1902,7 @@ if [ "$sieve" = 'yes' ]; then
         # Modify Roundcube config 
         mkdir -p $RC_CONFIG_DIR/plugins/managesieve
         cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_managesieve.inc.php $RC_CONFIG_DIR/plugins/managesieve/config.inc.php
-        ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php\
+        ln -s $RC_CONFIG_DIR/plugins/managesieve/config.inc.php $RC_INSTALL_DIR/plugins/managesieve/config.inc.php
         chown -R root:www-data $RC_CONFIG_DIR/
         chmod 751 -R $RC_CONFIG_DIR
         chmod 644 $RC_CONFIG_DIR/*.php

+ 1 - 1
install/hst-install.sh

@@ -9,7 +9,7 @@
 # Currently Supported Operating Systems:
 #
 # Debian 9, 10, 11
-# Ubuntu 18.04, 20.04
+# Ubuntu 18.04, 20.04, 22.04
 #
 # ======================================================== #
 

+ 2 - 2
install/upgrade/upgrade.conf

@@ -40,7 +40,7 @@ pma_v='5.2.0'
 
 # Set version of RoundCube (Webmail) to update during upgrade if not already installed
 # Note: only applies to "non-apt installs >= 1.4.0 or manually phased out"
-rc_v='1.5.2'
+rc_v='1.5.3'
 
 # Set version of Rainloop (Webmail) to update during upgrade if not already installed
 rl_v='1.16.0'
@@ -53,7 +53,7 @@ UPGRADE_UPDATE_FILEMANAGER_CONFIG='false'
 fm_v='7.8.1'
 
 # Set version of PHPMailer to update during upgrade if not already installed
-pm_v='6.6.2'
+pm_v='6.6.3'
 
 # Backblaze
 b2_v='3.2.0'

+ 51 - 0
install/upgrade/versions/1.6.1.sh

@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 1.6.0
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+####### Pass through information to the end user in case of a issue or problem  #######
+#######                                                                         #######
+####### Use add_upgrade_message "My message here" to include a message          #######
+####### in the upgrade notification email. Example:                             #######
+#######                                                                         #######
+####### add_upgrade_message "My message here"                                   #######
+#######                                                                         #######
+####### You can use \n within the string to create new lines.                   #######
+#######################################################################################
+
+upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'no'
+upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'no'
+upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'no'
+upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no'
+upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
+
+# Fix exim rate limit send issue
+if [ "$MAIL_SYSTEM" = "exim4" ]; then 
+    acl=$(cat /etc/exim4/exim4.conf.template | grep '${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}')
+    if [ ! -z "$acl" ]; then
+        echo "[ * ] Fixed an issue with rate limits and alias mail addresses"
+        sed -i 's/${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}/${extract{1}{:}{${lookup{$authenticated_id}/' /etc/exim4/exim4.conf.template
+    fi
+    spamscore=$(cat /etc/exim4/exim4.conf.template | grep 'SPAM_REJECT_SCORE =')
+    if [ -z "$spamscore" ]; then
+        echo "[ * ] Fixed an issue reject spam not working properly."
+        sed -i '/SPAM_SCORE = .*/a SPAM_REJECT_SCORE = 100' /etc/exim4/exim4.conf.template
+        sed -i '/          set acl_m1    = yes/a    warn    condition     = ${if exists {/etc/exim4/domains/$domain/reject_spam}{yes}{no}}\n          set acl_m3    = yes' /etc/exim4/exim4.conf.template
+    fi
+    
+fi
+
+# With setup from installer
+if [ -f "/etc/apt/sources.list.d/hestia-beta.list" ]; then
+    echo "[ ! ] Change to stable release!"
+    rm /etc/apt/sources.list.d/hestia-beta.list
+    sed -i 's/#//g' /etc/apt/sources.list.d/hestia.list
+fi
+check=$(cat /etc/apt/sources.list.d/hestia.list | grep "beta.hestiacp.com");
+if [ ! -z "$check" ]; then 
+    echo "[ ! ] Change to stable release!"
+    sed -i '/beta.hestiacp.com/d' /etc/apt/sources.list.d/hestia.list
+    sed -i 's/#//g' /etc/apt/sources.list.d/hestia.list
+fi

+ 1 - 1
src/deb/hestia/control

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

+ 5 - 5
src/deb/hestia/postinst

@@ -51,14 +51,14 @@ fi
 upgrade_welcome_message_log >> $LOG
 upgrade_welcome_message
 
-# Perform upgrade health check and refresh configuration before upgrading
-upgrade_health_check | tee -a $LOG
-upgrade_replace_default_config
-upgrade_refresh_config
-
 # Back up existing configuration files and templates
 upgrade_start_backup | tee -a $LOG
 
+# Perform upgrade health check and refresh configuration before upgrading
+upgrade_health_check | tee -a $LOG
+upgrade_replace_default_config | tee -a $LOG
+upgrade_refresh_config | tee -a $LOG
+
 # Execute version-specific upgrade scripts
 upgrade_start_routine | tee -a $LOG
 

+ 1 - 1
src/deb/nginx/control

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

+ 7 - 0
src/deb/nginx/nginx.conf

@@ -133,6 +133,13 @@ http {
         location /fm/ {
             alias /usr/local/hestia/web/fm/dist/;
             index index.php;
+            location ~ /([^/]+\.php)$ {
+                try_files /$1 =404;
+                fastcgi_pass    unix:/var/run/hestia-php.sock;
+                fastcgi_index index.php;
+                include fastcgi_params;
+                fastcgi_param SCRIPT_FILENAME /usr/local/hestia/web/fm/dist/index.php;
+            }
         }
 
         location ~ \.php$ {

+ 0 - 22
test/ssl/crt

@@ -1,22 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDmjCCAoICCQCjpzusnGxWaDANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMC
-VVMxEjAQBgNVBAgMCUJlcmtzaGlyZTESMBAGA1UEBwwJV2VzdG5vcnRoMQ4wDAYD
-VQQKDAVWZXN0YTELMAkGA1UECwwCSVQxGTAXBgNVBAMMEGRlbW8udmVzdGFjcC5j
-b20xHzAdBgkqhkiG9w0BCQEWEGluZm9AdmVzdGFjcC5jb20wHhcNMTExMjE0MTky
-NDU4WhcNMTIxMjEzMTkyNDU4WjCBjjELMAkGA1UEBhMCVVMxEjAQBgNVBAgMCUJl
-cmtzaGlyZTESMBAGA1UEBwwJV2VzdG5vcnRoMQ4wDAYDVQQKDAVWZXN0YTELMAkG
-A1UECwwCSVQxGTAXBgNVBAMMEGRlbW8udmVzdGFjcC5jb20xHzAdBgkqhkiG9w0B
-CQEWEGluZm9AdmVzdGFjcC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
-AoIBAQC85/k6Ekfo1z9AfzOFNce0rgy897nlkdiEdr67H05lhFlUHY129vzgrrZC
-kANji9sR0tGwcRdc2aHoTlbQGZ4f567LbWrUY0kc4ku56/5v74akf2P4HRm5AhSF
-6RHJfisl558i/JuO9M+fwCp1r9oOicapcyMJzaSXIeDTudWalKzwCNISH3neA+jw
-uJPFvw+NKtQoYHQN1ag24rmK1IUhdX70HverwS+DJykqEIcTMuON4FZ0UHx8Xr6U
-3pQ9yhulHTQEU03vL353ONJ6SYxzZRnt6GdE+jN+AsSDo0P7mRPoUtvi6n1AeVS+
-iSalLfZN0CEVxuMnjvA1I4DtPNZNAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAIft
-cXO9VpxvdlItINllvy5jrOVYn/U8NKNO1TNcqeCQmg2PQHfx8WCK4q3RBVV5aAu4
-87h6aTMH1YnxZfMtpMSZZi2FVQgeZsXs86UJu0jYXU06DApyL3G28w2LDwO/m1cw
-8xtMpofALyzmS/YKuGv5ptWCR57mw5a/5fyscWdFc3xgmZZxm/gO1o9pLcotVkLg
-H8dHFcQlqQbp2ejmvJmBdCgkNtgjdrJSVYQGsL1Ja/53S82NQD5LgDBq81kcbvqF
-ikD0BTAwKY6sETo3xCRxfno3A9ZTw7byk/QRl++qK02WrMnDVbcj1xeZR866QIfZ
-plL7FfrMTcBCs1S0Hwc=
------END CERTIFICATE-----

+ 0 - 27
test/ssl/key

@@ -1,27 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-MIIEpAIBAAKCAQEAvOf5OhJH6Nc/QH8zhTXHtK4MvPe55ZHYhHa+ux9OZYRZVB2N
-dvb84K62QpADY4vbEdLRsHEXXNmh6E5W0BmeH+euy21q1GNJHOJLuev+b++GpH9j
-+B0ZuQIUhekRyX4rJeefIvybjvTPn8Aqda/aDonGqXMjCc2klyHg07nVmpSs8AjS
-Eh953gPo8LiTxb8PjSrUKGB0DdWoNuK5itSFIXV+9B73q8EvgycpKhCHEzLjjeBW
-dFB8fF6+lN6UPcobpR00BFNN7y9+dzjSekmMc2UZ7ehnRPozfgLEg6ND+5kT6FLb
-4up9QHlUvokmpS32TdAhFcbjJ47wNSOA7TzWTQIDAQABAoIBAHPgdB/sINIyXylo
-HalkAPnTHhs4dn7dBQzUblEIdiWNluIjMqi7/wiwAzs3bey9WIdJY7kw1hztnwSK
-MXR7kmSN0MoWd0aLFMk0AzGsEqqFKnlzb1Y+O44iOYafHnsT+tHIj/R9McryXv3m
-eeUxFrh+SS+eYerci07tyCT4RJAJ/3RjQvlpZbZEkS/EF4lgg+V87CNF2hYzVIS0
-obOXVMMl7TeAF56tJfFM2hjVS9lD7o7AmfpuMLirZ/HNscjx9MgUgPDTpCLQ+o5g
-bV5QC5VdJtHKaH9H11CmOyl6FQp006dOzVfhxdblNSq8d9VYrLv3IF+j8MfvTxw1
-nVUj8P0CgYEA3AggZ/EuAWBDdks3y9vTnJVoaHDjrO9j7ldqWU3UONYjYPupCWXG
-LPxfFnHwifQBW2Yp0GrGoRI1Nz8wvZ1Q9JvziaWDSWfbUP/VtEL1N8QDQDemfh+p
-vQ48rMJ0cWtRQWloTDWiRJ6S57+bUcIlXfBhieZ7fsnrL092cUS/f58CgYEA28lO
-GLQA5KdiS0cDTCrzDP2ZnfPhsHEv+M0hIbjiULKkwJZkOHfp2byRJYakoT9Dnjwo
-3N1gFqGyXeCunI2P2yxu7HsYdDUsrK16IjRDhrwm2Yi0qQdBVBdC8EtCOpgdMbPw
-j+bavowW4sdZ+Cdt1UiXJW2inkVTeMn7u/82spMCgYEA1QPNE7PrPQvL4/8IAoVM
-RYBjtxDraiXMUhcw70oo1emCEMcyq9Vq2WxuRhWCsJuYoLq0aoCk0ZUGDflQH5Ho
-qRc93Blvk6ZHLhCv/LcCHb3XA9mchufydQQOe5Y6Ev+5h6EbhwQ5l0MJp/DY1nsl
-n98zHsUS8/lZhdDhMuFCn7MCgYAvEkobmFGopwCyRp86LOipG5dO8PChLVys2KID
-6ujth5Upegw029nFvFEJzHBt6HK+7PuDchYmQrNEz94VwWvR8Q5Ar4xpNwo+YVkL
-Ak6ECL/5TwICQX+IVwMLG9MvYWy/PF6FM1gd/zrXjwKB10/6ofVdGsH9S7O45ul3
-Ng2s6QKBgQDYFKzhN8vDDGhmhDIz0uAPaMkMUvsjFHvsuurboAHgLnOstXhc/M0N
-t/AhI+TM+JewVoT6F4FGWOR6ykGn9F5N7e+rHfU+/6yloD4quDavV+4JWuJomRpC
-QE0k8Pmgm3s5xo3kyb7J9h4l3b8MF2rXTzcqyG8UQMrSRjVUJ07scg==
------END RSA PRIVATE KEY-----

+ 0 - 319
test/test_actions.sh

@@ -1,319 +0,0 @@
-#!/bin/bash
-
-# Define some variables
-source /etc/profile.d/hestia.sh
-V_BIN="$HESTIA/bin"
-V_TEST="$HESTIA/test"
-
-# Define functions
-random() {
-    head /dev/urandom | tr -dc 0-9 | head -c$1
-}
-
-echo_result() {
-    echo -en  "$1"
-    echo -en '\033[60G'
-    echo -n '['
-
-    if [ "$2" -ne 0 ]; then
-        echo -n 'FAILED'
-        echo -n ']'
-        echo -ne '\r\n'
-        echo ">>> $4"
-        echo ">>> RETURN VALUE $2"
-        cat $3
-    else
-        echo -n '  OK  '
-        echo -n ']'
-    fi
-    echo -ne '\r\n'
-}
-
-# Create random username
-user="testu-$(random 4)"
-while [ ! -z "$(grep "^$user:" /etc/passwd)" ]; do
-    user="tmp-$(random 4)"
-done
-
-# Create random tmpfile
-tmpfile=$(mktemp -p /tmp )
-echo $tmpfile
-
-#----------------------------------------------------------#
-#                         User                             #
-#----------------------------------------------------------#
-# Add user
-cmd="v-add-user $user $user $user@hestiacp.com default Super Test"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "USER: Adding new user $user" "$?" "$tmpfile" "$cmd"
-
-# Change user password
-cmd="v-change-user-password $user t3st-p4ssw0rd"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "USER: Changing password" "$?" "$tmpfile" "$cmd"
-
-# Change user contact
-cmd="v-change-user-contact $user tester@hestiacp.com"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "USER: Changing email" "$?" "$tmpfile" "$cmd"
-
-# Change system shell
-cmd="v-change-user-shell $user bash"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "USER: Changing system shell to /bin/bash" "$?" "$tmpfile" "$cmd"
-
-# Change name servers
-cmd="v-change-user-ns $user ns0.com ns1.com ns2.com ns3.com"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "USER: Changing nameservers" "$?" "$tmpfile" "$cmd"
-
-
-#----------------------------------------------------------#
-#                         Cron                             #
-#----------------------------------------------------------#
-
-# Add cron job
-cmd="v-add-cron-job $user 1 1 1 1 1 echo"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Adding cron job" "$?" "$tmpfile" "$cmd"
-
-# Suspend cron job
-cmd="v-suspend-cron-job $user 1"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Suspending cron job" "$?" "$tmpfile" "$cmd"
-
-# Unsuspend cron job
-cmd="v-unsuspend-cron-job $user 1"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Unsuspending cron job" "$?" "$tmpfile" "$cmd"
-
-# Delete cron job
-cmd="v-delete-cron-job $user 1"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Deleting cron job" "$?" "$tmpfile" "$cmd"
-
-# Add cron job
-cmd="v-add-cron-job $user 1 1 1 1 1 echo 1"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Adding cron job" "$?" "$tmpfile" "$cmd"
-
-# Add cron job
-cmd="v-add-cron-job $user 1 1 1 1 1 echo 1"
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "CRON: Duplicate cron job check" "$retval" "$tmpfile" "$cmd"
-
-# Add second cron job
-cmd="v-add-cron-job $user 2 2 2 2 2 echo 2"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Adding second cron job" "$?" "$tmpfile" "$cmd"
-
-# Rebuild cron jobs
-cmd="v-rebuild-cron-jobs $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "CRON: Rebuilding cron jobs" "$?" "$tmpfile" "$cmd"
-
-
-#----------------------------------------------------------#
-#                          IP                              #
-#----------------------------------------------------------#
-
-# List network interfaces
-cmd="v-list-sys-interfaces plain"
-interface=$($cmd 2> $tmpfile | head -n 1)
-if [ -z "$interface" ]; then
-    echo_result "IP: Listing network interfaces" "1" "$tmpfile" "$cmd"
-else
-    echo_result "IP: Listing network interfaces" "0" "$tmpfile" "$cmd"
-fi
-
-# Add ip address
-cmd="v-add-sys-ip 198.18.0.123 255.255.255.255 $interface $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "IP: Adding ip 198.18.0.123" "$?" "$tmpfile" "$cmd"
-
-# Add duplicate ip
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "IP: Duplicate ip address check" "$retval" "$tmpfile" "$cmd"
-
-# Delete ip address
-cmd="v-delete-sys-ip 198.18.0.123"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "IP: Deleting ip 198.18.0.123" "$?" "$tmpfile" "$cmd"
-
-# Add ip address
-cmd="v-add-sys-ip 198.18.0.125 255.255.255.255 $interface $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "IP: Adding ip 198.18.0.125" "$?" "$tmpfile" "$cmd"
-
-
-#----------------------------------------------------------#
-#                         WEB                              #
-#----------------------------------------------------------#
-
-# Add web domain
-domain="test-$(random 4).hestiacp.com"
-cmd="v-add-web-domain $user $domain 198.18.0.125"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Adding domain $domain on 198.18.0.125" "$?" "$tmpfile" "$cmd"
-
-# Add duplicate
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "WEB: Duplicate web domain check" "$retval" "$tmpfile" "$cmd"
-
-# Add web domain alias
-cmd="v-add-web-domain-alias $user $domain v3.$domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Adding alias v3.$domain" "$?" "$tmpfile" "$cmd"
-
-# Alias duplicate
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "WEB: Duplicate web alias check" "$retval" "$tmpfile" "$cmd"
-
-# Add web domain stats
-cmd="v-add-web-domain-stats $user $domain awstats"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Enabling awstats" "$?" "$tmpfile" "$cmd"
-
-# Add web domain stats 
-cmd="v-add-web-domain-stats-user $user $domain test m3g4p4ssw0rd"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Adding awstats uzer" "$?" "$tmpfile" "$cmd"
-
-# Suspend web domain
-cmd="v-suspend-web-domain $user $domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Suspending web domain" "$?" "$tmpfile" "$cmd"
-
-# Unsuspend web domain
-cmd="v-unsuspend-web-domain $user $domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Unsuspending web domain" "$?" "$tmpfile" "$cmd"
-
-# Add web domain ssl
-cp $HESTIA/ssl/certificate.crt /tmp/$domain.crt
-cp $HESTIA/ssl/certificate.key /tmp/$domain.key
-cmd="v-add-web-domain-ssl $user $domain /tmp"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: Adding ssl support" "$?" "$tmpfile" "$cmd"
-
-# Rebuild web domains
-cmd="v-rebuild-web-domains $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "WEB: rebuilding web domains" "$?" "$tmpfile" "$cmd"
-
-
-#----------------------------------------------------------#
-#                         DNS                              #
-#----------------------------------------------------------#
-
-# Add dns domain
-cmd="v-add-dns-domain $user $domain 198.18.0.125"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Adding dns domain $domain" "$?" "$tmpfile" "$cmd"
-
-# Add duplicate
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "DNS: Duplicate domain check" "$retval" "$tmpfile" "$cmd"
-
-# Add dns record
-cmd="v-add-dns-record $user $domain test A 198.18.0.125 20"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Adding dns record" "$?" "$tmpfile" "$cmd"
-
-# Add duplicate
-$cmd > $tmpfile 2>> $tmpfile
-if [ "$?" -eq 4 ]; then
-    retval=0
-else
-    retval=1
-fi
-echo_result "DNS: Duplicate record check" "$retval" "$tmpfile" "$cmd"
-
-# Delete dns record
-cmd="v-delete-dns-record $user $domain 20"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Deleteing dns record" "$?" "$tmpfile" "$cmd"
-
-# Change exp
-cmd="v-change-dns-domain-exp $user $domain 2020-01-01"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Changing expiriation date" "$?" "$tmpfile" "$cmd"
-
-# Change ip
-cmd="v-change-dns-domain-ip $user $domain 127.0.0.1"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Changing domain ip" "$?" "$tmpfile" "$cmd"
-
-# Suspend dns domain
-cmd="v-suspend-dns-domain $user $domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Suspending domain" "$?" "$tmpfile" "$cmd"
-
-# Unuspend dns domain
-cmd="v-unsuspend-dns-domain $user $domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Unsuspending domain" "$?" "$tmpfile" "$cmd"
-
-# Rebuild dns domain
-cmd="v-rebuild-dns-domains $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "DNS: Rebuilding domain" "$?" "$tmpfile" "$cmd"
-
-
-# Add mail domain
-cmd="v-add-mail-domain $user $domain"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "Adding mail domain $domain" "$?" "$tmpfile" "$cmd"
-
-# Add mysql database
-database=d$(random 4)
-cmd="v-add-database $user $database $database dbp4ssw0rd mysql"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "Adding mysql database $database" "$?" "$tmpfile" "$cmd"
-
-# Add pgsql database
-# database=d$(random 4)
-# cmd="v-add-database $user $database $database dbp4ssw0rd pgsql"
-# $cmd > $tmpfile 2>> $tmpfile
-# echo_result "Adding pgsql database $database" "$?" "$tmpfile" "$cmd"
-
-# Rebuild user configs
-cmd="v-rebuild-user $user yes"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "Rebuilding user config" "$?" "$tmpfile" "$cmd"
-
-# Delete user
-cmd="v-delete-user $user"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "Deleting user $user" "$?" "$tmpfile" "$cmd"
-
-# Delete ip address
-cmd="v-delete-sys-ip 198.18.0.125"
-$cmd > $tmpfile 2>> $tmpfile
-echo_result "Deleting ip 198.18.0.125" "$?" "$tmpfile" "$cmd"
-

+ 1 - 3
web/edit/web/index.php

@@ -118,9 +118,7 @@ $v_ftp_path = $data[$v_domain]['FTP_PATH'];
 if (!empty($v_ftp_user)) {
     $v_ftp_password = "";
 }
-
-
-if (isset($v_custom_doc_domain)) {
+if (isset($v_custom_doc_domain) && $v_custom_doc_domain != '') {
     $v_ftp_user_prepath = '/home/'.$user_plain.'/web/'.$v_custom_doc_domain;
 } else {
     $v_ftp_user_prepath = '/home/'.$user_plain.'/web/'.$v_domain;

+ 11 - 7
web/inc/composer.lock

@@ -8,16 +8,16 @@
     "packages": [
         {
             "name": "phpmailer/phpmailer",
-            "version": "v6.6.2",
+            "version": "v6.6.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/PHPMailer/PHPMailer.git",
-                "reference": "b52ed06864fdda81b82ec8bf564cf15d45ed4f95"
+                "reference": "9400f305a898f194caff5521f64e5dfa926626f3"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/b52ed06864fdda81b82ec8bf564cf15d45ed4f95",
-                "reference": "b52ed06864fdda81b82ec8bf564cf15d45ed4f95",
+                "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3",
+                "reference": "9400f305a898f194caff5521f64e5dfa926626f3",
                 "shasum": ""
             },
             "require": {
@@ -72,13 +72,17 @@
                 }
             ],
             "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
+            "support": {
+                "issues": "https://github.com/PHPMailer/PHPMailer/issues",
+                "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.3"
+            },
             "funding": [
                 {
                     "url": "https://github.com/Synchro",
                     "type": "github"
                 }
             ],
-            "time": "2022-06-14T09:27:21+00:00"
+            "time": "2022-06-20T09:21:02+00:00"
         }
     ],
     "packages-dev": [],
@@ -89,5 +93,5 @@
     "prefer-lowest": false,
     "platform": [],
     "platform-dev": [],
-    "plugin-api-version": "1.1.0"
-}
+    "plugin-api-version": "2.3.0"
+}

+ 1 - 1
web/login/index.php

@@ -132,7 +132,7 @@ function authenticate_user($user, $password, $twofa = '')
             if ($method == 'yescrypt') {
                 $v_password = tempnam("/tmp", "vst");
                 $fp = fopen($v_password, "w");
-                fwrite($fp, $_POST['password']."\n");
+                fwrite($fp, $password."\n");
                 fclose($fp);
                 exec(HESTIA_CMD . 'v-check-user-password '. $v_user.' '. $v_password. ' '.$v_ip.' yes', $output, $return_var);
                 $hash = $output[0];

+ 3 - 3
web/templates/includes/panel.html

@@ -125,7 +125,7 @@
 							<div class="l-stat__col-title"><?=_('WEB');?>&nbsp;&nbsp;<i class="fas fa-globe-americas"></i></div>
 							<ul>
 								<li><?=_('domains');?>: <span><?=$panel[$user]['U_WEB_DOMAINS']?> / <?=$panel[$user]['WEB_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_WEB']?>)</span></li>
-								<li><?=_('aliases');?>: <span><?=$panel[$user]['U_WEB_ALIASES']?> / <?=$panel[$user]['WEB_ALIASES']=='unlimited' ? "<b>∞</b>" : $panel[$user]['WEB_ALIASES'] * $panel[$user]['WEB_DOMAINS']?></span></li>
+								<li><?=_('aliases');?>: <span><?=$panel[$user]['U_WEB_ALIASES']?> / <?=$panel[$user]['WEB_ALIASES']=='unlimited' || $panel[$user]['WEB_DOMAINS']=='unlimited'  ? "<b>∞</b>" : $panel[$user]['WEB_ALIASES'] * $panel[$user]['WEB_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>
@@ -140,7 +140,7 @@
 							<div class="l-stat__col-title"><?=_('DNS');?>&nbsp;&nbsp;<i class="fas fa-atlas"></i></div>
 							<ul>
 								<li><?=_('zones');?>: <span><?=$panel[$user]['U_DNS_DOMAINS']?> / <?=$panel[$user]['DNS_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_DNS']?>)</span></li>
-								<li><?=_('records');?>: <span><?=$panel[$user]['U_DNS_RECORDS']?> / <?=$panel[$user]['DNS_RECORDS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_RECORDS'] * $panel[$user]['DNS_DOMAINS']?></span></li>
+								<li><?=_('records');?>: <span><?=$panel[$user]['U_DNS_RECORDS']?> / <?=$panel[$user]['DNS_RECORDS']=='unlimited' || $panel[$user]['DNS_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['DNS_RECORDS'] * $panel[$user]['DNS_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>
@@ -155,7 +155,7 @@
 							<div class="l-stat__col-title"><?=_('MAIL');?>&nbsp;&nbsp;<i class="fas fa-mail-bulk"></i></div>
 							<ul>
 								<li><?=_('domains');?>: <span><?=$panel[$user]['U_MAIL_DOMAINS']?> / <?=$panel[$user]['MAIL_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_DOMAINS']?> (<?=$panel[$user]['SUSPENDED_MAIL']?>)</span></li>
-								<li><?=_('accounts');?>: <span><?=$panel[$user]['U_MAIL_ACCOUNTS']?> / <?=$panel[$user]['MAIL_ACCOUNTS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_ACCOUNTS'] * $panel[$user]['MAIL_DOMAINS']?></span></li>
+								<li><?=_('accounts');?>: <span><?=$panel[$user]['U_MAIL_ACCOUNTS']?> / <?=$panel[$user]['MAIL_ACCOUNTS']=='unlimited' || $panel[$user]['MAIL_DOMAINS']=='unlimited' ? "<b>∞</b>" : $panel[$user]['MAIL_ACCOUNTS'] * $panel[$user]['MAIL_DOMAINS']?></span></li>
 							</ul>
 						</a>
 					</div>

+ 1 - 1
web/templates/pages/edit_dns_rec.html

@@ -72,7 +72,7 @@
 						<tr>
 							<td>
 								<select class="vst-list" name="v_type">
-									<option value="A" <?php if ($v_type == 'A') echo selected; ?>>A</option>
+									<option value="A" <?php if ($v_type == 'A') echo "selected"; ?>>A</option>
 									<option value="AAAA" <?php if ($v_type == 'AAAA') echo "selected"; ?>>AAAA</option>
 									<option value="CAA" <?php if ($v_type == 'CAA') echo "selected"; ?>>CAA</option>
 									<option value="CNAME" <?php if ($v_type == 'CNAME') echo "selected"; ?>>CNAME</option>

+ 1 - 1
web/templates/pages/edit_mail.html

@@ -91,7 +91,7 @@
 						</tr>
 						<tr>
 							<td>
-								<input type="text" size="20" class="vst-input" name="v_rate" value="<?=htmlentities(trim($v_rate, "'"))?>">
+								<input type="text" size="20" class="vst-input" name="v_rate" value="<?=htmlentities(trim($v_rate, "'"))?>" <?php if($_SESSION['userContext'] != "admin"){ echo "disabled";}?>>
 							</td>
 						</tr>
 						<?php if (!empty($_SESSION['ANTISPAM_SYSTEM'])) {?>