From 34e8545969c51aeaf22cce6f27fc34c4d8ae32b4 Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Mon, 6 Dec 2021 00:57:57 +0100 Subject: [PATCH] fix(authelia): correct upgrade handling without encryption key --- charts/stable/authelia/Chart.yaml | 2 +- charts/stable/authelia/templates/_secrets.tpl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/stable/authelia/Chart.yaml b/charts/stable/authelia/Chart.yaml index bcb53e3572f..bc4b95cd66f 100644 --- a/charts/stable/authelia/Chart.yaml +++ b/charts/stable/authelia/Chart.yaml @@ -38,7 +38,7 @@ sources: - https://github.com/authelia/chartrepo - https://github.com/authelia/authelia type: application -version: 8.0.12 +version: 8.0.13 annotations: truecharts.org/catagories: | - security diff --git a/charts/stable/authelia/templates/_secrets.tpl b/charts/stable/authelia/templates/_secrets.tpl index 42b3536ca55..2854c28fc79 100644 --- a/charts/stable/authelia/templates/_secrets.tpl +++ b/charts/stable/authelia/templates/_secrets.tpl @@ -15,9 +15,14 @@ metadata: {{- $encryptionkey := "" }} data: {{- if $autheliaprevious }} - ENCRYPTION_KEY: {{ index $autheliaprevious.data "ENCRYPTION_KEY" }} SESSION_ENCRYPTION_KEY: {{ index $autheliaprevious.data "SESSION_ENCRYPTION_KEY" }} JWT_TOKEN: {{ index $autheliaprevious.data "JWT_TOKEN" }} + {{- if ( hasKey $autheliaprevious.data "ENCRYPTION_KEY" ) }} + ENCRYPTION_KEY: {{ index $autheliaprevious.data "ENCRYPTION_KEY" }} + {{- else }} + {{- $encryptionkey := randAlphaNum 100 }} + ENCRYPTION_KEY: {{ $encryptionkey | b64enc | quote }} + {{- end }} {{- else }} {{- $jwtsecret := randAlphaNum 50 }} {{- $sessionsecret := randAlphaNum 50 }}