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