mirror of
https://github.com/rtomik/helm-charts.git
synced 2026-07-16 16:25:16 +00:00
fixed [Bug][Paperless] Redis password from secret isn't working #5
This commit is contained in:
@ -92,17 +92,26 @@ Redis port
|
||||
Redis URL
|
||||
Constructs the Redis URL with optional authentication.
|
||||
Format: redis://[username]:[password]@host:port/database
|
||||
When existingSecret is configured, uses environment variable placeholder for password.
|
||||
*/}}
|
||||
{{- define "paperless-ngx.redis.url" -}}
|
||||
{{- $host := include "paperless-ngx.redis.host" . }}
|
||||
{{- $port := include "paperless-ngx.redis.port" . }}
|
||||
{{- $database := .Values.redis.external.database | toString }}
|
||||
{{- $username := .Values.redis.external.username | default "" }}
|
||||
{{- $password := .Values.redis.external.password | default "" }}
|
||||
{{- if and $username $password }}
|
||||
{{- if .Values.redis.external.existingSecret }}
|
||||
{{- if $username }}
|
||||
{{- printf "redis://%s:$REDIS_PASSWORD@%s:%s/%s" $username $host $port $database }}
|
||||
{{- else }}
|
||||
{{- printf "redis://:$REDIS_PASSWORD@%s:%s/%s" $host $port $database }}
|
||||
{{- end }}
|
||||
{{- else if .Values.redis.external.password }}
|
||||
{{- $password := .Values.redis.external.password }}
|
||||
{{- if $username }}
|
||||
{{- printf "redis://%s:%s@%s:%s/%s" $username $password $host $port $database }}
|
||||
{{- else if $password }}
|
||||
{{- else }}
|
||||
{{- printf "redis://:%s@%s:%s/%s" $password $host $port $database }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- printf "redis://%s:%s/%s" $host $port $database }}
|
||||
{{- end }}
|
||||
|
||||
@ -73,6 +73,16 @@ spec:
|
||||
- name: PAPERLESS_REDIS_PREFIX
|
||||
value: {{ .Values.redis.external.prefix | quote }}
|
||||
{{- end }}
|
||||
|
||||
# Redis password from secret (if configured)
|
||||
{{- if or .Values.redis.external.existingSecret .Values.redis.external.password }}
|
||||
- name: REDIS_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.redis.external.existingSecret | default (printf "%s-secrets" (include "paperless-ngx.fullname" .)) }}
|
||||
key: {{ .Values.redis.external.passwordKey | default "redis-password" }}
|
||||
{{- end }}
|
||||
|
||||
- name: PAPERLESS_DBHOST
|
||||
value: {{ include "paperless-ngx.postgresql.host" . | quote }}
|
||||
- name: PAPERLESS_DBPORT
|
||||
|
||||
Reference in New Issue
Block a user