Skip to content

Commit be674ae

Browse files
authored
Merge branch 'main' into feature/disable-support-apache2-standalone
2 parents b77d2b2 + c441abb commit be674ae

Some content is hidden

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

58 files changed

+2539
-1556
lines changed

bin/v-add-sys-rainloop

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ if [ "$UPDATE" == "no" ]; then
103103
echo "Forbidden" > ./data/index.html
104104

105105
# Create database
106-
mysql -e "DROP DATABASE rainloop"
107-
mysql -e "DROP USER rainloop@localhost"
108106
mysql -e "CREATE DATABASE rainloop"
109107
# Mysql available on system
110108
r=$(generate_password)
@@ -174,4 +172,4 @@ fi
174172

175173

176174
log_history "Rouncube successfuly installed" '' 'admin'
177-
log_event "$OK" "$ARGUMENTS"
175+
log_event "$OK" "$ARGUMENTS"

bin/v-change-sys-api

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ source $HESTIA/conf/hestia.conf
2525
#----------------------------------------------------------#
2626

2727
check_args '1' "$#" "STATUS"
28-
is_type_valid "enable,disable" "$status"
28+
is_type_valid "enable,disable,remove" "$status"
2929

3030
# Perform verification if read-only mode is enabled
3131
check_hestia_demo_mode
@@ -35,25 +35,45 @@ check_hestia_demo_mode
3535
#----------------------------------------------------------#
3636

3737
if [ "$status" = "enable" ]; then
38-
if [ $API = "no" ]; then
39-
if [ ! -f "$HESTIA/web/api/index.php" ]; then
40-
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/web/api/index.php -O $HESTIA/web/api/index.php
41-
else
42-
sed -i 's|die("Error: Disabled");|//die("Error: Disabled");|g' $HESTIA/web/api/index.php
38+
if [ ! -f "$HESTIA/web/api/index.php" ]; then
39+
wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/$RELEASE_BRANCH/web/api/index.php -O $HESTIA/web/api/index.php
40+
check_api_download=$(cat $HESTIA/web/api/index.php)
41+
if [ -z "$HESTIA/web/api/index.php" ]; then
42+
# Throw error message to user
43+
echo "ERROR: API installation failed."
44+
# Remove empty file created by wget output
45+
rm -f "$HESTIA/web/api/index.php"
46+
exit 1
4347
fi
44-
$HESTIA/bin/v-change-sys-config-value "API" "yes"
48+
else
49+
sed -i 's|die("Error: Disabled");|//die("Error: Disabled");|g' $HESTIA/web/api/index.php
50+
sed -i 's|////|//|g' $HESTIA/web/api/index.php
4551
fi
52+
$HESTIA/bin/v-change-sys-config-value "API" "yes"
4653
else
47-
if [ $API = "yes" ]; then
48-
$HESTIA/bin/v-change-sys-config-value "API" "no"
49-
$HESTIA/bin/v-change-sys-config-value "API_ALLOWED_IP" ""
54+
$HESTIA/bin/v-change-sys-config-value "API" "no"
55+
$HESTIA/bin/v-change-sys-config-value "API_ALLOWED_IP" ""
56+
if [ "$status" != "remove" ]; then
5057
sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
5158
fi
5259
fi
5360

61+
if [ "$status" = "remove" ]; then
62+
if [ ! -f "$HESTIA/web/api/index.php" ]; then
63+
echo "ERROR: API is not installed."
64+
exit 1
65+
else
66+
rm -f "$HESTIA/web/api/index.php"
67+
fi
68+
fi
69+
5470
#----------------------------------------------------------#
5571
# Logging #
5672
#----------------------------------------------------------#
5773

58-
log_history "API status has been changed to $status" '' 'admin'
74+
if [ "$status" = "enable" ] || [ "$status" = "disable" ]; then
75+
log_history "API status has been changed to $status" '' 'admin'
76+
else
77+
log_history "API has been disabled and removed" '' 'admin'
78+
fi
5979
log_event "$OK" "$ARGUMENTS"

bin/v-change-sys-config-value

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ else
4848
sed -i "s|$key=.*|$key='$value'|g" $HESTIA/conf/hestia.conf
4949
fi
5050

51+
# Sort configuration file in alphabetical order on change
52+
sort $HESTIA/conf/hestia.conf -o /tmp/updconf
53+
mv $HESTIA/conf/hestia.conf $HESTIA/conf/hestia.conf.bak
54+
mv /tmp/updconf $HESTIA/conf/hestia.conf
55+
rm -f $HESTIA/conf/hestia.conf.bak
56+
5157
#----------------------------------------------------------#
5258
# Hestia #
5359
#----------------------------------------------------------#

bin/v-rebuild-all

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ restart=$2
2222
# Includes
2323
# shellcheck source=/usr/local/hestia/func/main.sh
2424
# shellcheck source=/usr/local/hestia/func/rebuild.sh
25+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2526
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2627
source $HESTIA/func/main.sh
2728
source $HESTIA/func/rebuild.sh
29+
source $HESTIA/func/syshealth.sh
2830
source $HESTIA/conf/hestia.conf
2931

3032
# Export sbin

bin/v-rebuild-database

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ database=$2
2020
# shellcheck source=/usr/local/hestia/func/main.sh
2121
# shellcheck source=/usr/local/hestia/func/db.sh
2222
# shellcheck source=/usr/local/hestia/func/rebuild.sh
23+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2324
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2425
source $HESTIA/func/main.sh
2526
source $HESTIA/func/db.sh
2627
source $HESTIA/func/rebuild.sh
28+
source $HESTIA/func/syshealth.sh
2729
source $HESTIA/conf/hestia.conf
2830

2931

bin/v-rebuild-databases

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ user=$1
1919
# shellcheck source=/usr/local/hestia/func/main.sh
2020
# shellcheck source=/usr/local/hestia/func/db.sh
2121
# shellcheck source=/usr/local/hestia/func/rebuild.sh
22+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2223
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2324
source $HESTIA/func/main.sh
2425
source $HESTIA/func/db.sh
2526
source $HESTIA/func/rebuild.sh
27+
source $HESTIA/func/syshealth.sh
2628
source $HESTIA/conf/hestia.conf
2729

2830

bin/v-rebuild-dns-domain

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ update_serial=$4
2222
# shellcheck source=/usr/local/hestia/func/main.sh
2323
# shellcheck source=/usr/local/hestia/func/domain.sh
2424
# shellcheck source=/usr/local/hestia/func/rebuild.sh
25+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2526
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2627
source $HESTIA/func/main.sh
2728
source $HESTIA/func/domain.sh
2829
source $HESTIA/func/rebuild.sh
30+
source $HESTIA/func/syshealth.sh
2931
source $HESTIA/conf/hestia.conf
3032

3133

bin/v-rebuild-dns-domains

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ update_serial=$3
2121
# shellcheck source=/usr/local/hestia/func/main.sh
2222
# shellcheck source=/usr/local/hestia/func/domain.sh
2323
# shellcheck source=/usr/local/hestia/func/rebuild.sh
24+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2425
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2526
source $HESTIA/func/main.sh
2627
source $HESTIA/func/domain.sh
2728
source $HESTIA/func/rebuild.sh
29+
source $HESTIA/func/syshealth.sh
2830
source $HESTIA/conf/hestia.conf
2931

3032

bin/v-rebuild-mail-domain

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ domain=$2
1919
# Includes
2020
# shellcheck source=/usr/local/hestia/func/main.sh
2121
# shellcheck source=/usr/local/hestia/func/domain.sh
22-
# shellcheck source=/usr/local/hestia/func/rebuild.sh
2322
# shellcheck source=/usr/local/hestia/func/ip.sh
23+
# shellcheck source=/usr/local/hestia/func/rebuild.sh
24+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2425
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2526
source $HESTIA/func/main.sh
2627
source $HESTIA/func/domain.sh
27-
source $HESTIA/func/rebuild.sh
2828
source $HESTIA/func/ip.sh
29+
source $HESTIA/func/rebuild.sh
30+
source $HESTIA/func/syshealth.sh
2931
source $HESTIA/conf/hestia.conf
3032

3133
# Define mail user

bin/v-rebuild-mail-domains

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ user=$1
1818
# Includes
1919
# shellcheck source=/usr/local/hestia/func/main.sh
2020
# shellcheck source=/usr/local/hestia/func/domain.sh
21-
# shellcheck source=/usr/local/hestia/func/rebuild.sh
2221
# shellcheck source=/usr/local/hestia/func/ip.sh
22+
# shellcheck source=/usr/local/hestia/func/rebuild.sh
23+
# shellcheck source=/usr/local/hestia/func/syshealth.sh
2324
# shellcheck source=/usr/local/hestia/conf/hestia.conf
2425
source $HESTIA/func/main.sh
2526
source $HESTIA/func/domain.sh
26-
source $HESTIA/func/rebuild.sh
2727
source $HESTIA/func/ip.sh
28+
source $HESTIA/func/rebuild.sh
29+
source $HESTIA/func/syshealth.sh
2830
source $HESTIA/conf/hestia.conf
2931

3032
# Define mail user

0 commit comments

Comments
 (0)