From 958ad68078ac53ca0ade5c28648d8da8daba53ee Mon Sep 17 00:00:00 2001 From: Dan Arnfield Date: Wed, 8 May 2019 12:29:18 -0500 Subject: [PATCH] Add registrations_require_3pid synapse option --- roles/matrix-synapse/defaults/main.yml | 3 +++ roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index 177cf793..531217b3 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -114,6 +114,9 @@ matrix_synapse_use_presence: true # Controls whether people with access to the homeserver can register by themselves. matrix_synapse_enable_registration: false +# A list of 3PID types which users must supply when registering (possible values: email, msisdn). +matrix_synapse_registrations_require_3pid: [] + # Users who register on this homeserver will automatically be joined to these rooms. # Rooms are to be specified using addresses (e.g. `#address:example.com`) matrix_synapse_auto_join_rooms: [] diff --git a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 334ef454..acc4f94b 100644 --- a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -671,6 +671,9 @@ enable_registration: {{ matrix_synapse_enable_registration|to_json }} #registrations_require_3pid: # - email # - msisdn +{% if matrix_synapse_registrations_require_3pid %} +registrations_require_3pid: {{ matrix_synapse_registrations_require_3pid|to_json }} +{% endif %} # Explicitly disable asking for MSISDNs from the registration # flow (overrides registrations_require_3pid if MSISDNs are set as required)