From c039c3774a0f2dda391e7bf6fe98fc369c578973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 16 Feb 2024 23:31:30 +0100 Subject: [PATCH] Apply same default value from install to upgrade --- scripts/upgrade | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4ffdcc4..694a3f9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -110,17 +110,17 @@ then fi if [ -z "$registrations_require_3pid" ] then - registrations_require_3pid="none" + registrations_require_3pid=email ynh_app_setting_set --app=$app --key=registrations_require_3pid --value=$registrations_require_3pid fi if [ -z "$allowed_local_3pids_email" ] then - allowed_local_3pids_email="'^[^@]+@""matrix""\.org$'" + allowed_local_3pids_email='' ynh_app_setting_set --app=$app --key=allowed_local_3pids_email --value=$allowed_local_3pids_email fi if [ -z "$allowed_local_3pids_msisdn" ] then - allowed_local_3pids_msisdn="'\+33'" + allowed_local_3pids_msisdn='' ynh_app_setting_set --app=$app --key=allowed_local_3pids_msisdn --value=$allowed_local_3pids_msisdn fi if [ -z "$account_threepid_delegates_msisdn" ] @@ -168,6 +168,17 @@ then enable_group_creation="true" ynh_app_setting_set --app=$app --key=enable_group_creation --value=$enable_group_creation fi +if [ -z "$enable_3pid_lookup" ] +then + enable_3pid_lookup=false + ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup +fi +if [ -z "$turn_allow_guests" ] +then + turn_allow_guests=false + ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests +fi + if [ -z "$enable_registration" ] then @@ -178,22 +189,14 @@ then if [ "$is_free_registration" -eq "0" ] then enable_registration="false" - turn_allow_guests="false" - sso_enabled="true" password_enabled="false" - enable_3pid_lookup="false" + else enable_registration="true" - turn_allow_guests="true" - sso_enabled="false" password_enabled="true" - enable_3pid_lookup="true" fi ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration - ynh_app_setting_set --app=$app --key=turn_allow_guests --value=$turn_allow_guests - ynh_app_setting_set --app=$app --key=sso_enabled --value=$sso_enabled ynh_app_setting_set --app=$app --key=password_enabled --value=$password_enabled - ynh_app_setting_set --app=$app --key=enable_3pid_lookup --value=$enable_3pid_lookup fi if [ -z "$push_include_content" ]