charts/charts-wip/matrix-synapse/templates/secrets.yaml

88 lines
2.5 KiB
YAML
Raw Normal View History

2020-08-07 21:23:34 +00:00
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "matrix-synapse.fullname" . }}
labels:
{{- include "matrix-synapse.labels" . | nindent 4 }}
stringData:
config.yaml: |
{{- if .Values.config.recaptcha }}
## Captcha ##
recaptcha_private_key: {{ .Values.config.recaptcha.privateKey | quote }}
{{- end }}
{{- if .Values.config.turnSecret }}
2020-08-09 09:16:36 +00:00
2020-08-07 21:23:34 +00:00
## Turn ##
turn_shared_secret: {{ .Values.config.turnSecret | quote }}
2020-08-09 09:16:36 +00:00
{{- end }}
2020-08-07 21:23:34 +00:00
## Registration ##
2020-08-08 22:15:10 +00:00
registration_shared_secret: {{ .Values.config.registrationSharedSecret | default (randAlphaNum 24) | quote }}
2020-08-07 21:23:34 +00:00
## API Configuration ##
2020-08-09 09:16:36 +00:00
{{- if .Values.config.macaroonSecretKey }}
macaroon_secret_key: {{ .Values.config.macaroonSecretKey | quote }}
{{- end }}
2020-08-07 21:23:34 +00:00
{{- $postgresHost := include "matrix-synapse.postgresql.host" . }}
{{- $postgresDB := include "matrix-synapse.postgresql.database" . }}
{{- $postgresUser := include "matrix-synapse.postgresql.username" . }}
{{- $postgresPort := include "matrix-synapse.postgresql.port" . }}
{{- $postgresPass := include "matrix-synapse.postgresql.password" . }}
2020-08-09 09:16:36 +00:00
2020-08-07 21:23:34 +00:00
## Database configuration ##
database:
name: "psycopg2"
args:
user: {{ $postgresUser | quote }}
{{- if $postgresPass }}
password: {{ $postgresPass | quote }}
{{- else }}
password: "@@POSTGRES_PASSWORD@@"
{{- end }}
database: {{ $postgresDB | quote }}
host: {{ $postgresHost | quote }}
port: {{ $postgresPort }}
cp_min: 5
cp_max: 10
{{- $redisHost := include "matrix-synapse.redis.host" . }}
{{- $redisPort := include "matrix-synapse.redis.port" . }}
{{- $redisPass := include "matrix-synapse.redis.password" . }}
2020-08-09 09:16:36 +00:00
2020-08-07 21:23:34 +00:00
## Redis configuration ##
redis:
enabled: true
host: {{ $redisHost | quote }}
2020-08-08 22:15:10 +00:00
{{- if or .Values.redis.password .Values.externalRedis.password }}
{{- if $redisPass }}
2020-08-07 21:23:34 +00:00
password: {{ $redisPass | quote }}
2020-08-08 22:15:10 +00:00
{{- else }}
2020-08-07 21:23:34 +00:00
password: "@@REDIS_PASSWORD@@"
2020-08-08 22:15:10 +00:00
{{- end }}
2020-08-07 21:23:34 +00:00
{{- end }}
2020-08-08 22:15:10 +00:00
{{- if and .Values.signingkey.job.enabled (not .Values.signingkey.existingSecret) }}
{{- $name := include "matrix-synapse.workername" (dict "global" . "worker" "signingkey") }}
{{- if not (lookup "v1" "Secret" .Release.Namespace $name) }}
2020-08-07 21:23:34 +00:00
---
apiVersion: v1
kind: Secret
metadata:
2020-08-08 22:15:10 +00:00
annotations:
helm.sh/resource-policy: keep
2020-08-07 21:23:34 +00:00
name: {{ $name }}
labels:
{{- include "matrix-synapse.labels" . | nindent 4 }}
2020-08-08 22:15:10 +00:00
app.kubernetes.io/component: signingkey-job
{{- end }}
2020-08-07 21:23:34 +00:00
{{- end }}