feat(bookstack): Add autogenerated app_key (#2194)

This commit is contained in:
Stavros Kois
2022-03-17 08:09:31 +02:00
committed by GitHub
parent 55b09eb958
commit ca47f26dda
5 changed files with 48 additions and 11 deletions
@@ -0,0 +1,20 @@
{{/* Define the secrets */}}
{{- define "bookstack.secrets" -}}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: bookstack-secrets
{{- $bookstackprevious := lookup "v1" "Secret" .Release.Namespace "bookstack-secrets" }}
{{- $app_key := "" }}
data:
{{- if $bookstackprevious}}
APP_KEY: {{ index $bookstackprevious.data "APP_KEY" }}
{{- else }}
{{- $app_key := randAlphaNum 32 }}
APP_KEY: {{ $app_key | b64enc }}
{{- end }}
{{- end -}}