From bbce6f4880dac7d9de0a888985d6dc072c94f4ed Mon Sep 17 00:00:00 2001 From: James Elliott Date: Wed, 2 Oct 2024 10:11:11 +1000 Subject: [PATCH] fix: authelia url path (#264) This fixes an issue where the path value for the authelia_url was ignored. --- charts/authelia/Chart.yaml | 2 +- charts/authelia/templates/_ingress.tpl | 8 ++++++++ charts/authelia/templates/configMap.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/authelia/Chart.yaml b/charts/authelia/Chart.yaml index 888dc52..44c8389 100644 --- a/charts/authelia/Chart.yaml +++ b/charts/authelia/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: authelia -version: 0.9.6 +version: 0.9.7 kubeVersion: ">= 1.13.0-0" description: Authelia is a Single Sign-On Multi-Factor portal for web apps type: application diff --git a/charts/authelia/templates/_ingress.tpl b/charts/authelia/templates/_ingress.tpl index 3fd37b2..1c59271 100644 --- a/charts/authelia/templates/_ingress.tpl +++ b/charts/authelia/templates/_ingress.tpl @@ -1,3 +1,11 @@ +{{- define "authelia.ingress.uri" -}} + {{- if .Path }} + {{- printf "https://%s/%s" (include "authelia.ingress.host" .) .Path }} + {{- else }} + {{- printf "https://%s" (include "authelia.ingress.host" .) }} + {{- end }} +{{- end -}} + {{/* Returns the ingress host value. */}} diff --git a/charts/authelia/templates/configMap.yaml b/charts/authelia/templates/configMap.yaml index a25926f..40e94e8 100644 --- a/charts/authelia/templates/configMap.yaml +++ b/charts/authelia/templates/configMap.yaml @@ -202,7 +202,7 @@ data: cookies: {{- range $cookie := (required "The value 'configMap.session.cookies' must have at least one configuration" $session.cookies) }} - domain: {{ required "All 'domain' values for the 'configMap.session.cookies' configurations must be configured" .domain | squote }} - authelia_url: {{ printf "https://%s" (include "authelia.ingress.host" (merge (dict "SubDomain" $cookie.subdomain "Domain" $cookie.domain) $)) | squote }} + authelia_url: {{ include "authelia.ingress.uri" (merge (dict "SubDomain" $cookie.subdomain "Domain" $cookie.domain "Path" $cookie.path) $) | squote }} {{- if $cookie.default_redirection_url }} default_redirection_url: {{ $cookie.default_redirection_url | squote }} {{- end }}