install.fairie/home/dot_config/rclone/merge_rclone.conf
Brian Zalewski e43ff06510 Update 20 files
- /system/usr/local/bin/executable_rclone-mount
- /system/etc/systemd/system/r2-docker.service
- /system/etc/systemd/system/r2-{{ .user.username }}.service.tmpl
- /system/etc/sanoid/sanoid.conf.TODO
- /system/etc/cockpit/machines.d/TODO.cockpit-machine.json.tmpl
- /system/etc/keybase/config.json
- /system/etc/rcloneignore
- /system/.chezmoidata.yaml
- /system/.chezmoiexternal.toml
- /system/.chezmoiignore
- /home/dot_config/rclone/rcloneignore
- /home/dot_config/rclone/s3-docker.service.tmpl
- /home/dot_config/rclone/s3-user.service.tmpl
- /home/dot_config/rclone/merge_rclone.conf
- /home/dot_config/cockpit/machines.d/cockpit-machine.json.TODO
- /home/dot_config/keybase/config.json
- /home/.chezmoiscripts/universal/run_onchange_after_14-keybase.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_20-font.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_50-rclone.tmpl
- /home/.chezmoiexternal.toml
2023-01-29 06:55:46 +00:00

44 lines
1.4 KiB
Text

{{- if and (ne .user.CLOUDFLARE_ACCESS_KEY_ID "") (ne .user.CLOUDFLARE_SECRET_ACCESS_KEY "") (ne .user.CLOUDFLARE_R2_ACCOUNT_ID "") }}
#!/usr/bin/env bash
CONFIG_FILE="$HOME/.config/rclone/rclone.conf"
if cat "$CONFIG_FILE" | grep '# MEGABYTE LABS MANAGED S3'; then
# TODO: Remove old block
START_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" .zshrc | cut -f1 -d ":"`)"
END_LINE="$(echo `grep -n -m 1 "# MEGABYTE LABS MANAGED S3" .zshrc | cut -f1 -d ":"`)"
if command -v gsed > /dev/null; then
gsed -i "$START_LINE,$END_LINEd" "$CONFIG_FILE"
else
sed -i "$START_LINE,$END_LINEd" "$CONFIG_FILE"
fi
fi
tee -a "$CONFIG_FILE" > /dev/null <<EOT
# MEGABYTE LABS MANAGED S3
[{{ .user.username}}-s3]
type = s3
provider = Cloudflare
access_key_id = {{ .user.CLOUDFLARE_ACCESS_KEY_ID }}
secret_access_key = {{ .user.CLOUDFLARE_SECRET_ACCESS_KEY }}
region = auto
endpoint = https://{{ .user.CLOUDFLARE_R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
acl = private
[do-private]
type = s3
provider = DigitalOcean
env_auth = false
access_key_id = your_spaces_access_key
secret_access_key = your_spaces_secret_key
endpoint = private.nyc3.digitaloceanspaces.com
acl = private
[do-open]
type = s3
provider = DigitalOcean
env_auth = false
access_key_id = your_spaces_access_key
secret_access_key = your_spaces_secret_key
endpoint = open.nyc3.digitaloceanspaces.com
acl = public-read
# MEGABYTE LABS MANAGED S3
EOT
{{- end }}