about summary refs log tree commit diff
path: root/chart/templates/secrets.yaml
blob: 2a91c349342e39a8b593e38a09dfced87670ce91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{{- if (include "mastodon.createSecret" .) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "mastodon.fullname" . }}
  labels:
    {{- include "mastodon.labels" . | nindent 4 }}
type: Opaque
data:
  {{- if .Values.mastodon.s3.enabled }}
  {{- if not .Values.mastodon.s3.existingSecret }}
  AWS_ACCESS_KEY_ID: "{{ .Values.mastodon.s3.access_key | b64enc }}"
  AWS_SECRET_ACCESS_KEY: "{{ .Values.mastodon.s3.access_secret | b64enc }}"
  {{- end }}
  {{- end }}
  {{- if not .Values.mastodon.secrets.existingSecret }}
  {{- if not (empty .Values.mastodon.secrets.secret_key_base) }}
  SECRET_KEY_BASE: "{{ .Values.mastodon.secrets.secret_key_base | b64enc }}"
  {{- else }}
  SECRET_KEY_BASE: {{ required "secret_key_base is required" .Values.mastodon.secrets.secret_key_base }}
  {{- end }}
  {{- if not (empty .Values.mastodon.secrets.otp_secret) }}
  OTP_SECRET: "{{ .Values.mastodon.secrets.otp_secret | b64enc }}"
  {{- else }}
  OTP_SECRET: {{ required "otp_secret is required" .Values.mastodon.secrets.otp_secret }}
  {{- end }}
  {{- if not (empty .Values.mastodon.secrets.vapid.private_key) }}
  VAPID_PRIVATE_KEY: "{{ .Values.mastodon.secrets.vapid.private_key | b64enc }}"
  {{- else }}
  VAPID_PRIVATE_KEY: {{ required "vapid.private_key is required" .Values.mastodon.secrets.vapid.private_key }}
  {{- end }}
  {{- if not (empty .Values.mastodon.secrets.vapid.public_key) }}
  VAPID_PUBLIC_KEY: "{{ .Values.mastodon.secrets.vapid.public_key | b64enc }}"
  {{- else }}
  VAPID_PUBLIC_KEY: {{ required "vapid.public_key is required" .Values.mastodon.secrets.vapid.public_key }}
  {{- end }}
  {{- end }}
  {{- if not .Values.postgresql.enabled }}
  {{- if not .Values.postgresql.auth.existingSecret }}
  postgres-password: "{{ .Values.postgresql.auth.password | b64enc }}"
  {{- end }}
  {{- end }}
{{- end -}}