From a393698f19bfd1cdc3a61a7909f9fdcd238ed349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 18 Dec 2019 20:50:48 +0100 Subject: [PATCH] Fix settings migration --- scripts/upgrade | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d27c95d..0552f01 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -64,10 +64,6 @@ then ynh_die --message="Update from this synapse version is not available. You need to remove this package and reinstall the new package version." fi -if [ -z $server_name ]; then - server_name=$domain - ynh_app_setting_set $app server_name $domain -fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -93,7 +89,7 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS #================================================= -# MIGRATION 5 : GENERATE SYNAPSE SECRET +# MIGRATION 5 : Manage old settings #================================================= # Migrate from settings 'special_domain' to 'domain' and 'special_path' to 'path' @@ -107,6 +103,12 @@ if [ -z $domain ]; then ynh_app_setting_set --app=$app --key=no_sso --value true fi +# Define $server_name if not already defined +if [ -z $server_name ]; then + server_name=$domain + ynh_app_setting_set $app server_name $domain +fi + #================================================= # INSTALL DEPENDENCIES #=================================================