2021-05-19 13:12:45 +00:00
|
|
|
{{/* Define the secrets */}}
|
2021-05-22 22:18:56 +00:00
|
|
|
{{- define "vaultwarden.secrets" -}}
|
2021-05-19 13:12:45 +00:00
|
|
|
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- $adminToken := "" }}
|
2021-05-22 22:18:56 +00:00
|
|
|
{{- if eq .Values.vaultwarden.admin.enabled true }}
|
|
|
|
{{- $adminToken = .Values.vaultwarden.admin.token | default (randAlphaNum 48) | b64enc | quote }}
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $smtpUser := "" }}
|
2021-05-22 22:18:56 +00:00
|
|
|
{{- if and (eq .Values.vaultwarden.smtp.enabled true ) (.Values.vaultwarden.smtp.user) }}
|
|
|
|
{{- $smtpUser = .Values.vaultwarden.smtp.user | b64enc | quote }}
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $yubicoClientId := "" }}
|
2021-05-22 22:18:56 +00:00
|
|
|
{{- if eq .Values.vaultwarden.yubico.enabled true }}
|
|
|
|
{{- $yubicoClientId = required "Yubico Client ID required" .Values.vaultwarden.yubico.clientId | toString | b64enc | quote }}
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- end -}}
|
2021-05-22 20:43:29 +00:00
|
|
|
---
|
2021-04-13 15:02:41 +00:00
|
|
|
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
2021-08-31 18:00:05 +00:00
|
|
|
name: vaultwardensecret
|
2021-04-13 15:02:41 +00:00
|
|
|
data:
|
|
|
|
{{- if ne $adminToken "" }}
|
|
|
|
ADMIN_TOKEN: {{ $adminToken }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if ne $smtpUser "" }}
|
|
|
|
SMTP_USERNAME: {{ $smtpUser }}
|
2021-05-22 22:18:56 +00:00
|
|
|
SMTP_PASSWORD: {{ required "Must specify SMTP password" .Values.vaultwarden.smtp.password | b64enc | quote }}
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if ne $yubicoClientId "" }}
|
|
|
|
YUBICO_CLIENT_ID: {{ $yubicoClientId }}
|
2021-05-22 22:18:56 +00:00
|
|
|
YUBICO_SECRET_KEY: {{ required "Yubico Secret Key required" .Values.vaultwarden.yubico.secretKey | b64enc | quote }}
|
2021-04-13 15:02:41 +00:00
|
|
|
{{- end }}
|
2021-05-19 13:12:45 +00:00
|
|
|
{{- end -}}
|