diff --git a/config_panel.toml b/config_panel.toml index f8b4198..0d5dc7f 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -33,13 +33,13 @@ services = ["__APP__"] [main.welcome.allowed_local_3pids_email] ask = "Register only with given email formats" type = "tags" - help = '( e.g. ^[^@]+@matrix\\\\.org$ ) Note that \\\ will write \\ as suggested in homeserver.yaml' + help = '( e.g. ^[^@]+@matrix\\.org$ )' visible = 'enable_registration && (registrations_require_3pid == "email" || registrations_require_3pid == "email&msisdn")' [main.welcome.allowed_local_3pids_msisdn] ask = "Register only with given phone number formats" type = "tags" - help = '( e.g. \\\\+33 ) Note that \\\ will write \\ as suggested in homeserver.yaml' + help = '( e.g. \\+33 )' visible = 'enable_registration && (registrations_require_3pid == "email&msisdn" || registrations_require_3pid == "msisdn")' [main.welcome.disable_msisdn_registration] diff --git a/scripts/_common.sh b/scripts/_common.sh index a06e0b7..52ae1c0 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -62,7 +62,10 @@ configure_synapse() { local macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' local auto_join_rooms_sed_param="" if [ -n "$auto_join_rooms" ]; then - auto_join_rooms_sed_param='auto_join_rooms:\n - "'$auto_join_rooms'"' + auto_join_rooms_sed_param+='auto_join_rooms:' + while read -d, room; do + auto_join_rooms_sed_param+='\n - "'$room'"' + done <<< "${auto_join_rooms}," fi local registration_require_3pid_sed_param="" case ${registrations_require_3pid} in @@ -82,10 +85,14 @@ configure_synapse() { allowd_local_3pids_sed_param="allowed_local_3pids:" if [ -n "$allowed_local_3pids_email" ]; then - allowd_local_3pids_sed_param+="\n - medium: email\n pattern: '$allowed_local_3pids_email'" + while read -d, pattern ; do + allowd_local_3pids_sed_param+="\n - medium: email\n pattern: '$pattern'" + done <<< "${allowed_local_3pids_email}," fi if [ -n "$allowed_local_3pids_msisdn" ]; then - allowd_local_3pids_sed_param+="\n - medium: msisdn\n pattern: '$allowed_local_3pids_msisdn'" + while read -d, pattern ; do + allowd_local_3pids_sed_param+="\n - medium: msisdn\n pattern: '$pattern'" + done <<< "${allowed_local_3pids_msisdn}," fi fi