2022-04-18 06:29:33 +00:00
|
|
|
{{/* Define the secrets */}}
|
|
|
|
{{- define "audiobookshelf.secrets" -}}
|
2023-04-14 16:11:04 +00:00
|
|
|
{{- $secretName := (printf "%s-audiobookshelf-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) }}
|
|
|
|
{{- $audiobookshelfprevious := lookup "v1" "Secret" .Release.Namespace $secretName }}
|
2022-04-18 06:29:33 +00:00
|
|
|
{{- $token_secret := "" }}
|
2023-04-14 16:11:04 +00:00
|
|
|
enabled: true
|
2022-04-18 06:29:33 +00:00
|
|
|
data:
|
2023-04-14 16:11:04 +00:00
|
|
|
{{- if $audiobookshelfprevious }}
|
|
|
|
TOKEN_SECRET: {{ index $audiobookshelfprevious.data "TOKEN_SECRET" | b64dec }}
|
2022-04-18 06:29:33 +00:00
|
|
|
{{- else }}
|
|
|
|
{{- $token_secret := randAlphaNum 32 }}
|
2023-04-14 16:11:04 +00:00
|
|
|
TOKEN_SECRET: {{ $token_secret }}
|
2022-04-18 06:29:33 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- end -}}
|