Просмотр исходного кода

Release 1.6.12 (#3124)

* Add gitignore 
* Fix #3051 Unable to change database user
* PHP 8.2 support (#2969)
* Delete rrd database on deleting database host
* [Bug] Firewall loading failed after reboot (#3110)
* Fixed firewall loading failed after reboot
* Apply update to hestia-iptables Systemd unit
* Check if antivirus / antispam is installed (#3099)
* Fixing the template for WordPress to avoid caching of WordPress REST API (#3069)
* Strip some extra dots from user input (#3048)
* Also restart / reload proxy (#3060)
* Delete only subfolders and files
* Add ip to v-add-web-domain admin hostname ip (#3068)
* Add alias for composer (#3070)
* Fix issue when enabling mysqld-iptables in Fail2Ban (#3025)
* Fix issue when enabling mysqld-iptables
* Added script to update current installations
* 2971 [Bug] Time zone change bug (#3031)
* Fix 2971 | Use server time zone names
* Update shell list
* Fix #1750  No www alias for domain.co.uk (#3030)
* Fix error  in v-add-user-2fa
* Update WordpressSetup.php (#2990)
* #1236  Improve restart behavoir v-add-domain.com (#3020)
* Fix restart issues
* Set v-add-mail-domain to no
* 2923 [Bug]  Unable to create tmp directory (#3019)
* Delete task when backup fails
* Improve error message+ add link to docs
* Add node_modules to the .gitignore
* Fix #3011 (#3046) Fix Unsuspend database user permissions
* Fix: v-add-domain fails with package limit if limits are reached
* Update phpmailer
* Update versions
Jaap Marcus 3 лет назад
Родитель
Сommit
75674fde94

+ 1 - 0
.gitignore

@@ -17,3 +17,4 @@ npm-debug.log
 .vs
 .nova
 /.idea/
+node_modules

+ 28 - 1
CHANGELOG.md

@@ -1,11 +1,38 @@
 # Changelog
 All notable changes to this project will be documented in this file.
 
+## [1.6.12] - Service release
+
+### Features 
+
+- Add support for PHP 8.2
+
+### Bugfixes
+
+- Fixed an issue with Europe/Kyiv not existing in Debian / Ubuntu causing issues with saving (#3031 #2971)
+- Fixed an issue with v-backup-user loop when the user is unable to create a temp folder or not enough space (#2923 #3019)
+- Fixed an issue with restarting with via api (#1236 #30230)
+- Fixed an issue with *.co.uk and similar domains that does not create a www alias (#1750 and #3030)
+- Fixed an issue with enabling mysqld-iptables (#3035 @Krzysiek86 @neto373)
+- Add an alias for composer in bash_aliases (#3070 @madito)
+- Fix issues with multiple ips and hostname in installers (#3068)
+- Fixed an issue with Nginx + Apache2 settup and clearing proxy cache (#3060)
+- Update Wordpress to avoid caching of Wordpress Rest API (#3069 @niktest)
+- Fixed an issue with firewall and IPset tables shorter then 10 records (#3110 @myrevery)
+- Delete rrd database on deleting database host
+- Fixed an issue where a user was unable to change database user #3051
+- Fixed an issue with unsuspend database user permissions (remote) #3011 #3046
+- Fixed an issue with v-add-domain and package doesn't allow mail / web or DNS domains
+
+### Dependencies
+
+- Update PHPmailer to 6.7.1
+
 ## [1.6.11] - Service release 
 
 ### Important
 
-A bug in v-update-sys-hestia caused auto update to be not working. Please run: ` apt update && apt upgrade `
+- A bug in v-update-sys-hestia caused auto update to be not working. Please run: ` apt update && apt upgrade `
 
 ### Security
 

+ 2 - 2
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.6.10 | [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.12 | [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>
@@ -22,7 +22,7 @@ Hestia Control Panel is designed to provide administrators an easy to use web an
 Features and Services
 ----------------------------
 * Apache2 and NGINX with PHP-FPM
-* Multiple PHP versions (5.6 - 8.1, 8.0 as default)
+* Multiple PHP versions (5.6 - 8.2, 8.0 as default)
 * DNS Server (Bind) with clustering capabilities
 * POP/IMAP/SMTP mail services with Anti-Virus, Anti-Spam, and Webmail (ClamAV, SpamAssassin, Sieve, Roundcube)
 * MariaDB and/or PostgreSQL databases

+ 20 - 7
bin/v-add-domain

@@ -14,7 +14,7 @@
 user=$1
 domain=$2
 ip=$3
-restart="${4-yes}"
+restart=$4
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -54,20 +54,33 @@ fi
 
 # Working on web domain
 if [ -n "$WEB_SYSTEM" ]; then
-    $BIN/v-add-web-domain "$user" "$domain" "$ip" 'no'
-    check_result $? "can't add web domain" >/dev/null
+	check1=$(is_package_full 'WEB_DOMAINS')
+	if [ $? -eq 0 ]; then
+		$BIN/v-add-web-domain "$user" "$domain" "$ip" 'no'
+		check_result $? "can't add web domain"
+	fi
 fi
 
 # Working on DNS domain
 if [ -n "$DNS_SYSTEM" ]; then
-    $BIN/v-add-dns-domain "$user" "$domain" "$ip" "" "" "" "" "" "" "" "" "no"
-    check_result $? "can't add dns domain" >/dev/null
+	check2=$(is_package_full 'DNS_DOMAINS')
+	if [ $? -eq 0 ]; then
+		$BIN/v-add-dns-domain "$user" "$domain" "$ip" "" "" "" "" "" "" "" "" "no"
+		check_result $? "can't add dns domain"
+	fi
 fi
 
 # Working on mail domain
 if [ -n "$MAIL_SYSTEM" ]; then
-    $BIN/v-add-mail-domain $user $domain
-    check_result $? "can't add mail domain" >/dev/null
+	check3=$(is_package_full 'MAIL_DOMAINS')
+	if [ $? -eq 0 ]; then
+		$BIN/v-add-mail-domain $user $domain 'no'
+		check_result $? "can't add mail domain"
+	fi
+fi
+
+if [[ "$check1" != '' && "$check2" != '' && "$check3" != '' ]]; then
+	check_result 8 "Package limit reached"
 fi
 
 # Restarting services

+ 38 - 34
bin/v-add-firewall-ipset

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add firewall ipset
-# options: NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [FORCE]
+# options: NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [REFRESH]
 #
 # example: v-add-firewall-ipset country-nl 'http://ipverse.net/ipblocks/data/countries/nl.zone'
 #
@@ -14,7 +14,7 @@ ip_name=${1}
 data_source=${2}
 ip_version=${3:-v4}
 autoupdate=${4:-yes}
-force=${5:-no}
+refresh=${5:-no}
 
 # Includes
 # shellcheck source=/etc/hestiacp/hestia.conf
@@ -30,8 +30,8 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 check_args '1' "$#" 'NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [FORCE]'
 is_format_valid 'ip_name'
-is_boolean_format_valid "$autoupdate" 'bool (yes/no)'
-is_boolean_format_valid "$force" 'bool (yes/no)'
+is_boolean_format_valid "$autoupdate" 'Automatically update IP list (yes/no)'
+is_boolean_format_valid "$refresh" 'Refresh IP list (yes/no)'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 # Perform verification if read-only mode is enabled
@@ -39,16 +39,20 @@ check_hestia_demo_mode
 
 # Define variables for ipset configuration
 ipset_hstobject='../../data/firewall/ipset'
-IPSET_BIN="$(which ipset)"
+IPSET_BIN="$(command -v ipset)"
 IPSET_PATH="$HESTIA/data/firewall/ipset"
 
 # Ensure ipset is installed
 if [ -z "$IPSET_BIN" ]; then
-    apt-get --quiet --yes install ipset > /dev/null
-    check_result $? "Installing ipset package"
-
-    IPSET_BIN="$(which ipset)"
-    check_result $? "ipset binary not found"
+	if [ -f '/etc/redhat-release' ]; then
+		dnf install -q -y ipset > /dev/null
+	else
+		apt-get --quiet --yes install ipset > /dev/null
+	fi
+	check_result $? "Installing IPset package"
+
+	IPSET_BIN="$(which ipset)"
+	check_result $? "IPset binary not found"
 fi
 
 # Ensure ipset configuration path and master file exist before attempting to parse
@@ -83,8 +87,8 @@ IPSET_MIN_SIZE=10
 #                       Action                             #
 #----------------------------------------------------------#
 
-# Generate ip lists file if missing or when forced
-if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
+# Generate ip lists file if missing or required refresh
+if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$refresh" = "yes" ]; then
 
     iplist_tempfile=$(mktemp)
 
@@ -103,10 +107,9 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
 
     elif [[ "$data_source" =~ ^script:/ ]]; then
 
-        # Generate the ip list file trough a external script
-        # ex: compiling a ip list from multiple sources on demand
-
-        if [ -x "${data_source#script:}" ]; then
+		# Generate the ip list file trough a external script
+		# ex: compiling a ip list from multiple sources on demand
+		if [ -x "${data_source#script:}" ]; then
 
             setpriv --clear-groups --reuid nobody --regid nogroup -- ${data_source#script:} "$ip_name" > "$iplist_tempfile"
             check_result $? "Running custom ip list update script"
@@ -115,10 +118,9 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
 
     elif [[ "$data_source" =~ ^file:/ ]]; then
 
-        # Use a external ip-list file managed by other apps
-        # ex: Using a ip list that is continously updated
-
-        [ -f "${data_source#file:}" ] && cp -f "${data_source#file:}" "$iplist_tempfile"
+		# Use a external ip-list file managed by other apps
+		# ex: Using a ip list that is continously updated
+		[ -f "${data_source#file:}" ] && cp -f "${data_source#file:}" "$iplist_tempfile"
 
     fi
 
@@ -130,10 +132,10 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
         sed -i -r -n -e '/^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}/p' "$iplist_tempfile"
     fi
 
-    # Validate iplist file size
-    iplist_size=$(sed -r -e '/^#|^$/d' "$iplist_tempfile" | wc -l)
-    [[ "$iplist_size" -le "$IPSET_MIN_SIZE" ]] && check_result "$E_INVALID" "iplist file too small (<${IPSET_MIN_SIZE}), ignoring"
-    mv -f "$iplist_tempfile" "${IPSET_PATH}/${IPSET_FILE}.iplist"
+	# Validate iplist file size
+	iplist_size=$(sed -r -e '/^#|^$/d' "$iplist_tempfile" | wc -l)
+	[[ "$iplist_size" -le "$IPSET_MIN_SIZE" ]] && check_result "$E_INVALID" "IP list file too small (<${IPSET_MIN_SIZE}), ignoring"
+	mv -f "$iplist_tempfile" "${IPSET_PATH}/${IPSET_FILE}.iplist"
 
 fi
 
@@ -160,17 +162,19 @@ date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 if [ ! -f "${IPSET_PATH}.conf" ] || [ -z "$(get_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$LISTNAME')" ]; then
 
-    # Concatenating rule
-    str="LISTNAME='$ip_name' IP_VERSION='$ip_version' SOURCE='$data_source'"
-    str="$str AUTOUPDATE='$autoupdate' SUSPENDED='no'"
-    str="$str TIME='$time' DATE='$date'"
-    echo "$str" >> $HESTIA/data/firewall/ipset.conf
+	# Concatenating rule
+	str="LISTNAME='$ip_name' IP_VERSION='$ip_version' SOURCE='$data_source'"
+	str="$str AUTOUPDATE='$autoupdate' SUSPENDED='no'"
+	str="$str TIME='$time' DATE='$date'"
+	echo "$str" >> $HESTIA/data/firewall/ipset.conf
+	log_type="added"
 
-elif [ "$force" = "yes" ]; then
+elif [ "$refresh" = "yes" ]; then
 
-    # update iplist last regen time
-    update_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$TIME' "$time"
-    update_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$DATE' "$date"
+	# Update iplist last regen time
+	update_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$TIME' "$time"
+	update_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$DATE' "$date"
+	log_type="refreshed"
 
 fi
 
@@ -189,7 +193,7 @@ fi
 #----------------------------------------------------------#
 
 # Logging
-$BIN/v-log-action "system" "Info" "Firewall" "Added new IP list (Name: $ip_name, IP version: $ip_version, Autoupdate: $autoupdate)."
+$BIN/v-log-action "system" "Info" "Firewall" "IPset IP list ${log_type:-loaded} (Name: $ip_name, IP version: $ip_version, Autoupdate: $autoupdate)."
 log_event "$OK" "$ARGUMENTS"
 
 exit

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

@@ -17,7 +17,7 @@ antispam=${3-yes}
 antivirus=${4-yes}
 dkim=${5-yes}
 dkim_size=${6-1024}
-restart=${7-yes}
+restart="$7"
 reject=${8-no}
 
 # Includes
@@ -65,7 +65,7 @@ else
     is_domain_new 'mail' "$domain"
 fi
 if [ -z "$(is_ip_format_valid $domain)" ]; then
-    echo "Error: Invalid domain format. IP address detected as input." 
+    echo "Error: Invalid domain format. IP address detected as input."
     exit 1
 fi
 
@@ -93,6 +93,14 @@ fi
 # Generating timestamp
 new_timestamp
 
+if [ -z "$ANTISPAM_SYSTEM" ]; then
+	antispam="no"
+	reject="no"
+fi
+if [ -z "$ANTIVIRUS_SYSTEM" ]; then
+	antivirus="no"
+fi
+
 # Adding domain to mail.conf
 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'"
@@ -128,8 +136,8 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     if [ -n "$local_ip" ]; then
         echo "$local_ip" > $HOMEDIR/$user/conf/mail/$domain/ip
     fi
-    
-    if [ -n "$ANTISPAM_SYSTEM" ]; then 
+
+    if [ -n "$ANTISPAM_SYSTEM" ]; then
         # Adding antispam protection
         if [ "$antispam" = 'yes' ]; then
             touch "$HOMEDIR/$user/conf/mail/$domain/antispam"
@@ -138,7 +146,7 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
             touch "$HOMEDIR/$user/conf/mail/$domain/reject_spam"
         fi
     fi
-    
+
     if [ -n "$ANTIVIRUS_SYSTEM" ]; then
         # Adding antivirus protection
         if [ "$antivirus" = 'yes' ]; then
@@ -188,7 +196,7 @@ if [ -n "$WEB_SYSTEM" ] || [ -n "$PROXY_SYSTEM" ]; then
         $BIN/v-add-mail-domain-webmail "$user" "$domain" '' 'no'
     fi
 fi
-    
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 1 - 0
bin/v-add-user-composer

@@ -62,6 +62,7 @@ mkdir -p "$COMPOSER_DIR"
 chown $user: "$COMPOSER_DIR"
 mkdir -p "$HOMEDIR/$user/.config"
 chown $user: "$HOMEDIR/$user/.config"
+echo "alias composer=/home/"$user"/.composer/composer" >> /home/$user/.bash_aliases
 
 COMPOSER_SETUP_FILE=$(mktemp)
 check_result $? "Create temp file"

+ 14 - 9
bin/v-add-web-domain

@@ -53,11 +53,11 @@ check_args '2' "$#" 'USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]'
 is_format_valid 'user' 'domain' 'aliases' 'ip' 'proxy_ext'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
-is_package_full 'WEB_DOMAINS' 
+is_package_full 'WEB_DOMAINS'
 
-if [ "$aliases" != "none" ]; then 
+if [ "$aliases" != "none" ]; then
     ALIAS="$aliases"
-    is_package_full 'WEB_ALIASES' 
+    is_package_full 'WEB_ALIASES'
 fi
 
 if [ "$($BIN/v-list-web-domain $user $domain_utf plain |cut -f 1) " != "$domain" ]; then
@@ -69,7 +69,7 @@ else
     is_domain_new 'web' "$domain,$aliases"
 fi
 if [ -z "$(is_ip_format_valid $domain)" ]; then
-    echo "Error: Invalid domain format. IP address detected as input." 
+    echo "Error: Invalid domain format. IP address detected as input."
     exit 1
 fi
 
@@ -153,7 +153,12 @@ else
         # Check and skip www alias for subdomains.
         IFS='.' read -r -a domain_elements <<< "$domain"
         if [ "${#domain_elements[@]}" -gt 2 ]; then
-            ALIAS=""
+            is_valid_2_part_extension $domain
+            if [ $? -ne 0 ]; then
+                ALIAS=""
+            else
+                ALIAS="www.$domain"
+            fi
         else
             ALIAS="www.$domain"
         fi
@@ -170,7 +175,7 @@ fi
 # Preparing domain variables
 prepare_web_domain_values
 
-if [ -z "$WEB_TEMPLATE" ]; then 
+if [ -z "$WEB_TEMPLATE" ]; then
     WEB_TEMPLATE='default'
     update_user_value "$user" '$WEB_TEMPLATE' "default"
 fi
@@ -186,12 +191,12 @@ if [ -n "$PROXY_SYSTEM" ]; then
         PROXY_EXT="$PROXY_EXT,exe,pdf,ppt,txt,odt,ods,odp,odf,tar,wav,bmp"
         PROXY_EXT="$PROXY_EXT,rtf,js,mp3,avi,mpeg,flv,html,htm"
     fi
-    if [ -z "$PROXY_TEMPLATE" ]; then 
+    if [ -z "$PROXY_TEMPLATE" ]; then
         PROXY_TEMPLATE='default'
         update_user_value "$user" '$PROXY_TEMPLATE' "default"
     fi
-    
-    add_web_config "$PROXY_SYSTEM" "$PROXY_TEMPLATE.tpl" 
+
+    add_web_config "$PROXY_SYSTEM" "$PROXY_TEMPLATE.tpl"
 fi
 
 #----------------------------------------------------------#

+ 24 - 19
bin/v-backup-user

@@ -160,7 +160,7 @@ if [ -z "$BACKUP" ]; then
 fi
 
 # Check if backup folder exists and have the correct permission
-if [[ ! -d "$BACKUP" ]]; then 
+if [[ ! -d "$BACKUP" ]]; then
     mkdir -p $BACKUP
 fi
 if [ "$(stat -c %a "$BACKUP")" != 755 ]; then
@@ -179,9 +179,12 @@ let u_disk=$(($(get_user_disk_usage) * 2))
 let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
 
 if [ "$u_disk" -gt "$v_disk" ]; then
+    let u_disk_original=$(get_user_disk_usage)
     # Always notify on failure
-    echo "not enough diskspace available to perform the backup." | $SENDMAIL -s "$subj" "$email" "yes"
-    check_result "$E_LIMIT" "not enough diskspace available to perform the backup."
+    echo "Not enough disk space available ($v_disk mb) to perform the backup  of $user. ( $u_disk_original mb * 2 = $u_disk mb). https://hestiacp.com/docs/server-administration/backup-restore.html" | $SENDMAIL -s "$subj" "$email" "yes"
+    # Deleting task from queue
+    sed -i "/v-backup-user $user /d" $HESTIA/data/queue/backup.pipe
+    check_result "$E_LIMIT" "not enough disk space available ($v_disk mb) to perform the backup  of $user. ( $u_disk_original mb * 2 = $u_disk mb)."
 fi
 
 if [ -z "$BACKUP_TEMP" ]; then
@@ -193,6 +196,8 @@ tmpdir=$(mktemp -p $BACKUP_TEMP -d)
 
 if [ "$?" -ne 0 ]; then
     echo "Can't create tmp dir $tmpdir" |$SENDMAIL -s "$subj" "$email" "yes"
+    # Deleting task from queue
+    sed -i "/v-backup-user $user /d" $HESTIA/data/queue/backup.pipe
     check_result "$E_NOTEXIST" "can't create tmp dir"
 fi
 
@@ -331,24 +336,24 @@ if [ -n "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
 
         domain_conf=$(grep "DOMAIN='$domain'" $conf)
         parse_object_kv_list_non_eval domain_conf
-        
+
         mkdir -p template/$WEB_SYSTEM/
         mkdir template/php-fpm/
-        
-        if [ $WEB_BACKEND == 'php-fpm' ]; then 
+
+        if [ $WEB_BACKEND == 'php-fpm' ]; then
             cp $HESTIA/data/templates/web/$WEB_SYSTEM/php-fpm/$TPL.tpl template/$WEB_SYSTEM/
             cp $HESTIA/data/templates/web/$WEB_SYSTEM/php-fpm/$TPL.stpl template/$WEB_SYSTEM/
             cp $HESTIA/data/templates/web/php-fpm/$BACKEND.tpl template/php-fpm/
         else
             cp $HESTIA/data/templates/web/$WEB_SYSTEM/$TPL.tpl template/$WEB_SYSTEM/
-            cp $HESTIA/data/templates/web/$WEB_SYSTEM/$TPL.stpl template/$WEB_SYSTEM/   
+            cp $HESTIA/data/templates/web/$WEB_SYSTEM/$TPL.stpl template/$WEB_SYSTEM/
         fi
         if [ -n "$PROXY_SYSTEM" ] && [ -n "$PROXY" ]; then
             mkdir  template/$PROXY_SYSTEM
             cp $HESTIA/data/templates/web/$PROXY_SYSTEM/$PROXY.tpl template/$PROXY_SYSTEM/
-            cp $HESTIA/data/templates/web/$PROXY_SYSTEM/$PROXY.stpl template/$PROXY_SYSTEM/      
+            cp $HESTIA/data/templates/web/$PROXY_SYSTEM/$PROXY.stpl template/$PROXY_SYSTEM/
         fi
-    
+
         # Backup ssl certificates
         if [ "$SSL" = 'yes' ] ; then
             cp $HOMEDIR/$user/conf/web/$domain/ssl/$domain.* conf/
@@ -382,7 +387,7 @@ if [ -n "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then
         # Backup files
         if [ "$BACKUP_MODE" = 'zstd' ]; then
             tar "${fargs[@]}" -cpf- * | pzstd -"$BACKUP_GZIP" - > $tmpdir/web/$domain/domain_data.tar.zst
-        else    
+        else
             tar "${fargs[@]}" -cpf- * | gzip -"$BACKUP_GZIP" - > $tmpdir/web/$domain/domain_data.tar.gz
         fi
     done
@@ -501,9 +506,9 @@ if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL" != '*' ]; then
         if [ ${#accounts[@]} -gt 0 ]; then
             if [ "$BACKUP_MODE" = 'zstd' ]; then
                 tar -cpf- "${accounts[@]}"  | pzstd -"$BACKUP_GZIP" - > $tmpdir/mail/$domain/accounts.tar.zst
-            else    
+            else
                 tar -cpf- "${accounts[@]}" | gzip -"$BACKUP_GZIP" - > $tmpdir/mail/$domain/accounts.tar.gz
-            fi        
+            fi
         fi
     done
 
@@ -551,7 +556,7 @@ if [ -n "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
         if [ "$BACKUP_MODE" = 'zstd' ]; then
                     dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.zst"
         else
-            dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"        
+            dumpgz="$tmpdir/db/$database/$database.$TYPE.sql.gz"
         fi
 
         grants="$tmpdir/db/$database/conf/$database.$TYPE.$DBUSER"
@@ -582,9 +587,9 @@ if [ -n "$DB_SYSTEM" ] && [ "$DB" != '*' ]; then
             if [ "$BACKUP_MODE" = 'zstd' ]; then
                 pzstd -$BACKUP_GZIP $dump
                 rm $dump;
-            else    
+            else
                 gzip -$BACKUP_GZIP $dump
-            fi                     
+            fi
         fi
     done
 
@@ -662,10 +667,10 @@ if [ "$USER" != '*' ]; then
             # Backup files and dirs
             if [ "$BACKUP_MODE" = 'zstd' ]; then
                 tar --anchored -cpf- "${fargs[@]}" $udir | pzstd -"$BACKUP_GZIP" - > $tmpdir/user_dir/$udir.tar.zst
-            else    
+            else
                 tar --anchored -cpf- "${fargs[@]}" $udir | gzip -"$BACKUP_GZIP" - > $tmpdir/user_dir/$udir.tar.gz
-            fi 
-            
+            fi
+
         fi
     done
     set +f
@@ -712,7 +717,7 @@ done
 # Removing tmpdir
 rm -rf $tmpdir
 if [[ "$errorcode" != "0" ]]; then
-    if [[ "$BACKUP_SYSTEM"  =~ "local" ]]; then 
+    if [[ "$BACKUP_SYSTEM"  =~ "local" ]]; then
         echo -e "$(date "+%F %T") *** Local backup was successfully executed. Remote backup failed ***" |\
         tee -a $BACKUP/$user.log
         BACKUP_SYSTEM="local"

+ 3 - 0
bin/v-delete-database-host

@@ -45,6 +45,9 @@ check_hestia_demo_mode
 
 # Deleting server
 sed -i "/HOST='$host' /d" "$HESTIA/conf/$type.conf"
+# Delete RRD database
+rm -fr $HESTIA'/web/rrd/db/'$type'_'$host'.rrd'
+rm -fr $HESTIA'/web/rrd/db/'*-$type'_'$host'.*'
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 22 - 18
bin/v-delete-firewall-ipset

@@ -24,42 +24,46 @@ source_conf "$HESTIA/conf/hestia.conf"
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-ipset_hstobject='../../data/firewall/ipset'
-
 check_args '1' "$#" 'NAME'
 is_format_valid 'ip_name'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
-is_object_valid "$ipset_hstobject" 'LISTNAME' "$ip_name"
 
+# Define variables for ipset configuration
+ipset_hstobject='../../data/firewall/ipset'
+is_object_valid "$ipset_hstobject" 'LISTNAME' "$ip_name"
 ip_version="$(get_object_value "$ipset_hstobject" 'LISTNAME' "$ip_name" '$IP_VERSION')"
 
-IPSET_BIN="$(which ipset)"
-IPSET_PATH="$HESTIA/data/firewall/ipset"
-IPSET_FILE="${ip_name}.${ip_version}"
-
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
+IPSET_BIN="$(command -v ipset)"
+IPSET_PATH="$HESTIA/data/firewall/ipset"
+IPSET_FILE="${ip_name}.${ip_version}"
+
 # Install ipset package if missing
 if [ -z "$IPSET_BIN" ]; then
-    apt-get --quiet --yes install ipset > /dev/null
-    check_result $? "Installing ipset package"
-
-    IPSET_BIN="$(which ipset)"
-    check_result $? "ipset binary not found"
+	if [ -f '/etc/redhat-release' ]; then
+		dnf install -q -y ipset > /dev/null
+	else
+		apt-get --quiet --yes install ipset > /dev/null
+	fi
+	check_result $? "Installing IPset package"
+
+	IPSET_BIN="$(which ipset)"
+	check_result $? "IPset binary not found"
 fi
 
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-if $IPSET_BIN --quiet list "${ip_name}-tmp" >/dev/null; then
-    $IPSET_BIN --quiet destroy "${ip_name}-tmp"
+if $IPSET_BIN -quiet list "${ip_name}-tmp" > /dev/null; then
+	$IPSET_BIN -quiet destroy "${ip_name}-tmp"
 fi
 
-if $IPSET_BIN --quiet list "${ip_name}" >/dev/null; then
-    $IPSET_BIN --quiet destroy "${ip_name}"
-    check_result $? "ipset ${ip_name} still used by iptables. Cannot remove"
+if $IPSET_BIN -quiet list "${ip_name}" > /dev/null; then
+	$IPSET_BIN -quiet destroy "${ip_name}"
+	check_result $? "ipset ${ip_name} still used by iptables. Cannot remove"
 fi
 
 sed -i "/LISTNAME='$ip_name'/d" "${IPSET_PATH}.conf"
@@ -70,7 +74,7 @@ rm -f "${IPSET_PATH}/${IPSET_FILE}.iplist"
 #----------------------------------------------------------#
 
 # Logging
-$BIN/v-log-action "system" "Info" "Firewall" "Deleted IP list (Name: $ip_name)."
+$BIN/v-log-action "system" "Info" "Firewall" "IPset IP list deleted (Name: $ip_name)."
 log_event "$OK" "$ARGUMENTS"
 
 exit

+ 23 - 439
bin/v-get-sys-timezones

@@ -25,457 +25,41 @@ source_conf "$HESTIA/conf/hestia.conf"
 #                       Action                             #
 #----------------------------------------------------------#
 
-Zones="Africa/Abidjan
-Africa/Accra
-Africa/Addis_Ababa
-Africa/Algiers
-Africa/Asmara
-Africa/Bamako
-Africa/Bangui
-Africa/Banjul
-Africa/Bissau
-Africa/Blantyre
-Africa/Brazzaville
-Africa/Bujumbura
-Africa/Cairo
-Africa/Casablanca
-Africa/Ceuta
-Africa/Conakry
-Africa/Dakar
-Africa/Dar_es_Salaam
-Africa/Djibouti
-Africa/Douala
-Africa/El_Aaiun
-Africa/Freetown
-Africa/Gaborone
-Africa/Harare
-Africa/Johannesburg
-Africa/Juba
-Africa/Kampala
-Africa/Khartoum
-Africa/Kigali
-Africa/Kinshasa
-Africa/Lagos
-Africa/Libreville
-Africa/Lome
-Africa/Luanda
-Africa/Lubumbashi
-Africa/Lusaka
-Africa/Malabo
-Africa/Maputo
-Africa/Maseru
-Africa/Mbabane
-Africa/Mogadishu
-Africa/Monrovia
-Africa/Nairobi
-Africa/Ndjamena
-Africa/Niamey
-Africa/Nouakchott
-Africa/Ouagadougou
-Africa/Porto-Novo
-Africa/Sao_Tome
-Africa/Tripoli
-Africa/Tunis
-Africa/Windhoek
-America/Adak
-America/Anchorage
-America/Anguilla
-America/Antigua
-America/Araguaina
-America/Argentina/Buenos_Aires
-America/Argentina/Catamarca
-America/Argentina/Cordoba
-America/Argentina/Jujuy
-America/Argentina/La_Rioja
-America/Argentina/Mendoza
-America/Argentina/Rio_Gallegos
-America/Argentina/Salta
-America/Argentina/San_Juan
-America/Argentina/San_Luis
-America/Argentina/Tucuman
-America/Argentina/Ushuaia
-America/Aruba
-America/Asuncion
-America/Atikokan
-America/Bahia
-America/Bahia_Banderas
-America/Barbados
-America/Belem
-America/Belize
-America/Blanc-Sablon
-America/Boa_Vista
-America/Bogota
-America/Boise
-America/Cambridge_Bay
-America/Campo_Grande
-America/Cancun
-America/Caracas
-America/Cayenne
-America/Cayman
-America/Chicago
-America/Chihuahua
-America/Costa_Rica
-America/Creston
-America/Cuiaba
-America/Curacao
-America/Danmarkshavn
-America/Dawson
-America/Dawson_Creek
-America/Denver
-America/Detroit
-America/Dominica
-America/Edmonton
-America/Eirunepe
-America/El_Salvador
-America/Fortaleza
-America/Glace_Bay
-America/Godthab
-America/Goose_Bay
-America/Grand_Turk
-America/Grenada
-America/Guadeloupe
-America/Guatemala
-America/Guayaquil
-America/Guyana
-America/Halifax
-America/Havana
-America/Hermosillo
-America/Indiana/Indianapolis
-America/Indiana/Knox
-America/Indiana/Marengo
-America/Indiana/Petersburg
-America/Indiana/Tell_City
-America/Indiana/Vevay
-America/Indiana/Vincennes
-America/Indiana/Winamac
-America/Inuvik
-America/Iqaluit
-America/Jamaica
-America/Juneau
-America/Kentucky/Louisville
-America/Kentucky/Monticello
-America/Kralendijk
-America/La_Paz
-America/Lima
-America/Los_Angeles
-America/Lower_Princes
-America/Maceio
-America/Managua
-America/Manaus
-America/Marigot
-America/Martinique
-America/Matamoros
-America/Mazatlan
-America/Menominee
-America/Merida
-America/Metlakatla
-America/Mexico_City
-America/Miquelon
-America/Moncton
-America/Monterrey
-America/Montevideo
-America/Montserrat
-America/Nassau
-America/New_York
-America/Nipigon
-America/Nome
-America/Noronha
-America/North_Dakota/Beulah
-America/North_Dakota/Center
-America/North_Dakota/New_Salem
-America/Ojinaga
-America/Panama
-America/Pangnirtung
-America/Paramaribo
-America/Phoenix
-America/Port-au-Prince
-America/Port_of_Spain
-America/Porto_Velho
-America/Puerto_Rico
-America/Rainy_River
-America/Rankin_Inlet
-America/Recife
-America/Regina
-America/Resolute
-America/Rio_Branco
-America/Santa_Isabel
-America/Santarem
-America/Santiago
-America/Santo_Domingo
-America/Sao_Paulo
-America/Scoresbysund
-America/Sitka
-America/St_Barthelemy
-America/St_Johns
-America/St_Kitts
-America/St_Lucia
-America/St_Thomas
-America/St_Vincent
-America/Swift_Current
-America/Tegucigalpa
-America/Thule
-America/Thunder_Bay
-America/Tijuana
-America/Toronto
-America/Tortola
-America/Vancouver
-America/Whitehorse
-America/Winnipeg
-America/Yakutat
-America/Yellowknife
-Antarctica/Casey
-Antarctica/Davis
-Antarctica/DumontDUrville
-Antarctica/Macquarie
-Antarctica/Mawson
-Antarctica/McMurdo
-Antarctica/Palmer
-Antarctica/Rothera
-Antarctica/Syowa
-Antarctica/Troll
-Antarctica/Vostok
-Arctic/Longyearbyen
-Asia/Aden
-Asia/Almaty
-Asia/Amman
-Asia/Anadyr
-Asia/Aqtau
-Asia/Aqtobe
-Asia/Ashgabat
-Asia/Baghdad
-Asia/Bahrain
-Asia/Baku
-Asia/Bangkok
-Asia/Beirut
-Asia/Bishkek
-Asia/Brunei
-Asia/Chita
-Asia/Choibalsan
-Asia/Colombo
-Asia/Damascus
-Asia/Dhaka
-Asia/Dili
-Asia/Dubai
-Asia/Dushanbe
-Asia/Gaza
-Asia/Hebron
-Asia/Ho_Chi_Minh
-Asia/Hong_Kong
-Asia/Hovd
-Asia/Irkutsk
-Asia/Jakarta
-Asia/Jayapura
-Asia/Jerusalem
-Asia/Kabul
-Asia/Kamchatka
-Asia/Karachi
-Asia/Kathmandu
-Asia/Khandyga
-Asia/Kolkata
-Asia/Krasnoyarsk
-Asia/Kuala_Lumpur
-Asia/Kuching
-Asia/Kuwait
-Asia/Macau
-Asia/Magadan
-Asia/Makassar
-Asia/Manila
-Asia/Muscat
-Asia/Nicosia
-Asia/Novokuznetsk
-Asia/Novosibirsk
-Asia/Omsk
-Asia/Oral
-Asia/Phnom_Penh
-Asia/Pontianak
-Asia/Pyongyang
-Asia/Qatar
-Asia/Qyzylorda
-Asia/Rangoon
-Asia/Riyadh
-Asia/Sakhalin
-Asia/Samarkand
-Asia/Seoul
-Asia/Shanghai
-Asia/Singapore
-Asia/Srednekolymsk
-Asia/Taipei
-Asia/Tashkent
-Asia/Tbilisi
-Asia/Tehran
-Asia/Thimphu
-Asia/Tokyo
-Asia/Ulaanbaatar
-Asia/Urumqi
-Asia/Ust-Nera
-Asia/Vientiane
-Asia/Vladivostok
-Asia/Yakutsk
-Asia/Yekaterinburg
-Asia/Yerevan
-Atlantic/Azores
-Atlantic/Bermuda
-Atlantic/Canary
-Atlantic/Cape_Verde
-Atlantic/Faroe
-Atlantic/Madeira
-Atlantic/Reykjavik
-Atlantic/South_Georgia
-Atlantic/St_Helena
-Atlantic/Stanley
-Australia/Adelaide
-Australia/Brisbane
-Australia/Broken_Hill
-Australia/Currie
-Australia/Darwin
-Australia/Eucla
-Australia/Hobart
-Australia/Lindeman
-Australia/Lord_Howe
-Australia/Melbourne
-Australia/Perth
-Australia/Sydney
-Europe/Amsterdam
-Europe/Andorra
-Europe/Athens
-Europe/Belgrade
-Europe/Berlin
-Europe/Bratislava
-Europe/Brussels
-Europe/Bucharest
-Europe/Budapest
-Europe/Busingen
-Europe/Chisinau
-Europe/Copenhagen
-Europe/Dublin
-Europe/Gibraltar
-Europe/Guernsey
-Europe/Helsinki
-Europe/Isle_of_Man
-Europe/Istanbul
-Europe/Jersey
-Europe/Kaliningrad
-Europe/Kiev
-Europe/Lisbon
-Europe/Ljubljana
-Europe/London
-Europe/Luxembourg
-Europe/Madrid
-Europe/Malta
-Europe/Mariehamn
-Europe/Minsk
-Europe/Monaco
-Europe/Moscow
-Europe/Oslo
-Europe/Paris
-Europe/Podgorica
-Europe/Prague
-Europe/Riga
-Europe/Rome
-Europe/Samara
-Europe/San_Marino
-Europe/Sarajevo
-Europe/Simferopol
-Europe/Skopje
-Europe/Sofia
-Europe/Stockholm
-Europe/Tallinn
-Europe/Tirane
-Europe/Uzhgorod
-Europe/Vaduz
-Europe/Vatican
-Europe/Vienna
-Europe/Vilnius
-Europe/Volgograd
-Europe/Warsaw
-Europe/Zagreb
-Europe/Zaporozhye
-Europe/Zurich
-Indian/Antananarivo
-Indian/Chagos
-Indian/Christmas
-Indian/Cocos
-Indian/Comoro
-Indian/Kerguelen
-Indian/Mahe
-Indian/Maldives
-Indian/Mauritius
-Indian/Mayotte
-Indian/Reunion
-Pacific/Apia
-Pacific/Auckland
-Pacific/Bougainville
-Pacific/Chatham
-Pacific/Chuuk
-Pacific/Easter
-Pacific/Efate
-Pacific/Enderbury
-Pacific/Fakaofo
-Pacific/Fiji
-Pacific/Funafuti
-Pacific/Galapagos
-Pacific/Gambier
-Pacific/Guadalcanal
-Pacific/Guam
-Pacific/Honolulu
-Pacific/Johnston
-Pacific/Kiritimati
-Pacific/Kosrae
-Pacific/Kwajalein
-Pacific/Majuro
-Pacific/Marquesas
-Pacific/Midway
-Pacific/Nauru
-Pacific/Niue
-Pacific/Norfolk
-Pacific/Noumea
-Pacific/Pago_Pago
-Pacific/Palau
-Pacific/Pitcairn
-Pacific/Pohnpei
-Pacific/Port_Moresby
-Pacific/Rarotonga
-Pacific/Saipan
-Pacific/Tahiti
-Pacific/Tarawa
-Pacific/Tongatapu
-Pacific/Wake
-Pacific/Wallis"
+json_list() {
+  jq -ncR '[inputs]' <<< "$zones"
+}
 
-# Check timesonze
-if [ -f /etc/timezone ]; then
- TZ=$(cat /etc/timezone)
-elif [ -h /etc/localtime ]; then
-  TZ=$(readlink /etc/localtime | sed "s/\/usr\/share\/zoneinfo\///")
-else
-  checksum=$(md5sum /etc/localtime | cut -d' ' -f1)
-  TZ=$(find /usr/share/zoneinfo/ -type f -exec md5sum {} \; |\
-    grep "^$checksum" | sed "s/.*\/usr\/share\/zoneinfo\///" | head -n 1)
-fi
+shell_list() {
+  IFS=$'\n'
+  echo "Timezone"
+  echo "--------"
+  for zone in $zones; do
+    echo $zone;
+  done
+}
 
-echo $TZ
+plain_list() {
+  IFS=$'\n'
+  for zone in $zones; do
+    echo $zone;
+  done
+}
 
-exit
-# Defining config
-echo -e "$str" > $tmp_file
-conf=$tmp_file
 
-# Defining fileds to select
-fields="\$SYS \$HOSTNAME \$OS \$VERSION \$ARCH \$UPTIME \$LOADAVERAGE"
+zones=$(cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort)
 
-# Listing services
+# Listing data
 case $format in
     json)   json_list ;;
-    plain)  nohead=1; shell_list ;;
-    shell)  fields="\$HOSTNAME \$OS \$VERSION \$ARCH \$UPTIME \$LOADAVERAGE"
-            shell_list | column -t ;;
-    *)      check_args '1' '0' 'USER [FORMAT]'
+    plain)  plain_list ;;
+    shell)  shell_list |column -t ;;
 esac
 
-rm -f $tmp_file
 
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
 
+
+
 exit

+ 6 - 2
bin/v-purge-nginx-cache

@@ -49,12 +49,12 @@ parse_object_kv_list "$conf"
 
 # Purge nginx FastCGI cache
 if [ -d "/var/cache/nginx/micro/$domain" ]; then
-    rm -rf /var/cache/nginx/micro/$domain
+    rm -rf /var/cache/nginx/micro/$domain/*
 fi
 
 # Purge nginx proxy cache
 if [ -d "/var/cache/nginx/$domain" ]; then
-    rm -rf /var/cache/nginx/$domain
+    rm -rf /var/cache/nginx/$domain/*
 fi
 
 #----------------------------------------------------------#
@@ -65,6 +65,10 @@ fi
 if [ "$restart" != "no" ]; then
     $BIN/v-restart-web "$restart"
     check_result $? "Web restart failed" > /dev/null
+
+    $BIN/v-restart-proxy "$restart"
+    check_result $? "Proxy restart failed" >/dev/null
+
 fi
 
 # Logging

+ 31 - 31
bin/v-restart-service

@@ -51,37 +51,37 @@ else
 fi
 
 for service in $service_list; do
-
-    if [ "$service" = "iptables" ]; then
-        # Run the restart rules for iptables firewall
-        $BIN/v-stop-firewall
-        $BIN/v-update-firewall
-    elif [ "$restart" = "ssl" ] && [ "$service" = "nginx" ]; then
-        service $service upgrade >> $log 2>&1
-    elif [ -z "$restart" -o "$restart" = "no" ] && [ \
-            "$service" = "nginx" -o     \
-            "$service" = "apache2" -o   \
-            "$service" = "exim4" -o     \
-            "$service" = "dovecot" -o   \
-            "$service" = "bind9" -o     \
-            "$service" = "named" -o     \
-            "$service" = "vsftpd" -o    \
-            "$service" = "php5.6-fpm" -o \
-            "$service" = "php7.0-fpm" -o \
-            "$service" = "php7.1-fpm" -o \
-            "$service" = "php7.2-fpm" -o \
-            "$service" = "php7.3-fpm" -o \
-            "$service" = "php7.4-fpm" -o \
-            "$service" = "php8.0-fpm" -o \
-            "$service" = "php8.1-fpm" -o \
-            "$service" = "proftpd" -o    \
-            "$service" = "ssh" -o       \
-            "$service" = "fail2ban" ]; then
-        systemctl reload-or-restart "$service" > /dev/null 2>&1
-    else
-        systemctl reset-failed "$service" >> $log 2>&1
-        systemctl restart "$service" >> $log 2>&1
-    fi
+	if [ "$service" = "iptables" ]; then
+		# Run the restart rules for iptables firewall
+		$BIN/v-stop-firewall
+		$BIN/v-update-firewall
+	elif [ "$restart" = "ssl" ] && [ "$service" = "nginx" ]; then
+		service $service upgrade >> $log 2>&1
+	elif [ -z "$restart" -o "$restart" = "no" ] && [ \
+		"$service" = "nginx" -o \
+		"$service" = "apache2" -o \
+		"$service" = "exim4" -o \
+		"$service" = "dovecot" -o \
+		"$service" = "bind9" -o \
+		"$service" = "named" -o \
+		"$service" = "vsftpd" -o \
+		"$service" = "php5.6-fpm" -o \
+		"$service" = "php7.0-fpm" -o \
+		"$service" = "php7.1-fpm" -o \
+		"$service" = "php7.2-fpm" -o \
+		"$service" = "php7.3-fpm" -o \
+		"$service" = "php7.4-fpm" -o \
+		"$service" = "php8.0-fpm" -o \
+		"$service" = "php8.1-fpm" -o \
+        "$service" = "php8.2-fpm" -o \
+		"$service" = "proftpd" -o \
+		"$service" = "ssh" -o \
+		"$service" = "fail2ban" ]; then
+		systemctl reload-or-restart "$service" > /dev/null 2>&1
+	else
+		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.
     if [ $? -ne 0 ]; then

+ 27 - 27
bin/v-run-cli-cmd

@@ -47,33 +47,33 @@ if [ -z "$(which "$clicmd")" ]; then
     check_result "$E_NOTEXIST" "Cli command does not exist $clicmd"
 fi
 basecmd="$(basename "$clicmd")"
-
-if [ "$basecmd" != 'ps'         -a \
-     "$basecmd" != 'ls'         -a \
-     "$basecmd" != 'tar'        -a \
-     "$basecmd" != 'zip'        -a \
-     "$basecmd" != 'unzip'      -a \
-     "$basecmd" != 'gzip'       -a \
-     "$basecmd" != 'gunzip'     -a \
-     "$basecmd" != 'mkdir'      -a \
-     "$basecmd" != 'find'       -a \
-     "$basecmd" != 'id'         -a \
-     "$basecmd" != 'grep'       -a \
-     "$basecmd" != 'egrep'      -a \
-     "$basecmd" != 'sed'        -a \
-     "$basecmd" != 'cat'        -a \
-     "$basecmd" != 'php5.6'     -a \
-     "$basecmd" != 'php7.0'     -a \
-     "$basecmd" != 'php7.1'     -a \
-     "$basecmd" != 'php7.2'     -a \
-     "$basecmd" != 'php7.3'     -a \
-     "$basecmd" != 'php7.4'     -a \
-     "$basecmd" != 'php8.0'     -a \
-     "$basecmd" != 'php8.1'     -a \
-     "$basecmd" != 'php'        -a \
-     "$basecmd" != "wp"      -a \
-     "$basecmd" != 'composer' ]; then
-    check_result "$E_FORBIDEN" "Error: Cli command not enabled"
+if [ "$basecmd" != 'ps' -a \
+	"$basecmd" != 'ls' -a \
+	"$basecmd" != 'tar' -a \
+	"$basecmd" != 'zip' -a \
+	"$basecmd" != 'unzip' -a \
+	"$basecmd" != 'gzip' -a \
+	"$basecmd" != 'gunzip' -a \
+	"$basecmd" != 'mkdir' -a \
+	"$basecmd" != 'find' -a \
+	"$basecmd" != 'id' -a \
+	"$basecmd" != 'grep' -a \
+	"$basecmd" != 'egrep' -a \
+	"$basecmd" != 'sed' -a \
+	"$basecmd" != 'cat' -a \
+	"$basecmd" != 'php5.6' -a \
+	"$basecmd" != 'php7.0' -a \
+	"$basecmd" != 'php7.1' -a \
+	"$basecmd" != 'php7.2' -a \
+	"$basecmd" != 'php7.3' -a \
+	"$basecmd" != 'php7.4' -a \
+	"$basecmd" != 'php8.0' -a \
+	"$basecmd" != 'php8.1' -a \
+    "$basecmd" != 'php8.2'     -a \
+	"$basecmd" != 'php' -a \
+	"$basecmd" != "wp" -a \
+	"$basecmd" != 'composer' ]; then
+	check_result "$E_FORBIDEN" "Error: Cli command not enabled"
 fi
 
 all_scriptargs=("$@")

+ 30 - 32
bin/v-stop-firewall

@@ -28,8 +28,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-#is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
-
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
@@ -69,36 +67,36 @@ rm -f $tmp
 if [ -d "/etc/sysconfig" ]; then
     /sbin/iptables-save > /etc/sysconfig/iptables
 else
-    /sbin/iptables-save > /etc/iptables.rules
-    iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .);
-    sd_unit="/lib/systemd/system/hestia-iptables.service"
-    if [ ! -e "$sd_unit" ]; then
-        echo "[Unit]" >> $sd_unit
-        echo "Description=Loading Hestia firewall rules" >> $sd_unit
-        echo "DefaultDependencies=no" >> $sd_unit
-        echo "Wants=network-pre.target local-fs.target" >> $sd_unit
-        echo "Before=network-pre.target" >> $sd_unit
-        echo "After=local-fs.target" >> $sd_unit
-        echo "" >> $sd_unit
-        echo "[Service]" >> $sd_unit
-        echo "Type=oneshot" >> $sd_unit
-        echo "RemainAfterExit=yes" >> $sd_unit
-        echo "ExecStartPre=-${HESTIA}/bin/v-update-firewall-ipset" >> $sd_unit
-        if [ "$iptablesversion" = "v1.6" ]; then
-            echo "ExecStart=/sbin/iptables-restore /etc/iptables.rules" >> $sd_unit
-        else 
-            echo "ExecStart=/sbin/iptables-restore --wait=10 /etc/iptables.rules" >> $sd_unit
-        fi
-        echo "" >> $sd_unit
-        echo "[Install]" >> $sd_unit
-        echo "WantedBy=multi-user.target" >> $sd_unit
-        systemctl daemon-reload
-    fi
-    systemctl is-enabled hestia-iptables >/dev/null 2>&1 && systemctl disable hestia-iptables >/dev/null 2>&1
-    if [ -z "$FIREWALL_SYSTEM" ]; then
-        rm -f $sd_unit
-        systemctl daemon-reload
-    fi
+	/sbin/iptables-save > /etc/iptables.rules
+	iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .)
+	sd_unit="/lib/systemd/system/hestia-iptables.service"
+	if [ ! -e "$sd_unit" ]; then
+		echo "[Unit]" >> $sd_unit
+		echo "Description=Loading Hestia firewall rules" >> $sd_unit
+		echo "DefaultDependencies=no" >> $sd_unit
+		echo "Wants=network-pre.target local-fs.target" >> $sd_unit
+		echo "Before=network-pre.target" >> $sd_unit
+		echo "After=local-fs.target" >> $sd_unit
+		echo "" >> $sd_unit
+		echo "[Service]" >> $sd_unit
+		echo "Type=oneshot" >> $sd_unit
+		echo "RemainAfterExit=yes" >> $sd_unit
+		echo "ExecStartPre=-${HESTIA}/bin/v-update-firewall-ipset load" >> $sd_unit
+		if [ "$iptablesversion" = "v1.6" ]; then
+			echo "ExecStart=/sbin/iptables-restore /etc/iptables.rules" >> $sd_unit
+		else
+			echo "ExecStart=/sbin/iptables-restore --wait=10 /etc/iptables.rules" >> $sd_unit
+		fi
+		echo "" >> $sd_unit
+		echo "[Install]" >> $sd_unit
+		echo "WantedBy=multi-user.target" >> $sd_unit
+		systemctl -q daemon-reload
+	fi
+	systemctl -q is-enabled hestia-iptables 2> /dev/null && systemctl -q disable hestia-iptables
+	if [ -z "$FIREWALL_SYSTEM" ]; then
+		rm -f $sd_unit
+		systemctl -q daemon-reload
+	fi
 fi
 
 

+ 26 - 26
bin/v-update-firewall

@@ -180,32 +180,32 @@ fi
 if [ -d "/etc/sysconfig" ]; then
     /sbin/iptables-save > /etc/sysconfig/iptables
 else
-    /sbin/iptables-save > /etc/iptables.rules
-    iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .);
-    sd_unit="/lib/systemd/system/hestia-iptables.service"
-    if [ ! -e "$sd_unit" ]; then
-        echo "[Unit]" >> $sd_unit
-        echo "Description=Loading Hestia firewall rules" >> $sd_unit
-        echo "DefaultDependencies=no" >> $sd_unit
-        echo "Wants=network-pre.target local-fs.target" >> $sd_unit
-        echo "Before=network-pre.target" >> $sd_unit
-        echo "After=local-fs.target" >> $sd_unit
-        echo "" >> $sd_unit
-        echo "[Service]" >> $sd_unit
-        echo "Type=oneshot" >> $sd_unit
-        echo "RemainAfterExit=yes" >> $sd_unit
-        echo "ExecStartPre=-${HESTIA}/bin/v-update-firewall-ipset" >> $sd_unit
-        if [ "$iptablesversion" = "v1.6" ]; then
-            echo "ExecStart=/sbin/iptables-restore /etc/iptables.rules" >> $sd_unit
-        else 
-            echo "ExecStart=/sbin/iptables-restore --wait=10 /etc/iptables.rules" >> $sd_unit
-        fi
-        echo "" >> $sd_unit
-        echo "[Install]" >> $sd_unit
-        echo "WantedBy=multi-user.target" >> $sd_unit
-        systemctl daemon-reload
-    fi
-    systemctl is-enabled hestia-iptables >/dev/null 2>&1 || systemctl enable hestia-iptables >/dev/null 2>&1
+	/sbin/iptables-save > /etc/iptables.rules
+	iptablesversion=$(iptables --version | head -1 | awk '{print $2}' | cut -f -2 -d .)
+	sd_unit="/lib/systemd/system/hestia-iptables.service"
+	if [ ! -e "$sd_unit" ]; then
+		echo "[Unit]" >> $sd_unit
+		echo "Description=Loading Hestia firewall rules" >> $sd_unit
+		echo "DefaultDependencies=no" >> $sd_unit
+		echo "Wants=network-pre.target local-fs.target" >> $sd_unit
+		echo "Before=network-pre.target" >> $sd_unit
+		echo "After=local-fs.target" >> $sd_unit
+		echo "" >> $sd_unit
+		echo "[Service]" >> $sd_unit
+		echo "Type=oneshot" >> $sd_unit
+		echo "RemainAfterExit=yes" >> $sd_unit
+		echo "ExecStartPre=-${HESTIA}/bin/v-update-firewall-ipset load" >> $sd_unit
+		if [ "$iptablesversion" = "v1.6" ]; then
+			echo "ExecStart=/sbin/iptables-restore /etc/iptables.rules" >> $sd_unit
+		else
+			echo "ExecStart=/sbin/iptables-restore --wait=10 /etc/iptables.rules" >> $sd_unit
+		fi
+		echo "" >> $sd_unit
+		echo "[Install]" >> $sd_unit
+		echo "WantedBy=multi-user.target" >> $sd_unit
+		systemctl -q daemon-reload
+	fi
+	systemctl -q is-enabled hestia-iptables 2> /dev/null || systemctl -q enable hestia-iptables
 fi
 
 #----------------------------------------------------------#

+ 13 - 13
bin/v-update-firewall-ipset

@@ -10,8 +10,7 @@
 #                Variables & Functions                     #
 #----------------------------------------------------------#
 
-# Force refresh
-force=${1:-no}
+refresh=${1:-no}
 
 # Includes
 source /etc/profile.d/hestia.sh
@@ -26,7 +25,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-is_boolean_format_valid "$force" 'bool (yes/no)'
+is_refresh_ipset_format_valid "$refresh" 'Refresh IP lists (load/yes/no)'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 # Perform verification if read-only mode is enabled
@@ -40,21 +39,22 @@ for ipset_name in $(search_objects "$ipset_hstobject" 'SUSPENDED' 'no' 'LISTNAME
     ipset_date="$(get_object_value "$ipset_hstobject" 'LISTNAME' "$ipset_name" '$DATE')"
     ipset_au="$(get_object_value "$ipset_hstobject" 'LISTNAME' "$ipset_name" '$AUTOUPDATE')"
 
-    if [ "$ipset_au" = 'no' ] ; then
-        # load existing ip list files in the kernel but don't auto update them
-        $BIN/v-add-firewall-ipset "$ipset_name"
-        continue
-    fi
+	if [ "$ipset_au" = 'no' ] || [ "$refresh" = 'load' ]; then
+		# Load existing ip list files in the kernel but don't auto update them
+		# The "load" refresh option is only used by hestia-iptables systemd service
+		$BIN/v-add-firewall-ipset "$ipset_name"
+		continue
+	fi
 
     last_updated_ts=$(date -d "$ipset_date $ipset_time" +%s)
     now=$(date +%s)
     hours_since_update=$(( (now - last_updated_ts) / (60*60) ))
 
-    if [[ "$hours_since_update" -lt 24 ]] && [ "$force" = 'no' ]; then
-        # load existing ip list files in the kernel but don't auto update them
-        $BIN/v-add-firewall-ipset "$ipset_name"
-        continue
-    fi
+	if [[ "$hours_since_update" -lt 24 ]] && [ "$refresh" = 'no' ]; then
+		# Load existing ip list files in the kernel but don't auto update them
+		$BIN/v-add-firewall-ipset "$ipset_name"
+		continue
+	fi
 
     $BIN/v-add-firewall-ipset "$ipset_name" '' '' '' 'yes'
 done

+ 1 - 1
func/db.sh

@@ -537,7 +537,7 @@ suspend_pgsql_database() {
 # Unsuspend MySQL database
 unsuspend_mysql_database() {
     mysql_connect $HOST
-    query="GRANT ALL ON \`$database\`.* FROM \`$DBUSER\`@\`%\`"
+    query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`"
     mysql_query "$query" > /dev/null
     query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost"
     mysql_query "$query" > /dev/null

+ 7 - 0
func/main.sh

@@ -858,6 +858,13 @@ is_boolean_format_valid() {
     fi
 }
 
+# Refresh IPset format validator
+is_refresh_ipset_format_valid() {
+	if [ "$1" != 'load' ] && [ "$1" != 'yes' ] && [ "$1" != 'no' ]; then
+		check_result "$E_INVALID" "invalid $2 format :: $1"
+	fi
+}
+
 # Common format validator
 is_common_format_valid() {
     exclude="[!|#|$|^|&|(|)|+|=|{|}|:|<|>|?|/|\|\"|'|;|%|\`| ]"

+ 1 - 1
install/deb/fail2ban/jail.local

@@ -28,7 +28,7 @@ logpath  = /var/log/dovecot.log
 enabled  = false
 filter   = mysqld-auth
 action   = hestia[name=DB]
-logpath  = /var/log/mysql.log
+logpath  = /var/log/mysql/error.log
 maxretry = 5
 
 [hestia-iptables]

+ 1 - 1
install/deb/templates/web/nginx/caching.stpl

@@ -26,7 +26,7 @@ server {
         proxy_no_cache $no_cache;
 
         set $no_cache 0;
-            if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|/store.*|/cart.*|/my-account.*|/checkout.*|/user/|/admin/|/administrator/|/manager/|index.php") {
+            if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|/store.*|/cart.*|/my-account.*|/checkout.*|/user/|/admin/|/administrator/|/manager/|index.php") {
                 set $no_cache 1;
             }
             if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {

+ 1 - 1
install/deb/templates/web/nginx/caching.tpl

@@ -21,7 +21,7 @@ server {
         proxy_no_cache $no_cache;
 
         set $no_cache 0;
-            if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|/store.*|/cart.*|/my-account.*|/checkout.*|/user/|/admin/|/administrator/|/manager/|index.php") {
+            if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|/store.*|/cart.*|/my-account.*|/checkout.*|/user/|/admin/|/administrator/|/manager/|index.php") {
                 set $no_cache 1;
             }
             if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {

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

@@ -55,7 +55,7 @@ server {
             fastcgi_index index.php;
             include /etc/nginx/fastcgi_params;
             include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
-            if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
+            if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
                 set $no_cache 1;
             }
             if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {

+ 1 - 1
install/deb/templates/web/nginx/php-fpm/wordpress.tpl

@@ -50,7 +50,7 @@ server {
             fastcgi_index index.php;
             include /etc/nginx/fastcgi_params;
             include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
-            if ($request_uri ~* "/wp-admin/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
+            if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
                 set $no_cache 1;
             }
             if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {

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

@@ -31,9 +31,9 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.11'
+HESTIA_INSTALL_VER='1.6.12'
 # Dependencies
-multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
+multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
 fpm_v="8.0"
 mariadb_v="10.6"
 
@@ -169,6 +169,9 @@ sort_config_file(){
 
 # Validate hostname according to RFC1178
 validate_hostname () {
+    # remove extra .
+    servername = $(echo "$servername" |sed -e "s/[.]*$//g")
+    servername = $(echo "$domain" |sed -e "s/^[.]*//")
     if [[ $(echo "$servername" | grep -o "\." | wc -l) -gt 1 ]] && [[ ! $servername =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
         # Hostname valid
         return 1
@@ -1942,7 +1945,7 @@ fi
 
 
 # Adding default domain
-$HESTIA/bin/v-add-web-domain admin $servername
+$HESTIA/bin/v-add-web-domain admin $servername $ip
 check_result $? "can't create $servername domain"
 
 # Adding cron jobs

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

@@ -31,9 +31,9 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.6.11'
+HESTIA_INSTALL_VER='1.6.12'
 # Dependencies
-multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
+multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
 fpm_v="8.0"
 mariadb_v="10.6"
 
@@ -167,6 +167,9 @@ sort_config_file(){
 
 # Validate hostname according to RFC1178
 validate_hostname () {
+    # remove extra .
+    servername = $(echo "$servername" |sed -e "s/[.]*$//g")
+    servername = $(echo "$domain" |sed -e "s/^[.]*//")
     if [[ $(echo "$servername" | grep -o "\." | wc -l) -gt 1 ]] && [[ ! $servername =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
         # Hostname valid
         return 1
@@ -2025,7 +2028,7 @@ if [ "$postgresql" = 'yes' ]; then
 fi
 
 # Adding default domain
-$HESTIA/bin/v-add-web-domain admin $servername
+$HESTIA/bin/v-add-web-domain admin $servername $ip
 check_result $? "can't create $servername domain"
 
 # Adding cron jobs

+ 1 - 1
install/rpm/fail2ban/jail.local

@@ -28,7 +28,7 @@ logpath  = /var/log/dovecot.log
 enabled  = false
 filter   = mysqld-auth
 action   = hestia[name=DB]
-logpath  = /var/log/mysql.log
+logpath  = /var/log/mysql/error.log
 maxretry = 5
 
 [hestia-iptables]

+ 1 - 1
install/upgrade/upgrade.conf

@@ -35,7 +35,7 @@ UPGRADE_RESTART_SERVICES='true'
 #######################################################################################
 
 # Supported PHP versions
-multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1")
+multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0" "8.1" "8.2")
 
 #######################################################################################
 #######                        3rd Party Software Updates                       #######

+ 33 - 0
install/upgrade/versions/1.6.12.sh

@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Hestia Control Panel upgrade script for target version 1.6.12
+
+#######################################################################################
+#######                      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'
+
+if [ -f "/etc/fail2ban/jail.local" ]; then
+	sed -i "s|/var/log/mysql.log|/var/log/mysql/error.log|g" /etc/fail2ban/jail.local
+fi
+
+# Fixed firewall loading failed after reboot, applying update to hestia-iptables Systemd unit.
+if [ "$FIREWALL_SYSTEM" = "iptables" ]; then
+	echo "[ * ] Update loading firewall rules service..."
+	$BIN/v-delete-sys-firewall
+	$BIN/v-add-sys-firewall
+fi

+ 1 - 1
src/deb/hestia/control

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

+ 5 - 0
web/.gitignore

@@ -0,0 +1,5 @@
+node_modules
+
+src/vendor/filp
+src/vendor/psr
+src/vendor/composer/installed.json

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

@@ -50,7 +50,7 @@ if (!empty($_POST['save'])) {
 
     // Change database user
     if (($v_dbuser != $_POST['v_dbuser']) && (empty($_SESSION['error_msg']))) {
-        $v_dbuser = escapeshellarg($v_dbuser);
+        $v_dbuser = escapeshellarg($_POST['v_dbuser']);
         exec(HESTIA_CMD."v-change-database-user ".$user." ".escapeshellarg($v_database)." ".$v_dbuser, $output, $return_var);
         check_return_code($return_var, $output);
         unset($output);

+ 20 - 96
web/edit/server/index.php

@@ -15,49 +15,13 @@ if ($_SESSION['userContext'] != 'admin') {
 $v_hostname = exec('hostname');
 
 // List available timezones and get current one
-$v_timezones = list_timezones();
 exec(HESTIA_CMD."v-get-sys-timezone", $output, $return_var);
 $v_timezone = $output[0];
 unset($output);
-if ($v_timezone == 'Etc/UTC') {
-    $v_timezone = 'UTC';
-}
-if ($v_timezone == 'Pacific/Honolulu') {
-    $v_timezone = 'HAST';
-}
-if ($v_timezone == 'US/Aleutian') {
-    $v_timezone = 'HADT';
-}
-if ($v_timezone == 'Etc/GMT+9') {
-    $v_timezone = 'AKST';
-}
-if ($v_timezone == 'America/Anchorage') {
-    $v_timezone = 'AKDT';
-}
-if ($v_timezone == 'America/Dawson_Creek') {
-    $v_timezone = 'PST';
-}
-if ($v_timezone == 'PST8PDT') {
-    $v_timezone = 'PDT';
-}
-if ($v_timezone == 'MST7MDT') {
-    $v_timezone = 'MDT';
-}
-if ($v_timezone == 'Canada/Saskatchewan') {
-    $v_timezone = 'CST';
-}
-if ($v_timezone == 'CST6CDT') {
-    $v_timezone = 'CDT';
-}
-if ($v_timezone == 'EST5EDT') {
-    $v_timezone = 'EDT';
-}
-if ($v_timezone == 'America/Puerto_Rico') {
-    $v_timezone = 'AST';
-}
-if ($v_timezone == 'America/Halifax') {
-    $v_timezone = 'ADT';
-}
+
+exec(HESTIA_CMD."v-get-sys-timezones json", $output, $return_var);
+$v_timezones = json_decode(implode('', $output), true);
+unset($output);
 
 // List supported php versions
 exec(HESTIA_CMD."v-list-web-templates-backend json", $output, $return_var);
@@ -65,14 +29,15 @@ $backend_templates = json_decode(implode('', $output), true);
 unset($output);
 
 $v_php_versions = [
-     'php-5.6',
-     'php-7.0',
-     'php-7.1',
-     'php-7.2',
-     'php-7.3',
-     'php-7.4',
-     'php-8.0',
-     'php-8.1',
+	"php-5.6",
+	"php-7.0",
+	"php-7.1",
+	"php-7.2",
+	"php-7.3",
+	"php-7.4",
+	"php-8.0",
+	"php-8.1",
+	"php-8.2",
 ];
 sort($v_php_versions);
 
@@ -340,51 +305,10 @@ if (!empty($_POST['save'])) {
     // Change timezone
     if (empty($_SESSION['error_msg'])) {
         if (!empty($_POST['v_timezone'])) {
-            $v_tz = $_POST['v_timezone'];
-            if ($v_tz == 'UTC') {
-                $v_tz = 'Etc/UTC';
-            }
-            if ($v_tz == 'HAST') {
-                $v_tz = 'Pacific/Honolulu';
-            }
-            if ($v_tz == 'HADT') {
-                $v_tz = 'US/Aleutian';
-            }
-            if ($v_tz == 'AKST') {
-                $v_tz = 'Etc/GMT+9';
-            }
-            if ($v_tz == 'AKDT') {
-                $v_tz = 'America/Anchorage';
-            }
-            if ($v_tz == 'PST') {
-                $v_tz = 'America/Dawson_Creek';
-            }
-            if ($v_tz == 'PDT') {
-                $v_tz = 'PST8PDT';
-            }
-            if ($v_tz == 'MDT') {
-                $v_tz = 'MST7MDT';
-            }
-            if ($v_tz == 'CST') {
-                $v_tz = 'Canada/Saskatchewan';
-            }
-            if ($v_tz == 'CDT') {
-                $v_tz = 'CST6CDT';
-            }
-            if ($v_tz == 'EDT') {
-                $v_tz = 'EST5EDT';
-            }
-            if ($v_tz == 'AST') {
-                $v_tz = 'America/Puerto_Rico';
-            }
-            if ($v_tz == 'ADT') {
-                $v_tz = 'America/Halifax';
-            }
-
-            if ($v_timezone != $v_tz) {
-                exec(HESTIA_CMD."v-change-sys-timezone ".escapeshellarg($v_tz), $output, $return_var);
+            if ($v_timezone != $_POST['v_timezone']) {
+                exec(HESTIA_CMD."v-change-sys-timezone ".escapeshellarg($_POST['v_timezone']), $output, $return_var);
                 check_return_code($return_var, $output);
-                $v_timezone = $v_tz;
+                $v_timezone = $_POST['v_timezone'];
                 unset($output);
             }
         }
@@ -1041,7 +965,7 @@ if (!empty($_POST['save'])) {
             $v_security_adv = 'yes';
         }
     }
-    
+
     if ($_POST['v_api_system'] != $_SESSION['API_SYSTEM'] || $_POST['v_api'] != $_SESSION['API'] || $_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']){
         if (empty($_SESSION['error_msg'])) {
             if($_POST['v_api'] == "no" && $_POST['v_api_system'] === 0 ){
@@ -1066,7 +990,7 @@ if (!empty($_POST['save'])) {
                 $v_security_adv = 'yes';
             }
         }
-        
+
         // Change API access
         if (empty($_SESSION['error_msg'])) {
             if ($_POST['v_api'] != $_SESSION['API']) {
@@ -1083,7 +1007,7 @@ if (!empty($_POST['save'])) {
                 $v_security_adv = 'yes';
             }
         }
-            
+
         // Change API allowed IPs
         if (empty($_SESSION['error_msg'])) {
             if ($_POST['v_api_allowed_ip'] != $_SESSION['API_ALLOWED_IP']) {
@@ -1107,7 +1031,7 @@ if (!empty($_POST['save'])) {
                     $v_security_adv = 'yes';
                 }
             }
-        }   
+        }
 
     }
 

+ 12 - 10
web/inc/composer.lock

@@ -8,16 +8,16 @@
     "packages": [
         {
             "name": "phpmailer/phpmailer",
-            "version": "v6.6.5",
+            "version": "v6.7.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/PHPMailer/PHPMailer.git",
-                "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627"
+                "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627",
-                "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627",
+                "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
+                "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
                 "shasum": ""
             },
             "require": {
@@ -27,17 +27,19 @@
                 "php": ">=5.5.0"
             },
             "require-dev": {
-                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
-                "doctrine/annotations": "^1.2",
+                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
+                "doctrine/annotations": "^1.2.6 || ^1.13.3",
                 "php-parallel-lint/php-console-highlighter": "^1.0.0",
                 "php-parallel-lint/php-parallel-lint": "^1.3.2",
                 "phpcompatibility/php-compatibility": "^9.3.5",
                 "roave/security-advisories": "dev-latest",
-                "squizlabs/php_codesniffer": "^3.6.2",
-                "yoast/phpunit-polyfills": "^1.0.0"
+                "squizlabs/php_codesniffer": "^3.7.1",
+                "yoast/phpunit-polyfills": "^1.0.4"
             },
             "suggest": {
                 "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
+                "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
+                "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
                 "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
                 "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
                 "psr/log": "For optional PSR-3 debug logging",
@@ -74,7 +76,7 @@
             "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.5"
+                "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
             },
             "funding": [
                 {
@@ -82,7 +84,7 @@
                     "type": "github"
                 }
             ],
-            "time": "2022-10-07T12:23:10+00:00"
+            "time": "2022-12-08T13:30:06+00:00"
         }
     ],
     "packages-dev": [],

+ 8 - 9
web/src/app/WebApp/Installers/Wordpress/WordpressSetup.php

@@ -5,15 +5,14 @@ namespace Hestia\WebApp\Installers\Wordpress;
 use Hestia\System\Util;
 use Hestia\WebApp\Installers\BaseSetup as BaseSetup;
 
-class WordpressSetup extends BaseSetup
-{
-    protected $appInfo = [
-        'name' => 'Wordpress',
-        'group' => 'cms',
-        'enabled' => true,
-        'version' => 'latest',
-        'thumbnail' => 'wp-thumb.png'
-    ];
+class WordpressSetup extends BaseSetup {
+	protected $appInfo = [
+		"name" => "WordPress",
+		"group" => "cms",
+		"enabled" => true,
+		"version" => "latest",
+		"thumbnail" => "wp-thumb.png",
+	];
 
     protected $appname = 'wordpress';
     protected $config = [

+ 2 - 5
web/templates/pages/edit_server.html

@@ -73,14 +73,11 @@
 									</tr>
 									<tr>
 										<td>
-											<select class="vst-list" name="v_timezone">
+											<select class="vst-list" name="v_timezone">	
 												<?php
 													foreach ($v_timezones as $key => $value) {
 														echo "\t\t\t\t<option value=\"".$key."\"";
-														if ((!empty($v_timezone)) && ( $key == $v_timezone)){
-															echo ' selected' ;
-														}
-														if($key == "UTC" && $v_timezone == "Etc/UTC"){
+														if ((!empty($value)) && ( $value == $v_timezone)){
 															echo ' selected' ;
 														}
 														echo ">".$value."</option>\n";