Skip to content

Commit 5389bba

Browse files
author
Kristan Kenney
committed
Merge branch 'staging/fixes' into main
2 parents 13feac8 + a2406c7 commit 5389bba

File tree

133 files changed

+848
-134
lines changed

Some content is hidden

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

133 files changed

+848
-134
lines changed

bin/v-add-cron-letsencrypt-job

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ source $HESTIA/conf/hestia.conf
2121

2222
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
2323

24+
# Perform verification if read-only mode is enabled
25+
check_hestia_demo_mode
2426

2527
#----------------------------------------------------------#
2628
# Action #

bin/v-add-cron-reports

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
3131
is_object_valid 'user' 'USER' "$user"
3232
is_object_unsuspended 'user' 'USER' "$user"
3333

34+
# Perform verification if read-only mode is enabled
35+
check_hestia_demo_mode
3436

3537
#----------------------------------------------------------#
3638
# Action #

bin/v-add-cron-restart-job

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ source $HESTIA/conf/hestia.conf
2121

2222
is_system_enabled "$CRON_SYSTEM" 'CRON_SYSTEM'
2323

24+
# Perform verification if read-only mode is enabled
25+
check_hestia_demo_mode
2426

2527
#----------------------------------------------------------#
2628
# Action #

bin/v-add-database-host

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@ source $HESTIA/conf/hestia.conf
3434
is_mysql_host_alive() {
3535
mycnf=$(mktemp)
3636
echo "[client]">$mycnf
37-
echo "host='$HOST'" >> $mycnf
38-
echo "user='$USER'" >> $mycnf
39-
echo "password='$PASSWORD'" >> $mycnf
40-
echo "port='$PORT'" >> $mycnf
37+
echo "host='$host'" >> $mycnf
38+
echo "user='$user'" >> $mycnf
39+
echo "password='$password'" >> $mycnf
40+
echo "port='$port'" >> $mycnf
4141

4242
chmod 600 $mycnf
4343
mysql --defaults-file=$mycnf -e 'SELECT VERSION()' >/dev/null 2>&1
4444
rm $mycnf
45-
if [ '0' -ne "$?" ]; then
45+
46+
if [ "$?" -ne '0' ]; then
4647
echo "Error: MySQL connection to $host failed"
4748
log_event "$E_CONNECT" "$ARGUMENTS"
4849
exit $E_CONNECT
@@ -52,7 +53,7 @@ is_mysql_host_alive() {
5253
is_pgsql_host_alive() {
5354
export PGPASSWORD="$dbpass"
5455
psql -h $host -U $dbuser -p $port -c "SELECT VERSION()" > /dev/null 2>&1
55-
if [ '0' -ne "$?" ]; then
56+
if [ "$?" -ne '0' ]; then
5657
echo "Error: PostgreSQL connection to $host failed"
5758
log_event "$E_CONNECT" "$ARGUMENTS"
5859
exit $E_CONNECT
@@ -73,8 +74,8 @@ if [ -z $template ]; then template="template1"; fi
7374
database_set_default_ports
7475

7576
is_format_valid 'host' 'dbuser' 'max_db' 'charsets' 'template' 'port'
76-
#is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
77-
#is_type_valid "$DB_SYSTEM" "$type"
77+
is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
78+
is_type_valid "$DB_SYSTEM" "$type"
7879
is_dbhost_new
7980
is_password_valid
8081
dbpass="$password"
@@ -84,6 +85,8 @@ case $type in
8485
pgsql) is_pgsql_host_alive ;;
8586
esac
8687

88+
# Perform verification if read-only mode is enabled
89+
check_hestia_demo_mode
8790

8891
#----------------------------------------------------------#
8992
# Action #

bin/v-add-dns-on-web-alias

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ if [ -e "$USER_DATA/dns/$alias.conf" ]; then
3737
exit
3838
fi
3939

40+
# Perform verification if read-only mode is enabled
41+
check_hestia_demo_mode
4042

4143
#----------------------------------------------------------#
4244
# Action #

bin/v-add-fs-archive

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ check_args '3' "$#" 'USER ARCHIVE FILE [FILE_2] [FILE_3] [FILE ...]'
2121
is_format_valid 'user'
2222
is_object_valid 'user' 'USER' "$user"
2323

24+
# Perform verification if read-only mode is enabled
25+
check_hestia_demo_mode
26+
2427
# Checking user homedir
2528
homedir=$(grep "^$user:" /etc/passwd |cut -f 6 -d :)
2629
if [ -z $homedir ]; then

bin/v-add-fs-directory

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ check_args '2' "$#" 'USER DIR'
2121
is_format_valid 'user'
2222
is_object_valid 'user' 'USER' "$user"
2323

24+
# Perform verification if read-only mode is enabled
25+
check_hestia_demo_mode
26+
2427
# Checking user homedir
2528
homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
2629
if [ -z $homedir ]; then

bin/v-add-fs-file

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ check_args '2' "$#" 'USER FILE'
2121
is_format_valid 'user'
2222
is_object_valid 'user' 'USER' "$user"
2323

24+
# Perform verification if read-only mode is enabled
25+
check_hestia_demo_mode
26+
2427
# Checking user homedir
2528
homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
2629
if [ -z $homedir ]; then

bin/v-add-letsencrypt-domain

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ debug_log() {
106106
echo -e "\n==[${1}]==\n${2}\n" >> "$log_file"
107107
}
108108

109+
# Perform verification if read-only mode is enabled
110+
check_hestia_demo_mode
111+
109112
#----------------------------------------------------------#
110113
# Action #
111114
#----------------------------------------------------------#

bin/v-add-letsencrypt-host

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ source $HESTIA/func/main.sh
2323
source $HESTIA/func/domain.sh
2424
source $HESTIA/conf/hestia.conf
2525

26-
26+
# Perform verification if read-only mode is enabled
27+
check_hestia_demo_mode
2728
#----------------------------------------------------------#
2829
# Verifications #
2930
#----------------------------------------------------------#

0 commit comments

Comments
 (0)