|
|
@@ -69,7 +69,7 @@ upgrade_health_check() {
|
|
|
# Theme
|
|
|
if [ -z "$THEME" ]; then
|
|
|
echo "[ ! ] Adding missing variable to hestia.conf: THEME ('default')"
|
|
|
- $BIN/v-change-sys-theme 'default'
|
|
|
+ $BIN/v-change-sys-config-value 'THEME' 'default'
|
|
|
fi
|
|
|
|
|
|
# Default language
|
|
|
@@ -143,7 +143,17 @@ upgrade_health_check() {
|
|
|
echo "[ ! ] Adding missing variable to hestia.conf: INACTIVE_SESSION_TIMEOUT ('60')"
|
|
|
$BIN/v-change-sys-config-value "INACTIVE_SESSION_TIMEOUT" "60"
|
|
|
fi
|
|
|
-
|
|
|
+
|
|
|
+ # Enforce Subdomain ownership
|
|
|
+ if [ -z "$ENFORCE_SUBDOMAIN_OWNERSHIP" ]; then
|
|
|
+ echo "[ ! ] Adding missing variable to hestia.conf: ENFORCE_SUBDOMAIN_OWNERSHIP ('yes')"
|
|
|
+ $BIN/v-change-sys-config-value "ENFORCE_SUBDOMAIN_OWNERSHIP" "yes"
|
|
|
+ fi
|
|
|
+ # API Allowed IP
|
|
|
+ if [ -z "$API_ALLOWED_IP" ]; then
|
|
|
+ echo "[ ! ] Adding missing variable to hestia.conf: API_ALLOWED_IP ('allow-all')"
|
|
|
+ $BIN/v-change-sys-config-value "API_ALLOWED_IP" "allow-all"
|
|
|
+ fi
|
|
|
|
|
|
echo "[ * ] Health check complete. Starting upgrade from $VERSION to $new_version..."
|
|
|
echo "============================================================================="
|
|
|
@@ -226,9 +236,8 @@ upgrade_complete_message() {
|
|
|
echo "Forum: https://forum.hestiacp.com/ "
|
|
|
echo "Discord: https://discord.gg/nXRUZch "
|
|
|
echo "GitHub: https://github.com/hestiacp/hestiacp/ "
|
|
|
- echo "E-mail: info@hestiacp.com "
|
|
|
echo
|
|
|
- echo "Help support the Hestia Control Panel project by donating via PayPal: "
|
|
|
+ echo "Help support the Hestia Control Panel project by donating via PayPal: "
|
|
|
echo "https://www.hestiacp.com/donate "
|
|
|
echo
|
|
|
echo "Made with love & pride by the open-source community around the world. "
|
|
|
@@ -646,7 +655,7 @@ upgrade_roundcube(){
|
|
|
if [ ! -z "$(echo "$WEBMAIL_SYSTEM" | grep -w 'roundcube')" ]; then
|
|
|
rc_version=$(cat /var/lib/roundcube/index.php | grep -o -E '[0-9].[0-9].[0-9]+' | head -1);
|
|
|
if [ "$rc_version" == "$rc_v" ]; then
|
|
|
- echo "[ * ] Upgrading RoundCube to version v$rc_v..."
|
|
|
+ echo "[ * ] Upgrading Roundcube to version v$rc_v..."
|
|
|
$HESTIA/bin/v-add-sys-roundcube
|
|
|
fi
|
|
|
fi
|
|
|
@@ -658,13 +667,20 @@ upgrade_rainloop(){
|
|
|
if [ ! -z "$(echo "$WEBMAIL_SYSTEM" | grep -w 'rainloop')" ]; then
|
|
|
rc_version=$(cat /var/lib/rainloop/data/VERSION);
|
|
|
if [ "$rc_version" == "$rc_v" ]; then
|
|
|
- echo "[ * ] Upgrading rainloop to version v$rc_v..."
|
|
|
+ echo "[ * ] Upgrading Rainloop to version v$rl_v..."
|
|
|
$HESTIA/bin/v-add-sys-rainloop
|
|
|
fi
|
|
|
fi
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
+disable_api(){
|
|
|
+ if [ "$API" = "no" ]; then
|
|
|
+ echo "[ ! ] Disable Api..."
|
|
|
+ sed -i 's|//die("Error: Disabled");|die("Error: Disabled");|g' $HESTIA/web/api/index.php
|
|
|
+ $HESTIA/bin/v-change-sys-config-value "API_ALLOWED_IP" ""
|
|
|
+ fi
|
|
|
+}
|
|
|
upgrade_rebuild_web_templates() {
|
|
|
if [ "$UPGRADE_UPDATE_WEB_TEMPLATES" = "true" ]; then
|
|
|
echo "[ ! ] Updating default web domain templates..."
|
|
|
@@ -694,6 +710,7 @@ upgrade_rebuild_users() {
|
|
|
echo "[ * ] Rebuilding user accounts and domains, this may take a few minutes..."
|
|
|
fi
|
|
|
for user in $($HESTIA/bin/v-list-sys-users plain); do
|
|
|
+ export restart="no"
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
echo " - $user:"
|
|
|
else
|
|
|
@@ -734,16 +751,9 @@ upgrade_rebuild_users() {
|
|
|
}
|
|
|
|
|
|
upgrade_restart_services() {
|
|
|
- # Refresh user interface theme
|
|
|
- if [ "$THEME" ]; then
|
|
|
- if [ "$THEME" != "default" ]; then
|
|
|
- echo "[ * ] Applying user interface updates..."
|
|
|
- $BIN/v-change-sys-theme $THEME
|
|
|
- fi
|
|
|
- fi
|
|
|
-
|
|
|
if [ "$UPGRADE_RESTART_SERVICES" = "true" ]; then
|
|
|
echo "[ * ] Restarting services..."
|
|
|
+ export restart="yes"
|
|
|
sleep 2
|
|
|
if [ ! -z "$MAIL_SYSTEM" ]; then
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
@@ -774,7 +784,7 @@ upgrade_restart_services() {
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
echo " - php$v-fpm"
|
|
|
fi
|
|
|
- $BIN/v-restart-service php$v-fpm $restart
|
|
|
+ $BIN/v-restart-service php$v-fpm
|
|
|
fi
|
|
|
done
|
|
|
if [ ! -z "$FTP_SYSTEM" ]; then
|
|
|
@@ -787,20 +797,20 @@ upgrade_restart_services() {
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
echo " - $FIREWALL_EXTENSION"
|
|
|
fi
|
|
|
- $BIN/v-restart-service $FIREWALL_EXTENSION yes
|
|
|
+ $BIN/v-restart-service $FIREWALL_EXTENSION
|
|
|
fi
|
|
|
# Restart SSH daemon service
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
echo " - sshd"
|
|
|
fi
|
|
|
- $BIN/v-restart-service ssh $restart
|
|
|
+ $BIN/v-restart-service ssh
|
|
|
fi
|
|
|
|
|
|
# Always restart the Hestia Control Panel service
|
|
|
if [ "$DEBUG_MODE" = "true" ]; then
|
|
|
echo " - hestia"
|
|
|
fi
|
|
|
- $BIN/v-restart-service hestia $restart
|
|
|
+ $BIN/v-restart-service hestia
|
|
|
}
|
|
|
|
|
|
upgrade_perform_cleanup() {
|