From df97089a79a1fa465a9ed9cfe22333bcc2034912 Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 12:35:58 +0200 Subject: [PATCH 1/2] Support encrypted Rclone configs Fixes #2 --- charts/rclone-copy/templates/rclone-cron.yaml | 7 +++++++ charts/rclone-copy/templates/secret.yaml | 9 +++++++++ charts/rclone-copy/values.yaml | 2 ++ 3 files changed, 18 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..90fb402 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -78,6 +78,13 @@ spec: resources: {{ toYaml .Values.resources | indent 14 }} + + env: + - name: RCLONE_CONFIG_PASS + valueFrom: + secretKeyRef: + name: rclone-config-{{ .Release.Name }} + key: password 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 From 9baad00a5dcb9fbb8d66408937a1578ea1c0de8b Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 8 Jul 2024 12:57:20 +0200 Subject: [PATCH 2/2] Update --- charts/rclone-copy/templates/rclone-cron.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index 90fb402..73b36d1 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -79,12 +79,14 @@ 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: