diff --git a/charts/authelia/Chart.yaml b/charts/authelia/Chart.yaml index e34f694..6c79a28 100644 --- a/charts/authelia/Chart.yaml +++ b/charts/authelia/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: authelia -version: 0.1.3 +version: 0.1.4 kubeVersion: ">= 1.13.0" description: Authelia is a Single Sign-On Multi-Factor portal for web apps type: application diff --git a/charts/authelia/templates/_helpers.tpl b/charts/authelia/templates/_helpers.tpl index f560099..84479c8 100644 --- a/charts/authelia/templates/_helpers.tpl +++ b/charts/authelia/templates/_helpers.tpl @@ -63,6 +63,82 @@ Returns true if pod is stateful. {{- end -}} {{- end -}} +{{/* +Returns true if redis is configured. +*/}} +{{- define "authelia.configured.redis" -}} + {{- if .Values.configMap -}} + {{- if .Values.configMap.session -}} + {{- if .Values.configMap.session.redis -}} + {{- true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* +Returns true if redis secret is configured. +*/}} +{{- define "authelia.configured.redisSecret" -}} + {{- if .Values.secret -}} + {{- if .Values.secret.redis -}} + {{- if hasKey .Values.secret.redis "value" -}} + {{- true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* +Returns true if smtp is enabled. +*/}} +{{- define "authelia.configured.smtp" -}} + {{- if .Values.configMap -}} + {{- if .Values.configMap.notifier -}} + {{- if .Values.configMap.notifier.smtp -}} + {{- true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* +Returns true if smtp secret is configured. +*/}} +{{- define "authelia.configured.smtpSecret" -}} + {{- if .Values.secret -}} + {{- if .Values.secret.smtp -}} + {{- if hasKey .Values.secret.smtp "value" -}} + {{- true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* +Returns true if duo is enabled. +*/}} +{{- define "authelia.configured.duo" -}} + {{- if .Values.configMap -}} + {{- if .Values.configMap.duo_api -}} + {{- true -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{/* +Returns true if duo secret is configured. +*/}} +{{- define "authelia.configured.duoSecret" -}} + {{- if .Values.secret -}} + {{- if .Values.secret.duo -}} + {{- if hasKey .Values.secret.duo "value" -}} + {{- true -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} + {{/* Returns the name of the chain Middleware for forward auth which gets applied to other IngressRoutes. */}} diff --git a/charts/authelia/templates/secret.yaml b/charts/authelia/templates/secret.yaml index 6eb6aa2..65d0257 100644 --- a/charts/authelia/templates/secret.yaml +++ b/charts/authelia/templates/secret.yaml @@ -14,13 +14,13 @@ data: {{- .Values.secret.session.key | nindent 2 }}: {{ include "authelia.secret.standard" (merge (dict "SecretValue" .Values.secret.session.value) .) }} {{- .Values.secret.ldap.key | nindent 2 }}: {{ include "authelia.secret.standard" (merge (dict "SecretValue" .Values.secret.ldap.value) .) }} {{- .Values.secret.storage.key | nindent 2 }}: {{ include "authelia.secret.standard" (merge (dict "SecretValue" .Values.secret.storage.value) .) }} - {{- if .Values.secret.redis.enabled }} + {{- if or (include "authelia.configured.redis" .) (include "authelia.configured.redisSecret" .) }} {{- .Values.secret.redis.key | nindent 2 }}: {{ include "authelia.secret.standard" (merge (dict "SecretValue" .Values.secret.redis.value) .) }} {{- end }} - {{- if .Values.secret.smtp.enabled }} + {{- if or (include "authelia.configured.smtp" .) (include "authelia.configured.smtpSecret" .) }} {{- .Values.secret.smtp.key | nindent 2 }}: {{ include "authelia.secret.standard" (merge (dict "SecretValue" .Values.secret.smtp.value) .) }} {{- end }} - {{- if and .Values.configMap.duo_api .Values.secret.duo.value }} + {{- if or (include "authelia.configured.duo" .) (include "authelia.configured.duoSecret" .) }} {{- .Values.secret.duo.key | nindent 2 }}: {{ .Values.secret.duo.value | b64enc }} {{- end }} {{- end -}} \ No newline at end of file diff --git a/charts/authelia/values.yaml b/charts/authelia/values.yaml index ed6bd5d..6ca5591 100644 --- a/charts/authelia/values.yaml +++ b/charts/authelia/values.yaml @@ -856,11 +856,9 @@ secret: key: DUO_API_KEY # value: redis: - enabled: false key: REDIS_PASSWORD # value: smtp: - enabled: false key: SMTP_PASSWORD # value: