Skip to content

Commit 07e20a5

Browse files
authored
Merge pull request hestiacp#541 from hestiacp/feature-readonly-mode
Feature readonly/demo mode
2 parents f06bcdf + a7ed4c8 commit 07e20a5

File tree

129 files changed

+442
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+442
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
33

44
## [CURRENT] - Development
55
### Features
6-
-
6+
- Add read only/demo mode function if DEMO_MODE is set to yes in hestia.conf
77

88
### Bugfixes
99
-

bin/v-acknowledge-user-notification

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ check_args '2' "$#" 'USER NOTIFICATION'
2626
is_format_valid 'user' 'nid'
2727
is_object_valid 'user' 'USER' "$user"
2828

29+
# Perform verification if read-only mode is enabled
30+
check_hestia_demo_mode
31+
2932

3033
#----------------------------------------------------------#
3134
# Action #

bin/v-add-cron-hestia-autoupdate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if [ ! -z "$check_cron" ]; then
2929
exit
3030
fi
3131

32+
# Perform verification if read-only mode is enabled
33+
check_hestia_demo_mode
34+
3235

3336
#----------------------------------------------------------#
3437
# Action #

bin/v-add-cron-job

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ source $HESTIA/conf/hestia.conf
2727

2828
HIDE=7
2929

30-
3130
#----------------------------------------------------------#
3231
# Verifications #
3332
#----------------------------------------------------------#
@@ -42,6 +41,9 @@ get_next_cronjob
4241
is_format_valid 'job'
4342
is_object_new 'cron' 'JOB' "$job"
4443

44+
# Perform verification if read-only mode is enabled
45+
check_hestia_demo_mode
46+
4547

4648
#----------------------------------------------------------#
4749
# Action #

bin/v-add-database

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ source $HESTIA/func/main.sh
3030
source $HESTIA/func/db.sh
3131
source $HESTIA/conf/hestia.conf
3232

33-
3433
#----------------------------------------------------------#
3534
# Verifications #
3635
#----------------------------------------------------------#
@@ -50,6 +49,9 @@ is_package_full 'DATABASES'
5049
is_password_valid
5150
dbpass="$password"
5251

52+
# Perform verification if read-only mode is enabled
53+
check_hestia_demo_mode
54+
5355

5456
#----------------------------------------------------------#
5557
# Action #

bin/v-add-dns-domain

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ source $HESTIA/conf/hestia.conf
3636
format_domain
3737
format_domain_idn
3838

39-
4039
#----------------------------------------------------------#
4140
# Verifications #
4241
#----------------------------------------------------------#
@@ -84,6 +83,9 @@ if [ ! -z "$ns8" ]; then
8483
is_format_valid 'ns8'
8584
fi
8685

86+
# Perform verification if read-only mode is enabled
87+
check_hestia_demo_mode
88+
8789

8890
#----------------------------------------------------------#
8991
# Action #

bin/v-add-dns-record

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ is_object_new "dns/$domain" 'ID' "$id"
8383
is_dns_fqnd "$rtype" "$dvalue"
8484
is_dns_nameserver_valid "$domain" "$rtype" "$dvalue"
8585

86+
# Perform verification if read-only mode is enabled
87+
check_hestia_demo_mode
88+
8689

8790
#----------------------------------------------------------#
8891
# Action #

bin/v-add-domain

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ fi
3232
is_object_valid 'user' 'USER' "$user"
3333
is_object_unsuspended 'user' 'USER' "$user"
3434

35+
# Perform verification if read-only mode is enabled
36+
check_hestia_demo_mode
37+
3538

3639
#----------------------------------------------------------#
3740
# Action #

bin/v-add-firewall-ban

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ is_format_valid 'ip' 'chain'
3333
is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
3434

3535

36+
# Perform verification if read-only mode is enabled
37+
check_hestia_demo_mode
38+
3639
#----------------------------------------------------------#
3740
# Action #
3841
#----------------------------------------------------------#

bin/v-add-firewall-chain

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ check_args '1' "$#" 'CHAIN [PORT] [PROTOCOL]'
4040
is_format_valid 'chain'
4141
is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
4242

43+
# Perform verification if read-only mode is enabled
44+
check_hestia_demo_mode
4345

4446
#----------------------------------------------------------#
4547
# Action #

0 commit comments

Comments
 (0)