fix(synapse): secret tweaking

This commit is contained in:
kjeld Schouten-Lebbing
2022-01-31 19:32:17 +01:00
parent 63fa237a04
commit ddc9b8762e
2 changed files with 17 additions and 6 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ maintainers:
name: synapse name: synapse
sources: [] sources: []
type: application type: application
version: 0.0.11 version: 0.0.12
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- cloud - cloud
+16 -5
View File
@@ -1,5 +1,21 @@
{{/* Define the configs */}} {{/* Define the configs */}}
{{- define "synapse.secret" -}} {{- define "synapse.secret" -}}
{{- $previous := lookup "v1" "Secret" .Release.Namespace "synapse-secret-macaroon" }}
{{- $msk := randAlphaNum 50 }}
{{- if $previous }}
{{- $msk = ( index $previous.data "key" ) | b64dec }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: synapse-secret-macaroon
labels:
{{ include "common.labels" . | nindent 4 }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
data:
key: {{ $msk | b64enc }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -10,8 +26,6 @@ metadata:
annotations: annotations:
rollme: {{ randAlphaNum 5 | quote }} rollme: {{ randAlphaNum 5 | quote }}
stringData: stringData:
{{- $previous := lookup "v1" "Secret" .Release.Namespace "synapse-secret" }}
{{- $msk := randAlphaNum 50 }}
secret.yaml: | secret.yaml: |
{{- if .Values.mail.enabled }} {{- if .Values.mail.enabled }}
email: email:
@@ -40,9 +54,6 @@ stringData:
registration_shared_secret: {{ .Values.matrix.registration.sharedSecret }} registration_shared_secret: {{ .Values.matrix.registration.sharedSecret }}
{{- end }} {{- end }}
{{- if $previous }}
{{- $msk = ( index $previous.stringData "macaroon_secret_key" ) }}
{{- end }}
macaroon_secret_key: {{ $msk }} macaroon_secret_key: {{ $msk }}
{{- if .Values.coturn.enabled -}} {{- if .Values.coturn.enabled -}}