asdfas
1# Copy to scripts/.r2-env (gitignored) and fill in your Cloudflare R2 details, then run:
2# node scripts/r2-roundtrip.mjs
3# All five are required. No quotes needed; values are trimmed.
4
5# Cloudflare account id — forms the S3 endpoint host <id>.r2.cloudflarestorage.com
6R2_ACCOUNT_ID=
7
8# Target R2 bucket name
9R2_BUCKET=
10
11# R2 API token access key id (token must be scoped Object Read & Write on the bucket)
12R2_ACCESS_KEY_ID=
13
14# R2 API token secret access key
15R2_SECRET_ACCESS_KEY=
16
17# The bucket's PUBLIC serve host, bare (no https://, no path) — an R2 custom domain
18# like cdn.example.com, or the bucket's public r2.dev subdomain. The S3 endpoint itself
19# will NOT serve reads, so this must be a public-read domain bound to the bucket.
20R2_PUBLIC_HOST=