Browse Source

Merge pull request #1479 from hestiacp/fix/2020-12-demo_mode

Fix issues with unauthorized access
Raphael Schneeberger 5 years ago
parent
commit
8c37526d13
100 changed files with 231 additions and 28 deletions
  1. 2 0
      bin/v-add-cron-letsencrypt-job
  2. 2 0
      bin/v-add-cron-reports
  3. 2 0
      bin/v-add-cron-restart-job
  4. 2 0
      bin/v-add-database-host
  5. 2 0
      bin/v-add-dns-on-web-alias
  6. 3 0
      bin/v-add-fs-archive
  7. 3 0
      bin/v-add-fs-directory
  8. 3 0
      bin/v-add-fs-file
  9. 3 0
      bin/v-add-letsencrypt-domain
  10. 2 1
      bin/v-add-letsencrypt-host
  11. 2 1
      bin/v-add-letsencrypt-user
  12. 2 0
      bin/v-add-remote-dns-domain
  13. 2 1
      bin/v-add-remote-dns-host
  14. 2 0
      bin/v-add-remote-dns-record
  15. 2 0
      bin/v-add-sys-firewall
  16. 2 1
      bin/v-add-sys-quota
  17. 2 0
      bin/v-add-sys-sftp-jail
  18. 3 0
      bin/v-add-sys-theme
  19. 3 0
      bin/v-add-sys-webmail
  20. 2 1
      bin/v-add-user-notification
  21. 3 0
      bin/v-add-user-sftp-jail
  22. 2 0
      bin/v-add-user-sftp-key
  23. 2 1
      bin/v-add-web-domain-httpauth
  24. 2 0
      bin/v-backup-user
  25. 2 1
      bin/v-backup-users
  26. 2 0
      bin/v-change-dns-record-id
  27. 3 0
      bin/v-change-fs-file-permission
  28. 2 0
      bin/v-change-remote-dns-domain-exp
  29. 2 0
      bin/v-change-remote-dns-domain-soa
  30. 2 0
      bin/v-change-remote-dns-domain-ttl
  31. 3 0
      bin/v-change-user-php-cli
  32. 3 0
      bin/v-change-user-role
  33. 2 0
      bin/v-check-api-key
  34. 3 0
      bin/v-check-fs-permission
  35. 3 0
      bin/v-copy-fs-directory
  36. 3 0
      bin/v-copy-fs-file
  37. 2 1
      bin/v-delete-backup-host
  38. 2 1
      bin/v-delete-cron-reports
  39. 2 1
      bin/v-delete-cron-restart-job
  40. 2 0
      bin/v-delete-database-host
  41. 2 0
      bin/v-delete-dns-on-web-alias
  42. 3 0
      bin/v-delete-fs-directory
  43. 3 0
      bin/v-delete-fs-file
  44. 2 1
      bin/v-delete-remote-dns-domain
  45. 2 1
      bin/v-delete-remote-dns-domains
  46. 2 1
      bin/v-delete-remote-dns-host
  47. 2 1
      bin/v-delete-remote-dns-record
  48. 2 1
      bin/v-delete-sys-quota
  49. 2 1
      bin/v-delete-sys-sftp-jail
  50. 6 0
      bin/v-delete-sys-theme
  51. 3 0
      bin/v-delete-sys-webmail
  52. 2 1
      bin/v-delete-user-sftp-jail
  53. 3 0
      bin/v-download-backup
  54. 3 0
      bin/v-extract-fs-archive
  55. 2 1
      bin/v-generate-api-key
  56. 3 0
      bin/v-generate-ssl-cert
  57. 2 0
      bin/v-insert-dns-domain
  58. 2 0
      bin/v-insert-dns-record
  59. 2 0
      bin/v-insert-dns-records
  60. 3 0
      bin/v-move-fs-directory
  61. 3 0
      bin/v-move-fs-file
  62. 2 0
      bin/v-rebuild-all
  63. 2 1
      bin/v-rebuild-cron-jobs
  64. 2 1
      bin/v-rebuild-database
  65. 2 1
      bin/v-rebuild-databases
  66. 2 1
      bin/v-rebuild-dns-domain
  67. 2 1
      bin/v-rebuild-dns-domains
  68. 2 1
      bin/v-rebuild-mail-domain
  69. 2 1
      bin/v-rebuild-mail-domains
  70. 2 1
      bin/v-rebuild-user
  71. 2 1
      bin/v-rebuild-users
  72. 2 0
      bin/v-rebuild-web-domain
  73. 2 1
      bin/v-rebuild-web-domains
  74. 2 0
      bin/v-schedule-letsencrypt-domain
  75. 2 0
      bin/v-schedule-user-backup
  76. 3 0
      bin/v-schedule-user-backup-download
  77. 2 0
      bin/v-schedule-user-restore
  78. 3 0
      bin/v-search-command
  79. 2 0
      bin/v-search-domain-owner
  80. 2 0
      bin/v-search-fs-object
  81. 3 0
      bin/v-search-object
  82. 3 0
      bin/v-search-user-object
  83. 2 0
      bin/v-sync-dns-cluster
  84. 2 0
      bin/v-unsuspend-database
  85. 2 0
      bin/v-unsuspend-database-host
  86. 2 0
      bin/v-unsuspend-databases
  87. 2 0
      bin/v-unsuspend-dns-domain
  88. 2 0
      bin/v-unsuspend-dns-domains
  89. 2 0
      bin/v-unsuspend-dns-record
  90. 2 0
      bin/v-unsuspend-domain
  91. 2 0
      bin/v-unsuspend-mail-account
  92. 2 0
      bin/v-unsuspend-mail-accounts
  93. 2 0
      bin/v-unsuspend-mail-domain
  94. 2 0
      bin/v-unsuspend-mail-domains
  95. 2 0
      bin/v-unsuspend-remote-dns-host
  96. 2 0
      bin/v-unsuspend-user
  97. 2 0
      bin/v-unsuspend-web-domain
  98. 2 0
      bin/v-unsuspend-web-domains
  99. 3 0
      bin/v-update-dns-templates
  100. 3 0
      bin/v-update-firewall-ipset

+ 2 - 0
bin/v-add-cron-letsencrypt-job

@@ -21,6 +21,8 @@ source $HESTIA/conf/hestia.conf
 
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-add-cron-reports

@@ -31,6 +31,8 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -21,6 +21,8 @@ source $HESTIA/conf/hestia.conf
 
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -84,6 +84,8 @@ case $type in
     pgsql) is_pgsql_host_alive ;;
 esac
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -37,6 +37,8 @@ if [ -e "$USER_DATA/dns/$alias.conf" ]; then
     exit
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-add-fs-archive

@@ -21,6 +21,9 @@ check_args '3' "$#" 'USER ARCHIVE FILE [FILE_2] [FILE_3] [FILE ...]'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd |cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-add-fs-directory

@@ -21,6 +21,9 @@ check_args '2' "$#" 'USER DIR'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-add-fs-file

@@ -21,6 +21,9 @@ check_args '2' "$#" 'USER FILE'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-add-letsencrypt-domain

@@ -106,6 +106,9 @@ debug_log() {
     echo -e "\n==[${1}]==\n${2}\n" >> "$log_file"
 }
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -23,7 +23,8 @@ source $HESTIA/func/main.sh
 source $HESTIA/func/domain.sh
 source $HESTIA/conf/hestia.conf
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-add-letsencrypt-user

@@ -66,7 +66,8 @@ if [ ! -z "$KID" ]; then
     exit
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -34,6 +34,8 @@ is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -55,7 +55,8 @@ is_password_valid
 is_dnshost_new
 is_dnshost_alive
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -35,6 +35,8 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
 is_procces_running
 remote_dns_health_check
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -25,6 +25,8 @@ if [ "$FIREWALL_SYSTEM" = 'iptables' ]; then
     exit
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -46,7 +46,8 @@ if [ $? -ne 0 ]; then
     fi
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-add-sys-sftp-jail

@@ -23,6 +23,8 @@ restart=$1
 #                    Verifications                         #
 #----------------------------------------------------------#
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-add-sys-theme

@@ -26,6 +26,9 @@ source $HESTIA/conf/hestia.conf
 # Define themes repository URL format
 HESTIA_THEMES_REPO="$HESTIA_GIT_REPO/$RELEASE_BRANCH/install/deb/themes"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-add-sys-webmail

@@ -55,6 +55,9 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-add-user-notification

@@ -29,7 +29,8 @@ check_args '2' "$#" 'USER TOPIC NOTICE [TYPE]'
 is_format_valid 'user' 'topic' 'notice'
 is_object_valid 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -49,6 +49,9 @@ if [[ " ${users[@]} " =~ " ${user} " ]]; then
     exit;
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -27,6 +27,8 @@ check_args '1' "$#" 'USER [TTL]'
 is_format_valid 'user' 'ttl'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 1
bin/v-add-web-domain-httpauth

@@ -31,7 +31,8 @@ shtaccess="$htaccess"
 shtpasswd="$htpasswd"
 docroot="$HOMEDIR/$user/web/$domain/public_html"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-backup-user

@@ -38,6 +38,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_backup_enabled
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 1
bin/v-backup-users

@@ -20,7 +20,8 @@ source /etc/profile
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -45,6 +45,8 @@ is_object_unsuspended 'dns' 'DOMAIN' "$domain"
 is_object_valid "dns/$domain" 'ID' "$id"
 is_object_new "dns/$domain" 'ID' "$newid"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-change-fs-file-permission

@@ -22,6 +22,9 @@ check_args '3' "$#" 'USER FILE PERMISSIONS'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 2 - 0
bin/v-change-remote-dns-domain-exp

@@ -32,6 +32,8 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
 is_procces_running
 remote_dns_health_check
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-change-remote-dns-domain-soa

@@ -34,6 +34,8 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
 is_procces_running
 remote_dns_health_check
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-change-remote-dns-domain-ttl

@@ -34,6 +34,8 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
 is_procces_running
 remote_dns_health_check
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-change-user-php-cli

@@ -58,6 +58,9 @@ if grep -q "alias php='env php$version'" "$FILE"; then
   exit;
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-change-user-role

@@ -33,6 +33,9 @@ is_object_valid 'user' 'USER' "$user"
 
 is_object_unsuspended 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-check-api-key

@@ -22,6 +22,8 @@ time_n_date=$(date +'%T %F')
 time=$(echo "$time_n_date" |cut -f 1 -d \ )
 date=$(echo "$time_n_date" |cut -f 2 -d \ )
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-check-fs-permission

@@ -21,6 +21,9 @@ check_args '2' "$#" 'USER FILE'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-copy-fs-directory

@@ -22,6 +22,9 @@ check_args '3' "$#" 'USER SRC_DIRECTORY DST_DIRECTORY'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-copy-fs-file

@@ -22,6 +22,9 @@ check_args '3' "$#" 'USER SRC_FILE DST_FILE'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 2 - 1
bin/v-delete-backup-host

@@ -32,7 +32,8 @@ if [ -z "$types" ]; then
     exit $E_INVALID
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-delete-cron-reports

@@ -31,7 +31,8 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-delete-cron-restart-job

@@ -21,7 +21,8 @@ source $HESTIA/conf/hestia.conf
 
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -34,6 +34,8 @@ is_type_valid "$DB_SYSTEM" "$type"
 is_object_valid "../../conf/$type" 'HOST' "$host"
 is_dbhost_free
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-delete-dns-on-web-alias

@@ -32,6 +32,8 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #

+ 3 - 0
bin/v-delete-fs-directory

@@ -22,6 +22,9 @@ check_args '2' "$#" 'USER DIRECTORY'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-delete-fs-file

@@ -22,6 +22,9 @@ check_args '2' "$#" 'USER FILE'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

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

@@ -32,7 +32,8 @@ is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -28,7 +28,8 @@ is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-delete-remote-dns-host

@@ -30,7 +30,8 @@ is_format_valid 'host'
 is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -33,7 +33,8 @@ is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-delete-sys-quota

@@ -21,7 +21,8 @@ source $HESTIA/conf/hestia.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -25,7 +25,8 @@ source $HESTIA/conf/hestia.conf
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 6 - 0
bin/v-delete-sys-theme

@@ -20,6 +20,12 @@ theme=$1
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
+#----------------------------------------------------------#
+#                    Verifications                         #
+#----------------------------------------------------------#
+
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-delete-sys-webmail

@@ -41,6 +41,9 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-delete-user-sftp-jail

@@ -40,7 +40,8 @@ if [[ ! " ${users[@]} " =~ " ${user} " ]]; then
     exit
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-download-backup

@@ -40,6 +40,9 @@ source $HESTIA/func/backup.sh
 check_args '2' "$#" 'USER BACKUP'
 is_format_valid 'user' 'backup'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-extract-fs-archive

@@ -25,6 +25,9 @@ check_args '3' "$#" 'USER ARCHIVE DIRECTORY [SELECTED_DIR] [STRIP] [TEST]'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

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

@@ -18,7 +18,8 @@ keygen() {
 KEYS="$HESTIA/data/keys/"
 HASH=$(keygen)
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -76,6 +76,9 @@ if [ ! -f /root/.rnd ]; then
     touch /root/.rnd
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-insert-dns-domain

@@ -44,6 +44,8 @@ if [ "$flush" = 'no' ]; then
     is_domain_new 'dns' $domain
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-insert-dns-record

@@ -33,6 +33,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"
 parse_object_kv_list "$data"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-insert-dns-records

@@ -32,6 +32,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-move-fs-directory

@@ -23,6 +23,9 @@ check_args '3' "$#" 'USER SRC_DIRECTORY DST_DIRECTORY'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 3 - 0
bin/v-move-fs-file

@@ -23,6 +23,9 @@ check_args '3' "$#" 'USER SRC_FILE DST_FILE'
 is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Checking user homedir
 homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
 if [ -z $homedir ]; then

+ 2 - 0
bin/v-rebuild-all

@@ -37,6 +37,8 @@ is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 1
bin/v-rebuild-cron-jobs

@@ -30,7 +30,8 @@ is_format_valid 'user'
 is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-database

@@ -33,7 +33,8 @@ is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_valid 'db' 'DB' "$database"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-databases

@@ -31,7 +31,8 @@ is_format_valid 'user'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-dns-domain

@@ -36,7 +36,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'dns' 'DOMAIN' "$domain"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-dns-domains

@@ -37,7 +37,8 @@ if [ "$DNS_SYSTEM" = 'remote' ]; then
     exit
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -45,7 +45,8 @@ if [ "$MAIL_SYSTEM" = 'remote' ]; then
     exit
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

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

@@ -42,7 +42,8 @@ if [ "$MAIL_SYSTEM" = 'remote' ]; then
     exit
 fi
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-user

@@ -34,7 +34,8 @@ is_format_valid 'user'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-users

@@ -27,7 +27,8 @@ export PATH=$PATH:/usr/sbin
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-rebuild-web-domain

@@ -36,6 +36,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 1
bin/v-rebuild-web-domains

@@ -34,7 +34,8 @@ is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
-
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-schedule-letsencrypt-domain

@@ -36,6 +36,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
 is_object_unsuspended 'web' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-schedule-user-backup

@@ -31,6 +31,8 @@ is_object_valid 'user' 'USER' "$user"
 is_backup_enabled
 is_backup_scheduled 'backup'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-schedule-user-backup-download

@@ -32,6 +32,9 @@ source $HESTIA/conf/hestia.conf
 check_args '2' "$#" 'USER BACKUP'
 is_format_valid 'user' 'backup'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-schedule-user-restore

@@ -38,6 +38,8 @@ is_object_valid 'user' 'USER' "$user"
 is_backup_enabled
 is_backup_scheduled 'restore'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-search-command

@@ -25,6 +25,9 @@ if [ $# -eq 0 ]; then
     exit 1
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 2 - 0
bin/v-search-domain-owner

@@ -26,6 +26,8 @@ source $HESTIA/func/main.sh
 
 check_args '1' "$#" 'DOMAIN [TYPE]'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-search-fs-object

@@ -14,6 +14,8 @@ path=$3
 # Includes
 source $HESTIA/func/main.sh
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 #----------------------------------------------------------#
 #                    Verifications                         #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-search-object

@@ -20,6 +20,9 @@ format=${2-shell}
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Json list function
 json_list_search() {
     echo '{'

+ 3 - 0
bin/v-search-user-object

@@ -21,6 +21,9 @@ format=${3-shell}
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 # Json list function
 json_list_search() {
     echo '{'

+ 2 - 0
bin/v-sync-dns-cluster

@@ -28,6 +28,8 @@ is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
 is_procces_running
 remote_dns_health_check 'no_email'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-database

@@ -33,6 +33,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_valid 'db' 'DB' "$database"
 is_object_suspended 'db' 'DB' "$database"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-database-host

@@ -31,6 +31,8 @@ is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid "../../conf/$type" 'HOST' "$host"
 is_object_suspended "../../conf/$type" 'HOST' "$host"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-databases

@@ -28,6 +28,8 @@ is_format_valid 'user'
 is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-dns-domain

@@ -26,6 +26,8 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #

+ 2 - 0
bin/v-unsuspend-dns-domains

@@ -30,6 +30,8 @@ is_format_valid 'user'
 is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-dns-record

@@ -29,6 +29,8 @@ format_domain
 format_domain_idn
 # TODO: $domain_idn not used in this script - maybe $domain should be converted to $doman_idn ?
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                    Verifications                         #

+ 2 - 0
bin/v-unsuspend-domain

@@ -30,6 +30,8 @@ check_args '2' "$#" 'USER DOMAIN'
 is_format_valid 'user' 'domain'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-mail-account

@@ -43,6 +43,8 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 is_object_valid "mail/$domain" 'ACCOUNT' "$account"
 is_object_suspended "mail/$domain" 'ACCOUNT' "$account"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-mail-accounts

@@ -39,6 +39,8 @@ is_object_unsuspended 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_unsuspended 'mail' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -39,6 +39,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_valid 'mail' 'DOMAIN' "$domain"
 is_object_suspended 'mail' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

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

@@ -30,6 +30,8 @@ is_format_valid 'user'
 is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-remote-dns-host

@@ -30,6 +30,8 @@ is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
 is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
 is_object_suspended "../../conf/dns-cluster" 'HOST' "$host"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-user

@@ -32,6 +32,8 @@ if [ "$user" = 'admin' ]; then
     exit
 fi
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-web-domain

@@ -41,6 +41,8 @@ is_object_valid 'user' 'USER' "$user"
 is_object_valid 'web' 'DOMAIN' "$domain"
 is_object_suspended 'web' 'DOMAIN' "$domain"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 2 - 0
bin/v-unsuspend-web-domains

@@ -31,6 +31,8 @@ is_format_valid 'user'
 is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
 is_object_valid 'user' 'USER' "$user"
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
 
 #----------------------------------------------------------#
 #                       Action                             #

+ 3 - 0
bin/v-update-dns-templates

@@ -19,6 +19,9 @@ restart=$1
 source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 #----------------------------------------------------------#
 #                       Action                             #
 #----------------------------------------------------------#

+ 3 - 0
bin/v-update-firewall-ipset

@@ -28,6 +28,9 @@ source $HESTIA/conf/hestia.conf
 is_boolean_format_valid "$force" 'bool (yes/no)'
 is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
 
+# Perform verification if read-only mode is enabled
+check_hestia_demo_mode
+
 ipset_hstobject='../../data/firewall/ipset'
 
 for ipset_name in $(search_objects "$ipset_hstobject" 'SUSPENDED' 'no' 'LISTNAME' 2>/dev/null); do

Some files were not shown because too many files changed in this diff