From a7153e09cc66f4a5d680b9265d89279e5706713d Mon Sep 17 00:00:00 2001 From: Ben Tilford <248725+btilford@users.noreply.github.com> Date: Fri, 6 May 2022 00:54:41 -0600 Subject: [PATCH] feat(synapse) registration support (#2603) * Feature:Synapse: Working on questions/config needed to support registration * Simplify output of synapse allowed local 3PIDs * Bumped patch version of Synapse * Update charts/stable/synapse/questions.yaml * PR #2603 Synapse questions/config updates based on review * PR #2603 Bump synapse minor version * Feature:Synapse: Working on questions/config needed to support registration * Simplify output of synapse allowed local 3PIDs * Bumped patch version of Synapse * PR #2603 Synapse questions/config updates based on review * Update charts/stable/synapse/questions.yaml * PR #2603 Bump synapse minor version * PR #2603 Quoting strings per PR comments * Update charts/stable/synapse/questions.yaml * PR #2603 Quoting strings per PR comments Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/stable/synapse/Chart.yaml | 2 +- charts/stable/synapse/questions.yaml | 68 ++++++++++++++++++- .../stable/synapse/templates/_configmap.tpl | 20 ++++++ 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/charts/stable/synapse/Chart.yaml b/charts/stable/synapse/Chart.yaml index 6910eaffc81..55d516defd4 100644 --- a/charts/stable/synapse/Chart.yaml +++ b/charts/stable/synapse/Chart.yaml @@ -24,7 +24,7 @@ maintainers: name: synapse sources: [] type: application -version: 2.0.30 +version: 2.1.0 annotations: truecharts.org/catagories: | - cloud diff --git a/charts/stable/synapse/questions.yaml b/charts/stable/synapse/questions.yaml index 628e48f3bff..4fc3ab8473c 100644 --- a/charts/stable/synapse/questions.yaml +++ b/charts/stable/synapse/questions.yaml @@ -222,6 +222,72 @@ questions: schema: type: boolean default: false + show_subquestions_if: true + subquestions: + - variable: requiresToken + label: "Requires Token" + description: "Require users to submit a token during registration." + schema: + type: boolean + default: true + - variable: require3PID + label: "Third Party ID" + description: "The 3rd party IDs required during registration. (All selected will be required)" + schema: + type: list + default: [] + items: + - variable: medium + label: "Medium" + schema: + type: string + default: "email" + enum: + - value: "email" + description: "Email" + - value: "msisdn" + description: "MSISDN" + - variable: enable3PIDLookup + label: "Lookup Third Party ID" + schema: + type: boolean + default: true + - variable: disableMSISDNRegistration + label: "Disable MSISDN Registration" + description: "Override requirement for MSISDN during registration" + schema: + type: boolean + default: false + - variable: allowedLocal3PIDs + label: "Allowed Local Third Party IDs" + description: "Restrict 3PID to specific patterns" + schema: + type: list + default: [] + items: + - variable: allowed + label: "Allowed Third Party ID" + schema: + type: dict + attrs: + - variable: medium + label: "Medium" + schema: + type: string + required: true + default: "email" + enum: + - value: "email" + description: "Email" + - value: "msisdn" + description: "MSISDN" + - variable: pattern + label: "Pattern" + description: "Regular expression to match against" + schema: + type: string + default: "" + required: true - variable: sharedSecret label: "Shared Secret" description: | @@ -252,7 +318,7 @@ questions: default: [] items: - variable: serverName - label: Server Name + label: "Server Name" schema: type: string default: "" diff --git a/charts/stable/synapse/templates/_configmap.tpl b/charts/stable/synapse/templates/_configmap.tpl index 304096accd3..5c2c653409c 100644 --- a/charts/stable/synapse/templates/_configmap.tpl +++ b/charts/stable/synapse/templates/_configmap.tpl @@ -86,6 +86,26 @@ data: enable_registration: {{ .Values.matrix.registration.enabled }} + {{- if .Values.matrix.registration.enabled }} + registration_requires_token: {{ .Values.matrix.registration.requiresToken }} + + {{- if .Values.matrix.registration.require3PID }} + registrations_require_3pid: + {{- range .Values.matrix.registration.requires3PID }} + - {{ . | .medium }} + {{- end }} + {{- end }} + + disable_msisdn_registration: {{ .Values.matrix.registration.disableMSISDNRegistration }} + enable_3pid_lookup: {{ .Values.matrix.registration.enable3PIDLookup }} + + {{- if .Values.matrix.registration.allowedLocal3PIDs }} + allowed_local_3pids: + {{ .Values.matrix.registration.allowedLocal3PIDs }} + {{- end }} + + {{- end }} + allow_guest_access: {{ .Values.matrix.registration.allowGuests }} {{- if .Values.synapse.metrics.enabled }}