install.fairie/dotfiles/.local/share/chezmoi/home/private_dot_config/rclone/merge_rclone.conf

23 lines
632 B
Text
Raw Normal View History

{{- 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 -}}