infra(r2): configure Cloudflare R2 bucket with CORS rules and custom domain for PMTiles delivery #101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context & Purpose
As mandated in
docs/ARCHITECTURE.md §1.1,§3, and§4, all multi-megabyte spatial vector tile archives (concessions.pmtiles,peat_soil.pmtiles,khg.pmtiles,terrain.pmtiles) are static binary assets that must be served directly from edge object storage (Cloudflare R2) via Anycast CDN points of presence rather than tracked inside Git or served from VPS memory.Cloudflare R2 provides zero-dollar egress fees and native HTTP 206 Partial Content byte-range support.
Required Infrastructure Steps (Human Maintainer)
Create Cloudflare R2 Bucket:
titik-gambut-tiles(ornokopia-gambut-tiles).APAC).Configure CORS Rules on R2 Bucket:
Allow MapLibre GL JS clients to issue byte-range queries with range headers:
Bind Custom Domain:
tiles.gambut.nokopia.com(or route undercdn.nokopia.com/tiles/)..pmtilesand.pngextensions.Generate S3-Compatible API Credentials:
R2_ACCOUNT_ID,R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEY, andR2_BUCKET_NAMEfor repository secrets.Local / CI Upload Utility:
scripts/upload-tiles-r2.mjsusing@aws-sdk/client-s3for uploading compiled archives.Acceptance Criteria