2023-06-16 07:01:34 +00:00
|
|
|
{{/* Define the secrets */}}
|
|
|
|
{{- define "firezone.secrets" -}}
|
|
|
|
{{- $secretName := (printf "%s-firezone-secrets" (include "tc.v1.common.lib.chart.names.fullname" $)) -}}
|
2023-09-09 17:06:56 +00:00
|
|
|
|
|
|
|
# firezone requires all these keys to be in base 64 | b64enc format presented in the container, so this b64enc here is intentional
|
|
|
|
# https://www.firezone.dev/docs/reference/env-vars#secrets-and-encryption
|
2023-09-09 20:13:13 +00:00
|
|
|
{{- $keyGuardian := randAlphaNum 48 | b64enc -}}
|
|
|
|
{{- $keyDatabase := randAlphaNum 32 | b64enc -}}
|
|
|
|
{{- $keySecret := randAlphaNum 48 | b64enc -}}
|
|
|
|
{{- $keyLive := randAlphaNum 24 | b64enc -}}
|
|
|
|
{{- $keyCookieSigning := randAlphaNum 6 | b64enc -}}
|
|
|
|
{{- $keyCookieEncrypt := randAlphaNum 6 | b64enc -}}
|
2023-06-16 07:01:34 +00:00
|
|
|
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName) -}}
|
|
|
|
{{- $keyGuardian = index .data "GUARDIAN_SECRET_KEY" | b64dec -}}
|
|
|
|
{{- $keyDatabase = index .data "DATABASE_ENCRYPTION_KEY" | b64dec -}}
|
|
|
|
{{- $keySecret = index .data "SECRET_KEY_BASE" | b64dec -}}
|
|
|
|
{{- $keyLive = index .data "LIVE_VIEW_SIGNING_SALT" | b64dec -}}
|
|
|
|
{{- $keyCookieSigning = index .data "COOKIE_SIGNING_SALT" | b64dec -}}
|
|
|
|
{{- $keyCookieEncrypt = index .data "COOKIE_ENCRYPTION_SALT" | b64dec -}}
|
|
|
|
{{- end }}
|
|
|
|
enabled: true
|
|
|
|
data:
|
2023-09-09 17:06:56 +00:00
|
|
|
GUARDIAN_SECRET_KEY: {{ $keyGuardian }}
|
|
|
|
DATABASE_ENCRYPTION_KEY: {{ $keyDatabase }}
|
|
|
|
SECRET_KEY_BASE: {{ $keySecret }}
|
|
|
|
LIVE_VIEW_SIGNING_SALT: {{ $keyLive }}
|
|
|
|
COOKIE_SIGNING_SALT: {{ $keyCookieSigning }}
|
|
|
|
COOKIE_ENCRYPTION_SALT: {{ $keyCookieEncrypt }}
|
2023-06-16 07:01:34 +00:00
|
|
|
{{- end -}}
|