matrix-synapse: Add redis dbid to configuration

This will only have an effect in the upcoming Synapse 1.78.0 release

Fixes #33
This commit is contained in:
Alexander "Ace" Olofsson 2023-02-22 20:30:14 +01:00
parent 78b5323c67
commit f9238b77e3
No known key found for this signature in database
GPG key ID: D439C9470CB04C73
3 changed files with 24 additions and 3 deletions

View file

@ -270,3 +270,14 @@ Set redis password
{{ .Values.externalRedis.password }}
{{- end -}}
{{- end -}}
{{/*
Set redis database id
*/}}
{{- define "matrix-synapse.redis.dbid" -}}
{{- if .Values.redis.dbid -}}
{{ .Values.redis.dbid }}
{{- else if .Values.externalRedis.dbid -}}
{{ .Values.externalRedis.dbid }}
{{- end -}}
{{- end -}}

View file

@ -60,21 +60,25 @@ stringData:
{{- $redisHost := include "matrix-synapse.redis.host" . }}
{{- $redisPort := include "matrix-synapse.redis.port" . }}
{{- $redisPass := include "matrix-synapse.redis.password" . }}
{{- $redisDbid := include "matrix-synapse.redis.dbid" . }}
## Redis configuration ##
redis:
enabled: true
host: {{ $redisHost | quote }}
{{- if $redisPort }}
port: {{ $redisPort }}
{{- end }}
{{- if or .Values.redis.auth.enabled .Values.redis.usePassword .Values.redis.password .Values.redis.auth.password .Values.externalRedis.password }}
{{- if and $redisPass (not .Values.redis.existingSecret) }}
password: {{ $redisPass | quote }}
{{- else }}
password: "@@REDIS_PASSWORD@@"
{{- end }}
{{- if $redisPort }}
port: {{ $redisPort }}
{{- end }}
{{- end }}
{{- if $redisDbid }}
dbid: {{ $redisDbid }}
{{- end }}
{{- with .Values.extraSecrets }}

View file

@ -732,6 +732,9 @@ externalPostgresql:
redis:
enabled: true
## Database ID for non-default database
# dbid: 0
auth:
enabled: true
# XXX Change me!
@ -760,6 +763,9 @@ externalRedis:
port: 6379
# password: synapse
## Database ID for non-default database
# dbid: 0
## The name of an existing secret with redis credentials
#existingSecret: redis-secrets