2023-03-20 02:32:51 -07:00
|
|
|
{{- if and (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID"))) (env "CLOUDFLARE_R2_ID")) (or (and (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET"))) (env "CLOUDFLARE_R2_SECRET")) (ne .user.cloudflare.r2 "") -}}
|
2023-01-29 20:44:55 -08:00
|
|
|
[private]
|
|
|
|
type = s3
|
|
|
|
provider = Cloudflare
|
|
|
|
env_auth = false
|
2023-03-19 23:38:30 -07:00
|
|
|
access_key_id = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_ID" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_ID" }}{{ end }}
|
|
|
|
secret_access_key = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_SECRET" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_SECRET" }}{{ end }}
|
2023-01-29 20:44:55 -08:00
|
|
|
endpoint = {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/private
|
|
|
|
acl = private
|
|
|
|
|
|
|
|
[public]
|
|
|
|
type = s3
|
|
|
|
provider = Cloudflare
|
|
|
|
env_auth = false
|
2023-03-19 23:38:30 -07:00
|
|
|
access_key_id = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_ID" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_ID" }}{{ end }}
|
|
|
|
secret_access_key = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_SECRET" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_SECRET" }}{{ end }}
|
2023-01-29 20:44:55 -08:00
|
|
|
endpoint = {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/public
|
|
|
|
acl = public-read
|
|
|
|
|
|
|
|
[system]
|
|
|
|
type = s3
|
|
|
|
provider = Cloudflare
|
|
|
|
env_auth = false
|
2023-03-19 23:38:30 -07:00
|
|
|
access_key_id = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_ID")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_ID" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_ID" }}{{ end }}
|
|
|
|
secret_access_key = {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "CLOUDFLARE_R2_SECRET")) }}{{ includeTemplate "secrets/CLOUDFLARE_R2_SECRET" | decrypt }}{{ else }}{{ env "CLOUDFLARE_R2_SECRET" }}{{ end }}
|
2023-01-29 20:44:55 -08:00
|
|
|
endpoint = {{ .user.cloudflare.r2 }}.r2.cloudflarestorage.com/system
|
|
|
|
acl = private
|
|
|
|
{{ end -}}
|