22 lines
632 B
Text
22 lines
632 B
Text
{{- if and (ne .scriptEnv.CLOUDFLARE_ACCESS_KEY_ID "") (ne .scriptEnv.CLOUDFLARE_SECRET_ACCESS_KEY "") (ne .scriptEnv.CLOUDFLARE_R2_ACCOUNT_ID "") }}
|
|
#!/usr/bin/env bash
|
|
R2_CONFIG=$(cat <<EOT
|
|
[r2-user]
|
|
type = s3
|
|
provider = Cloudflare
|
|
access_key_id = {{ .user.cloudflareAccessKeyId }}
|
|
secret_access_key = {{ .user.cloudflareSecretAccessKey }}
|
|
region = auto
|
|
endpoint = https://{{ .user.cloudflareR2AccountId }}.r2.cloudflarestorage.com
|
|
acl = private
|
|
EOT
|
|
)
|
|
|
|
# Consider https://github.com/dustinsand/blockinfile
|
|
if cat $HOME/.config/rclone/rclone.conf | grep '[r2-user]'; then
|
|
# TODO: Remove old block
|
|
fi
|
|
|
|
# TODO:
|
|
#tee -a
|
|
{{- end -}}
|