Explorar o código

Trim all whitespace (#3038)

Alec Rust %!s(int64=3) %!d(string=hai) anos
pai
achega
7e02569b18
Modificáronse 100 ficheiros con 313 adicións e 313 borrados
  1. 13 13
      .drone.yml
  2. 3 3
      CONTRIBUTING.md
  3. 1 1
      SECURITY.md
  4. 14 14
      bin/v-add-backup-host
  5. 2 2
      bin/v-add-database
  6. 2 2
      bin/v-add-database-host
  7. 3 3
      bin/v-add-database-temp-user
  8. 2 2
      bin/v-add-dns-domain
  9. 2 2
      bin/v-add-dns-record
  10. 2 2
      bin/v-add-fastcgi-cache
  11. 1 1
      bin/v-add-firewall-chain
  12. 3 3
      bin/v-add-firewall-ipset
  13. 1 1
      bin/v-add-fs-file
  14. 20 20
      bin/v-add-letsencrypt-domain
  15. 1 1
      bin/v-add-letsencrypt-host
  16. 2 2
      bin/v-add-mail-domain-ssl
  17. 4 4
      bin/v-add-mail-domain-webmail
  18. 2 2
      bin/v-add-remote-dns-host
  19. 1 1
      bin/v-add-sys-api-ip
  20. 2 2
      bin/v-add-sys-dependencies
  21. 5 5
      bin/v-add-sys-ip
  22. 15 15
      bin/v-add-sys-pma-sso
  23. 1 1
      bin/v-add-sys-quota
  24. 18 18
      bin/v-add-sys-rainloop
  25. 24 24
      bin/v-add-sys-roundcube
  26. 1 1
      bin/v-add-sys-smtp
  27. 6 6
      bin/v-add-user
  28. 4 4
      bin/v-add-user-package
  29. 4 4
      bin/v-add-user-sftp-jail
  30. 1 1
      bin/v-add-user-sftp-key
  31. 1 1
      bin/v-add-user-wp-cli
  32. 1 1
      bin/v-add-web-domain-allow-users
  33. 1 1
      bin/v-add-web-domain-ftp
  34. 9 9
      bin/v-add-web-domain-redirect
  35. 1 1
      bin/v-add-web-domain-ssl
  36. 1 1
      bin/v-add-web-domain-ssl-preset
  37. 2 2
      bin/v-add-web-php
  38. 1 1
      bin/v-change-cron-job
  39. 1 1
      bin/v-change-dns-domain-dnssec
  40. 1 1
      bin/v-change-dns-record
  41. 17 17
      bin/v-change-domain-owner
  42. 1 1
      bin/v-change-mail-account-rate-limit
  43. 4 4
      bin/v-change-remote-dns-domain-exp
  44. 7 7
      bin/v-change-remote-dns-domain-soa
  45. 6 6
      bin/v-change-remote-dns-domain-ttl
  46. 3 3
      bin/v-change-sys-api
  47. 5 5
      bin/v-change-sys-db-alias
  48. 2 2
      bin/v-change-sys-hostname
  49. 4 4
      bin/v-change-sys-port
  50. 1 1
      bin/v-change-sys-release
  51. 1 1
      bin/v-change-user-config-value
  52. 1 1
      bin/v-change-user-package
  53. 1 1
      bin/v-change-user-password
  54. 1 1
      bin/v-change-user-php-cli
  55. 1 1
      bin/v-change-user-role
  56. 1 1
      bin/v-change-user-template
  57. 4 4
      bin/v-change-web-domain-docroot
  58. 1 1
      bin/v-change-web-domain-ftp-password
  59. 1 1
      bin/v-check-mail-account-hash
  60. 1 1
      bin/v-check-user-hash
  61. 3 3
      bin/v-check-user-password
  62. 3 3
      bin/v-copy-user-package
  63. 1 1
      bin/v-delete-database-temp-user
  64. 1 1
      bin/v-delete-dns-domain
  65. 6 6
      bin/v-delete-firewall-ban
  66. 1 1
      bin/v-delete-letsencrypt-domain
  67. 2 2
      bin/v-delete-mail-domain
  68. 2 2
      bin/v-delete-remote-dns-domain
  69. 2 2
      bin/v-delete-remote-dns-domains
  70. 2 2
      bin/v-delete-remote-dns-record
  71. 1 1
      bin/v-delete-sys-api-ip
  72. 1 1
      bin/v-delete-sys-ip
  73. 2 2
      bin/v-delete-sys-pma-sso
  74. 1 1
      bin/v-delete-sys-sftp-jail
  75. 1 1
      bin/v-delete-sys-smtp-relay
  76. 1 1
      bin/v-delete-user-ips
  77. 1 1
      bin/v-delete-user-log
  78. 1 1
      bin/v-delete-web-domain
  79. 1 1
      bin/v-delete-web-domain-allow-users
  80. 3 3
      bin/v-delete-web-domain-redirect
  81. 2 2
      bin/v-delete-web-php
  82. 1 1
      bin/v-generate-api-key
  83. 1 1
      bin/v-generate-debug-report
  84. 2 2
      bin/v-generate-ssl-cert
  85. 1 1
      bin/v-get-dns-domain-value
  86. 1 1
      bin/v-get-mail-account-value
  87. 1 1
      bin/v-get-mail-domain-value
  88. 2 2
      bin/v-get-user-salt
  89. 1 1
      bin/v-insert-dns-domain
  90. 2 2
      bin/v-list-access-keys
  91. 5 5
      bin/v-list-backup-host
  92. 5 5
      bin/v-list-dnssec-public-key
  93. 1 1
      bin/v-list-sys-cpu-status
  94. 1 1
      bin/v-list-sys-db-status
  95. 2 2
      bin/v-list-sys-disk-status
  96. 1 1
      bin/v-list-sys-dns-status
  97. 2 2
      bin/v-list-sys-mail-status
  98. 1 1
      bin/v-list-sys-memory-status
  99. 2 2
      bin/v-list-sys-network-status
  100. 1 1
      bin/v-list-sys-nginx-config

+ 13 - 13
.drone.yml

@@ -1,7 +1,7 @@
 ---
 kind: pipeline
 type: ssh
-name: Ubuntu | Nginx + Apache2  
+name: Ubuntu | Nginx + Apache2
 
 concurrency:
   limit: 1
@@ -9,15 +9,15 @@ concurrency:
 server:
   host:
     from_secret: server_address
-  user: 
+  user:
     from_secret: username
-  ssh_key: 
+  ssh_key:
     from_secret: ssh_key
 
 platform:
   os: linux
   arch: amd64
-   
+
 steps:
 - name: Download submodules
   image: alpine/git
@@ -32,7 +32,7 @@ steps:
 - name: Run restore tests
   commands:
   - bats ./test/restore.bats
-- name: Run config tests 
+- name: Run config tests
   commands:
   - bats ./test/config-tests.bats
 
@@ -48,7 +48,7 @@ trigger:
 ---
 kind: pipeline
 type: ssh
-name: Debian | Nginx  
+name: Debian | Nginx
 
 concurrency:
   limit: 1
@@ -56,15 +56,15 @@ concurrency:
 server:
   host:
     from_secret: server_address2
-  user: 
+  user:
     from_secret: username
-  ssh_key: 
+  ssh_key:
     from_secret: ssh_key
 
 platform:
   os: linux
   arch: amd64
-   
+
 steps:
 - name: Download submodules
   image: alpine/git
@@ -83,10 +83,10 @@ steps:
   commands:
   - cp /root/le-env.sh /tmp/hestia-le-env.sh
   - bats ./test/letsencrypt.bats
-- name: Run config tests 
+- name: Run config tests
   commands:
   - bats ./test/config-tests.bats
-  
+
 trigger:
   event: [ pull_request, push ]
   ref:
@@ -161,9 +161,9 @@ steps:
             - freight-add ./hestia/*.deb apt/bionic apt/focal apt/jammy apt/stretch apt/buster apt/bullseye
             - freight-cache
             - rm -fr ./hestia/
-  
+
 trigger:
-    event: [ promote] 
+    event: [ promote]
 
 ---
 kind: signature

+ 3 - 3
CONTRIBUTING.md

@@ -9,7 +9,7 @@ Ways to contribute
 - **Code review and bug fixes**:
     - Read over the code and if you notice errors (even spelling mistakes), submit a pull request with your changes.
 - **New features**:
-    - Is there an awesome feature that you'd love to see included? Submit a pull request with your changes, and if approved your PR will be reviewed and merged for inclusion in an upcoming release. While our development team tries to accomodate all reasonable requests please remember that it does take time to develop, implement and test new features and as such we may not be able to fulfill all requests or may have to put a feature on backlog for a later date. 
+    - Is there an awesome feature that you'd love to see included? Submit a pull request with your changes, and if approved your PR will be reviewed and merged for inclusion in an upcoming release. While our development team tries to accomodate all reasonable requests please remember that it does take time to develop, implement and test new features and as such we may not be able to fulfill all requests or may have to put a feature on backlog for a later date.
 - **Translations**:
     - If you are a non-English speaker and would like to improve the quality of the translations used in Hestia Control Panel's web interface, please go to [Hestia Translate](https://translate.hestiacp.com/projects/hestiacp/) to review the translations database. For more information please read [How to contribute with Translations](https://forum.hestiacp.com/t/how-to-contribute-with-translations/1664) on our forum.  You can also open an issue report [GitHub](https://www.github.com/hestiacp/hestiacp/issues) highlighting the issue with the current translation so that it can be corrected.
 - **Donations**:
@@ -25,7 +25,7 @@ Development for this project takes place in branches to effectively develop, man
 
 We have three primary or "evergreen" branches, which exist throughout our product's lifetime. Please refer to the following table for a description:
 
-| Branch        | Description     
+| Branch        | Description
 |---------------|:---------------:|
 | `main`        | Contains a snapshot of the latest development code.<br>**Not intended for production use and contains code from a merge snapshot.**
 | `beta`        | Contains a snapshot of the next version which is currently in testing.<br>**Not intended for production use, however code from this branch should be stable.**
@@ -48,7 +48,7 @@ Branch name examples:
 * `test/mail-domain-ssl`
 
 ### Squashing commits for smaller changes
-To aid other developers and keep the project's commit history clean, please **squash your commits** when it's appropriate. For example with smaller commits related to the same piece of code, such as commits labelled "Fixed item 1", "Adjusted color of button XYZ", "Adjusted alignment of button XYZ" can be squashed into one commit with the title "Fixed button issues in item". 
+To aid other developers and keep the project's commit history clean, please **squash your commits** when it's appropriate. For example with smaller commits related to the same piece of code, such as commits labelled "Fixed item 1", "Adjusted color of button XYZ", "Adjusted alignment of button XYZ" can be squashed into one commit with the title "Fixed button issues in item".
 
 ### What happens when I submit a pull request?
 - Our internal development team will review your work and validate your request.

+ 1 - 1
SECURITY.md

@@ -11,7 +11,7 @@ If you are unable to use [Huntr.dev](https://huntr.dev/bounties/disclose/?target
 
 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. 
+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 ;)
 

+ 14 - 14
bin/v-add-backup-host

@@ -5,7 +5,7 @@
 # example: v-add-backup-host sftp backup.acme.com admin p4$$w@Rd
 #          v-add-backup-host b2 bucketName keyID applicationKey
 #
-# Add a new remote backup location. Currently SFTP, FTP and Backblaze are supported 
+# Add a new remote backup location. Currently SFTP, FTP and Backblaze are supported
 
 #----------------------------------------------------------#
 #                Variables & Functions                     #
@@ -50,7 +50,7 @@ EOF
 
 # Defining sftp command function
 sftpc() {
-    if [ "$privatekey" != "yes" ]; then 
+    if [ "$privatekey" != "yes" ]; then
     expect -f "-" <<EOF "$@"
         set count 0
         spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o Port=$port $user@$host
@@ -109,19 +109,19 @@ else
             set count 0
             spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o Port=$port -i $raw_password $user@$host
             expect {
-    
+
                 -re "Couldn't|(.*)disconnect|(.*)stalled|(.*)not found" {
                     set count \$argc
                     set output "Disconnected."
                     set rc $E_FTP
                     exp_continue
                 }
-    
+
                 -re ".*denied.*(publickey|password)." {
                     set output "Permission denied, wrong publickey or password."
                     set rc $E_CONNECT
                 }
-    
+
                 "sftp>" {
                     if {\$count < \$argc} {
                         set arg [lindex \$argv \$count]
@@ -136,17 +136,17 @@ else
                     }
                     exp_continue
                 }
-    
+
                 timeout {
                     set output "Connection timeout."
                     set rc $E_CONNECT
                 }
             }
-    
+
             if {[info exists output] == 1} {
                 puts "\$output"
             }
-    
+
             exit \$rc
 EOF
     fi
@@ -167,13 +167,13 @@ if [ "$type" != 'local' ];then
             privatekey="yes"
             password="$raw_password"
         else
-            is_password_valid    
-        fi   
+            is_password_valid
+        fi
     else
         is_password_valid
     fi
     format_no_quotes "$password" "password"
-    
+
     if [ "$type" = 'sftp' ]; then
         which expect >/dev/null 2>&1
         check_result $? "expect command not found"  "$E_NOTEXIST"
@@ -273,11 +273,11 @@ if [ "$type" = 'b2' ]; then
         echo "Error: Binary download failed, b2 doesnt work as expected."
         exit 3
     fi
-    
+
     b2 clear-account > /dev/null 2>&1
     b2 authorize-account "$user" "$raw_password"> /dev/null 2>&1
     b2 ls --long "$host" "$user" > /dev/null 2>&1
-    
+
     if [ $? -ne 0 ]; then
         check_result "$E_CONNECT" "b2 failed to verify connection"
     fi
@@ -286,7 +286,7 @@ fi
 if [ "$type" = 'rclone' ]; then
     curl -s https://rclone.org/install.sh | bash /dev/null > /dev/null 2>&1
     # Verify account exists
-    if [ ! -z "$(cat /root/.config/rclone/rclone.conf | grep "\[$host\]")" ]; then 
+    if [ ! -z "$(cat /root/.config/rclone/rclone.conf | grep "\[$host\]")" ]; then
         echo "test" > /tmp/hestia-backup.txt
         # Try to upload a single file
         if [ -z "$path" ]; then

+ 2 - 2
bin/v-add-database

@@ -38,7 +38,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 if [ "$type" = "pgsql" ]; then
    database=$(echo "$user"_"$2" | tr '[:upper:]' '[:lower:]');
-   dbuser=$(echo "$user"_"$3" | tr '[:upper:]' '[:lower:]'); 
+   dbuser=$(echo "$user"_"$3" | tr '[:upper:]' '[:lower:]');
 fi
 
 #----------------------------------------------------------#
@@ -60,7 +60,7 @@ is_object_unsuspended "../../../conf/$type" 'DBHOST' "$host"
 is_package_full 'DATABASES'
 is_password_valid
 
-if [ "$type" = "pgsql" ]; then 
+if [ "$type" = "pgsql" ]; then
    exclude="-"
     if [[ "$dbuser" =~ $exclude ]]; then
         check_result "$E_INVALID" "invalid database user format"

+ 2 - 2
bin/v-add-database-host

@@ -41,11 +41,11 @@ is_mysql_host_alive() {
     echo "user='$dbuser'" >> $mycnf
     echo "password='$password'" >> $mycnf
     echo "port='$port'" >> $mycnf
-    
+
     chmod 600 $mycnf
     mysql --defaults-file=$mycnf -e 'SELECT VERSION()' >/dev/null 2>&1
     rm $mycnf
-    
+
     if [ "$?" -ne '0' ]; then
         echo "Error: MySQL connection to $host failed"
         log_event "$E_CONNECT" "$ARGUMENTS"

+ 3 - 3
bin/v-add-database-temp-user

@@ -4,8 +4,8 @@
 #
 # example: v-add-database-temp-user wordress wordpress_db mysql
 #
-# This function creates an temporary database user mysql_sso_db_XXXXXXXX and a random password 
-# The user has an limited validity and only granted access to the specific database 
+# This function creates an temporary database user mysql_sso_db_XXXXXXXX and a random password
+# The user has an limited validity and only granted access to the specific database
 # Returns json to be read SSO Script
 
 #----------------------------------------------------------#
@@ -57,7 +57,7 @@ check_hestia_demo_mode
 # Get database values
 get_database_values
 
-#generate password and unique user 
+#generate password and unique user
 dbpass=$(generate_password);
 dbuser="hestia_sso_$(generate_password)";
 

+ 2 - 2
bin/v-add-dns-domain

@@ -65,11 +65,11 @@ else
     is_domain_new 'dns' "$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
 
-if [ -n "$restart" ]; then 
+if [ -n "$restart" ]; then
     is_format_valid 'restart'
 fi
 

+ 2 - 2
bin/v-add-dns-record

@@ -66,12 +66,12 @@ fi
 # - [SRV] will be  stripped of double quotes even when  containing spaces
 # - [DNSKEY] will be  stripped of double quotes even when  containing spaces
 # - Rest of record types will be striped of quotes and the final string
-#   will be enclosed in double quotes if containing spaces or semicolons 
+#   will be enclosed in double quotes if containing spaces or semicolons
 
 if [ "$rtype" != "CAA" ]; then
     dvalue=${dvalue//\"/}
     # Add support for DS key
-    if [ "$rtype" != "DNSKEY" ] && [ "$rtype" != "DS" ] ; then 
+    if [ "$rtype" != "DNSKEY" ] && [ "$rtype" != "DS" ] ; then
         if [ "$rtype" != 'SRV' ] && [[ "$dvalue" =~ [\;[:space:]] ]]; then
             dvalue='"'"$dvalue"'"'
         fi

+ 2 - 2
bin/v-add-fastcgi-cache

@@ -80,8 +80,8 @@ EOF
 chown root:$user $fastcgi
 chmod 640 $fastcgi
 
-str="fastcgi_cache_path /var/cache/nginx/micro/$domain levels=1:2" 
-str="$str keys_zone=$domain:10m max_size=512m inactive=30m use_temp_path=off;" 
+str="fastcgi_cache_path /var/cache/nginx/micro/$domain levels=1:2"
+str="$str keys_zone=$domain:10m max_size=512m inactive=30m use_temp_path=off;"
 conf='/etc/nginx/conf.d/fastcgi_cache_pool.conf'
 if [ -f "$conf" ]; then
     if [ -z "$(grep "=${domain}:" $conf)" ]; then

+ 1 - 1
bin/v-add-firewall-chain

@@ -61,7 +61,7 @@ case $chain in
                 if [ -z "$sshport" ]; then
                     sshport=22
                 fi
-                port=$sshport; 
+                port=$sshport;
                 protocol=TCP ;;
     FTP)        port=21; protocol=TCP  ;;
     MAIL)       port='25,465,587,110,995,143,993'; protocol=TCP  ;;

+ 3 - 3
bin/v-add-firewall-ipset

@@ -57,7 +57,7 @@ fi
 
 # Ensure ipset configuration path and master file exist before attempting to parse
 mkdir -p "$IPSET_PATH"
-if [ ! -f "$HESTIA/data/firewall/ipset.conf" ]; then 
+if [ ! -f "$HESTIA/data/firewall/ipset.conf" ]; then
     touch $HESTIA/data/firewall/ipset.conf
 fi
 
@@ -98,8 +98,8 @@ if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
         check_result $? "Downloading ip list"
 
         # Advanced: execute script with the same basename for aditional pre-processing
-        # ex: 
-        if [ -x "${IPSET_PATH}/${IPSET_FILE}.sh" ]; then 
+        # ex:
+        if [ -x "${IPSET_PATH}/${IPSET_FILE}.sh" ]; then
             preprocess_output="$(cat "$iplist_tempfile" | setpriv --clear-groups --reuid nobody --regid nogroup -- ${IPSET_PATH}/${IPSET_FILE}.sh "$ip_name" "$iplist_tempfile")"
             check_result $? "Preprocessing script failed (${IPSET_FILE}.sh)"
             [[ "$preprocess_output" ]] && echo "$preprocess_output" > "$iplist_tempfile"

+ 1 - 1
bin/v-add-fs-file

@@ -46,7 +46,7 @@ fi
 
 # Creating file
 user_exec touch "$dst_file" >/dev/null 2>&1
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     echo "Error: file $dst_file was not created"
     exit 3
 fi

+ 20 - 20
bin/v-add-letsencrypt-domain

@@ -78,7 +78,7 @@ fi
 # Set DNS CAA record retrieval commands
 if [ -n "$DNS_SYSTEM" ]; then
     dns_domain=$($BIN/v-list-dns-domains "$user" | grep "$domain" | cut -d' ' -f1)
-    caa_record=$($BIN/v-list-dns-records "$user" "$domain" | grep -i "CAA" | grep -i "letsencrypt.org" | cut -d' ' -f1 )    
+    caa_record=$($BIN/v-list-dns-records "$user" "$domain" | grep -i "CAA" | grep -i "letsencrypt.org" | cut -d' ' -f1 )
 fi
 
 if [ -z "$mail" ] || [ "$mail" = 'no' ]; then
@@ -126,13 +126,13 @@ if [ -n "$mail" ]; then
     fi
 else
     parse_object_kv_list $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
-    
+
     domain_redirect="$REDIRECT"
     if [[ -n "$domain_redirect"  ]] ; then
         domain_redirect_code="$REDIRECT_CODE"
         $BIN/v-delete-web-domain-redirect $user $domain
     fi
-    
+
     domain_forcessl="$SSL_FORCE"
     if [[ "$domain_forcessl" == 'yes' ]] ; then
         $BIN/v-delete-web-domain-ssl-force $user $domain
@@ -346,9 +346,9 @@ for auth in $authz; do
                     $BIN/v-restart-proxy
                     check_result $? "Proxy restart failed" > /dev/null
                 fi
-            else  
-                get_object_value 'mail' 'DOMAIN' "$root_domain" "WEBMAIL" 
-                if [ -n "$WEBMAIL" ]; then 
+            else
+                get_object_value 'mail' 'DOMAIN' "$root_domain" "WEBMAIL"
+                if [ -n "$WEBMAIL" ]; then
                     well_known="/var/lib/$WEBMAIL/.well-known"
                     acme_challenge="$well_known/acme-challenge"
                     mkdir -p $acme_challenge
@@ -362,11 +362,11 @@ for auth in $authz; do
             check_result $? "Web restart failed" > /dev/null
         fi
     fi
-    
-    if [ "$DNS_CLUSTER" = "yes" ]; then 
+
+    if [ "$DNS_CLUSTER" = "yes" ]; then
         $BIN/v-update-sys-queue dns-cluster
-    fi 
-    
+    fi
+
     # Requesting ACME validation / STEP 5
     validation_check=$(echo "$answer" |grep '"valid"')
     if [[ -n "$validation_check" ]]; then
@@ -404,9 +404,9 @@ for auth in $authz; do
             result=$(wget -qO- $url)
             debug_log "Debug information Step 5"  "$result"
             details=$(echo $result | jq '.error.detail' )
-            error_code=$(echo $result | jq '.error.status' )            
-            
-            debug_log "Abort Step 5" "=> Wrong status" 
+            error_code=$(echo $result | jq '.error.status' )
+
+            debug_log "Abort Step 5" "=> Wrong status"
             check_result "$E_CONNECT" "Let's Encrypt validation status $status ($domain). Details: $error_code:$details"
         fi
 
@@ -528,18 +528,18 @@ fi
 if [ -z "$mail" ]; then
     ssl_home="$(get_object_value 'web' 'DOMAIN' "$domain" '$SSL_HOME')"
     ssl_enabled="$(get_object_value 'web' 'DOMAIN' "$domain" '$SSL')"
-    if [ "$ssl_enabled" = "yes" ]; then 
-        $BIN/v-update-web-domain-ssl "$user" "$domain" "$ssl_dir" "updatessl" 
+    if [ "$ssl_enabled" = "yes" ]; then
+        $BIN/v-update-web-domain-ssl "$user" "$domain" "$ssl_dir" "updatessl"
     else
-        $BIN/v-add-web-domain-ssl "$user" "$domain" "$ssl_dir" "$ssl_home" "updatessl" 
+        $BIN/v-add-web-domain-ssl "$user" "$domain" "$ssl_dir" "$ssl_home" "updatessl"
     fi
  else
  # TODO replace with v-update-mail-domain-ssl if ssl is enabled
     ssl_enabled="$(get_object_value 'mail' 'DOMAIN' "$root_domain" '$SSL')"
-    if [ "$ssl_enabled" = "yes" ]; then 
-        $BIN/v-update-mail-domain-ssl "$user" "$root_domain" "$ssl_dir" "updatessl" 
+    if [ "$ssl_enabled" = "yes" ]; then
+        $BIN/v-update-mail-domain-ssl "$user" "$root_domain" "$ssl_dir" "updatessl"
     else
-        $BIN/v-add-mail-domain-ssl "$user" "$root_domain" "$ssl_dir" "updatessl" 
+        $BIN/v-add-mail-domain-ssl "$user" "$root_domain" "$ssl_dir" "updatessl"
     fi
 fi
 
@@ -567,7 +567,7 @@ if [ -z "$mail" ]; then
     fi
     update_object_value 'web' 'DOMAIN' "$domain" '$LETSENCRYPT' 'yes'
     update_object_value 'web' 'DOMAIN' "$domain" '$LETSENCRYPT_FAIL_COUNT' "0"
-    
+
     if [[ "$domain_forcessl" == 'yes' ]] ; then
         $BIN/v-add-web-domain-ssl-force $user $domain
     fi

+ 1 - 1
bin/v-add-letsencrypt-host

@@ -26,7 +26,7 @@ check_hestia_demo_mode
 
 # Argument definition
 domain=$(hostname -f);
-if [ -z $domain ]; then 
+if [ -z $domain ]; then
     domain=$HOSTNAME;
 fi
 user="$($HESTIA/bin/v-search-domain-owner "$domain" web)"

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

@@ -3,7 +3,7 @@
 # options: USER DOMAIN SSL_DIR [RESTART]
 #
 # This function turns on SSL support for a mail domain. Parameter ssl_dir
-# is a path to a directory where 2 or 3 ssl files can be found. Certificate file 
+# is a path to a directory where 2 or 3 ssl files can be found. Certificate file
 # mail.domain.tld.crt and its key mail.domain.tld.key are mandatory. Certificate
 # authority mail.domain.tld.ca file is optional.
 
@@ -63,7 +63,7 @@ is_web_domain_cert_valid
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-if [ -n "$restart" ]; then 
+if [ -n "$restart" ]; then
     is_format_valid "$restart"
 fi
 #----------------------------------------------------------#

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

@@ -19,7 +19,7 @@ webmail=$3
 restart="$4"
 quiet=$5
 
-if [ -z "$restart" ]; then 
+if [ -z "$restart" ]; then
     restart="yes"
 fi
 
@@ -121,7 +121,7 @@ else
             fi
         fi
     fi
-    
+
     if [ "$webmail" == "roundcube" ]; then
         WEBMAIL_TEMPLATE="default"
         if [ -n "$PROXY_SYSTEM" ]; then
@@ -143,7 +143,7 @@ else
             PROXY_TEMPLATE="default_disabled"
         fi
     fi
-    
+
     add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.tpl"
 
     if [ -n "$PROXY_SYSTEM" ]; then
@@ -172,7 +172,7 @@ update_object_value 'mail' 'DOMAIN' "$domain" '$WEBMAIL' "$webmail"
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-if [ "$restart" = 'yes' ]; then 
+if [ "$restart" = 'yes' ]; then
     # Restarting web server
     $BIN/v-restart-web "$restart"
     check_result $? "Web restart failed" >/dev/null

+ 2 - 2
bin/v-add-remote-dns-host

@@ -3,7 +3,7 @@
 # options: HOST PORT USER PASSWORD [TYPE] [DNS_USER]
 #
 # example: v-add-remote-dns-host slave.your_host.com 8083 admin your_passw0rd
-# 
+#
 # example: v-add-remote-dns-host slave.your_host.com 8083 api_key ''
 #
 # This function adds remote dns server to the dns cluster.
@@ -85,7 +85,7 @@ else
     str="HOST='$host' PORT='$port' USER='$user' PASSWORD='$password'"
     str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'"
     str="$str TIME='$time' DATE='$date'"
-fi    
+fi
 
 # Adding host to dns-cluster.conf
 echo "$str" >> $HESTIA/conf/dns-cluster.conf

+ 1 - 1
bin/v-add-sys-api-ip

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: add IP address to API allow list
-# options: IP 
+# options: IP
 #
 # example: v-add-sys-api-ip 1.1.1.1
 

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

@@ -1,5 +1,5 @@
 #!/bin/bash
-# Add php dependencies to Hestia 
+# Add php dependencies to Hestia
 # options: [MODE]
 #
 # This function install PHPMailer and quoteshellarg as via composer
@@ -66,7 +66,7 @@ mkdir -p ${PM_INSTALL_DIR}/vendor
 chown $user: -R ${PM_INSTALL_DIR}/vendor
 
 openssl_installed=$(/usr/local/hestia/php/bin/php -m | grep openssl);
-if [ -z "$openssl_installed"  ]; then 
+if [ -z "$openssl_installed"  ]; then
     COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php $COMPOSER_BIN --quiet --no-dev install
 else
     COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install

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

@@ -8,7 +8,7 @@
 # can specify ip name which will be used as root domain for temporary aliases.
 # For example, if you set a1.myhosting.com as name, each new domain created on
 # this ip will automatically receive alias $domain.a1.myhosting.com. Of course
-# you must have wildcard record *.a1.myhosting.com pointed to ip. This feature 
+# you must have wildcard record *.a1.myhosting.com pointed to ip. This feature
 # is very handy when customer wants to test domain before dns migration.
 
 #----------------------------------------------------------#
@@ -73,10 +73,10 @@ if [ -z "$sys_ip_check" ]; then
     # Adding sys ip
     /sbin/ip addr add $ip/$cidr dev $iface \
         broadcast $broadcast label $iface
-    
+
     # Check if netplan is in use and generate configuration file
-    if [ ! -z $(which netplan) ]; then 
-        if  [ ! -z "$(netplan generate --mapping "$iface" | grep networkd)" ]; then   
+    if [ ! -z $(which netplan) ]; then
+        if  [ ! -z "$(netplan generate --mapping "$iface" | grep networkd)" ]; then
             netplan=1
         else
             netplan=0
@@ -84,7 +84,7 @@ if [ -z "$sys_ip_check" ]; then
     else
         netplan=0
     fi
-    
+
     if [ "$netplan" == "1" ]; then
         if [ -f "/etc/netplan/60-hestia.yaml" ]; then
             sys_ip="        - $ip/$cidr"

+ 15 - 15
bin/v-add-sys-pma-sso

@@ -1,5 +1,5 @@
 #!/bin/bash
-# info: enables support for single sign on phpMyAdmin 
+# info: enables support for single sign on phpMyAdmin
 # options: [mode]
 #
 # example: v-add-sys-pma-sso
@@ -41,17 +41,17 @@ if [ -n "$PHPMYADMIN_KEY" ] && [ "$PHPMYADMIN_KEY" != "" ] ; then
     exit 1;
 fi
 
-if [ -f "/usr/share/phpmyadmin/hestia-sso.php" ]; then 
+if [ -f "/usr/share/phpmyadmin/hestia-sso.php" ]; then
     echo "Error: hestia-sso.php is already installed"
     exit 2
 fi
 
-if [ -f "/usr/local/hesta/web/api/index.php" ]; then 
+if [ -f "/usr/local/hesta/web/api/index.php" ]; then
     echo "Error: API script not installed"
     exit 2
 fi
 
-if [ "API_SYSTEM" = "0" ]; then 
+if [ "API_SYSTEM" = "0" ]; then
     echo "Error: API is not enabled"
     exit 2
 fi
@@ -66,15 +66,15 @@ apikey=$($BIN/v-add-access-key 'admin' 'phpmyadmin-sso' 'phpMyAdmin' 'plain');
 
 # copy config dir to /usr/share/phpmyadmin/
 cp -f $HESTIA_INSTALL_DIR/phpmyadmin/hestia-sso.php $PMA_INSTALL/hestia-sso.php
-chmod 640 $PMA_INSTALL/hestia-sso.php 
-chown root:www-data $PMA_INSTALL/hestia-sso.php 
+chmod 640 $PMA_INSTALL/hestia-sso.php
+chown root:www-data $PMA_INSTALL/hestia-sso.php
 
-sed -i "s/%PHPMYADMIN_KEY%/$phpmyadminkey/g" $PMA_INSTALL/hestia-sso.php 
-sed -i "s/%API_KEY%/$apikey/g" $PMA_INSTALL/hestia-sso.php 
-sed -i "s/%API_HOST_NAME%/$(hostname)/g" $PMA_INSTALL/hestia-sso.php 
-sed -i "s/%API_HESTIA_PORT%/$BACKEND_PORT/g" $PMA_INSTALL/hestia-sso.php 
+sed -i "s/%PHPMYADMIN_KEY%/$phpmyadminkey/g" $PMA_INSTALL/hestia-sso.php
+sed -i "s/%API_KEY%/$apikey/g" $PMA_INSTALL/hestia-sso.php
+sed -i "s/%API_HOST_NAME%/$(hostname)/g" $PMA_INSTALL/hestia-sso.php
+sed -i "s/%API_HESTIA_PORT%/$BACKEND_PORT/g" $PMA_INSTALL/hestia-sso.php
 
-# Check if config already contains the keys 
+# Check if config already contains the keys
 touch $PMA_CONFIG/hestia-sso.inc.php
 chmod 640 $PMA_CONFIG/hestia-sso.inc.php
 chown root:www-data $PMA_CONFIG/hestia-sso.inc.php
@@ -89,17 +89,17 @@ if(isset(\$_GET['hestia_token']) || isset(\$_COOKIE['SignonSession'])){
 ?>" >> $PMA_CONFIG/hestia-sso.inc.php
 
 file=$(cat $PMA_CONFIG/config.inc.php)
-if ! [[  "$file" =~ hestia-sso.inc.php ]]; then 
-    if [[ $file =~ "//Add Hestia SSO code here" ]]; then 
+if ! [[  "$file" =~ hestia-sso.inc.php ]]; then
+    if [[ $file =~ "//Add Hestia SSO code here" ]]; then
         sed -i "s|//Add Hestia SSO code here|//Add Hestia SSO code here\n     include ('$PMA_CONFIG/hestia-sso.inc.php');|g" $PMA_CONFIG/config.inc.php
     else
-        echo "include ('$PMA_CONFIG/hestia-sso.inc.php');" >> $PMA_CONFIG/config.inc.php    
+        echo "include ('$PMA_CONFIG/hestia-sso.inc.php');" >> $PMA_CONFIG/config.inc.php
     fi
 fi
 
 $BIN/v-change-sys-config-value 'PHPMYADMIN_KEY' "$phpmyadminkey"
 
-if [  -z "$(echo $API_ALLOWED_IP | grep 127.0.0.1)"  ]; then 
+if [  -z "$(echo $API_ALLOWED_IP | grep 127.0.0.1)"  ]; then
     $BIN/v-add-sys-api-ip "127.0.0.1"
 fi
 

+ 1 - 1
bin/v-add-sys-quota

@@ -24,7 +24,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 # Ensure that quota kernel modules are installed
 kernel_module_check=$(find /lib/modules/`uname -r` -type f -name '*quota_v*.ko*' | egrep '.*' && [ $? -eq 0 ])
 if [ -z "$kernel_module_check" ]; then
-    # Install kernel modules for quota support. 
+    # Install kernel modules for quota support.
     # Requires reboot to activate updated kernel.
     echo "Installing required kernel modules for quota support..."
     reboot_req="Y"

+ 18 - 18
bin/v-add-sys-rainloop

@@ -54,13 +54,13 @@ if [ -z "$HOMEDIR" ] || [ -z "$HESTIA_INSTALL_DIR" ]; then
     exit 2
 fi
 
-# Get current version 
+# Get current version
 if [ -f "/var/lib/rainloop/data/VERSION" ]; then
     version=$(cat $RL_INSTALL_DIR/data/VERSION);
     if [ "$version" == "$rl_v" ]; then
         echo "Error: Installed version ($version) is equal to the available version ($rl_v)"
         exit 2;
-    else 
+    else
         UPDATE="yes"
     fi
 fi
@@ -78,12 +78,12 @@ if [ "$UPDATE" == "no" ]; then
 
     mkdir $RL_INSTALL_DIR
     mkdir $RL_CONFIG_DIR
-    
+
     cd "$RL_INSTALL_DIR"
     [ ! -f "${RC_INSTALL_DIR}/${RC_FILE}" ] && wget "$RL_URL" --retry-connrefused --quiet -O "${RL_INSTALL_DIR}/${RL_FILE}"
-    
+
     key=$(openssl rand -hex 4);
-    
+
     admin_account="admin_$key"
     admin_password=$(generate_password)
     r=$(generate_password)
@@ -91,9 +91,9 @@ if [ "$UPDATE" == "no" ]; then
     echo "Username: admin_$key" > ~/.rainloop
     echo "Password: $admin_password" >> ~/.rainloop
     echo "Secret key: admin_$key" >> ~/.rainloop
-    
+
     unzip -q ${RL_INSTALL_DIR}/${RL_FILE}
-    
+
     mv ./data $RL_CONFIG_DIR/
     ln -s $RL_CONFIG_DIR/data/ ./data
 
@@ -122,22 +122,22 @@ if [ "$UPDATE" == "no" ]; then
     wget --quiet -O $RL_CONFIG_DIR/data/_data_/_default_/plugins/add-x-originating-ip-header/VERSION https://raw.githubusercontent.com/RainLoop/rainloop-webmail/master/plugins/add-x-originating-ip-header/VERSION
     wget --quiet -O $RL_CONFIG_DIR/data/_data_/_default_/plugins/add-x-originating-ip-header/README https://raw.githubusercontent.com/RainLoop/rainloop-webmail/master/plugins/add-x-originating-ip-header/README
     wget --quiet -O $RL_CONFIG_DIR/data/_data_/_default_/plugins/add-x-originating-ip-header/LICENSE https://raw.githubusercontent.com/RainLoop/rainloop-webmail/master/plugins/add-x-originating-ip-header/LICENSE
-    
+
     cp -f $HESTIA_INSTALL_DIR/rainloop/plugins/plugin-add-x-originating-ip-header.ini $RL_CONFIG_DIR/data/_data_/_default_/configs/plugin-add-x-originating-ip-header.ini
     cp -f $HESTIA_INSTALL_DIR/rainloop/plugins/plugin-hestia-change-password.ini $RL_CONFIG_DIR/data/_data_/_default_/configs/plugin-hestia-change-password.ini
-    
+
     sed -i "s/%hostname%/$(hostname)/g" $RL_CONFIG_DIR/data/_data_/_default_/configs/plugin-hestia-change-password.ini
     sed -i "s/%port%/$BACKEND_PORT/g" $RL_CONFIG_DIR/data/_data_/_default_/configs/plugin-hestia-change-password.ini
-    
-    
+
+
     chown -R  www-data:www-data ./data
     chown -R  www-data:www-data $RL_CONFIG_DIR/
-    
-    rm  ${RL_INSTALL_DIR}/${RL_FILE}  
+
+    rm  ${RL_INSTALL_DIR}/${RL_FILE}
     # Add robots.txt
     echo "User-agent: *" > $RL_INSTALL_DIR/robots.txt
     echo "Disallow: /" >> $RL_INSTALL_DIR/robots.txt
-    
+
     # Updating hestia.conf
     if [ -z "$(grep WEBMAIL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
         $BIN/v-change-sys-config-value 'WEBMAIL_SYSTEM' 'rainloop'
@@ -154,12 +154,12 @@ if [ "$UPDATE" == "no" ]; then
 else
    [ ! -f "${RC_INSTALL_DIR}/${RC_FILE}" ] && wget "$RL_URL" --quiet -O "${RL_INSTALL_DIR}/${RL_FILE}"
    version=$(cat $RL_INSTALL_DIR/data/VERSION);
-   
-   unzip -q -j rainloop-latest.zip "data/VERSION" -d $RL_INSTALL_DIR/ 
+
+   unzip -q -j rainloop-latest.zip "data/VERSION" -d $RL_INSTALL_DIR/
    version_source=$(cat $RL_INSTALL_DIR/VERSION);
-   
+
    # Check version inside .zip file in case hestia didn't update yet
-   if [ "$version" != "$version_source" ]; then 
+   if [ "$version" != "$version_source" ]; then
        unzip -q ${RL_INSTALL_DIR}/${RL_FILE}
        rm $RL_INSTALL_DIR/$RL_FILE
     fi

+ 24 - 24
bin/v-add-sys-roundcube

@@ -61,13 +61,13 @@ if [ -d "/usr/share/roundcube" ]; then
     exit 2;
 fi
 
-# Get current version 
+# Get current version
 if [ -f "/var/lib/roundcube/index.php" ]; then
     version=$(cat $RC_INSTALL_DIR/index.php | grep -o -E '[0-9].[0-9].[0-9]+' | head -1);
     if [ "$version" == "$rc_v" ]; then
         echo "Error: Installed version ($version) is equal to the available version ($rc_v)"
         exit 2;
-    else 
+    else
         UPDATE="yes"
     fi
 fi
@@ -82,16 +82,16 @@ check_hestia_demo_mode
 if [ "$UPDATE" == "no" ]; then
     rm  -f -r $RC_INSTALL_DIR
     rm  -f -r $RC_CONFIG_DIR
-    
+
     mkdir -p $RC_INSTALL_DIR/
     mkdir -p $RC_CONFIG_DIR/
-    
+
     cd "$RC_INSTALL_DIR"
     [ ! -f "${RC_INSTALL_DIR}/${RC_FILE}" ] && wget "$RC_URL" --retry-connrefused --quiet -O "${RC_INSTALL_DIR}/${RC_FILE}"
-    
+
     tar xzf $RC_FILE
     cp -rT $RC_EXTRACT $RC_INSTALL_DIR
-    
+
     # Delete old config folder
     cp $RC_INSTALL_DIR/config/defaults.inc.php $RC_CONFIG_DIR/defaults.inc.php
     rm -f -r $RC_INSTALL_DIR/config/
@@ -100,41 +100,41 @@ if [ "$UPDATE" == "no" ]; then
     cp -f $HESTIA_COMMON_DIR/roundcube/main.inc.php $RC_CONFIG_DIR/config.inc.php
     cp -f $HESTIA_COMMON_DIR/roundcube/mimetypes.php $RC_CONFIG_DIR/mimetypes.php
     chmod 644 $RC_CONFIG_DIR/*.php
-    
+
     cp -f $HESTIA_COMMON_DIR/roundcube/hestia.php $RC_INSTALL_DIR/plugins/password/drivers/
     mkdir -p $RC_CONFIG_DIR/plugins/password
     mkdir -p $RC_CONFIG_DIR/plugins/newmail_notifier
     mkdir -p $RC_CONFIG_DIR/plugins/zipdownload
-    
-    # Allow changes to the respective config / Create symlinks to /etc/roundcube/ 
+
+    # Allow changes to the respective config / Create symlinks to /etc/roundcube/
     cp -f $HESTIA_COMMON_DIR/roundcube/config.inc.php $RC_CONFIG_DIR/plugins/password/config.inc.php
     ln -s $RC_CONFIG_DIR/plugins/password/config.inc.php ./plugins/password/config.inc.php
     cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_newmail_notifier.inc.php $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php
     ln -s $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php ./plugins/newmail_notifier/config.inc.php
     cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_zipdownload.inc.php $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php
     ln -s $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php ./plugins/zipdownload/config.inc.php
-    
-    # Set up correct permissions roundcube    
+
+    # Set up correct permissions roundcube
     chown -R root:www-data $RC_CONFIG_DIR/
-    chmod 751 -R $RC_CONFIG_DIR    
+    chmod 751 -R $RC_CONFIG_DIR
     chmod 644 $RC_CONFIG_DIR/config.inc.php
     chmod 644 $RC_CONFIG_DIR/plugins/password/config.inc.php
     chmod 644 $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php
     chmod 644 $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php
-    
+
     # Add robots.txt
     echo "User-agent: *" > /var/lib/roundcube/robots.txt
     echo "Disallow: /" >> /var/lib/roundcube/robots.txt
-    
+
     chown -R root:www-data $RC_INSTALL_DIR
-  
-    # Log file 
+
+    # Log file
     if [ ! -d  $RC_LOG ];then
         mkdir $RC_LOG
     fi
     chown www-data:www-data $RC_LOG
     chmod 751 $RC_LOG
-    
+
     if [ ! -z "$(echo "$DB_SYSTEM" | grep -w 'mysql')" ]; then
         mysql -e "DROP DATABASE IF EXISTS roundcube"
         mysql -e "DROP USER IF EXISTS roundcube@localhost"
@@ -148,17 +148,17 @@ if [ "$UPDATE" == "no" ]; then
     fi
 
     # TODO: Add support for PostgreSQL
-    
+
     rcDesKey="$(openssl rand -base64 30 | tr -d "/" | cut -c1-24)"
     sed -i "s/%des_key%/$rcDesKey/g" $RC_CONFIG_DIR/config.inc.php
     # Update server hostname in password change plugin
     sed -i "s/localhost/$(hostname)/g" $RC_CONFIG_DIR/plugins/password/config.inc.php
-    
+
     # Clean up
     rm -f -r $RC_INSTALL_DIR/installer;
     rm -f -r $RC_INSTALL_DIR/$RC_FILE;
     rm -f -r $RC_INSTALL_DIR/$RC_EXTRACT;
-    
+
     # Updating hestia.conf
     if [ -z "$(grep WEBMAIL_SYSTEM $HESTIA/conf/hestia.conf)" ]; then
         $BIN/v-change-sys-config-value 'WEBMAIL_SYSTEM' 'roundcube'
@@ -171,20 +171,20 @@ if [ "$UPDATE" == "no" ]; then
            fi
         fi
     fi
-    
+
     phpenmod mcrypt > /dev/null 2>&1
 else
     cd "$RC_INSTALL_DIR"
     [ ! -f "${RC_INSTALL_DIR}/${RC_FILE}" ] && wget "$RC_URL" --quiet -O "${RC_INSTALL_DIR}/${RC_FILE}"
-    
+
     tar xzf $RC_FILE
-    
+
     # Run Roundcube upgrade script
     $RC_INSTALL_DIR/$RC_EXTRACT/bin/installto.sh -y $RC_INSTALL_DIR > /dev/null 2>&1
     $RC_INSTALL_DIR/bin/update.sh --version "$version" > /dev/null 2>&1
     $RC_INSTALL_DIR/bin/indexcontacts.sh > /dev/null 2>&1
     chown -R root:www-data $RC_INSTALL_DIR
-    
+
     #clean up the mess
     if [ -d "$RC_INSTALL_DIR/installer" ]; then
         rm -f -r $RC_INSTALL_DIR/installer

+ 1 - 1
bin/v-add-sys-smtp

@@ -45,7 +45,7 @@ check_hestia_demo_mode
 #----------------------------------------------------------#
 
 change_sys_value "USE_SERVER_SMTP" 'true'
-change_sys_value "SERVER_SMTP_HOST" "$domain" 
+change_sys_value "SERVER_SMTP_HOST" "$domain"
 change_sys_value "SERVER_SMTP_PORT" "$port"
 change_sys_value "SERVER_SMTP_SECURITY" "$smtp_security"
 change_sys_value "SERVER_SMTP_USER" "$username"

+ 6 - 6
bin/v-add-user

@@ -17,7 +17,7 @@ email=$3
 package=${4-default}
 name=$5
 # Last name has been added for backward compatibility with WHMCS / Blesta VestaCP Plugins
-if [ -n "$6" ]; then 
+if [ -n "$6" ]; then
     name="$name $6";
 fi
 # Includes
@@ -51,7 +51,7 @@ is_user_free() {
 check_args '3' "$#" 'USER PASSWORD EMAIL [PACKAGE] [NAME] '
 is_format_valid 'user' 'email' 'package'
 if [ -n "$name" ]; then
-    is_format_valid 'name' 
+    is_format_valid 'name'
 fi
 
 is_user_free "$user"
@@ -79,7 +79,7 @@ check_result $? "user creation failed" "$E_INVALID"
 # Adding password
 echo "$user:$password" | /usr/sbin/chpasswd
 
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     # Delete user on failure
     /usr/sbin/deluser "$user" > /dev/null 2>&1
     echo "Error: Password not accepted due to PAM restrictions"
@@ -105,14 +105,14 @@ mkdir $HOMEDIR/$user/conf
 
 if [ -n "$WEB_SYSTEM" ]; then
     mkdir $HOMEDIR/$user/conf/web $HOMEDIR/$user/web $HOMEDIR/$user/tmp
-    chmod 751 $HOMEDIR/$user/conf/web 
+    chmod 751 $HOMEDIR/$user/conf/web
     chmod 700 $HOMEDIR/$user/tmp
     chown $user:$user $HOMEDIR/$user/web $HOMEDIR/$user/tmp
 fi
 
 if [ -n "$MAIL_SYSTEM" ]; then
     mkdir $HOMEDIR/$user/conf/mail $HOMEDIR/$user/mail
-    chmod 751 $HOMEDIR/$user/mail 
+    chmod 751 $HOMEDIR/$user/mail
     chmod 755 $HOMEDIR/$user/conf/mail
 fi
 
@@ -125,7 +125,7 @@ if [ -n "$DNS_SYSTEM" ]; then
     mkdir $HOMEDIR/$user/conf/dns
     chmod 771 $HOMEDIR/$user/conf/dns
     chown root:$dns_group $HOMEDIR/$user/conf/dns
-fi 
+fi
 
 # Create default writeable folders
 mkdir $HOMEDIR/$user/.config \

+ 4 - 4
bin/v-add-user-package

@@ -49,7 +49,7 @@ is_package_consistent() {
     if [ "$CRON_JOBS" != 'unlimited' ]; then
         is_int_format_valid "$CRON_JOBS" 'CRON_JOBS'
     fi
-    
+
     is_int_format_valid "$RATE_LIMIT" 'RATE_LIMIT'
 
     if [ "$DISK_QUOTA" != 'unlimited' ]; then
@@ -82,7 +82,7 @@ is_package_consistent() {
             i=$((i+1))
         done
     fi
-    
+
     is_format_valid_shell "$SHELL"
 }
 
@@ -94,11 +94,11 @@ check_args '2' "$#" 'PKG_DIR PACKAGE' 'rewrite'
 is_format_valid 'package'
 if [ "$rewrite" != 'yes' ]; then
     is_package_new "$package"
-else 
+else
     is_package_valid "$package"
 fi
 
-if [ ! -f "$tmpfile" ]; then 
+if [ ! -f "$tmpfile" ]; then
     echo "$tmpfile does not exists"
     exit "$E_NOTEXIST";
 fi

+ 4 - 4
bin/v-add-user-sftp-jail

@@ -29,12 +29,12 @@ source_conf "$HESTIA/conf/hestia.conf"
 check_args '1' "$#" 'USER'
 is_format_valid 'user'
 check=$(is_object_valid 'user' 'USER' "$user")
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     user_str=$(grep "^$user:" /etc/passwd |egrep "rssh|nologin")
     #try to detect "owner" of the ftp_user if not found dont set it up
-    user_owner=$(echo $user_str | cut -f6 -d : | cut -f3 -d / ) 
+    user_owner=$(echo $user_str | cut -f6 -d : | cut -f3 -d / )
     is_object_valid 'user' 'USER' "$user_owner"
-fi 
+fi
 user_str=$(grep "^$user:" /etc/passwd |egrep "rssh|nologin")
 if [ -z "$user_str" ]; then
     exit
@@ -45,7 +45,7 @@ ssh_users=$(grep -A1 "^# Hestia SFTP Chroot" /etc/ssh/sshd_config | sed -n 2p |
 IFS=',' read -r -a users <<< "$ssh_users"
 
 # Check if jail exist
-match_string="$ssh_users," 
+match_string="$ssh_users,"
 if [[ "$match_string" =~ ,$user, ]]; then
     if [[ -d /home/$user && -z "$(find /home/$user -user root -print -prune -o -prune)" ]]; then
        chown root:root /home/$user

+ 1 - 1
bin/v-add-user-sftp-key

@@ -68,7 +68,7 @@ if [ ! -f "${AUTHKEY_FILE}" ] || [ "$new_privkey" = true ]; then
     echo "from=\"127.0.0.1\",command=\"internal-sftp\",restrict ${pubkey_str} TS:${expire} ${pubkey_desc}" >> "${AUTHKEY_FILE}"
 fi
 
-# 
+#
 chown ${user}: "${AUTHKEY_FILE}"
 chown admin: "${PRVKEY_FILE}"
 

+ 1 - 1
bin/v-add-user-wp-cli

@@ -54,7 +54,7 @@ fi
 mkdir -p "$WPCLI_DIR"
 chown $user:$user "$WPCLI_DIR"
 
-user_exec wget --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache --quiet -O "$WPCLI_BIN" https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar 
+user_exec wget --tries=3 --timeout=15 --read-timeout=15 --waitretry=3 --no-dns-cache --quiet -O "$WPCLI_BIN" https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
 user_exec chmod +x "$WPCLI_BIN"
 
 #----------------------------------------------------------#

+ 1 - 1
bin/v-add-web-domain-allow-users

@@ -4,7 +4,7 @@
 #
 # example: v-add-web-domain-allow-users admin admin.com
 #
-# Bypass the rule check for Enforce subdomain ownership for a specific domain. 
+# Bypass the rule check for Enforce subdomain ownership for a specific domain.
 # Enforce subdomain ownership setting in /edit/server/ set to no will always overwrite this behaviour
 # eg: admin adds admin.com
 # user can create user.admin.com

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

@@ -98,7 +98,7 @@ fi
 # Set ftp user password
 echo "$ftp_user:$password" | /usr/sbin/chpasswd
 
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     # Delete user on failure again
     /usr/sbin/deluser "$ftp_user"  > /dev/null 2>&1
     echo "Error: Password not accepted due to PAM restrictions"

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

@@ -2,14 +2,14 @@
 # info: Adding force redirect to domain
 # options: USER DOMAIN REDIRECT HTTPCODE [RESTART]
 #
-# example: v-add-web-domain-redirect user domain.tld domain.tld 
-# example: v-add-web-domain-redirect user domain.tld www.domain.tld 
-# example: v-add-web-domain-redirect user domain.tld shop.domain.tld  
+# example: v-add-web-domain-redirect user domain.tld domain.tld
+# example: v-add-web-domain-redirect user domain.tld www.domain.tld
+# example: v-add-web-domain-redirect user domain.tld shop.domain.tld
 # example: v-add-web-domain-redirect user domain.tld different-domain.com
 # example: v-add-web-domain-redirect user domain.tld shop.different-domain.com
 # example: v-add-web-domain-redirect user domain.tld different-domain.com 302
 #
-# Function creates a forced redirect to a domain 
+# Function creates a forced redirect to a domain
 
 #----------------------------------------------------------#
 #                Variables & Functions                     #
@@ -58,7 +58,7 @@ else
     if  [ -z "$isValidUrl" ]; then
         check_result $E_INVALID "Invalid redirect"
     fi
-fi 
+fi
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
@@ -75,7 +75,7 @@ fi
 # Insert redirect commands
 if [ -n "$PROXY_SYSTEM" ] || [ "$WEB_SYSTEM" = 'nginx' ]; then
     if [ "$scheme" = 1 ]; then
-        echo "   return $code $redirect\$request_uri;" > $conf        
+        echo "   return $code $redirect\$request_uri;" > $conf
         if [ ! -e "$sconf" ]; then
             ln -s "$conf" "$sconf"
         fi
@@ -83,13 +83,13 @@ if [ -n "$PROXY_SYSTEM" ] || [ "$WEB_SYSTEM" = 'nginx' ]; then
         echo "if (\$host != \"$redirect\") {" > $conf
         echo "   return $code \$scheme://$redirect\$request_uri;" >> $conf
         echo "}" >> $conf
-        
+
         if [ ! -e "$sconf" ]; then
             ln -s "$conf" "$sconf"
         fi
     fi
 else
-    echo "Non supported please use .htaccess instead" 
+    echo "Non supported please use .htaccess instead"
     exit 2;
 fi
 
@@ -111,7 +111,7 @@ if [ "$restart" = "yes" ]; then
     # Restarting web server
     $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

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

@@ -5,7 +5,7 @@
 # example: v-add-web-domain-ssl admin example.com /home/admin/conf/example.com/web
 #
 # This function turns on SSL support for a domain. Parameter ssl_dir is a path
-# to directory where 2 or 3 ssl files can be found. Certificate file 
+# to directory where 2 or 3 ssl files can be found. Certificate file
 # domain.tld.crt and its key domain.tld.key are mandatory. Certificate
 # authority domain.tld.ca file is optional. If home directory parameter
 # (ssl_home) is not set, https domain uses public_shtml as separate

+ 1 - 1
bin/v-add-web-domain-ssl-preset

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: Adding force SSL for a domain
-# options: USER DOMAIN [SSL] 
+# options: USER DOMAIN [SSL]
 #
 # example: v-add-web-domain-ssl-preset
 #

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

@@ -48,7 +48,7 @@ if [ -f "$php_fpm" ] && [ -f "$HESTIA/data/templates/web/php-fpm/PHP-${version/\
 fi
 
 # Check if php version is supported
-if  [[ ! "$multiphp_v" =~ "$version" ]]; then 
+if  [[ ! "$multiphp_v" =~ "$version" ]]; then
     echo "ERROR: Specified PHP version is not supported or does not exist."
     exit "$E_INVALID";
 fi
@@ -135,7 +135,7 @@ sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf
 cp -f $HESTIA_INSTALL_DIR/php-fpm/php-fpm.conf /etc/php/$version/fpm/
 sed -i "s/fpm_v/$version/g" /etc/php/$version/fpm/php-fpm.conf
 
-# Increase max upload and max post size 
+# Increase max upload and max post size
 sed -i "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/php/$version/fpm/php.ini
 sed -i "s/post_max_size = 8M/post_max_size = 100M/g" /etc/php/$version/fpm/php.ini
 sed -i "s/max_execution_time = 30/max_execution_time = 60/g" /etc/php/$version/fpm/php.ini

+ 1 - 1
bin/v-change-cron-job

@@ -34,7 +34,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 #----------------------------------------------------------#
 
 check_args '7' "$#" 'USER JOB MIN HOUR DAY MONTH WDAY COMMAND'
-is_format_valid 'user' 'job' 'min' 'hour' 'day' 'month' 'wday' 'command' 
+is_format_valid 'user' 'job' 'min' 'hour' 'day' 'month' 'wday' 'command'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"

+ 1 - 1
bin/v-change-dns-domain-dnssec

@@ -55,7 +55,7 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
-if [ -f "$HESTIA/data/queue/dns-cluster.pipe" ]; then 
+if [ -f "$HESTIA/data/queue/dns-cluster.pipe" ]; then
     bash $HESTIA/data/queue/dns-cluster.pipe
 fi
 

+ 1 - 1
bin/v-change-dns-record

@@ -107,7 +107,7 @@ if [ "$rtype" != "CAA" ]; then
 fi
 
 
-#RTYPE wasn't checked make sure to do it now correctly 
+#RTYPE wasn't checked make sure to do it now correctly
 is_format_valid 'user' 'domain' 'id' 'record' 'rtype' 'dvalue'
 
 # Additional verifications

+ 17 - 17
bin/v-change-domain-owner

@@ -56,8 +56,8 @@ if [ -n "$web_data" ]; then
     echo "[*] Moving web domain..."
     $BIN/v-suspend-web-domain "$owner" "$domain" >> /dev/null 2>&1
     parse_object_kv_list "$web_data"
-    
-    if [ -n "$CUSTOM_DOCROOT" ]; then 
+
+    if [ -n "$CUSTOM_DOCROOT" ]; then
         if [ -z $(echo $CUSTOM_DOCROOT | grep -i "/home/$owner/web/$domain") ]; then
             docdomain=$(echo "$CUSTOM_DOCROOT" | cut -d'/' -f5)
             $BIN/v-list-web-domain $user $docdomain > /dev/null
@@ -67,7 +67,7 @@ if [ -n "$web_data" ]; then
             fi
             new_docroot=$(echo $CUSTOM_DOCROOT | sed "s/\/home\/$owner/\/home\/$user/");
             new_php_docroot=$(echo $CUSTOM_PHPROOT | sed "s/\/home\/$owner/\/home\/$user/");
-            
+
         else
             new_docroot=$(echo $CUSTOM_DOCROOT | sed "s/\/home\/$owner/\/home\/$user/");
             new_php_docroot=$(echo $CUSTOM_PHPROOT | sed "s/\/home\/$owner/\/home\/$user/");
@@ -77,11 +77,11 @@ if [ -n "$web_data" ]; then
     if [ -z "$(echo $(get_user_ips) | grep $IP)" ]; then
         echo "[*] IP dedicated to $owner select new ip adress..."
         get_user_ip
-    fi 
+    fi
     old_ip=$IP;
-    new_ip=$ip; 
+    new_ip=$ip;
     echo $ip;
-    
+
     # Change IP
     if [ -n "$ip" ]; then
         web_data=$(echo "$web_data" | sed "s/IP='$IP'/IP='$ip'/")
@@ -91,7 +91,7 @@ if [ -n "$web_data" ]; then
         web_data=$(echo "$web_data" | sed "s|CUSTOM_PHPROOT='$CUSTOM_PHPROOT'|CUSTOM_PHPROOT='$new_php_docroot'|")
     fi
     web_data=$(echo "$web_data" | sed "s/SUSPENDED='no'/SUSPENDED='yes'/")
-    
+
     # Check SSL
     if [ "$SSL" = 'yes' ]; then
         ssl_crt=$HESTIA/data/users/$owner/ssl/$domain.crt
@@ -194,13 +194,13 @@ if [ -n "$mail_data" ]; then
         mv -f $HESTIA/data/users/$owner/mail/$domain.pub \
             $HESTIA/data/users/$user/mail/
     fi
-    
+
     # Move SSL certificates
     if [ "$SSL" = 'yes' ]; then
          # Ensure that SSL directory exists and move certificates
         mkdir -p $HESTIA/data/users/$user/ssl/
         mkdir -p $HOMEDIR/$user/conf/mail/$domain/ssl/
-        
+
         ssl_crt=$HESTIA/data/users/$owner/ssl/mail.$domain.crt
         ssl_key=$HESTIA/data/users/$owner/ssl/mail.$domain.key
         ssl_ca=$HESTIA/data/users/$owner/ssl/mail.$domain.ca
@@ -208,8 +208,8 @@ if [ -n "$mail_data" ]; then
         mv $ssl_crt $HESTIA/data/users/$user/ssl/
         mv $ssl_key $HESTIA/data/users/$user/ssl/
         mv $ssl_ca $HESTIA/data/users/$user/ssl/ >> /dev/null 2>&1
-        mv $ssl_pem $HESTIA/data/users/$user/ssl/ >> /dev/null 2>&1     
-        
+        mv $ssl_pem $HESTIA/data/users/$user/ssl/ >> /dev/null 2>&1
+
         # Add certificate to user home directory
         cp -f $HESTIA/data/users/$user/ssl/mail.$domain.crt $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.crt
         cp -f $HESTIA/data/users/$user/ssl/mail.$domain.key $HOMEDIR/$user/conf/mail/$domain/ssl/$domain.key
@@ -222,7 +222,7 @@ if [ -n "$mail_data" ]; then
         if [ -f "/etc/dovecot/conf.d/domains/$domain.conf" ]; then
             rm -f /etc/dovecot/conf.d/domains/$domain.conf
         fi
-        
+
         echo "" >> /etc/dovecot/conf.d/domains/$domain.conf
         echo "local_name mail.$domain {" >> /etc/dovecot/conf.d/domains/$domain.conf
         echo "  ssl_cert = <$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.pem" >> /etc/dovecot/conf.d/domains/$domain.conf
@@ -287,16 +287,16 @@ fi
 $BIN/v-update-user-counters "$owner"
 $BIN/v-update-user-counters "$user"
 
-# Mail domains currently don't have the IP variable set see #2306 
+# Mail domains currently don't have the IP variable set see #2306
 if [ -n "$old_ip" ]; then
-    # Recalculate ip usage 
+    # Recalculate ip usage
     if [ -n "$ip" ]; then
         decrease_ip_value $old_ip $owner
-        increase_ip_value $new_ip 
+        increase_ip_value $new_ip
     else
-        # recalculate ip 
+        # recalculate ip
         decrease_ip_value $old_ip $owner
-        increase_ip_value $old_ip 
+        increase_ip_value $old_ip
     fi
 fi
 # Send notification to panel

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

@@ -60,7 +60,7 @@ check_hestia_demo_mode
 
 md5=$(get_object_value "mail/$domain" 'ACCOUNT' "$account" '$MD5')
 if [[ "$MAIL_SYSTEM" =~ exim ]]; then
-    if [ "$rate" = "system" ]; then 
+    if [ "$rate" = "system" ]; then
         user_rate_limit=$(get_object_value 'mail' 'DOMAIN' "$domain" '$RATE_LIMIT');
         if [ -n "$user_rate_limit" ]; then
             sed -i "/^$account@$domain_idn:/ d" $HOMEDIR/$user/conf/mail/$domain/limits

+ 4 - 4
bin/v-change-remote-dns-domain-exp

@@ -43,10 +43,10 @@ check_hestia_demo_mode
 
 IFS=$'\n'
 for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
 
@@ -56,11 +56,11 @@ for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
         str=$(echo "$str" | sed "s/SLAVE='no'/SLAVE='yes'/g");
         ip=$($BIN/v-list-sys-ips plain | cut -f1);
         str=$(echo "$str" | sed "s/MASTER='*'/MASTER='$ip'/g");
-            
+
         # Syncing domain data
         cluster_cmd v-insert-dns-domain $DNS_USER "$str" $HOSTNAME $flush 'no'
         check_result $? "$HOST connection failed" "$E_CONNECT"
-        
+
         rndc notify $domain  > /dev/null 2>&1
     else
         cluster_cmd v-insert-dns-domain "$DNS_USER" "$str" "$HOSTNAME" 'no'

+ 7 - 7
bin/v-change-remote-dns-domain-soa

@@ -45,32 +45,32 @@ check_hestia_demo_mode
 
 IFS=$'\n'
 for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
-    
+
     if [ "$DNS_CLUSTER_SYSTEM" = "zone" ]; then
         str=$(echo "$str" | sed "s/SLAVE='no'/SLAVE='yes'/g");
         ip=$($BIN/v-list-sys-ips plain | cut -f1);
         str=$(echo "$str" | sed "s/MASTER='*'/MASTER='$ip'/g");
-            
+
         # Syncing domain data
         cluster_cmd v-insert-dns-domain $DNS_USER "$str" $HOSTNAME $flush 'no'
         check_result $? "$HOST connection failed" "$E_CONNECT"
-        
+
         cluster_cmd v-rebuild-dns-domain $DNS_USER $domain 'yes' 'no'
         check_result $? "$HOST connection failed" "$E_CONNECT"
-        
+
         rndc notify $domain  > /dev/null 2>&1
     else
         # Syncing SOA
         str=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf)
         cluster_cmd v-insert-dns-domain "$DNS_USER" "$str" "$HOSTNAME" 'domain' 'no'
         check_result $? "$HOST connection failed (sync)" "$E_CONNECT"
-    
+
         # Rebuilding dns zone
         cluster_cmd v-rebuild-dns-domain "$DNS_USER" "$domain" 'yes' 'no'
         check_result $? "$HOST connection failed (rebuild)" "$E_CONNECT"

+ 6 - 6
bin/v-change-remote-dns-domain-ttl

@@ -45,10 +45,10 @@ check_hestia_demo_mode
 
 IFS=$'\n'
 for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
 
@@ -58,19 +58,19 @@ for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
         str=$(echo "$str" | sed "s/SLAVE='no'/SLAVE='yes'/g");
         ip=$($BIN/v-list-sys-ips plain | cut -f1);
         str=$(echo "$str" | sed "s/MASTER='*'/MASTER='$ip'/g");
-            
+
         # Syncing domain data
         cluster_cmd v-insert-dns-domain $DNS_USER "$str" $HOSTNAME $flush 'no'
         check_result $? "$HOST connection failed" "$E_CONNECT"
-        
+
         cluster_cmd v-rebuild-dns-domain $DNS_USER $domain 'yes' 'no'
         check_result $? "$HOST connection failed" "$E_CONNECT"
-        
+
         rndc notify $domain  > /dev/null 2>&1
     else
         cluster_cmd v-insert-dns-domain "$DNS_USER" "$str" "$HOSTNAME" 'domain' 'no'
         check_result $? "$HOST connection failed (sync)" "$E_CONNECT"
-    
+
         # Rebuilding dns zone
         cluster_cmd v-rebuild-dns-domain "$DNS_USER" "$domain" 'yes' 'no'
         check_result $? "$HOST connection failed (rebuild)" "$E_CONNECT"

+ 3 - 3
bin/v-change-sys-api

@@ -1,6 +1,6 @@
 #!/bin/bash
-# info: Enable / Disable API access 
-# options: STATUS 
+# info: Enable / Disable API access
+# options: STATUS
 #
 # example: v-change-sys-api enable legacy
 #          # Enable legacy api currently default on most of api based systems
@@ -40,7 +40,7 @@ if [ "$status" = "enable" ]; then
     if [ ! -f "$HESTIA/web/api/index.php" ]; then
         wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/$RELEASE_BRANCH/web/api/index.php -O $HESTIA/web/api/index.php
         if [ ! -s "$HESTIA/web/api/index.php" ]; then
-            wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/api/index.php -O $HESTIA/web/api/index.php    
+            wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/api/index.php -O $HESTIA/web/api/index.php
             if [ ! -s "$HESTIA/web/api/index.php" ]; then
                 # Throw error message to user
                 echo "ERROR: API installation failed."

+ 5 - 5
bin/v-change-sys-db-alias

@@ -54,7 +54,7 @@ if [ "$type" = "pma" ] || [ "$type" = "PMA" ] || [ "$type" = "phpmyadmin" ]; the
         rm -f /etc/apache2/conf.d/phpmyadmin.inc
         cp -f $HESTIA_INSTALL_DIR/pma/apache.conf /etc/apache2/conf.d/phpmyadmin.inc
         sed -i "s|%pma_alias%|$alias|g" /etc/apache2/conf.d/phpmyadmin.inc
-        
+
         # Restart services
         $HESTIA/bin/v-restart-service apache2
     fi
@@ -63,7 +63,7 @@ if [ "$type" = "pma" ] || [ "$type" = "PMA" ] || [ "$type" = "phpmyadmin" ]; the
         rm -f /etc/nginx/conf.d/phpmyadmin.inc
         cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/phpmyadmin.inc
         sed -i "s|%pma_alias%|$alias|g" /etc/nginx/conf.d/phpmyadmin.inc
-        
+
         # Restart services
         $HESTIA/bin/v-restart-service nginx
     fi
@@ -81,8 +81,8 @@ if [ "$type" = "pga" ] || [ "$type" = "PGA" ] || [ "$type" = "phppgadmin" ]; the
     if [ -e "/etc/apache2/conf.d/phppgadmin.inc" ]; then
         rm -f /etc/apache2/conf.d/phppgadmin.inc
         cp -f $HESTIA_INSTALL_DIR/pga/phppgadmin.conf /etc/apache2/conf.d/phppgadmin.inc
-        sed -i "s|%pga_alias%|$alias|g" /etc/apache2/conf.d/phppgadmin.inc 
-        
+        sed -i "s|%pga_alias%|$alias|g" /etc/apache2/conf.d/phppgadmin.inc
+
         # Restart services
         $HESTIA/bin/v-restart-service apache2
     fi
@@ -91,7 +91,7 @@ if [ "$type" = "pga" ] || [ "$type" = "PGA" ] || [ "$type" = "phppgadmin" ]; the
         rm -f /etc/nginx/conf.d/phppgadmin.inc
         cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/phppgadmin.inc
         sed -i "s|%pga_alias%|$alias|g" /etc/nginx/conf.d/phppgadmin.inc
-        
+
         # Restart services
         $HESTIA/bin/v-restart-service nginx
     fi

+ 2 - 2
bin/v-change-sys-hostname

@@ -56,14 +56,14 @@ 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 
+    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 
+fi
 
 #----------------------------------------------------------#
 #                       Hestia                             #

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

@@ -71,15 +71,15 @@ else
     if [ -d /etc/rainloop/ ]; then
         sed -i "/hestia_port/c\hestia_port = $PORT" /etc/rainloop/data/_data_/_default_/configs/plugin-hestia-change-password.ini
     fi
-    
+
     if [ -f "$HESTIA/data/firewall/rules.conf" ]; then
         sed -i "/COMMENT='HESTIA'/c\RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='$PORT' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'" $HESTIA/data/firewall/rules.conf
     fi
-    
+
     if [ -f $HESTIA/data/firewall/chains.conf ]; then
         sed -i "/CHAIN='HESTIA'/c\CHAIN='HESTIA' PORT='$PORT' PROTOCOL='TCP'" $HESTIA/data/firewall/chains.conf
     fi
-     
+
     # Restart services
     if [ -n "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != no ]; then
         $HESTIA/bin/v-restart-service iptables
@@ -88,7 +88,7 @@ else
     # Check if Hestia is running
     if [[ $(ps -eaf | grep -i hestia |sed '/^$/d' | wc -l) -gt 1 ]]; then
         $HESTIA/bin/v-restart-service hestia
-    fi  
+    fi
 fi
 
 #----------------------------------------------------------#

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

@@ -57,7 +57,7 @@ else
 
     # Remove old branch variable
     sed -i "/RELEASE_BRANCH/d" $HESTIA/conf/hestia.conf
-    
+
     # Set new branch variable
     echo "RELEASE_BRANCH='$branch'" >> $HESTIA/conf/hestia.conf
     echo "Updated system to update from Git using branch: $branch"

+ 1 - 1
bin/v-change-user-config-value

@@ -27,7 +27,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-is_format_valid 'user' 'key' 
+is_format_valid 'user' 'key'
 is_common_format_valid "$value" "$key"
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"

+ 1 - 1
bin/v-change-user-package

@@ -24,7 +24,7 @@ source $HESTIA/func/main.sh
 source_conf "$HESTIA/conf/hestia.conf"
 
 is_package_avalable() {
-    
+
     source_conf "$USER_DATA/user.conf"
 
     WEB_DOMAINS='0'

+ 1 - 1
bin/v-change-user-password

@@ -48,7 +48,7 @@ check_hestia_demo_mode
 # Changing user password
 echo "$user:$password" | /usr/sbin/chpasswd
 
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     echo "Error: Password not accepted due to PAM restrictions"
     exit 2
 fi

+ 1 - 1
bin/v-change-user-php-cli

@@ -42,7 +42,7 @@ source $USER_DATA/user.conf
 
 versions=$($BIN/v-list-sys-php plain);
 support=0;
-for v in $versions; do 
+for v in $versions; do
   if [ "$v" == "$version" ]; then
     support=1;
   fi

+ 1 - 1
bin/v-change-user-role

@@ -4,7 +4,7 @@
 #
 # example: v-change-user-role user administrator
 #
-# Give/revoke user administrator rights to manage all accounts as admin 
+# Give/revoke user administrator rights to manage all accounts as admin
 
 #----------------------------------------------------------#
 #                Variables & Functions                     #

+ 1 - 1
bin/v-change-user-template

@@ -41,7 +41,7 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
-case $type in 
+case $type in
     WEB) is_web_template_valid "$template";
         update_user_value "$user" '$WEB_TEMPLATE' "$template";;
     PROXY) is_proxy_template_valid "$template";

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

@@ -81,7 +81,7 @@ fi
 # Otherwise, set target document root path accordingly based on passed values.
 if [ "$target_domain" = "default" ]; then
     update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_DOCROOT' ""
-    update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_PHPROOT' "" 
+    update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_PHPROOT' ""
 else
     # Check for existence of specified directory under target domain's public_html folder
     target_domain_directory="$HOMEDIR/$user/web/$target_domain"
@@ -104,14 +104,14 @@ else
         CUSTOM_DOCROOT="${target_domain_directory}/public_html/"
         custom_phproot="${target_domain_directory}/public_html/"
     fi
-    
+
     add_object_key 'web' 'DOMAIN' "$domain" 'CUSTOM_DOCROOT' 'IP6'
     add_object_key 'web' 'DOMAIN' "$domain" 'CUSTOM_PHPROOT' 'IP6'
-    
+
     update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_DOCROOT' "$CUSTOM_DOCROOT"
     # CUSTOM_PHPROOT got overwriten by default
     CUSTOM_PHPROOT=$custom_phproot
-    update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_PHPROOT' "$CUSTOM_PHPROOT"  
+    update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_PHPROOT' "$CUSTOM_PHPROOT"
 fi
 
 #----------------------------------------------------------#

+ 1 - 1
bin/v-change-web-domain-ftp-password

@@ -61,7 +61,7 @@ check_hestia_demo_mode
 # Changing ftp user password
 echo "$ftp_user:$password" | /usr/sbin/chpasswd
 
-if [ $? -ne 0 ]; then 
+if [ $? -ne 0 ]; then
     echo "Error: Password not accepted due to PAM restrictions"
     exit 2
 fi

+ 1 - 1
bin/v-check-mail-account-hash

@@ -2,7 +2,7 @@
 # info: check user password
 # options: TYPE PASSWORD HASH
 #
-# example: v-check-mail-account-hash ARGONID2 PASS HASH 
+# example: v-check-mail-account-hash ARGONID2 PASS HASH
 #
 # This function verifies email account password hash
 

+ 1 - 1
bin/v-check-user-hash

@@ -62,7 +62,7 @@ if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'
 then
     salt=$(echo "$shadow" |cut -f 3 -d \$)
     method=$(echo "$shadow" |cut -f 2 -d \$)
-    if [ "$method" = "y" ]; then 
+    if [ "$method" = "y" ]; then
         method="yescrypt"
     elif [ "$method" -eq '1' ]; then
         method='md5'

+ 3 - 3
bin/v-check-user-password

@@ -63,7 +63,7 @@ then
     salt=$(echo "$shadow" |cut -f 3 -d \$)
     method=$(echo "$shadow" |cut -f 2 -d \$)
     if [ "$method" = "y" ]; then
-        method="yescrypt" 
+        method="yescrypt"
     elif [ "$method" -eq '1' ]; then
         method='md5'
     elif [ "$method" -eq '6' ]; then
@@ -86,7 +86,7 @@ fi
 
 if [ "$method" = "yescrypt" ]; then
     hash=$(mkpasswd "$password" "$shadow")
-    if [ $? -ne 0 ]; then 
+    if [ $? -ne 0 ]; then
         echo "Error: password missmatch"
         echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
         exit 9
@@ -114,7 +114,7 @@ fi
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-if [ -n "$return_hash" ]; then 
+if [ -n "$return_hash" ]; then
     echo $hash;
 fi
 # Logging

+ 3 - 3
bin/v-copy-user-package

@@ -3,7 +3,7 @@
 # options: PACKAGE NEW_PACKAGE
 #
 # example: v-copy-user-package default new
-# 
+#
 # This function allows the user to duplicate an existing
 # package file to facilitate easier configuration.
 
@@ -37,7 +37,7 @@ is_package_new "$new_package"
 is_object_format_valid "$package" "Package"
 is_object_format_valid "$new_package" "New package"
 
-if [ -n "$1" ]; then 
+if [ -n "$1" ]; then
     if [ ! -f "$HESTIA/data/packages/$package.pkg" ]; then
         echo "Error: package does not exist."
         exit "$E_NOTEXIST"
@@ -46,7 +46,7 @@ if [ -n "$1" ]; then
         # Copy package
         cp -f "$HESTIA/data/packages/$package.pkg" "$HESTIA/data/packages/$new_package.pkg"
         # Don't leave the .sh file behind
-        if [ -f "$HESTIA/data/packages/$package.sh" ]; then 
+        if [ -f "$HESTIA/data/packages/$package.sh" ]; then
             cp $HESTIA/data/packages/$package.sh $HESTIA/data/packages/$new_package.sh
         fi
     else

+ 1 - 1
bin/v-delete-database-temp-user

@@ -5,7 +5,7 @@
 # example: v-add-database-temp-user wordress hestia_sso_user mysql
 #
 # Revokes "temp user" access to a database and removes the user
-# To be used in combination with v-add-database-temp-user 
+# To be used in combination with v-add-database-temp-user
 
 #----------------------------------------------------------#
 #                Variables & Functions                     #

+ 1 - 1
bin/v-delete-dns-domain

@@ -64,7 +64,7 @@ if [[ "$DNS_SYSTEM" =~ named|bind ]]; then
     rm -f $HOMEDIR/$user/conf/dns/$domain.db
 fi
 
-if [ -n "$dnssec" ]; then 
+if [ -n "$dnssec" ]; then
     # Delete existing keys
     rm -fr  $HOMEDIR/$user/conf/dns/$domain.db.*
     rm -fr /var/cache/bind/K$domain_idn.*

+ 6 - 6
bin/v-delete-firewall-ban

@@ -46,27 +46,27 @@ check_hestia_demo_mode
 heal_iptables_links
 
 conf="$HESTIA/data/firewall/banlist.conf"
-if [ "$chain" == "ALL" ]; then  
+if [ "$chain" == "ALL" ]; then
     check_ip=$(grep  "IP='$ip' CHAIN='*'" $conf)
-    if [ -z  "$check_ip" ]; then 
+    if [ -z  "$check_ip" ]; then
         exit;
     fi
     grep  "IP='$ip' CHAIN='*'" $conf | while read -r line ; do
         parse_object_kv_list  $line
-        
+
         # Deleting ip from banlist
         sip=$(echo "$IP"| sed "s|/|\\\/|g")
         sed -i "/IP='$sip' CHAIN='$CHAIN'/d" $conf
         b=$($iptables -L fail2ban-$CHAIN --line-number -n|grep -w $ip|awk '{print $1}')
-        $iptables -D fail2ban-$CHAIN $b 2>/dev/null   
-    done  
+        $iptables -D fail2ban-$CHAIN $b 2>/dev/null
+    done
 else
     # Checking ip in banlist
     check_ip=$(grep "IP='$ip' CHAIN='$chain'" $conf 2>/dev/null)
     if [ -z "$check_ip" ]; then
         exit
     fi
-    
+
     # Deleting ip from banlist
     sip=$(echo "$ip"| sed "s|/|\\\/|g")
     sed -i "/IP='$sip' CHAIN='$chain'/d" $conf

+ 1 - 1
bin/v-delete-letsencrypt-domain

@@ -56,7 +56,7 @@ check_hestia_demo_mode
 if [ -n "$DNS_SYSTEM" ]; then
     dns_domain=$($BIN/v-list-dns-domains "$user" | grep "$domain" | cut -d' ' -f1)
     caa_record=$($BIN/v-list-dns-records "$user" "$domain" | grep -i "letsencrypt" | cut -d' ' -f1)
-    
+
     if [ "$dns_domain" = "$domain" ]; then
         if [ -n "$caa_record" ]; then
             if [ -z "$mail" ]; then

+ 2 - 2
bin/v-delete-mail-domain

@@ -68,13 +68,13 @@ fi
 
 # Delete SSL certificates and configuration
 if [ "$SSL" = 'yes' ] || [ -e "$HOMEDIR/$user/conf/mail/$domain/ssl/$domain.crt" ]; then
-    $BIN/v-delete-mail-domain-ssl "$user" "$domain" 
+    $BIN/v-delete-mail-domain-ssl "$user" "$domain"
 fi
 
 # Delete webmail configuration if it exists
 if [ -n "$WEB_SYSTEM" ] || [ -n "$PROXY_SYSTEM" ]; then
     if [ -n "$IMAP_SYSTEM" ]; then
-        $BIN/v-delete-mail-domain-webmail "$user" "$domain" 'yes'    
+        $BIN/v-delete-mail-domain-webmail "$user" "$domain" 'yes'
     fi
 fi
 

+ 2 - 2
bin/v-delete-remote-dns-domain

@@ -44,10 +44,10 @@ check_hestia_demo_mode
 # Starting cluster loop
 IFS=$'\n'
 for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
 

+ 2 - 2
bin/v-delete-remote-dns-domains

@@ -47,10 +47,10 @@ fi
 
 # Starting cluster loop
 for cluster in $hosts; do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
 

+ 2 - 2
bin/v-delete-remote-dns-record

@@ -45,10 +45,10 @@ check_hestia_demo_mode
 # Starting cluster loop
 IFS=$'\n'
 for cluster in $(cat $HESTIA/conf/dns-cluster.conf); do
-    
+
     # Reset user, password and hash vars
     clear_dns_cluster_settings
-    
+
     # Parsing remote host parameters
     parse_object_kv_list "$cluster"
 

+ 1 - 1
bin/v-delete-sys-api-ip

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: delete ip adresss from allowed ip list api
-# options: IP 
+# options: IP
 #
 # example: v-delete-sys-api-ip 1.1.1.1
 

+ 1 - 1
bin/v-delete-sys-ip

@@ -116,7 +116,7 @@ if [ -n "$PROXY_SYSTEM" ]; then
         # Remove RPAFproxy_ips line when ip list is empty
         [ "$(grep RPAFproxy_ips $rpaf_conf | sed 's/^[[:space:]]*//g')" = "RPAFproxy_ips" ] && sed -i "/RPAFproxy_ips/d" $rpaf_conf
     fi
-    
+
     #mod_remoteip
     remoteip_conf="/etc/$WEB_SYSTEM/mods-enabled/remoteip.conf"
     if [ -e "$remoteip_conf" ]; then

+ 2 - 2
bin/v-delete-sys-pma-sso

@@ -1,5 +1,5 @@
 #!/bin/bash
-# info: disables support for single sign on PHPMYADMIN 
+# info: disables support for single sign on PHPMYADMIN
 # options: [mode]
 #
 # example: v-delete-sys-pma-sso
@@ -38,7 +38,7 @@ fi
 if [ ! -e "$PMA_INSTALL/hestia-sso.php" ]; then
      echo 'Error:  PMA Single Sign On already disabled'
      exit 1;
-fi 
+fi
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 1 - 1
bin/v-delete-sys-sftp-jail

@@ -2,7 +2,7 @@
 # info: delete system sftp jail
 # options: NONE
 #
-# example: v-delete-sys-sftp-jail 
+# example: v-delete-sys-sftp-jail
 #
 # This function disables sftp jailed environment
 

+ 1 - 1
bin/v-delete-sys-smtp-relay

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: disable system wide smtp relay support
-# options: 
+# options:
 #
 # example: v-delete-sys-smtp-relay
 #

+ 1 - 1
bin/v-delete-user-ips

@@ -44,7 +44,7 @@ check_hestia_demo_mode
 # Parsing user ips
 ip_list=$(grep -H "OWNER='$user'" $HESTIA/data/ips/* | cut -f 1 -d:)
 
-for ip in $ip_list; do 
+for ip in $ip_list; do
     ip=$(basename "$ip")
 
     # Checking webdomains and users

+ 1 - 1
bin/v-delete-user-log

@@ -2,7 +2,7 @@
 # info: Delete log file for user
 # options: USER
 #
-# example: v-delete-user-log user 
+# example: v-delete-user-log user
 #
 # This function for deleting a users log file
 

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

@@ -84,7 +84,7 @@ if [ "$SSL" = 'yes' ]; then
 fi
 
 if [ "$FASTCGI_CACHE" = "yes" ]; then
-    # make sure no trails left behind 
+    # make sure no trails left behind
     $BIN/v-delete-fastcgi-cache "$user" "$domain"
 fi
 

+ 1 - 1
bin/v-delete-web-domain-allow-users

@@ -4,7 +4,7 @@
 #
 # example: v-delete-web-domain-allow-users admin admin.com
 #
-# Enable the rule check for Enforce subdomain ownership for a specific domain. 
+# Enable the rule check for Enforce subdomain ownership for a specific domain.
 # Enforce subdomain ownership setting in /edit/server/ set to no will always overwrite this behaviour
 # eg: admin adds admin.com
 # user can create user.admin.com

+ 3 - 3
bin/v-delete-web-domain-redirect

@@ -4,7 +4,7 @@
 #
 # example: v-add-web-domain-redirect user domain.tld
 #
-# Function delete a forced redirect to a domain 
+# Function delete a forced redirect to a domain
 
 #----------------------------------------------------------#
 #                Variables & Functions                     #
@@ -50,7 +50,7 @@ if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
     rm "$HOMEDIR/$user/conf/web/$domain/nginx.conf_redirect"
     rm "$HOMEDIR/$user/conf/web/$domain/nginx.ssl.conf_redirect"
 else
-     echo "Non supported please use .htaccess instead" 
+     echo "Non supported please use .htaccess instead"
      exit 2;
 fi
 
@@ -63,7 +63,7 @@ update_object_value 'web' 'DOMAIN' "$domain" '$REDIRECT_CODE' ""
 
 $BIN/v-restart-web "$restart"
 check_result $? "Web restart failed" >/dev/null
-    
+
 $BIN/v-restart-proxy "$restart"
 check_result $? "Proxy restart failed" >/dev/null
 

+ 2 - 2
bin/v-delete-web-php

@@ -64,7 +64,7 @@ mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli
  php$version-soap php$version-xml php$version-zip php$version-mbstring
  php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
  php$version-imap php$version-ldap"
- 
+
 # Check is version is 7.1 or below to add mcrypt
 if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then
     mph="$mph php$version-mcrypt"
@@ -98,7 +98,7 @@ if [ -f "$php_fpm" ]; then
     else
         echo "apt-get purge $mph"
     fi
-    exit 1; 
+    exit 1;
 fi
 
 # Cleanup php folder

+ 1 - 1
bin/v-generate-api-key

@@ -2,7 +2,7 @@
 # info: generate api key
 # options: NONE
 #
-# example: v-generate-api-key 
+# example: v-generate-api-key
 #
 # This function creates a key file in $HESTIA/data/keys/
 

+ 1 - 1
bin/v-generate-debug-report

@@ -51,7 +51,7 @@ time_n_date=$(date +'%F %T')
 time_n_date=$(echo "$time_n_date" | sed "s|:||g" | sed "s| |_|g")
 
 # If logging specified, export shellcheck output to log
-if [ "$log" = "yes" ]; then 
+if [ "$log" = "yes" ]; then
     if [ "$mode" = "all" ]; then
         shellcheck -x "$HESTIA/bin/$script" > "$DEBUG_PATH/${script}_$time_n_date.log"
     fi

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

@@ -80,7 +80,7 @@ is_common_format_valid $unit "unit"
 
 release="$(lsb_release -s -r)"
 
-if [ -z "$email" ] && [ "$release" = "18.04" ]; then 
+if [ -z "$email" ] && [ "$release" = "18.04" ]; then
     echo "Email address is required";
     exit 2;
 fi
@@ -104,7 +104,7 @@ openssl genrsa "$KEY_SIZE" > "$domain.key" 2>/dev/null
 
 subj=""
 # Generate the CSR
-if [ -n "$email" ]; then 
+if [ -n "$email" ]; then
     subj="/emailAddress=$email"
 fi
 

+ 1 - 1
bin/v-get-dns-domain-value

@@ -54,4 +54,4 @@ get_object_value 'dns' 'DOMAIN' "$domain" "$key"
 # Logging
 log_event "$OK" "$ARGUMENTS"
 
-exit 
+exit

+ 1 - 1
bin/v-get-mail-account-value

@@ -57,4 +57,4 @@ get_object_value "mail/$domain" 'ACCOUNT' "$account" "$key"
 # Logging
 log_event "$OK" "$ARGUMENTS"
 
-exit 
+exit

+ 1 - 1
bin/v-get-mail-domain-value

@@ -55,4 +55,4 @@ get_object_value 'mail' 'DOMAIN' "$domain" "$key"
 # Logging
 log_event "$OK" "$ARGUMENTS"
 
-exit 
+exit

+ 2 - 2
bin/v-get-user-salt

@@ -84,7 +84,7 @@ if echo "$shadow" | grep -qE '^\$[0-9a-z]+\$[^\$]+\$'
 then
     salt=$(echo "$shadow" |cut -f 3 -d \$)
     method=$(echo "$shadow" |cut -f 2 -d \$)
-    if [ "$method" = "y" ]; then 
+    if [ "$method" = "y" ]; then
         method='yescrypt'
         salt=$(echo "$shadow" |cut -f 4 -d \$)
     elif [ "$method" -eq '1' ]; then
@@ -96,7 +96,7 @@ then
         echo "$date $time $user $ip46 failed to login" >> $HESTIA/log/auth.log
         exit 9
     fi
-elif [[ "$shadow" =~ ! ]]; then 
+elif [[ "$shadow" =~ ! ]]; then
     echo "Error: Account has been suspended"
     echo "$date $time $user $ip46 has been suspended" >> $HESTIA/log/auth.log
     exit 5

+ 1 - 1
bin/v-insert-dns-domain

@@ -76,7 +76,7 @@ dns_rec="$dns_rec DNSSEC='$DNSSEC' KEY='$KEY' SLAVE='$SLAVE' MASTER='$MASTER'"
 dns_rec="$dns_rec SUSPENDED='$SUSPENDED' TIME='$time' DATE='$date'"
 echo "$dns_rec" >> $USER_DATA/dns.conf
 
-if [ "$SLAVE" = "yes" ]; then 
+if [ "$SLAVE" = "yes" ]; then
     touch $USER_DATA/dns/$domain.conf
 fi
 # Set permission

+ 2 - 2
bin/v-list-access-keys

@@ -35,9 +35,9 @@ json_list() {
                 if [[ -n "$PERMISSIONS" ]]; then
                     PERMISSIONS_ARR="[\"$(echo "$PERMISSIONS" | sed -E 's|,|", "|g')\"]"
                 fi
-    
+
                 ACCESS_KEY_ID="$(basename "$key_file")"
-    
+
                 echo -en "${quote:-\n}"
                 echo -n '    "'$ACCESS_KEY_ID'": {'
                 echo -n '"ACCESS_KEY_ID": "'${ACCESS_KEY_ID}'", '

+ 5 - 5
bin/v-list-backup-host

@@ -24,7 +24,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 # JSON list function
 json_list() {
-    case $type in 
+    case $type in
     'sftp' | 'ftp' | 'rclone')
     echo '{'
     echo '    "'$type'": {
@@ -47,7 +47,7 @@ json_list() {
          "TIME": "'$TIME'",
          "DATE": "'$DATE'"
      }'
-     echo '}' 
+     echo '}'
     ;;
     esac
 }
@@ -83,7 +83,7 @@ plain_list() {
     'b2')
     echo -e "$BUCKET\t$type\t$B2_KEYID\t$TIME\t$DATE"
     ;;
-    esac 
+    esac
 }
 
 # CSV list function
@@ -97,7 +97,7 @@ csv_list() {
     echo "BUCKET,TYPE,B2_KEYID,TIME,DATE"
     echo "$BUCKET,$type,$B2_KEYID,$TIME,$DATE"
     ;;
-    esac 
+    esac
 }
 
 # Type format validator
@@ -113,7 +113,7 @@ is_type_format_valid() {
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'TYPE [FORMAT]'
-is_common_format_valid $type "type" 
+is_common_format_valid $type "type"
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 5 - 5
bin/v-list-dnssec-public-key

@@ -1,5 +1,5 @@
 #!/bin/bash
-# info: list public dnssec key 
+# info: list public dnssec key
 # options: USER DOMAIN [FROMAT]
 #
 # example: v-list-dns-public-key admin acme.com
@@ -55,10 +55,10 @@ json_list() {
 # SHELL list function
 shell_list() {
    echo "RECORD:    $record"
-   echo "DS:        $DS" 
-   echo "FLAG:      $flag" 
-   echo "ALGORITHM: $algorithm" 
-   echo "KEY:       $key"  
+   echo "DS:        $DS"
+   echo "FLAG:      $flag"
+   echo "ALGORITHM: $algorithm"
+   echo "KEY:       $key"
 }
 
 # PLAIN list function

+ 1 - 1
bin/v-list-sys-cpu-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list system cpu info
-# options: 
+# options:
 #
 # example: v-list-sys-cpu-status
 #

+ 1 - 1
bin/v-list-sys-db-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list db status
-# options: 
+# options:
 #
 # v-list-sys-db-status
 #

+ 2 - 2
bin/v-list-sys-disk-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list disk information
-# options: 
+# options:
 #
 # example: v-list-sys-disk-status
 #
@@ -19,7 +19,7 @@ echo -en  "-------------------------------------\n\n"
 df -ih
 echo -en "\n-------------------------------------"
 echo -en  "-------------------------------------\n\n"
- 
+
 # Displaying I/O usage
 iostat -m
 echo -en "\n-------------------------------------"

+ 1 - 1
bin/v-list-sys-dns-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list dns status
-# options: 
+# options:
 #
 # example: v-list-sys-dns-status
 #

+ 2 - 2
bin/v-list-sys-mail-status

@@ -1,8 +1,8 @@
 #!/bin/bash
 # info: list mail status
-# options: 
+# options:
 #
-# example: v-list-sys-mail-status 
+# example: v-list-sys-mail-status
 #
 # This function lists mail server status
 

+ 1 - 1
bin/v-list-sys-memory-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list virtual memory info
-# options: 
+# options:
 #
 # example: v-list-sys-memory-status
 #

+ 2 - 2
bin/v-list-sys-network-status

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: list system network status
-# options: 
+# options:
 #
 # example: v-list-sys-network-status
 #
@@ -11,7 +11,7 @@
 #----------------------------------------------------------#
 
 # Displaying network stats
-ss -s 
+ss -s
 echo -en "\n-------------------------------------"
 echo -en  "-------------------------------------\n\n"
 

+ 1 - 1
bin/v-list-sys-nginx-config

@@ -2,7 +2,7 @@
 # info: list nginx config parameters
 # options: [FORMAT]
 #
-# example: v-list-sys-nginx-config 
+# example: v-list-sys-nginx-config
 #
 # This function for obtaining the list of nginx config parameters.
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio