2022-08-10 18:12:58 +03:00
|
|
|
{{- if (include "mastodon.createSecret" .) }}
|
2020-06-29 14:58:48 +03:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
|
|
|
name: {{ template "mastodon.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "mastodon.labels" . | nindent 4 }}
|
|
|
|
type: Opaque
|
|
|
|
data:
|
2021-02-19 10:52:32 +02:00
|
|
|
{{- if .Values.mastodon.s3.enabled }}
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- if not .Values.mastodon.s3.existingSecret }}
|
2021-02-19 10:52:32 +02:00
|
|
|
AWS_ACCESS_KEY_ID: "{{ .Values.mastodon.s3.access_key | b64enc }}"
|
|
|
|
AWS_SECRET_ACCESS_KEY: "{{ .Values.mastodon.s3.access_secret | b64enc }}"
|
|
|
|
{{- end }}
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- end }}
|
|
|
|
{{- if not .Values.mastodon.secrets.existingSecret }}
|
2021-02-15 09:00:54 +02:00
|
|
|
{{- if not (empty .Values.mastodon.secrets.secret_key_base) }}
|
|
|
|
SECRET_KEY_BASE: "{{ .Values.mastodon.secrets.secret_key_base | b64enc }}"
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- else }}
|
2021-02-15 09:00:54 +02:00
|
|
|
SECRET_KEY_BASE: {{ required "secret_key_base is required" .Values.mastodon.secrets.secret_key_base }}
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- end }}
|
2021-02-15 09:00:54 +02:00
|
|
|
{{- if not (empty .Values.mastodon.secrets.otp_secret) }}
|
|
|
|
OTP_SECRET: "{{ .Values.mastodon.secrets.otp_secret | b64enc }}"
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- else }}
|
2021-02-15 09:00:54 +02:00
|
|
|
OTP_SECRET: {{ required "otp_secret is required" .Values.mastodon.secrets.otp_secret }}
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- end }}
|
2021-02-15 09:00:54 +02:00
|
|
|
{{- if not (empty .Values.mastodon.secrets.vapid.private_key) }}
|
|
|
|
VAPID_PRIVATE_KEY: "{{ .Values.mastodon.secrets.vapid.private_key | b64enc }}"
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- else }}
|
2021-02-15 09:00:54 +02:00
|
|
|
VAPID_PRIVATE_KEY: {{ required "vapid.private_key is required" .Values.mastodon.secrets.vapid.private_key }}
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- end }}
|
2021-02-15 09:00:54 +02:00
|
|
|
{{- if not (empty .Values.mastodon.secrets.vapid.public_key) }}
|
|
|
|
VAPID_PUBLIC_KEY: "{{ .Values.mastodon.secrets.vapid.public_key | b64enc }}"
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- else }}
|
2021-02-15 09:00:54 +02:00
|
|
|
VAPID_PUBLIC_KEY: {{ required "vapid.public_key is required" .Values.mastodon.secrets.vapid.public_key }}
|
2020-06-29 14:58:48 +03:00
|
|
|
{{- end }}
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- end }}
|
2021-02-14 21:16:32 +02:00
|
|
|
{{- if not .Values.postgresql.enabled }}
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- if not .Values.postgresql.auth.existingSecret }}
|
2022-11-08 18:18:57 +02:00
|
|
|
password: "{{ .Values.postgresql.auth.password | b64enc }}"
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- end }}
|
2021-02-14 21:16:32 +02:00
|
|
|
{{- end }}
|
2022-08-10 18:12:58 +03:00
|
|
|
{{- end -}}
|