From b12b059bc1f31ae1776568c0471a95feb9af7344 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 13:13:43 +0200 Subject: [PATCH] Support encrypted Rclone configs (#5) Fixes #2 --- charts/rclone-copy/templates/rclone-cron.yaml | 9 +++++++++ charts/rclone-copy/templates/secret.yaml | 9 +++++++++ charts/rclone-copy/values.yaml | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 charts/rclone-copy/templates/secret.yaml diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 7ddf601..73b36d1 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -78,6 +78,15 @@ spec: resources: {{ toYaml .Values.resources | indent 14 }} + + {{- if .Values.configPassword }} + env: + - name: RCLONE_CONFIG_PASS + valueFrom: + secretKeyRef: + name: rclone-config-{{ .Release.Name }} + key: password + {{- end }} restartPolicy: {{ .Values.restartPolicy }} volumes: diff --git a/charts/rclone-copy/templates/secret.yaml b/charts/rclone-copy/templates/secret.yaml new file mode 100644 index 0000000..ca6de3d --- /dev/null +++ b/charts/rclone-copy/templates/secret.yaml @@ -0,0 +1,9 @@ +{{- if .Values.configPassword }} +apiVersion: v1 +kind: Secret +metadata: + name: rclone-config-{{ .Release.Name }} +type: Opaque +data: + password: {{ .Values.configPassword | b64enc }} +{{- end }} diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml index ace2fc0..518cbea 100644 --- a/charts/rclone-copy/values.yaml +++ b/charts/rclone-copy/values.yaml @@ -76,3 +76,5 @@ backoffLimit: 6 podAnnotations: {} podLabels: {} + +# configPassword: password