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

Merge branch 'release' into releases/v1.5

Jaap Marcus 3 лет назад
Родитель
Сommit
f50b545bf0
100 измененных файлов с 781 добавлено и 673 удалено
  1. 69 5
      .drone.yml
  2. 74 0
      .github/ISSUE_TEMPLATE/BUG-REPORT.yml
  3. 30 0
      .github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml
  4. 20 0
      .github/ISSUE_TEMPLATE/SUPPORT.yml
  5. 0 34
      .github/ISSUE_TEMPLATE/bug_report.md
  6. 0 20
      .github/ISSUE_TEMPLATE/feature_request.md
  7. 0 14
      .github/ISSUE_TEMPLATE/support-request.md
  8. 246 1
      CHANGELOG.md
  9. 3 3
      README.md
  10. 3 5
      bin/v-acknowledge-user-notification
  11. 6 9
      bin/v-add-backup-host
  12. 7 10
      bin/v-add-cron-hestia-autoupdate
  13. 4 7
      bin/v-add-cron-job
  14. 3 7
      bin/v-add-cron-letsencrypt-job
  15. 3 7
      bin/v-add-cron-reports
  16. 2 6
      bin/v-add-cron-restart-job
  17. 2 6
      bin/v-add-database
  18. 2 6
      bin/v-add-database-host
  19. 2 3
      bin/v-add-database-temp-user
  20. 6 6
      bin/v-add-dns-domain
  21. 2 6
      bin/v-add-dns-on-web-alias
  22. 7 9
      bin/v-add-dns-record
  23. 2 7
      bin/v-add-domain
  24. 3 6
      bin/v-add-fastcgi-cache
  25. 2 6
      bin/v-add-firewall-ban
  26. 4 6
      bin/v-add-firewall-chain
  27. 21 22
      bin/v-add-firewall-ipset
  28. 4 7
      bin/v-add-firewall-rule
  29. 5 2
      bin/v-add-fs-archive
  30. 5 2
      bin/v-add-fs-directory
  31. 5 2
      bin/v-add-fs-file
  32. 2 6
      bin/v-add-letsencrypt-domain
  33. 3 6
      bin/v-add-letsencrypt-host
  34. 3 7
      bin/v-add-letsencrypt-user
  35. 2 6
      bin/v-add-mail-account
  36. 2 7
      bin/v-add-mail-account-alias
  37. 2 7
      bin/v-add-mail-account-autoreply
  38. 2 7
      bin/v-add-mail-account-forward
  39. 2 6
      bin/v-add-mail-account-fwd-only
  40. 3 6
      bin/v-add-mail-domain
  41. 2 7
      bin/v-add-mail-domain-antispam
  42. 2 7
      bin/v-add-mail-domain-antivirus
  43. 2 7
      bin/v-add-mail-domain-catchall
  44. 2 7
      bin/v-add-mail-domain-dkim
  45. 1 2
      bin/v-add-mail-domain-smtp-relay
  46. 5 3
      bin/v-add-mail-domain-ssl
  47. 4 5
      bin/v-add-mail-domain-webmail
  48. 5 7
      bin/v-add-remote-dns-domain
  49. 4 7
      bin/v-add-remote-dns-host
  50. 2 6
      bin/v-add-remote-dns-record
  51. 6 4
      bin/v-add-sys-api-ip
  52. 2 5
      bin/v-add-sys-filemanager
  53. 2 7
      bin/v-add-sys-firewall
  54. 4 8
      bin/v-add-sys-ip
  55. 3 5
      bin/v-add-sys-phpmailer
  56. 7 4
      bin/v-add-sys-pma-sso
  57. 2 5
      bin/v-add-sys-quota
  58. 4 5
      bin/v-add-sys-rainloop
  59. 10 8
      bin/v-add-sys-roundcube
  60. 12 6
      bin/v-add-sys-sftp-jail
  61. 1 4
      bin/v-add-sys-smtp
  62. 3 6
      bin/v-add-sys-smtp-relay
  63. 6 9
      bin/v-add-user
  64. 2 7
      bin/v-add-user-2fa
  65. 5 6
      bin/v-add-user-composer
  66. 3 6
      bin/v-add-user-notification
  67. 2 7
      bin/v-add-user-package
  68. 10 8
      bin/v-add-user-sftp-jail
  69. 2 9
      bin/v-add-user-sftp-key
  70. 4 7
      bin/v-add-user-ssh-key
  71. 2 6
      bin/v-add-user-wp-cli
  72. 6 7
      bin/v-add-web-domain
  73. 3 8
      bin/v-add-web-domain-alias
  74. 1 4
      bin/v-add-web-domain-allow-users
  75. 2 5
      bin/v-add-web-domain-backend
  76. 2 7
      bin/v-add-web-domain-ftp
  77. 3 7
      bin/v-add-web-domain-httpauth
  78. 2 7
      bin/v-add-web-domain-proxy
  79. 3 5
      bin/v-add-web-domain-redirect
  80. 2 6
      bin/v-add-web-domain-ssl
  81. 2 5
      bin/v-add-web-domain-ssl-force
  82. 2 5
      bin/v-add-web-domain-ssl-hsts
  83. 1 2
      bin/v-add-web-domain-ssl-preset
  84. 2 7
      bin/v-add-web-domain-stats
  85. 2 7
      bin/v-add-web-domain-stats-user
  86. 8 11
      bin/v-add-web-php
  87. 3 8
      bin/v-backup-user
  88. 3 7
      bin/v-backup-users
  89. 2 7
      bin/v-change-cron-job
  90. 2 7
      bin/v-change-database-host-password
  91. 2 7
      bin/v-change-database-owner
  92. 2 7
      bin/v-change-database-password
  93. 2 7
      bin/v-change-database-user
  94. 2 7
      bin/v-change-dns-domain-exp
  95. 2 7
      bin/v-change-dns-domain-ip
  96. 2 7
      bin/v-change-dns-domain-soa
  97. 2 7
      bin/v-change-dns-domain-tpl
  98. 2 7
      bin/v-change-dns-domain-ttl
  99. 28 17
      bin/v-change-dns-record
  100. 2 6
      bin/v-change-dns-record-id

+ 69 - 5
.drone.yml

@@ -1,7 +1,7 @@
 ---
 kind: pipeline
 type: ssh
-name: HestiaCP + Nginx + Apache2  
+name: Ubuntu | Nginx + Apache2  
 
 concurrency:
   limit: 1
@@ -40,12 +40,18 @@ steps:
   - ./test/check_php.sh
 
 trigger:
-  event: [ push, pull_request ]
+  event: [ pull_request, push ]
+  ref:
+  - refs/heads/staging/*
+  - refs/heads/beta
+  - refs/heads/release
+  - refs/heads/main
+  - refs/pull/*/head
 
 ---
 kind: pipeline
 type: ssh
-name: HestiaCP + Nginx  
+name: Debian | Nginx  
 
 concurrency:
   limit: 1
@@ -76,6 +82,10 @@ steps:
 - name: Run restore tests
   commands:
   - bats ./test/restore.bats
+- name: Run Letsencrypt test against Staging
+  commands:
+  - cp /root/le-env.sh /tmp/hestia-le-env.sh
+  - bats ./test/letsencrypt.bats
 - name: Run config tests 
   commands:
   - bats ./test/config-tests.bats
@@ -84,7 +94,13 @@ steps:
   - ./test/check_php.sh
 
 trigger:
-  event: [ push, pull_request ]
+  event: [ pull_request, push ]
+  ref:
+  - refs/heads/staging/*
+  - refs/heads/beta
+  - refs/heads/release
+  - refs/heads/main
+  - refs/pull/*/head
 
 ---
 kind: pipeline
@@ -103,6 +119,54 @@ steps:
 trigger:
    event: [ pull_request, push ] 
 
+---
+kind: pipeline
+type: docker
+name: Push to beta atp server
+
+platform:
+  os: linux
+  arch: amd64
+
+steps:
+  - name: Build
+    image: debian:bullseye
+    commands:
+    - ln -snf /etc/localtime && echo CET > /etc/timezone
+    - ./src/hst_autocompile.sh --dontinstalldeps --hestia --debug --cross --noinstall --keepbuild --debug '~localsrc'
+    - mkdir -p ./hestia/
+    - mv /tmp/hestiacp-src/deb/*.deb ./hestia/
+  - name: Upload
+    image: appleboy/drone-scp
+    settings:
+      host:
+        from_secret: apt_server
+      user: root
+      key:
+        from_secret: ssh_key
+      port: 22
+      command_timeout: 2m
+      target: /root/
+      source:
+        - ./hestia/*
+  - name: Publish
+    image: appleboy/drone-ssh
+    settings:
+        host:
+          from_secret: apt_server
+        user: root
+        key:
+          from_secret: ssh_key
+        port: 22
+        command_timeout: 2m
+        script:
+            - freight-add ./hestia/*.deb apt/bionic apt/focal apt/stretch apt/buster apt/bullseye
+            - freight-cache
+            - rm -fr ./hestia/
+  
+trigger:
+    event: [ promote] 
+
 ---
 kind: signature
-hmac: 48d34d11001c99b470114f50c4284fa107a5e61ad08ada38307493b9e9b2883f
+hmac: 07f845f902f859c97c78a346d340f7fb8d4b1242581a242e592b149c13428f50

+ 74 - 0
.github/ISSUE_TEMPLATE/BUG-REPORT.yml

@@ -0,0 +1,74 @@
+name: Bug Report
+description: File a bug report and help us to improve Hestia Control Panel
+title: "[Bug] "
+labels: [bug]
+body:
+  - type: markdown
+    attributes:
+      value: |
+        If you have encountered a bug or problem in Hestia Control Panel, use this form to let us know.
+        **Important: DO NOT include any private/sensitive information such as email addresses, passwords, IP addresses, or hostnames.**
+  - type: textarea
+    id: describe
+    attributes:
+      label: Describe the bug
+      description: |
+        A clear description of what the bug is. Include as much detail as possible, such as the configuration of your server and any troubleshooting steps that you've already performed.
+      placeholder: Tell us exactly what you see!
+    validations:
+      required: true
+  - type: textarea
+    id: reproduce
+    attributes:
+      label: Tell us how to replicate the bug
+      description: |
+        What steps did you take when the bug occured or things did not work as you expected?
+      placeholder: |
+        1. Click on the Web tab.
+        2. Click on Add Web Domain.
+        3. Attempted to add a domain and received an Internal Server Error after pressing Save.
+    validations:
+      required: true
+  - type: dropdown
+    id: part
+    attributes:
+      label: Which components are affected by this bug?
+      multiple: true
+      options:
+        - Control Panel Backend
+        - Control Panel Command Line Interface
+        - Control Panel Installation or Upgrade
+        - Control Panel Web Interface
+        - Backend Web Server (Nginx, Apache2)
+        - Database (MariaDB, PostgreSQL)
+        - Let's Encrypt SSL
+        - Mail (Exim, Dovecot)
+        - Mail Security (Antivirus, Antispam)
+        - Webmail (Roundcube, Rainloop)
+        - Firewall (Iptables, Fail2ban)
+    validations:
+      required: true
+  - type: input
+    id: version
+    attributes:
+      label: Hestia Control Panel Version
+      placeholder: 1.x.x
+    validations:
+      required: true
+  - type: input
+    id: os
+    attributes:
+      label: Operating system
+      placeholder: Ubuntu 20.04 or Debian 11
+    validations:
+      required: true
+  - type: textarea
+    id: logs
+    attributes:
+      label: Log capture
+      description: Copy and paste any relevant log output in the field below. This will be automatically formatted into code, so no need for backticks. **Remove any sensitive information before submitting!**
+      render: shell
+  - type: markdown
+    attributes:
+      value: |
+        *Thank you* for taking the time to fill out this bug report.

+ 30 - 0
.github/ISSUE_TEMPLATE/FEATURE-REQUEST.yml

@@ -0,0 +1,30 @@
+name: Feature
+description: Suggest a new idea or change
+title: "[Feature] "
+labels: [feature]
+body:
+  - type: markdown
+    attributes:
+      value: |
+        Is there a feature or change that you think would make Hestia Control Panel work better for you? Send us your ideas and our development team will take them into consideration.
+        Before submitting a new idea, look at the **[current feature requests list](https://github.com/hestiacp/hestiacp/labels/feature)** to see if it has already been requested.
+  - type: textarea
+    id: request
+    attributes:
+      label: Describe the feature or change in detail
+    validations:
+      required: true
+  - type: dropdown
+    id: priority
+    attributes:
+      label: Would you like to sponsor this feature to have it implemented?
+      description: While there is no obligation, our development team has a limited number of resources and time available and a financial contribution would help prioritize your request.
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+  - type: markdown
+    attributes:
+      value: |
+        **Thank you** for taking the time to send us your request, we appreciate your contribution.

+ 20 - 0
.github/ISSUE_TEMPLATE/SUPPORT.yml

@@ -0,0 +1,20 @@
+name: Support / Question
+description: Request for help, support, or to ask a general question
+title: "[Support] Do not use this form! "
+labels: [invalid]
+body:
+  - type: markdown
+    attributes:
+      value: |
+        **Do not submit requests for support on GitHub! We use this platform for development purposes only.**
+        If you need help or want to ask a question, use one of these options:
+
+        * [Documentation](https://docs.hestiacp.com/)
+        * [Discussion Forums](https://forum.hestiacp.com/)
+        * [Discord (chat)](https://discord.gg/8b2HGNe8ne) (#community-support)
+  - type: checkboxes
+    id: support
+    attributes:
+      options:
+        - label: I acknowledge that any support request submitted with this form will be closed.
+          required: true

+ 0 - 34
.github/ISSUE_TEMPLATE/bug_report.md

@@ -1,34 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: "[BUG]"
-labels: ''
-assignees: ''
-
----
-
-**Describe the bug**
-A clear and concise description of what the bug is. Please include as much information as possible in your issue report, such as the configuration of your server and any troubleshooting steps that you've already performed.
-
-**NOTE: Do not include any personal or sensitive information, such as email addresses or passwords.**
-
-**To Reproduce**
-What steps did you take when the issue occured? 
-1. Ex.: Click on the "Web" tab.
-2. Ex.: Click on "Add Web Domain".
-3. Ex.: Attempted to add a domain and received an Internal Server Error.
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
-
-**Operating system:**
-Please enter your answer here (e.g. Ubuntu 20.04 LTS)
-
-**Hestia Control Panel version:**
-Please enter your answer here (e.g. 1.3.2). 
-
-**Additional context**
-If there is anything else that you'd like us to know about this issue that will help us diagnose and troubleshoot more effectively, such as links to forum posts or other discussions, please feel free to share here.

+ 0 - 20
.github/ISSUE_TEMPLATE/feature_request.md

@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: "[FEATURE]"
-labels: ''
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.

+ 0 - 14
.github/ISSUE_TEMPLATE/support-request.md

@@ -1,14 +0,0 @@
----
-name: Support request
-about: For support, take a look here
-title: "[SUPPORT]"
-labels: ''
-assignees: ''
-
----
-
-**Please do NOT use our GitHub Project for support requests, you can find community support and help here:**
-
-**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)
-**Forums:** [forum.hestiacp.com](https://forum.hestiacp.com/)
-**Discord:** [Join the discussion](https://discord.gg/8b2HGNe8ne)

+ 246 - 1
CHANGELOG.md

@@ -1,15 +1,260 @@
 # Changelog
 All notable changes to this project will be documented in this file.
 
+## [1.5.15] - Service release
+
+### Bugfixes
+
+- Fixed an issue with wildcard DNS records 
+
+### Dependencies
+
+- Update phpMyAdmin to 5.1.4 (https://www.phpmyadmin.net/files/5.1.4/) (#2529)
+
+## [1.5.14] - Service release
+
+### Bugfixes
+
+- Fixed an issue with login with ipv6 (#2564)
+- Fixed an issue with dns records containing an . (#2559)
+
+## [1.5.13] - Service release
+
+### Bugfixes
+
+- Fixed an issue in add / change dns record via GUI. (#2557)
+
+## [1.5.12] - Service release
+
+### Bugfixes
+
+- Fixed vulnerability with Sed [CVE-2022-1509](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-1509)
+- Remove localhost exception for invalidating sessions [SSD disclosure](https://ssd-disclosure.com/ssd-advisory-vestacp-multiple-vulnerabilities/)
+
+## [1.5.11] - Service release
+
+### Bugfixes
+- Fixed an issue where Hestia port change did not update chain for fail2ban (#2465)
+- Fixed permission issues with /var/log/roundcube (#2466)
+- Fixed multiple issues in UI (#2464)
+- Allow v-change-user-template update backend templates (#2475)
+- Update composer dependencies (#2458 #2459)
+- Fixed an XSS vulnerability in "Edit" server page. (#2471) [CVE-2022-0986](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0986)
+- Fixed an issue with caching templates and internal redirects (#2482)
+
+## [1.5.10] - Service release
+
+### Bugfixes
+- Fixed an issue where webmail client options were not displayed in the Web UI (#2445)
+- Fixed an issue where users where not able to create an backup. (#2448 / #2449)
+- Fixed an issue where saving server settings could fail due to an incorrect PHP version check on mod-php servers (#2451)
+- Fixed an issue where MariaDB installations were broken when performing a clean install of HestiaCP v1.5.9 (#2452 | 2446)
+- Fixed recently discovered XSS vulnerabilities (#2453) [CVE-2022-0838](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0838)
+
+## [1.5.9] - Service release
+
+### Bugfixes
+
+- Fixed multiple XSS vulnerabilities in the web user interface. [CVE-2022-0752](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0752) / [CVE-2022-0753](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0753)
+- Fixed an issues with mariadb.sys user didn't work properly on MariaDB 10.6.x installs #2427
+- Change ipverse.net urls to new format hosted on Github #2429 and forum
+- Allow PTR to be used on domain.com 
+
+### Dependencies
+
+- Update PHPMailer to 6.6.0 (https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.0)
+- Update Filegator to 7.7.2 (https://github.com/filegator/filegator/releases/tag/v7.7.2)
+
+## [1.5.8] - Service release
+
+### Features
+
+ - No new features has been introduced
+
+### Bugfixes
+
+- Fixed an issue where SFTP jail was not enabled correctly for additional FTP accounts #2403 
+- Fixed an issue in the installer where the "Press any key to continue" prompt only responded to the Enter key #2398 
+- Fixed an issue where list sort order preference variable wasn't saved properly #2391
+- Fixed an issue with inconsistent behaviour in mail account settings information dialog #2392
+- Fixed an issue where .gnupg folder in /root/ had the wrong permissions set.
+- Fixed an issue where users were being redirected to login page when visiting /reset/ endpoint #2401
+- Fixed an issue where deleting sftp jail did not revert back permissions of said user. #2143
+- Fixed an issue where "REDIRECT" variable wasn't cleared correctly causing other sites to redirect to the domain after v-update-letsencrypt-ssl
+- Changed repository url MariaDB for new installs to https://wdlm.mariadb.com/repo/mariadb-server
+
+### Dependencies
+
+- Update phpMyAdmin to 5.1.3 (https://github.com/phpmyadmin/phpmyadmin/releases/tag/RELEASE_5_1_3)
+
+## [1.5.7] - Service release
+
+### Bugfixes
+
+- Fixed an issue with apt update and public key missing
+
+If you have to following error
+
+```
+The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A189E93654F0B0E5
+```
+
+Follow the following instructions
+
+```
+rm /usr/share/keyrings/hestia-keyring.gpg
+mkdir /root/.gnupg/
+gpg --no-default-keyring --keyring /usr/share/keyrings/hestia-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys A189E93654F0B0E5
+```
+
+After that run apt update && apt upgrade 
+
+## [1.5.6] - Service release
+
+### Bugfixes
+
+- Fixed an issue with the installer. system.pkg didn't allow for a Web alias #2381
+- Fixed an issue with upgrade script causing command to to be executed (https://forum.hestiacp.com/t/upgrading-to-1-5-5-error-line/5449/3)
+
+## [1.5.5] - Service release
+
+### Features
+
+- Improve default php-fpm.conf files. (#2318, #2343)
+- Notify user when a suspended user tries to login (#2310, #2345)
+- Allow setting default web install templates for Quick install (#2344) (https://github.com/hestiacp/hestia-quick-install)
+- Improve security how apt keys are downloaded #2299 (https://blog.cloudflare.com/dont-use-apt-key/)
+- Allow users to set system php version in Web GUI (#2357)
+- Added a link to the firewall in list services (#2371) @fra81
+
+### Changes
+
+- Modify template warning #2346
+- Removed 127.0.0.1 from the default accepted ip list api. (#2325)
+- Update translations
+
+### Bugfixes
+
+- Update CSS to prevent wrapping in email info box (#2353) @chriscapisce
+- Remove unwanted debug information regarding PhpMyAdmin SSO causing emails to be send to administrator
+- Allow the use of 8 name servers for DNS templates (Gmail, Zoho and Office 365) (#2369, #2370)
+- Fixed an issue where databases where not able to backup if it required custom settings
+- Allow users to edit default.pkg again. On new installs the default admin user will get assigned a new system.pkg (#2365)
+- Disable enabling PMA SSO when Api was disabled + Added link to FAQ for frequently asked questions. (#2365)
+- Remove error_reporting(null) and allow all errors to be logged in /var/log/hestia/nginx-error.log (#2365)
+- Fixed an issue where value "Allow suspended wasn't saved" (#2356, #2355)
+- Fixed and issue where AUTH_USER and AUTH_HASH was not present and there for during rebuild caused issues with Nginx (#2350, #2355)
+
+### Dependencies
+
+- Update PHPmyadmin to 5.1.2 (https://www.phpmyadmin.net/files/5.1.2/)
+- Update Filegator to 7.7.1 (https://github.com/filegator/filegator/releases/tag/v7.7.1)
+- Update B2CLI to 3.2.0 (https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v3.2.0) (#2349) @ptrinh
+
+## [1.5.4] - Service release
+
+### Features
+
+### Bugfixes
+
+- Fixed an issue with v-add-sys-phpmailer not updating properly (#2336)
+- Fixed an issue where users where not able to download backups via UI (#2335)
+- Fixed an issue where php8.0 got "rounded" to php8 causing default.tpl falling back to 8.1 (#2340)
+- Fixed an issue with recalculating disk usage (#2341)
+- Fixed an issue where php files where still executable in upload folder Wordpress
+- Fixed an bug where version numbers includeing revisions (-x) where unable to build properly
+
+## [1.5.3] - Service release
+
+### Features
+
+### Bugfixes
+
+- Fixed an issue where suspended objects where excluded in disk size calculation (#2312 #2313)
+- Fixed an issue when a users was unable edit them self when 2FA was enabled (#2314 #2316)
+- Fixed an issue in v-add-user-sftp as ftp users where not recognised as valid sftp jail set ups (#2308 #2319)
+- Fixed an issue when "Preview" features got disabled it kept the preview features enabled (#2322 #2323)
+- Limit access openbase dir hestia-php
+- Fixed an issue where an email was send after install nginx command not found (#2328)
+
+### Dependencies
+
+- Update PCRE 8.84 to PCRE2 10.39 for hestia-nginx package
+- Update Roundcube to 1.5.2 ([Release notes](https://github.com/roundcube/roundcubemail/releases/tag/1.5.2))
+- Update PHPMailer to 6.5.3 ([Release message](https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.3))
+
+## [1.5.2] - Service release
+
+### Features
+
+- Release notes are now available from the notification panel (#2276)
+- Web domain aliases are now displayed in the domain list (#2278 / #2289)
+- DNS, Mail, and Database sections will now be hidden in /edit/server if not installed (#2300)
+- Turkey has been added as an option for ipset (#2294)
+
+### Bugfixes
+
+- Improvements have been made to overall code quality (#2293, #2298, #2307)
+- Added improvements to the automated testing suite (bats) (#2280)
+- Clarified text that is shown during upgrade process (#2270)
+- Updated web domain templates to allow the use of .user.ini (#2267 / #2269)
+- Fixed an issue with the curl symlink on Debian during build process (#2275)
+- Fixed an issue where CAA records were deleted when turning off SSL for webmail (#2279)
+- Fixed an issue where email validation would fail when using IDN domains (#2273)
+- Changed behavior to prevent php-fpm restarts when modphp is installed (#2270)
+- Fixed an issue where passwords may not be correctly set on Debian 11 (#2270)
+- Fixed an issue with command path v-change-firewall-rule (#2249)
+- Fixed an issue in `v-backup-user` where you may encounter an error "invalid parameters for check_result" (#2284)
+- Fixed an issue which impacted the performance of Nextcloud/Owncloud ([forum post](https://forum.hestiacp.com/t/tip-create-a-nginx-template-for-nextcloud-to-let-synchronize-files-bigger-than-10mb/5123))
+- Fixed an issue where the access port for HestiaCP was not properly set on install (#2288 / #2291)
+- Fixed an issue where admins could not log in as a suspended user in the panel (#2286 / #2289)
+- Fixed an issue where the "Delete" button in the Edit User interface did not work as expected (#2282 / #2289)
+- Fixed an issue where editing an existing firewall rule with ipset would fail (#2292)
+- Fixed an error that may occur in /edit/server when no extra php versions were installed (#2289)
+- Fixed an issue where accessing the panel via Safari would result in error NSPOSIXErrorDomain:100 (#2274)
+- Corrected command syntax in v-delete-dns-records (#2295)
+- Fixed an issue where API allowed IP list values would be lost when saving changes (#2296 / #2300)
+- Fixed an issue where the debug mode option was not displayed on release builds and would be reset when saving server settings (#2300)
+- Fixed an issue where grep would throw an error when adding ipset rules for the first time (#2307)
+- Fixed incorrect variable spelling ($v_interace > $v_interface) (#2307)
+- Updated mail domain templates
+- Updated command line examples for docs.hestiacp.com
+- Fixed an issue where Lets encrypt was not able to obtain an valid ssl certificate when force ssl and / or redirect was enabled (#2176 / #2304 / #2304)
+- Fixed a issue in v-list-sys-dns-status
+
+### Dependencies
+
+
+## [1.5.1] - Service release
+
+### Bugfixes
+
+- Add B2 delete file support to BlackBlaze
+- Open phpmyadmin in new tab or window #2250 @manuelserol
+- Fix issue with ipset not working properly [Forum](https://forum.hestiacp.com/t/error-ipset-object-not-found/5015)
+- Improve port detection on multiple servers for SSH #2242 and #2255
+- Fixed an issue with # in config files
+- Fixed multiple bugs in installer
+- Set correct permission /install/deb/ folder 
+- Adjust /etc/apt/sources.list.d/hestia.list to include architecture to resolve issue with I386 missing in apt.hestiacp.com
+- Fallback to hostname without retrying ptr lookup in exim (#2259)
+- Enable quota with in dovecot when sieve is enabled @madito
+- Unable to edit php8.1 service #2261
+
+### Dependencies
+
+- Update Roundcube to 1.5.1 [Release Notice](https://roundcube.net/news/2021/11/28/update-1.5.1-released)
+
 ## [1.5.0] - Major Release (Feature / Quality Update)
 
 ### Breaking changes ###
 - **NOTE:** Changes have been made on how phpmyadmin/phppgadmin config are included in apache2 config. To restore to the old behaviour add `IncludeOptional conf.d/*.inc` below `IncludeOptional conf.d/*.conf` in /etc/apache2/apache2.conf and restart your server. 
 - **NOTE:** Hestia packages for arm64 has been added to atp.hestiacp.com please use the normal install instructions instead! For current ARM installs to enable auto update remove the `#` in /etc/apt/sources.list.d/hestia.list `# deb https://apt.hestiacp.com/ focal main` becomes `deb https://apt.hestiacp.com/ focal main` and then run `apt update && apt upgrade -y` 
+- **NOTE:** Make sure your server / VPS has a valid PTR record or otherwise you will not be able to send any mail!
 
 ### Features
 
-- Add support for Dovecote Sieve #2163 (@gejobj)
+- Add support for Dovecote Sieve #2163 (@gejobj) => [How to enable Managesieve](https://docs.hestiacp.com/admin_docs/mail.html#how-can-i-enable-managesieve)
 - Improve HELO based system and use RDNS lookup instead our old system
 - Add support for PHP 8.1 #2233 
 - Set default php version for new installs to PHP 8.0 

+ 3 - 3
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.5.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
+**Latest stable release:** Version 1.5.14 | [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>
@@ -39,8 +39,8 @@ AMD (x86_64 Intel/AMD)
 
 ARM64 (arm64)
 ----------------------------
-* **Debian:** 11, 10
-* **Ubuntu:** 20.04 LTS
+* **Debian:** 11, 10, 9
+* **Ubuntu:** 20.04 LTS or 18.04 LTS
 * **NOTE:** ARM 64 bit processors only! ARM 32bit (armhf) is currently not supported!
 
 Installing Hestia Control Panel

+ 3 - 5
bin/v-acknowledge-user-notification

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: update user notification
 # options: USER NOTIFICATION
-# labels: panel
 #
 # example: v-acknowledge-user-notification
 #
-# The function updates user notification.
-
+# This function updates user notification.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -23,6 +21,7 @@ source /etc/hestiacp/hestia.conf
 source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
+
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -34,7 +33,6 @@ is_object_valid 'user' 'USER' "$user"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 6 - 9
bin/v-add-backup-host

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: add backup host
 # options: TYPE HOST USERNAME PASSWORD [PATH] [PORT]
-# labels: 
 #
 # example: v-add-backup-host sftp backup.acme.com admin p4$$w@Rd
 #          v-add-backup-host b2 bucketName keyID applicationKey
@@ -9,7 +8,7 @@
 # Add a new remote backup location. Currently SFTP, FTP and Backblaze are supported 
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -22,17 +21,16 @@ path=${5-/backup}
 port=$6
 
 # Includes
-# shellcheck source=/etc/hestiacp/hestia.conf
-source /etc/hestiacp/hestia.conf
 # shellcheck source=/usr/local/hestia/func/main.sh
 source $HESTIA/func/main.sh
-
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
+# Fetch current verison B2 CLI tool
+source_conf "$HESTIA/install/upgrade/upgrade.conf"
 
 # Paths
 b2cli="/usr/local/bin/b2"
-b2lnk="https://f000.backblazeb2.com/file/backblazefiles/b2/cli/linux/b2"
+b2lnk="https://github.com/Backblaze/B2_Command_Line_Tool/releases/download/v$b2_v/b2-linux"
 
 # Defining ftp command function
 ftpc() {
@@ -99,7 +97,6 @@ sftpc() {
 EOF
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -107,7 +104,8 @@ EOF
 if [ "$type" != 'local' ];then
     check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
     is_format_valid 'host' 'path' 'port'
-    is_username_format_valid "$username" "username"
+    is_type_valid  'sftp,ftp,b2' "$type"
+    is_username_format_valid "$user" "username"
     is_password_valid
     format_no_quotes "$password" "password"
     
@@ -230,7 +228,6 @@ elif [ $type == 'b2' ]; then
     chmod 660 $HESTIA/conf/$type.backup.conf
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 7 - 10
bin/v-add-cron-hestia-autoupdate

@@ -1,13 +1,12 @@
 #!/bin/bash
-# info: add cron job for hestia autoupdates
+# info: add cron job for hestia automatic updates
 # options: MODE
-# labels: 
 #
-# The function adds cronjob for hestia autoupdate from apt or git.
-
+# This function adds a cronjob for hestia automatic updates
+# that can be downloaded from apt or git.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -22,7 +21,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -39,7 +37,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -75,13 +72,13 @@ str="$str CMD='$command' SUSPENDED='no' TIME='$time' DATE='$date'"
 # Adding to crontab
 echo "$str" >> $HESTIA/data/users/$user/cron.conf
 
-# Chaning permissions
+# Changing permissions
 chmod 660 $HESTIA/data/users/$user/cron.conf
 
 # Sort jobs by id number
 sort_cron_jobs
 
-# Sync cronjobs with system crond
+# Sync cronjobs with system cron
 sync_cron_jobs
 
 #----------------------------------------------------------#
@@ -91,7 +88,7 @@ sync_cron_jobs
 # Increasing cron value
 increase_user_value "$user" '$U_CRON_JOBS'
 
-# Restarting crond
+# Restarting cron
 $BIN/v-restart-cron
 check_result $? "Cron restart failed" >/dev/null
 

+ 4 - 7
bin/v-add-cron-job

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add cron job
 # options: USER MIN HOUR DAY MONTH WDAY COMMAND [JOB] [RESTART]
-# labels: 
 #
 # example: v-add-cron-job admin * * * * * sudo /usr/local/hestia/bin/v-backup-users
 #
-# The function adds a job to cron daemon. When executing commands, any output
+# This function adds a job to cron daemon. When executing commands, any output
 # is mailed to user's email if parameter REPORTS is set to 'yes'.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -46,12 +44,12 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_package_full 'CRON_JOBS'
 get_next_cronjob
 is_format_valid 'job'
+is_format_valid 'restart'
 is_object_new 'cron' 'JOB' "$job"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -77,7 +75,6 @@ sort_cron_jobs
 # Sync cronjobs with system crond
 sync_cron_jobs
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -85,7 +82,7 @@ sync_cron_jobs
 # Increasing cron value
 increase_user_value $user '$U_CRON_JOBS'
 
-# Restarting crond
+# Restarting cron
 $BIN/v-restart-cron "$restart"
 check_result $? "Cron restart failed" >/dev/null
 

+ 3 - 7
bin/v-add-cron-letsencrypt-job

@@ -1,13 +1,11 @@
 #!/bin/bash
-# info: add letsencrypt cronjob
+# info: add cron job for Let's Encrypt certificates
 # options: NONE
-# labels: 
 #
-# The script for enabling letsencrypt cronjob
-
+# This function adds a new cron job for Let's Encrypt.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -18,7 +16,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -39,7 +36,6 @@ if [ -z "$check_cron" ] && [ -n "$CRON_SYSTEM" ]; then
     $BIN/v-add-cron-job admin '*/5' '*' '*' '*' '*' "$cmd"
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 7
bin/v-add-cron-reports

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add cron reports
 # options: USER
-# labels: 
 #
 # example: v-add-cron-reports admin
 #
-# The script for enabling reports on cron tasks and administrative
+# This function for enabling reports on cron tasks and administrative
 # notifications.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -24,7 +22,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -48,12 +45,11 @@ update_user_value "$user" '$CRON_REPORTS' 'yes'
 # Sync system cron with user
 sync_cron_jobs
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-# Restart crond
+# Restart cron
 $BIN/v-restart-cron
 check_result $? "Cron restart failed" >/dev/null
 

+ 2 - 6
bin/v-add-cron-restart-job

@@ -1,13 +1,11 @@
 #!/bin/bash
 # info: add cron reports
 # options: NONE
-# labels: 
 #
-# The script for enabling restart cron tasks
-
+# This function for enabling restart cron tasks
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -18,7 +16,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -39,7 +36,6 @@ if [ -z "$check_cron" ] && [ -n "$CRON_SYSTEM" ]; then
     $BIN/v-add-cron-job admin '*' '*' '*' '*' '*' "$cmd"
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 6
bin/v-add-database

@@ -1,11 +1,10 @@
 #!/bin/bash
 # info: add database
 # options: USER DATABASE DBUSER DBPASS [TYPE] [HOST] [CHARSET]
-# labels: 
 #
 # example: v-add-database admin wordpress_db matt qwerty123
 #
-# The function creates the database concatenating username and user_db.
+# This function creates the database concatenating username and user_db.
 # Supported types of databases you can get using v-list-sys-config script.
 # If the host isn't stated and there are few hosts configured on the server,
 # then the host will be defined by one of three algorithms. "First" will choose
@@ -13,9 +12,8 @@
 # "Weight" will distribute new database through hosts evenly. Algorithm and
 # types of supported databases is designated in the main configuration file.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -76,7 +74,6 @@ dbpass="$password"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -87,7 +84,6 @@ case $type in
     pgsql) add_pgsql_database ;;
 esac
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,19 +1,17 @@
 #!/bin/bash
 # info: add new database server
 # options: TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TEMPLATE] [PORT]
-# labels: 
 #
 # example: v-add-database-host mysql localhost alice p@$$wOrd
 #
-# The function add new database server to the server pool. It supports local
+# This function add new database server to the server pool. It supports local
 # and remote database servers, which is useful for clusters. By adding a host
 # you can set limit for number of databases on a host. Template parameter is
 # used only for PostgreSQL and has an default value "template1". You can read
 # more about templates in official PostgreSQL documentation.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -65,7 +63,6 @@ is_pgsql_host_alive() {
     fi
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -113,7 +110,6 @@ case $type in
            str="$str TIME='$time' DATE='$date' PORT='$port'";;
 esac
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,16 +1,15 @@
 #!/bin/bash
 # info: add temp database user
 # options: USER DATABASE [TYPE] [HOST] [TTL]
-# labels: hestia database
 #
 # example: v-add-database-temp-user wordress wordpress_db mysql
 #
-# The function creates an temporary database user mysql_sso_db_XXXXXXXX and a random password 
+# 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
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition

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

@@ -1,19 +1,17 @@
 #!/bin/bash
 # info: add dns domain
 # options: USER DOMAIN IP [NS1] [NS2] [NS3] [NS4] [NS5] [NS6] [NS7] [NS8] [RESTART]
-# labels: dns
 #
 # example: v-add-dns-domain admin example.com ns1.example.com ns2.example.com '' '' '' '' '' '' yes
 #
-# The function adds DNS zone with records defined in the template. If the exp
+# This function adds DNS zone with records defined in the template. If the exp
 # argument isn't stated, the expiration date value will be set to next year.
 # The soa argument is responsible for the relevant record. By default the first
 # user's NS server is used. TTL is set as common for the zone and for all of
 # its records with a default value of 14400 seconds.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -68,6 +66,10 @@ if [ -z "$(is_ip_format_valid $domain)" ]; then
     exit 1
 fi
 
+if [ -n "$restart" ]; then 
+    is_format_valid 'restart'
+fi
+
 is_package_full 'DNS_DOMAINS'
 template=$(get_user_value '$DNS_TEMPLATE')
 is_dns_template_valid "$template"
@@ -110,7 +112,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -213,7 +214,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     echo "$cmd" >> $HESTIA/data/queue/dns-cluster.pipe
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 6
bin/v-add-dns-on-web-alias

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add dns domain or dns record after web domain alias
 # options: USER ALIAS IP [RESTART]
-# labels: dns
 #
 # example: v-add-dns-on-web-alias admin www.example.com 8.8.8.8
 #
-# The function adds dns domain or dns record based on web domain alias.
-
+# This function adds dns domain or dns record based on web domain alias.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,7 +26,6 @@ source $HESTIA/func/domain.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -85,7 +82,6 @@ if [ -z "$check_record" ]; then
         "$user" "$top_domain" "$sub_domain" A "$ip" '' '' "$restart" >> /dev/null
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 7 - 9
bin/v-add-dns-record

@@ -1,18 +1,16 @@
 #!/bin/bash
 # info: add dns record
 # options: USER DOMAIN RECORD TYPE VALUE [PRIORITY] [ID] [RESTART] [TTL]
-# labels: dns
 #
 # example: v-add-dns-record admin acme.com www A 162.227.73.112
 #
-# The call is used for adding new DNS record. Complex records of TXT, MX and
-# SRV types can be used by a filling in the 'value' argument. The function also
-# gets an id parameter for definition of certain record identifier or for the
+# This function is used to add a new DNS record. Complex records of TXT, MX and
+# SRV types can be used by a filling in the 'value' argument. This function also
+# gets an ID parameter for definition of certain record identifiers or for the
 # regulation of records.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -80,7 +78,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -99,11 +96,13 @@ is_object_new "dns/$domain" 'ID' "$id"
 is_dns_fqnd "$rtype" "$dvalue"
 is_dns_nameserver_valid "$domain" "$rtype" "$dvalue"
 is_format_valid 'ttl'
+if [ -n "$restart" ]; then
+    is_format_valid 'restart'
+fi
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -140,7 +139,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-domain

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add web/dns/mail domain
 # options: USER DOMAIN [IP] [RESTART]
-# labels: 
 #
 # example: v-add-domain admin example.com
 #
-# The function adds web/dns/mail domain to a server.
-
+# This function adds web/dns/mail domain to a server.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,7 +26,6 @@ source $HESTIA/func/ip.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -43,7 +40,6 @@ is_object_unsuspended 'user' 'USER' "$user"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -84,7 +80,6 @@ check_result $? "can't restart proxy" > /dev/null
 $BIN/v-restart-dns "$restart"
 check_result $? "can't restart dns" > /dev/null
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 6
bin/v-add-fastcgi-cache

@@ -1,16 +1,15 @@
 #!/bin/bash
 # info: Enable FastCGI cache for nginx
 # options: USER DOMAIN [DURATION] [DEBUG] [RESTART]
-# labels: hestia web
 #
 # example: v-add-fastcgi-cache user domain.tld 30m
 #
-# The function enables FastCGI cache for nginx
+# This function enables FastCGI cache for nginx
 # Acceptable values for duration is time in seconds (10s) minutes (10m) or days (10d)
 # Add "yes" as last parameter to append debug information to response headers
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -27,13 +26,12 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [DURATION] [DEBUG] [RESTART]'
-is_format_valid 'user' 'domain'
+is_format_valid 'user' 'domain' 'restart'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
@@ -52,7 +50,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 6
bin/v-add-firewall-ban

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add firewall blocking rule
 # options: IP CHAIN
-# labels: 
 #
 # example: v-add-firewall-ban 37.120.129.20 MAIL
 #
-# The function adds new blocking rule to system firewall
-
+# This function adds new blocking rule to system firewall
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -29,7 +27,6 @@ source $HESTIA/func/firewall.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -84,7 +81,6 @@ $iptables -I fail2ban-$chain 1 -s $ip \
 # Changing permissions
 chmod 660 $conf
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 6
bin/v-add-firewall-chain

@@ -1,20 +1,19 @@
 #!/bin/bash
 # info: add firewall chain
 # options: CHAIN [PORT] [PROTOCOL] [PROTOCOL]
-# labels: 
 #
 # example: v-add-firewall-chain CRM 5678 TCP
 #
-# The function adds new rule to system firewall
-
+# This function adds new rule to system firewall
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
 chain=$(echo $1 | tr '[:lower:]' '[:upper:]')
 port=$2
+port_ext=$2
 protocol=${4-TCP}
 protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
 
@@ -42,7 +41,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 #----------------------------------------------------------#
 
 check_args '1' "$#" 'CHAIN [PORT] [PROTOCOL]'
-is_format_valid 'chain'
+is_format_valid 'chain' 'port_ext' 'protocol'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
 # Perform verification if read-only mode is enabled
@@ -98,7 +97,6 @@ fi
 # Changing permissions
 chmod 660 $chains
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 21 - 22
bin/v-add-firewall-ipset

@@ -1,14 +1,13 @@
 #!/bin/bash
 # info: add firewall ipset
 # options: NAME [SOURCE] [IPVERSION] [AUTOUPDATE] [FORCE]
-# labels: hestia
 #
 # example: v-add-firewall-ipset country-nl 'http://ipverse.net/ipblocks/data/countries/nl.zone'
 #
-# The function adds new ipset to system firewall
+# This function adds new ipset to system firewall
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 ip_name=${1}
@@ -25,7 +24,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -36,11 +34,29 @@ is_boolean_format_valid "$autoupdate" 'bool (yes/no)'
 is_boolean_format_valid "$force" 'bool (yes/no)'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
-ipset_hstobject='../../data/firewall/ipset'
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
+# Define variables for ipset configuration
+ipset_hstobject='../../data/firewall/ipset'
 IPSET_BIN="$(which 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"
+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 
+    touch $HESTIA/data/firewall/ipset.conf
+fi
+
 if [ -z "$data_source" ]; then
     if [ ! -f "${IPSET_PATH}.conf" ] || [[ ! $(grep "LISTNAME='$ip_name'" "${IPSET_PATH}.conf") ]]; then
         check_args '2' "$#" 'NAME SOURCE [IPVERSION] [AUTOUPDATE] [FORCE]'
@@ -60,29 +76,13 @@ if ! echo "$data_source" | egrep -q '^(https?|script|file):'; then
     check_result "$E_INVALID" "invalid ipset source, valid: (http[s]://|script:|file:)"
 fi
 
-
 IPSET_FILE="${ip_name}.${ip_version}"
 IPSET_MIN_SIZE=10
 
-# Perform verification if read-only mode is enabled
-check_hestia_demo_mode
-
-# 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"
-fi
-
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-mkdir -p "$IPSET_PATH"
-
 # Generate ip lists file if missing or when forced
 if [ ! -f "${IPSET_PATH}/${IPSET_FILE}.iplist" ] || [ "$force" = "yes" ]; then
 
@@ -184,7 +184,6 @@ if ! grep --silent --no-messages "v-update-firewall-ipset" $HESTIA/data/queue/da
     echo "$cmd" >> $HESTIA/data/queue/daily.pipe
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 7
bin/v-add-firewall-rule

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add firewall rule
 # options: ACTION IP PORT [PROTOCOL] [COMMENT] [RULE]
-# labels: 
 #
 # example: v-add-firewall-rule DROP 185.137.111.77 25
 #
-# The function adds new rule to system firewall
-
+# This function adds new rule to system firewall
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -45,7 +43,6 @@ sort_fw_rules() {
         $HESTIA/data/firewall/rules.conf
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -61,7 +58,7 @@ if [ -n "$comment" ]; then
 fi
 if [[ "$ip" =~ ^ipset: ]]; then
     ipset_name="${ip#ipset:}"
-    v-list-firewall-ipset plain | grep "^$ipset_name\s" >/dev/null
+    $BIN/v-list-firewall-ipset plain | grep "^$ipset_name\s" >/dev/null
     check_result $? 'ipset object not found' "$E_NOTEXIST"
 else
     is_format_valid 'ip'
@@ -102,11 +99,11 @@ $BIN/v-update-firewall
 #----------------------------------------------------------#
 
 # Fix missing port value in log if zero
-# Logging
 if [ -z "$port" ]; then
     port="0"
 fi
 
+# Logging
 $BIN/v-log-action "system" "Info" "Firewall" "Added firewall rule (Action: $action, Port: $port, Protocol: $protocol)."
 log_event "$OK" "$ARGUMENTS"
 

+ 5 - 2
bin/v-add-fs-archive

@@ -1,11 +1,14 @@
 #!/bin/bash
 # info: archive directory
 # options: USER ARCHIVE SOURCE [SOURCE...]
-# labels: 
 #
 # example: v-add-fs-archive admin archive.tar readme.txt
 #
-# The function creates tar archive
+# This function creates tar archive
+
+#----------------------------------------------------------#
+#                Variables & Functions                     #
+#----------------------------------------------------------#
 
 user=$1
 archive=$2

+ 5 - 2
bin/v-add-fs-directory

@@ -1,11 +1,14 @@
 #!/bin/bash
 # info: add directory
 # options: USER DIRECTORY
-# labels: 
 #
 # example: v-add-fs-directory admin mybar
 #
-# The function creates new directory on the file system
+# This function creates new directory on the file system
+
+#----------------------------------------------------------#
+#                Variables & Functions                     #
+#----------------------------------------------------------#
 
 user=$1
 dst_dir=$2

+ 5 - 2
bin/v-add-fs-file

@@ -1,11 +1,14 @@
 #!/bin/bash
 # info: add file
 # options: USER FILE
-# labels: 
 #
 # example: v-add-fs-file admin readme.md
 #
-# The function creates new files on file system
+# This function creates new files on file system
+
+#----------------------------------------------------------#
+#                Variables & Functions                     #
+#----------------------------------------------------------#
 
 user=$1
 dst_file=$2

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: check letsencrypt domain
 # options: USER DOMAIN [ALIASES] [MAIL]
-# labels: web
 #
 # example: v-add-letsencrypt-domain admin wonderland.com www.wonderland.com
 #
-# The function check and validates domain with Let's Encrypt
-
+# This function check and validates domain with Let's Encrypt
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -64,7 +62,6 @@ query_le_v2() {
     debug_log "API call" "exit status: $?"
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -114,7 +111,6 @@ debug_log() {
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 6
bin/v-add-letsencrypt-host

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add letsencrypt for host and backend
 # options: NONE
-# labels: hestia
 #
 # example: v-add-letsencrypt-host
 #
-# The function check and validates the backend certificate and generate
+# This function check and validates the backend certificate and generate
 # a new let's encrypt certificate.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -33,6 +31,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -42,7 +41,6 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -91,7 +89,6 @@ $BIN/v-update-host-certificate "$user" "$domain"
 $BIN/v-add-web-domain-ssl-force "$user" "$domain" > /dev/null 2>&1
 $BIN/v-add-web-domain-ssl-hsts "$user" "$domain" > /dev/null 2>&1
 
-
 #----------------------------------------------------------#
 #                        Hestia                            #
 #----------------------------------------------------------#

+ 3 - 7
bin/v-add-letsencrypt-user

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: register letsencrypt user account
 # options: USER
-# labels: web
 #
 # example: v-add-letsencrypt-user bob
 #
-# The function creates and register LetsEncrypt account
-
+# This function creates and register LetsEncrypt account
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -55,7 +53,6 @@ query_le_v2() {
     curl -s -i -d "$post_data" "$1" -H "$content"
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -72,11 +69,11 @@ fi
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-
 # Defining user email
 if [[ -z "$EMAIL" ]]; then
     EMAIL=$(get_user_value '$CONTACT')
@@ -129,7 +126,6 @@ if [[ "${status:0:2}" -ne "20" ]]; then
     check_result "$E_CONNECT" "Let's Encrypt acc registration failed $status"
 fi
 
-
 #----------------------------------------------------------#
 #                        Hestia                            #
 #----------------------------------------------------------#

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain account
 # options: USER DOMAIN ACCOUNT PASSWORD [QUOTA]
-# labels: mail
 #
 # example: v-add-mail-account user example.com john P4$$vvOrD
 #
-# The function add new email account.
-
+# This function add new email account.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -34,7 +32,6 @@ if [[ "$account" =~ [[:upper:]] ]]; then
     account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
 fi
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -56,7 +53,6 @@ is_password_valid
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-account-alias

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail account alias aka nickname
 # options: USER DOMAIN ACCOUNT ALIAS
-# labels: mail
 #
 # example: v-add-mail-account-alias admin acme.com alice alicia
 #
-# The function add new email alias.
-
+# This function add new email alias.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -34,7 +32,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -53,7 +50,6 @@ is_mail_new "$malias"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -64,7 +60,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     echo "$str" >> $HOMEDIR/$user/conf/mail/$domain/aliases
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-account-autoreply

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail account autoreply message
 # options: USER DOMAIN ACCOUNT MESSAGE
-# labels: mail
 #
 # example: v-add-mail-account-autoreply admin example.com user Hello from e-mail!
 #
-# The function add new email account.
-
+# This function add new email account.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -41,7 +39,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -60,7 +57,6 @@ is_object_unsuspended "mail/$domain" 'ACCOUNT' "$account"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -73,7 +69,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     chmod 660 $msg
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-account-forward

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail account forward address
 # options: USER DOMAIN ACCOUNT FORWARD
-# labels: mail
 #
 # example: v-add-mail-account-forward admin acme.com alice bob
 #
-# The function add new email account.
-
+# This function add new email account.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -33,7 +31,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -60,7 +57,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -78,7 +74,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     echo "$account@$domain_idn:$fwd" >> $HOMEDIR/$user/conf/mail/$domain/aliases
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 6
bin/v-add-mail-account-fwd-only

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail account forward-only flag
 # options: USER DOMAIN ACCOUNT
-# labels: mail
 #
 # example: v-add-mail-account-fwd-only admin example.com user
 #
-# The function adds fwd-only flag
-
+# This function adds fwd-only flag
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -40,7 +38,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -64,7 +61,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain
 # options: USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE]
-# labels: mail
 #
 # example: v-add-mail-domain admin mydomain.tld
 #
-# The function adds MAIL domain.
-
+# This function adds MAIL domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -50,7 +48,7 @@ domain_utf=$(idn -t --quiet -u "$domain_idn")
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [ANTISPAM] [ANTIVIRUS] [DKIM] [DKIM_SIZE]'
-is_format_valid 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size'
+is_format_valid 'user' 'domain' 'antispam' 'antivirus' 'dkim' 'dkim_size' 'restart'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -76,7 +74,6 @@ is_base_domain_owner "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-domain-antispam

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain antispam support
 # options: USER DOMAIN
-# labels: mail
 #
 # example: v-add-mail-domain-antispam admin mydomain.tld
 #
-# The function enables spamassasin for incoming emails.
-
+# This function enables spamassasin for incoming emails.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -32,7 +30,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -49,7 +46,6 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTISPAM'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -59,7 +55,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     touch $HOMEDIR/$user/conf/mail/$domain/antispam
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-domain-antivirus

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain antivirus support
 # options: USER DOMAIN
-# labels: mail
 #
 # example: v-add-mail-domain-antivirus admin mydomain.tld
 #
-# The function enables clamav scan for incoming emails.
-
+# This function enables clamav scan for incoming emails.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -32,7 +30,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -49,7 +46,6 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$ANTIVIRUS'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -59,7 +55,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     touch $HOMEDIR/$user/conf/mail/$domain/antivirus
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-domain-catchall

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain catchall account
 # options: USER DOMAIN EMAIL
-# labels: mail
 #
 # example: v-add-mail-domain-catchall admin example.com master@example.com
 #
-# The function enables catchall account for incoming emails.
-
+# This function enables catchall account for incoming emails.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -32,7 +30,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -49,7 +46,6 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$CATCHALL'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -60,7 +56,6 @@ if [[ "$MAIL_SYSTEM" =~ exim ]]; then
     echo "*@$domain_idn:$email" >> $HOMEDIR/$user/conf/mail/$domain/aliases
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-mail-domain-dkim

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add mail domain dkim support
 # options: USER DOMAIN [DKIM_SIZE]
-# labels: mail
 #
 # example: v-add-mail-domain-dkim admin acme.com
 #
-# The function adds DKIM signature to outgoing domain emails.
-
+# This function adds DKIM signature to outgoing domain emails.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -40,7 +38,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -57,7 +54,6 @@ is_object_value_empty 'mail' 'DOMAIN' "$domain" '$DKIM'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -87,7 +83,6 @@ if [ -n "$DNS_SYSTEM" ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then
     $BIN/v-add-dns-record "$user" "$domain" "$record" TXT "$selector" '' '' 'yes' '' 'yes'
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 1 - 2
bin/v-add-mail-domain-smtp-relay

@@ -1,14 +1,13 @@
 #!/bin/bash
 # info: Add mail domain smtp relay support
 # options: USER DOMAIN HOST USERNAME PASSWORD [PORT]
-# labels: mail
 #
 # example: v-add-mail-domain-smtp-relay user domain.tld srv.smtprelay.tld uname123 pass12345
 #
 # This function adds mail domain smtp relay support.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition

+ 5 - 3
bin/v-add-mail-domain-ssl

@@ -1,15 +1,14 @@
 #!/bin/bash
 # info: add mail SSL for $domain
 # options: USER DOMAIN SSL_DIR [RESTART]
-# labels: hestia
 #
-# The function turns on SSL support for a mail domain. Parameter ssl_dir
+# 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 
 # mail.domain.tld.crt and its key mail.domain.tld.key are mandatory. Certificate
 # authority mail.domain.tld.ca file is optional.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -64,6 +63,9 @@ is_web_domain_cert_valid
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
+if [ -n "$restart" ]; then 
+    is_format_valid "$restart"
+fi
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -1,16 +1,15 @@
 #!/bin/bash
 # info: add webmail support for a domain
 # options: USER DOMAIN [WEBMAIL] [RESTART] [QUIET]
-# labels: hestia
 #
 # example: v-add-sys-webmail user domain.com
 # example: v-add-sys-webmail user domain.com rainloop
 # example: v-add-sys-webmail user domain.com roundcube
 #
-# this function enables webmail client for a mail domain.
+# This function enables webmail client for a mail domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -51,7 +50,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -63,7 +61,7 @@ if [ -z "$webmail" ]; then
 fi
 
 check_args '2' "$#" 'USER DOMAIN [WEBMAIL] [RESTART]'
-is_format_valid 'user' 'domain'
+is_format_valid 'user' 'domain' 'restart'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_system_enabled "$IMAP_SYSTEM" 'IMAP_SYSTEM'
 is_type_valid "$WEBMAIL_SYSTEM disabled" "$webmail"
@@ -167,6 +165,7 @@ fi
 
 # Set SSL as enabled in configuration
 update_object_value 'mail' 'DOMAIN' "$domain" '$WEBMAIL' "$webmail"
+
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 5 - 7
bin/v-add-remote-dns-domain

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add remote dns domain
 # options: USER DOMAIN [FLUSH]
-# labels: dns
 #
 # example: v-add-remote-dns-domain admin mydomain.tld yes
 #
-# The function synchronize dns domain with the remote server.
-
+# This function synchronize dns domain with the remote server.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,13 +26,15 @@ source $HESTIA/func/remote.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
 
 check_args '2' "$#" 'USER DOMAIN [FLUSH]'
 is_format_valid 'user' 'domain'
+if [ -n "$flush" ]; then
+    is_type_valid "records yes no" "$flush" 
+fi
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check
@@ -84,8 +84,6 @@ for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
     check_result $? "$HOST connection failed" "$E_CONNECT"
 done
 
-
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 7
bin/v-add-remote-dns-host

@@ -1,19 +1,17 @@
 #!/bin/bash
 # info: add new remote dns host
 # options: HOST PORT USER PASSWORD [TYPE] [DNS_USER]
-# labels: dns
 #
 # 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 ''
 #
-# The function adds remote dns server to the dns cluster.
+# This function adds remote dns server to the dns cluster.
 # As alternative api_key generated on the slave server.
 # See v-generate-api-key can be used to connect the remote dns server
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -42,14 +40,13 @@ source $HESTIA/func/remote.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
 
 args_usage='HOST PORT USER [PASSWORD] [TYPE] [DNS_USER]'
 check_args '3' "$#" "$args_usage"
-is_format_valid 'host' 'port' 'type' 'dns_user'
+is_format_valid 'host' 'port' 'dns_user'
 if [ -z "$password" ]; then
     is_format_valid 'hash'
 else
@@ -63,6 +60,7 @@ is_dnshost_alive
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -103,7 +101,6 @@ check_result $? "$HOST connection failed" "$E_CONNECT"
 $BIN/v-sync-dns-cluster "$host"
 check_result $? "$HOST sync failed" "$E_CONNECT"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add remote dns domain record
 # options: USER DOMAIN ID
-# labels: dns
 #
 # example: v-add-remote-dns-record bob acme.com 23
 #
-# The function synchronize dns domain with the remote server.
-
+# This function synchronize dns domain with the remote server.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -27,7 +25,6 @@ source $HESTIA/func/remote.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -80,7 +77,6 @@ for cluster in $(grep "SUSPENDED='no'" $HESTIA/conf/dns-cluster.conf); do
 
 done
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 6 - 4
bin/v-add-sys-api-ip

@@ -1,12 +1,11 @@
 #!/bin/bash
-# info: add ip adresss to allowed ip list api
+# info: add IP address to API allow list
 # options: IP 
-# labels: hestia
 #
 # example: v-add-sys-api-ip 1.1.1.1
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 ip46=${1// /}
@@ -31,7 +30,6 @@ is_format_valid 'ip46'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -42,6 +40,10 @@ else
     $BIN/v-change-sys-config-value 'API_ALLOWED_IP' "$ip46"
 fi
 
+#----------------------------------------------------------#
+#                       Hestia                             #
+#----------------------------------------------------------#
+
 # Logging
 $BIN/v-log-action "system" "Warning" "System" "Added new IP address added to Allowed IP API (IP: $ip46)"
 log_event "$OK" "$ARGUMENTS"

+ 2 - 5
bin/v-add-sys-filemanager

@@ -1,13 +1,12 @@
 #!/bin/bash
 # info: add file manager functionality to Hestia Control Panel
 # options: [MODE]
-# labels: hestia
 #
-# The function installs the File Manager on the server
+# This function installs the File Manager on the server
 # for access through the Web interface.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -20,7 +19,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 # load config file
 source_conf "$HESTIA/install/upgrade/upgrade.conf"
 
-
 MODE=$1
 user="admin"
 
@@ -29,7 +27,6 @@ FM_FILE="filegator_v${fm_v}.zip"
 FM_URL="https://github.com/filegator/filegator/releases/download/v${fm_v}/${FM_FILE}"
 COMPOSER_BIN="$HOMEDIR/$user/.composer/composer"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-sys-firewall

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add system firewall
 # options: NONE
-# labels: panel
 #
 # example: v-add-sys-firewall
 #
-# The script enables firewall
-
+# This function enables the system firewall.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -20,7 +18,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -32,7 +29,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -48,7 +44,6 @@ $BIN/v-change-sys-config-value "FIREWALL_SYSTEM" "iptables"
 # Updating firewall rules
 $BIN/v-update-firewall
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 8
bin/v-add-sys-ip

@@ -1,20 +1,18 @@
 #!/bin/bash
 # info: add system ip address
 # options: IP NETMASK [INTERFACE] [USER] [IP_STATUS] [IP_NAME] [NAT_IP]
-# labels:
 #
 # example: v-add-sys-ip 216.239.32.21 255.255.255.0
 #
-# The function adds ip address into a system. It also creates rc scripts. You
+# This function adds ip address into a system. It also creates rc scripts. You
 # 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 
 # is very handy when customer wants to test domain before dns migration.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Get interface name
@@ -63,7 +61,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -77,7 +74,7 @@ if [ -z "$sys_ip_check" ]; then
     /sbin/ip addr add $ip/$cidr dev $iface \
         broadcast $broadcast label $iface
     
-    # Improve check netplan
+    # Check if netplan is in use and generate configuration file
     if dpkg-query -W -f'${Status}' "netplan*" 2>/dev/null | grep -q "ok installed"; then 
         result=$(cat /etc/netplan/*.yaml 2>/dev/null | grep $(hostname -I | cut -d' ' -f1));
         if [ -n "$result" ]; then 
@@ -106,7 +103,7 @@ if [ -z "$sys_ip_check" ]; then
         echo -e $sys_ip >> /etc/netplan/60-hestia.yaml
         unset IFS
     else
-        sys_ip="\n# Added by hestia"
+        sys_ip="\n# Added by Hestia Control Panel"
         sys_ip="$sys_ip\nauto $iface"
         sys_ip="$sys_ip\niface $iface inet static"
         sys_ip="$sys_ip\naddress $ip"
@@ -195,7 +192,6 @@ if [ -n "$PROXY_SYSTEM" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 5
bin/v-add-sys-phpmailer

@@ -1,12 +1,11 @@
 #!/bin/bash
 # info: add PHPMailer functionality to Hestia Control Panel
 # options: [MODE]
-# labels: hestia
 #
-# The function installs PHPMailer for Server sided email communication
+# This function installs PHPMailer for server-side email communication.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -25,7 +24,6 @@ user="admin"
 PM_INSTALL_DIR="$HESTIA/web/inc"
 COMPOSER_BIN="$HOMEDIR/$user/.composer/composer"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -68,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_version"  ]; 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

+ 7 - 4
bin/v-add-sys-pma-sso

@@ -1,14 +1,13 @@
 #!/bin/bash
-# info: enables support for single sign on PHPmyAdmin 
+# info: enables support for single sign on phpMyAdmin 
 # options: [mode]
-# labels: 
 #
 # example: v-add-sys-pma-sso
 #
-# Enables support for SSO to PHPmyAdmin
+# This function enables support for SSO to phpMyAdmin
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 MODE=$1
@@ -110,6 +109,10 @@ fi
 
 $BIN/v-change-sys-config-value 'PHPMYADMIN_KEY' "$phpmyadminkey"
 
+if [  "$(echo $API_ALLOWED_IP | grep 127.0.0.1)" != "127.0.0.1" ]; then 
+    $BIN/v-add-sys-api-ip "127.0.0.1"
+fi
+
 #----------------------------------------------------------#
 #                       Logging                            #
 #----------------------------------------------------------#

+ 2 - 5
bin/v-add-sys-quota

@@ -1,14 +1,12 @@
 #!/bin/bash
 # info: add system quota
 # options: NONE
-# labels: 
 #
 # example: v-add-sys-quota
 #
-# The script enables filesystem quota on /home partition
+# This function enables filesystem quota on /home partition
 # Some kernels do require additional packages to be installed first
 
-
 #----------------------------------------------------------#
 #                 Variable & Function                      #
 #----------------------------------------------------------#
@@ -19,7 +17,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -50,6 +47,7 @@ fi
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -97,7 +95,6 @@ for user in $($HESTIA/bin/v-list-sys-users plain); do
     $BIN/v-update-user-quota "$user"
 done
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 5
bin/v-add-sys-rainloop

@@ -1,12 +1,11 @@
 #!/bin/bash
-# info: Install Rainloop in HestiaCP
+# info: Install Rainloop webmail client
 # options: [MODE]
-# labels: hestia
 #
-# The function installs Rainloop
+# This function installs the Rainloop webmail client.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -168,7 +167,7 @@ else
 fi
 
 #----------------------------------------------------------#
-#                       Logging                            #
+#                       Hestia                             #
 #----------------------------------------------------------#
 
 if [ "$UPDATE" = "yes" ]; then

+ 10 - 8
bin/v-add-sys-roundcube

@@ -1,12 +1,11 @@
 #!/bin/bash
-# info: Install RoundCube for Nginx/Apache2 
+# info: Install Roundcube webmail client
 # options: [MODE]
-# labels: hestia
 #
-# The function installs Round Cube
+# This function installs the Roundcube webmail client.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -147,14 +146,15 @@ if [ "$UPDATE" == "no" ]; then
         sed -i "s/%password%/$r/g" $RC_CONFIG_DIR/config.inc.php
         mysql roundcube < /var/lib/roundcube/SQL/mysql.initial.sql
     fi
-    # To do in future add support for Postgresql only setup
+
+    # 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
-    # Change hostname for password change
+    # Update server hostname in password change plugin
     sed -i "s/localhost/$(hostname)/g" $RC_CONFIG_DIR/plugins/password/config.inc.php
     
-    #Clean up
+    # 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;
@@ -182,6 +182,7 @@ else
     # 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
@@ -191,8 +192,9 @@ else
     rm -f -r $RC_INSTALL_DIR/$RC_FILE
     rm -f -r $RC_INSTALL_DIR/$RC_EXTRACT
 fi
+
 #----------------------------------------------------------#
-#                       Logging                            #
+#                       Hestia                             #
 #----------------------------------------------------------#
 
 if [ "$UPDATE" = "yes" ]; then

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add system sftp jail
 # options: [RESTART]
-# labels: 
 #
 # example: v-add-sys-sftp-jail yes
 #
-# The script enables sftp jailed environment
-
+# This function enables sftp jailed environment.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -20,7 +18,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 restart=$1
 
 #----------------------------------------------------------#
@@ -75,9 +72,18 @@ fi
 # Checking users
 shells="rssh|nologin"
 for user in $(grep "$HOMEDIR" /etc/passwd |egrep "$shells" |cut -f 1 -d:); do
-    $BIN/v-add-user-sftp-jail "$user" "$restart"
+    # Include all users v-add-user-sftp-jail will handle it
+    $BIN/v-add-user-sftp-jail "$user" "no"
 done
 
+# Restart ssh service
+if [ "$restart" = 'no' ]; then
+    # Skip restart of SSH daemon
+    echo "" > /dev/null 2>&1
+else
+    service ssh restart > /dev/null 2>&1
+fi
+
 # Add v-add-sys-sftp-jail to startup
 if [ ! -e "/etc/cron.d/hestia-sftp" ]; then
     echo "@reboot root sleep 60 && /usr/local/hestia/bin/v-add-sys-sftp-jail" > /etc/cron.d/hestia-sftp

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

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: Add SMTP Account for logging, notification and internal mail
 # options: DOMAIN PORT SMTP_SECURITY USERNAME PASSWORD EMAIL
-# labels:
 #
 # example: v-add-sys-smtp example.com 587 STARTTLS test@domain.com securepassword test@example.com
 #
@@ -9,7 +8,7 @@
 # for logging, notification and warn emails etc.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,7 +27,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -46,7 +44,6 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
-
 change_sys_value "USE_SERVER_SMTP" 'true'
 change_sys_value "SERVER_SMTP_HOST" "$domain" 
 change_sys_value "SERVER_SMTP_PORT" "$port"

+ 3 - 6
bin/v-add-sys-smtp-relay

@@ -1,14 +1,13 @@
 #!/bin/bash
 # info: add system wide smtp relay support
 # options: HOST USERNAME PASSWORD [PORT]
-# labels: hestia
 #
 # example: v-add-sys-smtp-relay srv.smtprelay.tld uname123 pass12345
 #
-# this function adds system wide smtp relay support.
+# This function adds system wide smtp relay support.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -25,7 +24,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -35,6 +33,7 @@ is_format_valid 'port' 'host' 'password'
 is_username_format_valid "$username" 'username'
 format_no_quotes "$password" 'passowrd'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
+
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
@@ -42,7 +41,6 @@ check_hestia_demo_mode
 #                       Action                             #
 #----------------------------------------------------------#
 
-
 change_sys_value 'SMTP_RELAY' 'true'
 change_sys_value 'SMTP_RELAY_HOST' "$host"
 change_sys_value 'SMTP_RELAY_PORT' "$port"
@@ -55,7 +53,6 @@ user:$username
 pass:$password
 EOL
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 6 - 9
bin/v-add-user

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add system user
 # options: USER PASSWORD EMAIL [PACKAGE] [NAME] [LASTNAME]
-# labels: 
 #
 # example: v-add-user admin2 P4$$w@rD bgates@aol.com
 #
-# The function creates new user account.
-
+# This function creates new user account.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -137,11 +135,6 @@ chown $user:$user \
 chmod a+x $HOMEDIR/$user
 chattr +i $HOMEDIR/$user/conf > /dev/null 2>&1
 
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
 # Adding user dir
 mkdir -p  $USER_DATA/ssl $USER_DATA/dns $USER_DATA/mail
 
@@ -266,6 +259,10 @@ fi
 # Adding jailed sftp env
 $BIN/v-add-user-sftp-jail $user
 
+#----------------------------------------------------------#
+#                       Hestia                             #
+#----------------------------------------------------------#
+
 # Logging
 $BIN/v-log-action "system" "Info" "Users" "User account added (Name: $user)."
 $BIN/v-log-action "$user" "Info" "System" "Welcome!"

+ 2 - 7
bin/v-add-user-2fa

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add 2fa to existing user
 # options: USER
-# labels: hestia panel
 #
 # example: v-add-user-2fa admin
 #
-# The function creates a new 2fa token for user.
-
+# This function creates a new 2fa token for user.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -23,8 +21,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -36,7 +32,6 @@ is_object_valid 'user' 'USER' "$user"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 5 - 6
bin/v-add-user-composer

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add composer (php dependency manager) for a user
 # options: USER
-# labels: hestia
 #
 # example: v-add-user-composer user [version]
 #
-# The function adds support for composer (php dependency manager)
+# This function adds support for composer (php dependency manager)
 # Homepage: https://getcomposer.org/
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -29,7 +27,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -45,7 +42,6 @@ is_object_unsuspended 'user' 'USER' "$user"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -87,6 +83,9 @@ check_result $? "Composer install failed"
 
 [ -f "$COMPOSER_SETUP_FILE" ] && rm -f "$COMPOSER_SETUP_FILE"
 
+#----------------------------------------------------------#
+#                       Hestia                             #
+#----------------------------------------------------------#
 
 # Logging
 $BIN/v-log-action "$user" "Info" "Plugins" "Composer support enabled."

+ 3 - 6
bin/v-add-user-notification

@@ -1,13 +1,11 @@
 #!/bin/bash
 # info: add user notification
 # options: USER TOPIC NOTICE [TYPE]
-# labels: 
 #
-# The function adds user notification.
-
+# This function adds a new user notification to the panel.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -24,7 +22,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -35,6 +32,7 @@ is_object_valid 'user' 'USER' "$user"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -67,7 +65,6 @@ echo "$str" >> $USER_DATA/notifications.conf
 # Changing permissions
 chmod 660 $USER_DATA/notifications.conf
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-user-package

@@ -1,13 +1,11 @@
 #!/bin/bash
 # info: adding user package
 # options: tmpfile PACKAGE [REWRITE]
-# labels: 
 #
-# The function adds new user package to the system.
-
+# This function adds new user package to the system.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -85,7 +83,6 @@ is_package_consistent() {
     is_format_valid_shell "$SHELL"
 }
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -108,7 +105,6 @@ is_package_consistent
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -116,7 +112,6 @@ check_hestia_demo_mode
 cp -f "$tmpfile" "$HESTIA/data/packages/$package.pkg"
 chmod 644 "$HESTIA/data/packages/$package.pkg"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add user sftp jail
 # options: USER [RESTART]
-# labels: 
 #
 # example: v-add-user-sftp-jail admin
 #
-# The script enables sftp jailed environment
-
+# This function enables sftp jailed environment
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -30,20 +28,24 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 check_args '1' "$#" 'USER'
 is_format_valid 'user'
-# Limit to only Hestia user(s)
-is_object_valid 'user' 'USER' "$user"
+check=$(is_object_valid 'user' 'USER' "$user")
+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 / ) 
+    is_object_valid 'user' 'USER' "$user_owner"
+fi 
 user_str=$(grep "^$user:" /etc/passwd |egrep "rssh|nologin")
 if [ -z "$user_str" ]; then
     exit
 fi
 
-
 # Get current users and split into array
 ssh_users=$(grep -A1 "^# Hestia SFTP Chroot" /etc/ssh/sshd_config | sed -n 2p | sed 's/Match User //')
 IFS=',' read -r -a users <<< "$ssh_users"
 
-match_string="$ssh_users,"
 # Check if jail exist
+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

+ 2 - 9
bin/v-add-user-sftp-key

@@ -1,13 +1,11 @@
 #!/bin/bash
 # info: add user sftp key
 # options: USER [TTL]
-# labels: hestia
 #
-# The script creates and updates ssh key for filemanager usage
-
+# This function creates and updates SSH keys for used with the File Manager.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -46,15 +44,12 @@ AUTHKEY_FILE="$HOMEDIR/$user/.ssh/authorized_keys"
 [ -z "$(readlink -f "$AUTHKEY_FILE" | egrep "^$HOMEDIR/$user/.ssh/")" ] && check_result "$E_FORBIDEN" "Invalid authorized keys path"
 
 if [ ! -f "${PRVKEY_FILE}" ]; then
-
     ssh-keygen -q -b 1024 -t rsa -f "${PRVKEY_FILE}" -N ""
     rm "${PUBKEY_FILE}"
     new_privkey=true
-
 fi
 
 if [ ! -f "${AUTHKEY_FILE}" ] || [ "$new_privkey" = true ]; then
-
     pubkey_str="$(ssh-keygen -y -f ${PRVKEY_FILE})"
     pubkey_desc="filemanager.ssh.key"
 
@@ -71,14 +66,12 @@ if [ ! -f "${AUTHKEY_FILE}" ] || [ "$new_privkey" = true ]; then
         echo "rm ${PRVKEY_FILE}" | at "now +${ttl} minute" > /dev/null 2>&1
     fi
     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}"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 4 - 7
bin/v-add-user-ssh-key

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: add ssh key
 # options: USER KEY
-# labels: hestia
 #
 # example: v-add-user-ssh-key user 'valid ssh key'
 #
@@ -9,10 +8,9 @@
 # After that it append the new key(s)
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
-
 # Argument definition
 user=$1
 key=$2
@@ -24,7 +22,6 @@ source /etc/hestiacp/hestia.conf
 source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
-# Additional argument formatting
 
 #----------------------------------------------------------#
 #                    Verifications                         #
@@ -48,7 +45,7 @@ source $USER_DATA/user.conf
 AUTHKEY_FILE="$HOMEDIR/$user/.ssh/authorized_keys"
 [ -z "$(readlink -f "$AUTHKEY_FILE" | egrep "^$HOMEDIR/$user/.ssh/")" ] && check_result "$E_FORBIDEN" "Invalid authorized keys path"
 
-#check if file exits
+# Check if file exits
 if [ ! -f "$AUTHKEY_FILE" ]; then
     v-add-fs-file "$user" "${AUTHKEY_FILE}"
 fi
@@ -59,10 +56,10 @@ if ! echo "$key" | ssh-keygen -l -f - > /dev/null 2>&1; then
     check_result "$E_PARSING" "Validating user private key"
 fi
 
-# make sure authorized_keys is ending with EOL
+# Make sure authorized_keys ends with EOL
 [ -f "${AUTHKEY_FILE}" ] && sed -i '$a\' "${AUTHKEY_FILE}"
 
-#append key to file
+# Append key data to file
 echo "$key" >> "$AUTHKEY_FILE"
 
 #----------------------------------------------------------#

+ 2 - 6
bin/v-add-user-wp-cli

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add wp-cli for a user
 # options: USER
-# labels: hestia
 #
 # example: v-add-user-wp-cli user
 #
-# The function adds support for wp-cli to the user account
-
+# This function adds support for wp-cli to the user account
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -26,7 +24,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -60,7 +57,6 @@ 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 chmod +x "$WPCLI_BIN"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,23 +1,20 @@
 #!/bin/bash
 # info: add web domain
 # options: USER DOMAIN [IP] [RESTART] [ALIASES] [PROXY_EXTENSIONS]
-# labels: web
 #
 # example: v-add-web-domain admin wonderland.com 192.18.22.43 yes www.wonderland.com
 #
-# The function adds virtual host to a server. In cases when ip is
+# This function adds virtual host to a server. In cases when ip is
 # undefined in the script, "default" template will be used. The alias of
 # www.domain.tld type will be automatically assigned to the domain unless
 # "none" is transmited as argument. If ip have associated dns name, this
 # domain will also get the alias domain-tpl.$ipname. An alias with the ip
 # name is useful during the site testing while dns isn't moved to server yet.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
-
 # Argument definition
 user=$1
 domain=$2
@@ -36,6 +33,8 @@ source $HESTIA/func/main.sh
 source $HESTIA/func/domain.sh
 # shellcheck source=/usr/local/hestia/func/ip.sh
 source $HESTIA/func/ip.sh
+# shellcheck source=/usr/local/hestia/func/syshealth.sh
+source $HESTIA/func/syshealth.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
@@ -88,7 +87,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -195,7 +193,6 @@ if [ -n "$PROXY_SYSTEM" ]; then
     add_web_config "$PROXY_SYSTEM" "$PROXY_TEMPLATE.tpl" 
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -217,6 +214,8 @@ echo "DOMAIN='$domain' IP='$ip' IP6='' CUSTOM_DOCROOT='' ALIAS='$ALIAS' TPL='$WE
  STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='0' U_BANDWIDTH='0'\
  SUSPENDED='no' TIME='$time' DATE='$date'" >> $USER_DATA/web.conf
 
+syshealth_repair_web_config
+
 # Restarting web server
 $BIN/v-restart-web "$restart"
 check_result $? "Web restart failed" >/dev/null

+ 3 - 8
bin/v-add-web-domain-alias

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add web domain alias
 # options: USER DOMAIN ALIASES [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-alias admin acme.com www.acme.com yes
 #
-# The call is intended for adding aliases to a domain (it is also called
-# "domain parking"). The function supports wildcards *.domain.tpl.
-
+# This function adds one or more aliases to a domain (it is also called
+# "domain parking"). This function supports wildcards *.domain.tpl.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -38,7 +36,6 @@ format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 format_aliases
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -60,7 +57,6 @@ is_base_domain_owner "$aliases"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -96,7 +92,6 @@ if [ -n  "$PROXY_SYSTEM" ] && [ -n "$PROXY" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: Allow other users create subdomains
 # options: USER DOMAIN
-# labels: web hestia
 #
 # example: v-add-web-domain-allow-users admin admin.com
 #
@@ -10,9 +9,8 @@
 # eg: admin adds admin.com
 # user can create user.admin.com
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 # Additional argument formatting
 format_domain
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#

+ 2 - 5
bin/v-add-web-domain-backend

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add web domain backend
 # options: USER DOMAIN [TEMPLATE] [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-backend admin exmaple.com default yes
 #
-# The call is used for adding web backend configuration.
-
+# This function is used to add the web backend configuration.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -43,7 +41,6 @@ is_backend_template_valid "$template"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-web-domain-ftp

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add ftp account for web domain.
 # options: USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH]
-# labels: web
 #
 # example: v-add-web-domain-ftp alice wonderland.com alice_ftp p4$$vvOrD
 #
-# The function creates additional ftp account for web domain.
-
+# This function creates additional ftp account for web domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -58,7 +55,6 @@ is_password_valid
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -114,7 +110,6 @@ ftp_md5=$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)
 # Adding jailed sftp env
 $BIN/v-add-user-sftp-jail "$ftp_user"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 7
bin/v-add-web-domain-httpauth

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add password protection for web domain
 # options: USER DOMAIN AUTH_USER AUTH_PASSWORD [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-httpauth admin acme.com user02 super_pass
 #
-# The call is used for securing web domain with http auth
-
+# This function is used for securing web domain with http auth
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,6 +33,7 @@ docroot="$HOMEDIR/$user/web/$domain/public_html"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -55,12 +54,10 @@ if [ -n "$(echo "$AUTH_USER" |tr : '\n' |grep ^$auth_user$)" ]; then
     exit "$E_EXISTS"
 fi
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
-
 # Adding htaccess password protection
     if [ "$WEB_SYSTEM" = "nginx" ] || [ "$PROXY_SYSTEM" = "nginx" ]; then
         htaccess="$HOMEDIR/$user/conf/web/$domain/nginx.conf_htaccess"
@@ -86,7 +83,6 @@ fi
         fi
     fi
 
-
 # Adding httpasswd user
 auth_hash=$($BIN/v-generate-password-hash htpasswd htpasswd $password)
 touch $htpasswd

+ 2 - 7
bin/v-add-web-domain-proxy

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: add webdomain proxy support
 # options: USER DOMAIN [TEMPLATE] [EXTENTIONS] [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-proxy admin example.com
 #
-# The function enables proxy support for a domain. This can significantly
+# This function enables proxy support for a domain. This can significantly
 # improve website speed.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -34,7 +32,6 @@ source $HESTIA/func/ip.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -55,7 +52,6 @@ is_proxy_template_valid $template
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -74,7 +70,6 @@ if [ "$SSL" = 'yes' ]; then
     add_web_config "$PROXY_SYSTEM" "$template.stpl"
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 3 - 5
bin/v-add-web-domain-redirect

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: Adding force redirect to domain
 # options: USER DOMAIN REDIRECT HTTPCODE [RESTART]
-# labels: hestia web
 #
 # example: v-add-web-domain-redirect user domain.tld domain.tld 
 # example: v-add-web-domain-redirect user domain.tld www.domain.tld 
@@ -12,9 +11,8 @@
 #
 # Function creates a forced redirect to a domain 
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -44,7 +42,6 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
 is_object_unsuspended 'web' 'DOMAIN' "$domain"
 
-
 scheme=0
 if [[ "$3" =~ http://|https:// ]]; then
     scheme=1
@@ -64,7 +61,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -99,11 +95,13 @@ fi
 #                       Hestia                             #
 #----------------------------------------------------------#
 
+# Update object keys
 if [ -z "$REDIRECT" ]; then
     add_object_key "web" 'DOMAIN' "$domain" 'REDIRECT' 'U_DISK'
     add_object_key "web" 'DOMAIN' "$domain" 'REDIRECT_CODE' 'U_DISK'
 fi
 
+# Update values for domain
 update_object_value 'web' 'DOMAIN' "$domain" '$REDIRECT' "$redirect"
 update_object_value 'web' 'DOMAIN' "$domain" '$REDIRECT_CODE' "$code"
 

+ 2 - 6
bin/v-add-web-domain-ssl

@@ -1,20 +1,18 @@
 #!/bin/bash
 # info: adding ssl for domain
 # options: USER DOMAIN SSL_DIR [SSL_HOME] [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-ssl admin example.com /home/admin/conf/example.com/web
 #
-# The function turns on SSL support for a domain. Parameter ssl_dir is a path
+# 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 
 # 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
 # documentroot directory.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -57,7 +55,6 @@ format_domain_idn
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -73,7 +70,6 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 is_object_value_empty 'web' 'DOMAIN' "$domain" '$SSL'
 is_web_domain_cert_valid
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 5
bin/v-add-web-domain-ssl-force

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: Adding force SSL for a domain
 # options: USER DOMAIN [RESTART] [QUIET]
-# labels: hestia web
 #
 # example: v-add-web-domain-ssl-force admin acme.com
 #
-# The function forces SSL for the requested domain.
-
+# This function forces SSL for the requested domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -41,7 +39,6 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 5
bin/v-add-web-domain-ssl-hsts

@@ -1,13 +1,11 @@
 #!/bin/bash
 # info: Adding hsts to a domain
 # options: USER DOMAIN [RESTART] [QUIET]
-# labels: hestia
 #
-# The function enables HSTS for the requested domain.
-
+# This function enables HSTS for the requested domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -38,7 +36,6 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -1,7 +1,6 @@
 #!/bin/bash
 # info: Adding force SSL for a domain
 # options: USER DOMAIN [SSL] 
-# labels: hestia web
 #
 # example: v-add-web-domain-ssl-preset
 #
@@ -9,7 +8,7 @@
 # When LE has been activated it will set the actions
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition

+ 2 - 7
bin/v-add-web-domain-stats

@@ -1,18 +1,16 @@
 #!/bin/bash
 # info: add log analyzer to generate domain statistics
 # options: USER DOMAIN TYPE
-# labels: web
 #
 # example: v-add-web-domain-stats admin example.com awstats
 #
-# The call is used for enabling log analyzer system to a domain. For viewing
+# This function is used for enabling log analyzer system to a domain. For viewing
 # the domain statistics use http://domain.tld/vstats/ link. Access this page
 # is not protected by default. If you want to secure it with passwords you
 # should use v-add-web-domain_stat_auth script.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -53,7 +50,6 @@ is_object_value_empty 'web' 'DOMAIN' "$domain" '$STATS'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -93,7 +89,6 @@ if [ "$type" == 'awstats' ]; then
         /etc/awstats/$type.$domain_idn.conf
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-add-web-domain-stats-user

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add password protection to web domain statistics
 # options: USER DOMAIN STATS_USER STATS_PASSWORD [RESTART]
-# labels: web
 #
 # example: v-add-web-domain-stats-user admin example.com watchdog your_password
 #
-# The call is used for securing the web statistics page.
-
+# This function is used for securing the web statistics page.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -29,7 +27,6 @@ source $HESTIA/func/domain.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -46,7 +43,6 @@ is_password_valid
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -71,7 +67,6 @@ salt=$(generate_password "$PW_MATRIX" "8")
 stats_pass=$($BIN/v-generate-password-hash md5 $salt $password)
 echo "$stats_user:$stats_pass" > $stats_dir/.htpasswd
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 8 - 11
bin/v-add-web-php

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: add php fpm version
 # options: VERSION
-# labels: hestia
 #
 # example: v-add-web-php 8.0
 #
-# The function checks and delete a fpm php version if not used by any domain.
-
+# This function checks and delete a fpm php version if not used by any domain.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -23,7 +21,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -36,7 +33,7 @@ php_fpm="/etc/init.d/php$version-fpm"
 # Verify php version format
 if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
     echo "The specified PHP version format is invalid, it should look like [0-9].[0-9]."
-    echo "Example:  7.0, 7.4, 8.0"
+    echo "Example: 7.0, 7.4, 8.0"
     exit "$E_INVALID";
 fi
 
@@ -55,16 +52,14 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
 
 mph="php$version-common php$version-mbstring php$version-bcmath php$version-cli php$version-curl
      php$version-fpm php$version-gd php$version-intl php$version-mysql
-     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"
+     php$version-soap php$version-xml php$version-zip 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
@@ -101,7 +96,7 @@ done
 # Do a blank echo to get the \n back
 echo
 
-# Check if installation was sucessfully
+# Check if installation was successful
 if [ ! -f "$php_fpm" ]; then
     echo "ERROR: Installation failed, please run the following command manually for debugging:"
     echo "apt-get install $mph"
@@ -124,6 +119,8 @@ v_tpl=${version//.}
 rm -f /etc/php/$version/fpm/pool.d/*
 cp -f $HESTIA_INSTALL_DIR/php-fpm/dummy.conf /etc/php/$version/fpm/pool.d/
 sed -i "s/9999/99$v_tpl/g" /etc/php/$version/fpm/pool.d/dummy.conf
+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
 
 # Install backend template
 cp -f $HESTIA_INSTALL_DIR/php-fpm/multiphp.tpl \

+ 3 - 8
bin/v-backup-user

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: backup system user with all its objects
 # options: USER NOTIFY
-# labels: 
 #
 # example: v-backup-user admin yes
 #
-# The call is used for backing up user with all its domains and databases.
-
+# This function is used for backing up user with all its domains and databases.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -183,7 +181,7 @@ let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
 if [ "$u_disk" -gt "$v_disk" ]; then
     # 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."
+    check_result "$E_LIMIT" "not enough diskspace available to perform the backup."
 fi
 
 if [ -z "$BACKUP_TEMP" ]; then
@@ -745,7 +743,6 @@ fi
 echo "$(date "+%F %T") Size: $size MB" |tee -a $BACKUP/$user.log
 echo "$(date "+%F %T") Runtime: $run_time $min" |tee -a $BACKUP/$user.log
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -787,8 +784,6 @@ if [ -e "$BACKUP/$user.log" ] && [ "$notify" = "yes" ]; then
     $BIN/v-add-user-notification "$user" "Backup created successfully" "<b>Archive:</b> $user.$backup_new_date.tar"
 fi
 
-
-
 # Logging
 $BIN/v-log-action "$user" "Info" "Backup" "Backup created (Archive: $backup_new_date.tar)."
 $BIN/v-log-action "system" "Info" "Backup" "Backup created (User: $user, Archive: $backup_new_date.tar)."

+ 3 - 7
bin/v-backup-users

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: backup all users
 # options: NONE
-# labels: 
 #
 # example: v-backup-users
 #
-# The function backups all system users.
-
+# This function backups all system users.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Includes
@@ -22,6 +20,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -54,7 +53,4 @@ done
 #                       Hestia                             #
 #----------------------------------------------------------#
 
-# No Logging
-#log_event "$OK" "$ARGUMENTS"
-
 exit

+ 2 - 7
bin/v-change-cron-job

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: change cron job
 # options: USER JOB MIN HOUR DAY MONTH WDAY COMMAND
-# labels: 
 #
 # example: v-change-cron-job admin 7 * * * * * * /usr/bin/uptime
 #
-# The function is used for changing existing job. It fully replace job
+# This function is used for changing existing job. It fully replace job
 # parameters with new one but with same id.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -31,7 +29,6 @@ source $HESTIA/func/main.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -47,7 +44,6 @@ is_object_unsuspended 'cron' 'JOB' "$job"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -74,7 +70,6 @@ sort_cron_jobs
 # Sync system cron with user
 sync_cron_jobs
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-database-host-password

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change database server password
 # options: TYPE HOST USER PASSWORD
-# labels: 
 #
 # example: v-change-database-host-password mysql localhost wp_user pA$$w@rD
 #
-# The function changes database server password.
-
+# This function changes database server password.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,7 +26,6 @@ source $HESTIA/func/db.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -42,7 +39,6 @@ dbpass="$password"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -68,7 +64,6 @@ esac
 update_object_value "../../conf/$type" 'HOST' "$host" '$USER' "$dbuser"
 update_object_value "../../conf/$type" 'HOST' "$host" '$PASSWORD' "$dbpass"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-database-owner

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change database owner
 # options: DATABASE USER
-# labels: 
 #
 # example: v-change-database-owner mydb alice
 #
-# The function for changing database owner.
-
+# This function for changing database owner.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -29,7 +27,6 @@ source $HESTIA/func/rebuild.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -81,7 +78,6 @@ fi
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -128,7 +124,6 @@ $BIN/v-delete-database "$owner" "$database" > /dev/null 2>&1
 $BIN/v-update-user-counters "$owner"
 $BIN/v-update-user-counters "$user"
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-database-password

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: change database password
 # options: USER DATABASE DBPASS
-# labels: 
 #
 # example: v-change-database-password admin wp_db neW_pAssWorD
 #
-# The function for changing database user password to a database. It uses the
+# This function for changing database user password to a database. It uses the
 # full name of database as argument.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -28,7 +26,6 @@ source $HESTIA/func/db.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -46,7 +43,6 @@ dbpass="$password"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -58,7 +54,6 @@ case $TYPE in
     pgsql) change_pgsql_password ;;
 esac
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-database-user

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change database username
 # options: USER DATABASE DBUSER [DBPASS]
-# labels: 
 #
 # example: v-change-database-user admin my_db joe_user
 #
-# The function for changing database user. It uses the
-
+# This function for changing database user. It uses the
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -30,7 +28,6 @@ source $HESTIA/func/rebuild.sh
 # load config file
 source_conf "$HESTIA/conf/hestia.conf"
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -48,7 +45,6 @@ dbpass="$password"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -100,7 +96,6 @@ if [ -z "$check_old_dbuser" ]; then
     esac
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-dns-domain-exp

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: change dns domain expiration date
 # options: USER DOMAIN EXP
-# labels: dns
 #
 # example: v-change-dns-domain-exp admin domain.pp.ua 2020-11-20
 #
-# The function of changing the term of expiration domain's registration. The
+# This function of changing the term of expiration domain's registration. The
 # serial number will be refreshed automatically during update.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -32,7 +30,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -48,7 +45,6 @@ is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -66,7 +62,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-dns-domain-ip

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change dns domain ip address
 # options: USER DOMAIN IP [RESTART]
-# labels: dns
 #
 # example: v-change-dns-domain-ip admin domain.com 123.212.111.222
 #
-# The function for changing the main ip of DNS zone.
-
+# This function for changing the main ip of DNS zone.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -34,7 +32,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -50,7 +47,6 @@ is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -81,7 +77,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

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

@@ -1,16 +1,14 @@
 #!/bin/bash
 # info: change dns domain soa record
 # options: USER DOMAIN SOA [RESTART]
-# labels: dns
 #
 # example: v-change-dns-domain-soa admin acme.com d.ns.domain.tld
 #
-# The function for changing SOA record. This type of records can not be
+# This function for changing SOA record. This type of records can not be
 # modified by v-change-dns-record call.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -51,7 +48,6 @@ is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -75,7 +71,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-dns-domain-tpl

@@ -1,17 +1,15 @@
 #!/bin/bash
 # info: change dns domain template
 # options: USER DOMAIN TEMPLATE [RESTART]
-# labels: dns
 #
 # example: v-change-dns-domain-tpl admin example.com child-ns yes
 #
-# The function for changing the template of records. By updating old records
+# This function for changing the template of records. By updating old records
 # will be removed and new records will be generated in accordance with
 # parameters of new template.
 
-
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ source_conf "$HESTIA/conf/hestia.conf"
 format_domain
 format_domain_idn
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -52,7 +49,6 @@ is_dns_template_valid "$template"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -149,7 +145,6 @@ if [ ! -z "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 2 - 7
bin/v-change-dns-domain-ttl

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change dns domain ttl
 # options: USER DOMAIN TTL [RESTART]
-# labels: dns
 #
 # example: v-change-dns-domain-ttl alice example.com 14400
 #
-# The function for changing the time to live TTL parameter for all records.
-
+# This function for changing the time to live TTL parameter for all records.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -34,7 +32,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -50,7 +47,6 @@ is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -74,7 +70,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

+ 28 - 17
bin/v-change-dns-record

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change dns domain record
 # options: USER DOMAIN ID RECORD TYPE VALUE [PRIORITY] [RESTART] [TTL]
-# labels: dns
 #
 # example: v-change-dns-record admin domain.ua 42 192.18.22.43
 #
-# The function for changing DNS record.
-
+# This function for changing DNS record.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -18,7 +16,7 @@ domain=$2
 domain_idn=$2
 id=$3
 record=$4
-type=$5
+rtype=$5
 dvalue=$(idn -t --quiet -u "$6" )
 priority=$7
 restart=$8
@@ -39,13 +37,12 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
 
 check_args '6' "$#" 'USER DOMAIN ID RECORD TYPE VALUE [PRIORITY] [RESTART] [TTL]'
-is_format_valid 'user' 'domain' 'id' 'record' 'type' 'dvalue'
+is_format_valid 'user' 'domain' 'id' 'record'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
@@ -57,7 +54,6 @@ is_format_valid 'ttl'
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode
 
-
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#
@@ -70,31 +66,47 @@ unset TTL
 line=$(grep "ID='$id'" $USER_DATA/dns/$domain.conf)
 parse_object_kv_list "$line"
 
-if [ -z "$type" ]; then
-    type=$TYPE
+if [ -z "$rtype" ]; then
+    rtype=$TYPE
+fi
+
+if [ -z "$priority" ]; then
+    priority=$PRIORITY
 fi
 
 # Null priority for none MX/SRV records
-if [ "$type" != 'MX' ] && [ "$TYPE" != 'SRV' ]; then
+if [ "$rtype" != 'MX' ] && [ "$rtype" != 'SRV' ]; then
     priority=''
 fi
 
 # Add trailing dot at the end of NS/CNAME/MX/PTR/SRV record
-if [[ $type =~ NS|CNAME|MX|PTR|SRV ]]; then
+if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then
     trailing_dot=$(echo "$dvalue" | grep "\.$")
     if [ -z "$trailing_dot" ]; then
         dvalue="$dvalue."
     fi
 fi
 
+if [ "$rtype" != "CAA" ]; then
+    dvalue=${dvalue//\"/}
+
+    if [ "$rtype" != 'SRV' ] && [[ "$dvalue" =~ [\;[:space:]] ]]; then
+        dvalue='"'"$dvalue"'"'
+    fi
+fi
+
+
+#RTYPE wasn't checked make sure to do it now correctly 
+is_format_valid 'user' 'domain' 'id' 'record' 'rtype' 'dvalue'
+
 # Additional verifications
 is_dns_fqnd "$TYPE" "$dvalue"
 is_dns_nameserver_valid "$domain" "$TYPE" "$dvalue"
 
-if [[ "$RECORD" == "$record" ]] && [[ "$TYPE" == "$type" ]] && [[ "$PRIORITY" -eq "$priority" ]] \
+if [[ "$RECORD" == "$record" ]] && [[ "$TYPE" == "$rtype" ]] && [[ "$PRIORITY" -eq "$priority" ]] \
         && [[ "$VALUE" == "$dvalue" ]] && [[ "$SUSPENDED" == 'no' ]] && [[ "$TTL" -eq "$ttl" ]]; then
     echo "No pending changes in DNS entry."
-    exit "$E_EXSIST"
+    exit "$E_EXISTS"
 fi
 
 # Generating timestamp
@@ -103,7 +115,7 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
 date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
 # Adding record
-dns_rec="ID='$id' RECORD='$record' TYPE='$type' PRIORITY='$priority'"
+dns_rec="ID='$id' RECORD='$record' TYPE='$rtype' PRIORITY='$priority'"
 dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$time' DATE='$date'"
 [ -n "$ttl" ] && dns_rec="$dns_rec TTL='$ttl'"
 # Deleting old record
@@ -130,7 +142,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#
@@ -140,7 +151,7 @@ $BIN/v-restart-dns "$restart"
 check_result $? "DNS restart failed" >/dev/null
 
 # Logging
-$BIN/v-log-action "$user" "Info" "DNS" "DNS record value changed (Type: $type, Record: $record, Value: $dvalue, Domain: $domain)."
+$BIN/v-log-action "$user" "Info" "DNS" "DNS record value changed (Type: $rtype, Record: $record, Value: $dvalue, Domain: $domain)."
 log_event "$OK" "$ARGUMENTS"
 
 exit

+ 2 - 6
bin/v-change-dns-record-id

@@ -1,15 +1,13 @@
 #!/bin/bash
 # info: change dns domain record id
 # options: USER DOMAIN ID NEWID [RESTART]
-# labels: dns
 #
 # example: v-change-dns-record-id admin acme.com 24 42 yes
 #
-# The function for changing internal record id.
-
+# This function for changing internal record id.
 
 #----------------------------------------------------------#
-#                    Variable&Function                     #
+#                Variables & Functions                     #
 #----------------------------------------------------------#
 
 # Argument definition
@@ -35,7 +33,6 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
-
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#
@@ -79,7 +76,6 @@ if [ -n "$DNS_CLUSTER" ]; then
     fi
 fi
 
-
 #----------------------------------------------------------#
 #                       Hestia                             #
 #----------------------------------------------------------#

Некоторые файлы не были показаны из-за большого количества измененных файлов