Enhance secret management by adding additionalSecrets and mail credentials checks in the Helm template

This commit is contained in:
Florian Weber 2025-05-08 13:30:04 +02:00
parent 0f14ad0329
commit e0e2e10fd1
Signed by: f.weber
GPG Key ID: A1C85EB19014A2D3

View File

@ -1,4 +1,4 @@
{{- if or (not .Values.db.enabled) (not (.Values.bookstack.auth | default dict | len | eq 0)) }} {{- if or (not .Values.db.enabled) (not (.Values.bookstack.auth | default dict | len | eq 0)) .Values.bookstack.config.additionalSecrets .Values.bookstack.mail.username .Values.bookstack.config.additionalSecrets .Values.bookstack.mail.password }}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
type: Opaque type: Opaque
@ -32,7 +32,7 @@ data:
$conf.clientSecret | b64enc | quote }} $conf.clientSecret | b64enc | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.bookstack.auth.ldap.enabled }} {{- if and .Values.bookstack.auth.ldap.enabled (not .Values.bookstack.auth.ldap.existingSecret) }}
LDAP_SERVER: {{ required LDAP_SERVER: {{ required
"You have to define a bookstack.auth.ldap.server" "You have to define a bookstack.auth.ldap.server"
.Values.bookstack.auth.ldap.server | b64enc | quote }} .Values.bookstack.auth.ldap.server | b64enc | quote }}
@ -40,7 +40,16 @@ data:
"You have to define a bookstack.auth.ldap.dn" "You have to define a bookstack.auth.ldap.dn"
.Values.bookstack.auth.ldap.dn | b64enc | quote }} .Values.bookstack.auth.ldap.dn | b64enc | quote }}
LDAP_PASS: {{ required LDAP_PASS: {{ required
"You have to define a bookstack.auth.ldap.passw" "You have to define a bookstack.auth.ldap.pass"
.Values.bookstack.auth.ldap.pass | b64enc | quote }} .Values.bookstack.auth.ldap.pass | b64enc | quote }}
{{- end }} {{- end }}
{{- if .Values.bookstack.mail.username }}
MAIL_USERNAME: {{ .Values.bookstack.mail.username | b64enc | quote }}
{{- end }}
{{- if .Values.bookstack.mail.password }}
MAIL_PASSWORD: {{ .Values.bookstack.mail.password | b64enc | quote }}
{{- end }}
{{- range $key, $value := .Values.bookstack.config.additionalSecrets }}
{{ $key | snakecase | upper }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }} {{- end }}