Skip to content

Commit 8a15b1c

Browse files
author
Kristan Kenney
committed
Replace known key database on upgrade
1 parent 1d6c98f commit 8a15b1c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

func/syshealth.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function syshealth_update_user_config_format() {
110110
}
111111

112112
# Update list of known keys for db.conf files
113-
function syshealth_update_database_config_format() {
113+
function syshealth_update_db_config_format() {
114114

115115
# DATABASE CONFIGURATION
116116
# Create array of known keys in configuration file
@@ -139,8 +139,7 @@ function syshealth_repair_web_config() {
139139
sanitize_config_file
140140
get_domain_values 'web'
141141
prev="DOMAIN"
142-
for key in $known_keys;
143-
do
142+
for key in $known_keys; do
144143
if [ -z "${!key}" ]; then
145144
add_object_key 'web' 'DOMAIN' "$domain" "$key" "$prev"
146145
fi

func/upgrade.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,16 @@ upgrade_rebuild_users() {
624624
fi
625625
}
626626

627+
upgrade_replace_default_config() {
628+
if [ "$UPGRADE_REPLACE_KNOWN_KEYS" ]; then
629+
syshealth_update_web_config_format
630+
syshealth_update_mail_config_format
631+
syshealth_update_dns_config_format
632+
syshealth_update_db_config_format
633+
syshealth_update_user_config_format
634+
fi
635+
}
636+
627637
upgrade_restart_services() {
628638
if [ "$UPGRADE_RESTART_SERVICES" = "true" ]; then
629639
echo "[ * ] Restarting services..."

install/upgrade/upgrade.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ UPGRADE_UPDATE_FILEMANAGER='true'
4141
UPGRADE_UPDATE_FILEMANAGER_CONFIG='false'
4242

4343
# Post installation clean-up
44+
UPGRADE_REPLACE_KNOWN_KEYS='true'
4445
UPGRADE_REBUILD_USERS='true'
4546
UPGRADE_RESTART_SERVICES='true'
4647

src/deb/hestia/postinst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ upgrade_welcome_message
4242

4343
# Perform upgrade health check and refresh configuration before upgrading
4444
upgrade_health_check | tee -a $LOG
45+
upgrade_replace_default_config
4546
upgrade_refresh_config
4647

4748
# Back up existing configuration files and templates

0 commit comments

Comments
 (0)