From 2404eb68101b329c9c4cace480d965242f009a9a Mon Sep 17 00:00:00 2001 From: Ben Tilford <248725+btilford@users.noreply.github.com> Date: Sun, 1 May 2022 14:37:52 -0600 Subject: [PATCH] [DNM] Synapse Matrix Fixes (#2582) * Attempting to fix issues with synapse that prevent registration using the homeserver. 1. Incorrect references for mail values in _secret.tpl 2. The shared secret question was nested under enable registration, however it's purpose is to bypass normal registration. 3. Coturn shared secret was missing from questions * Update charts/stable/synapse/questions.yaml * Update charts/stable/synapse/questions.yaml * Update charts/stable/synapse/templates/_secret.tpl * PR #2582 Synapse configuration Updates according to PR comments * PR #2582 Synapse configuration Fix trailing whitespace * Update charts/stable/synapse/Chart.yaml * Update Chart.yaml * Update questions.yaml Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Kjeld Schouten-Lebbing --- charts/stable/synapse/Chart.yaml | 2 +- charts/stable/synapse/questions.yaml | 43 +++++++++++-------- .../stable/synapse/templates/_configmap.tpl | 6 +++ charts/stable/synapse/templates/_secret.tpl | 14 +++--- 4 files changed, 39 insertions(+), 26 deletions(-) diff --git a/charts/stable/synapse/Chart.yaml b/charts/stable/synapse/Chart.yaml index 61a44854c39..598e1a3d577 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.24 +version: 2.0.25 annotations: truecharts.org/catagories: | - cloud diff --git a/charts/stable/synapse/questions.yaml b/charts/stable/synapse/questions.yaml index 3c72a92e653..628e48f3bff 100644 --- a/charts/stable/synapse/questions.yaml +++ b/charts/stable/synapse/questions.yaml @@ -120,6 +120,15 @@ questions: schema: type: string default: "matrix.example.com" + - variable: clientBaseUrl + label: Client Base URL + # Assigned to `client_base_url` formerly called `riot_base_url` + description: | + Custom URL for links within email notifications. If not set links will be + based on https://matrix.to + schema: + type: string + default: "" - variable: presence label: "Presence" schema: @@ -199,6 +208,11 @@ questions: # TODO: blacklist: - variable: registration label: "Registration Configuration" + # Enabling captcha instead of mail is also an option but currently only + # mail is configurable. + description: | + Enable registration. If enabled requires this will require enabling + and configuring mail for SMTP. schema: additional_attrs: true type: dict @@ -208,19 +222,16 @@ questions: schema: type: boolean default: false - show_subquestions_if: true - subquestions: - - variable: maxPixels - label: "Max Pixels" - schema: - type: string - default: "32M" - - variable: sharedSecret - label: "Shared Secret" - schema: - type: string - default: "" - private: true + - variable: sharedSecret + label: "Shared Secret" + description: | + If set, allows registration of standard or admin accounts by anyone who has the shared secret, even + if registration is otherwise disabled + schema: + type: string + default: "" + private: true + required: true # TODO: required3PIDs # TODO: autoJoinRooms - variable: security @@ -310,11 +321,6 @@ questions: schema: type: string default: "Matrix " - - variable: riotUrl - label: "Riot URL" - schema: - type: string - default: "" - variable: host label: "Host" schema: @@ -718,6 +724,7 @@ questions: schema: type: int default: 568 + # Include{podSecurityContextAdvanced} # Include{resources} diff --git a/charts/stable/synapse/templates/_configmap.tpl b/charts/stable/synapse/templates/_configmap.tpl index b9597f3dab9..1572ce34684 100644 --- a/charts/stable/synapse/templates/_configmap.tpl +++ b/charts/stable/synapse/templates/_configmap.tpl @@ -14,6 +14,12 @@ data: server_name: {{ .Values.matrix.serverName }} pid_file: /data/homeserver.pid public_baseurl: {{ include "matrix.baseUrl" . | quote }} + + {{- if .Values.matrix.clientBaseURL -}} + # Client Base URL, Formerly riot_base_url + client_base_url: {{ .Values.matrix.clientBaseURL }} + {{- end}} + use_presence: {{ .Values.matrix.presence }} allow_public_rooms_over_federation: {{ and .Values.matrix.federation.enabled .Values.matrix.federation.allowPublicRooms }} diff --git a/charts/stable/synapse/templates/_secret.tpl b/charts/stable/synapse/templates/_secret.tpl index 4c9e263709d..14f6c977d46 100644 --- a/charts/stable/synapse/templates/_secret.tpl +++ b/charts/stable/synapse/templates/_secret.tpl @@ -31,11 +31,11 @@ stringData: email: enable_notifs: {{ .Values.mail.enabled }} notif_from: {{ .Values.mail.from }} - smtp_host: {{ .Values.mail.external.host }} - smtp_port: {{ .Values.mail.external.port }} - smtp_user: {{ .Values.mail.external.username }} - smtp_pass: {{ .Values.mail.external.password }} - require_transport_security: {{ .Values.mail.external.requireTransportSecurity }} + smtp_host: {{ .Values.mail.host }} + smtp_port: {{ .Values.mail.port }} + smtp_user: {{ .Values.mail.username }} + smtp_pass: {{ .Values.mail.password }} + require_transport_security: {{ .Values.mail.requireTransportSecurity }} {{- end }} database: @@ -50,8 +50,8 @@ stringData: cp_max: 10 sslmode: "disable" - {{- if .Values.matrix.registration.sharedSecret }} - registration_shared_secret: {{ .Values.matrix.registration.sharedSecret }} + {{- if .Values.matrix.sharedSecret }} + registration_shared_secret: {{ .Values.matrix.sharedSecret }} {{- end }} macaroon_secret_key: {{ $msk }}