From e0e2e10fd1c6d8e26a7835e3953502748f02144a Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Thu, 8 May 2025 13:30:04 +0200 Subject: [PATCH] Enhance secret management by adding additionalSecrets and mail credentials checks in the Helm template --- bookstack/templates/secret-bookstack.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bookstack/templates/secret-bookstack.yaml b/bookstack/templates/secret-bookstack.yaml index cadcc96..fd0d050 100644 --- a/bookstack/templates/secret-bookstack.yaml +++ b/bookstack/templates/secret-bookstack.yaml @@ -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 kind: Secret type: Opaque @@ -32,7 +32,7 @@ data: $conf.clientSecret | b64enc | quote }} {{- end }} {{- end }} - {{- if .Values.bookstack.auth.ldap.enabled }} + {{- if and .Values.bookstack.auth.ldap.enabled (not .Values.bookstack.auth.ldap.existingSecret) }} LDAP_SERVER: {{ required "You have to define a bookstack.auth.ldap.server" .Values.bookstack.auth.ldap.server | b64enc | quote }} @@ -40,7 +40,16 @@ data: "You have to define a bookstack.auth.ldap.dn" .Values.bookstack.auth.ldap.dn | b64enc | quote }} 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 }} {{- 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 }}