helm-charts/ntfy/templates/secret.yaml

36 lines
1,018 B
YAML
Raw Normal View History

2024-07-26 02:21:20 +02:00
---
{{- $fullname := include "ntfy.fullname" . }}
{{- $secretName := printf "%s-env" $fullname }}
{{- $public := .Values.ntfy.webPush.keys.public }}
{{- $private := .Values.ntfy.webPush.keys.private }}
{{- with (lookup "v1" "Secret" .Release.Namespace $secretName)}}
{{- with get . "data" }}
{{- $public = $public | default (get . "NTFY_WEB_PUSH_PUBLIC_KEY" | b64dec) }}
{{- $private = $private | default (get . "NTFY_WEB_PUSH_PRIVATE_KEY" | b64dec) }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
annotations:
confighash: {{ .Values.ntfy | toYaml | sha256sum | trunc 32 }}
"helm.sh/hook": pre-install,pre-upgrade
helm.sh/resource-policy: keep
"helm.sh/hook-weight": "5"
"helm.sh/hook-delete-policy": hook-failed
2024-07-26 02:21:20 +02:00
labels:
{{- include "ntfy.labels" . | nindent 4 }}
data:
# web-push
{{- with $public }}
NTFY_WEB_PUSH_PUBLIC_KEY: {{ . | b64enc }}
{{- end }}
{{- with $private }}
NTFY_WEB_PUSH_PRIVATE_KEY: {{ . | b64enc }}
{{- end }}