Cloudflare R2 object storage setup & PMTiles sync pipeline (scripts/sync-tiles-r2.sh) #37

Closed
opened 2026-10-14 22:28:34 +00:00 by yuris · 1 comment
Owner

What to build

Set up an S3-compatible Cloudflare R2 bucket (titik-gambut-tiles) for zero-egress static tile distribution. Create an automated sync script to upload all compiled .pmtiles archives and asset bundles with correct MIME headers.

Technical specifications

  1. Target files:
    • scripts/sync-tiles-r2.sh: R2 upload script using AWS CLI / MinIO Client / rclone.
    • .env.example: Add R2 endpoint, access key, secret key, and public tile bucket URL configurations.
  2. Metadata headers:
    • Content-Type: application/x-protobuf for .pmtiles files.
    • Content-Type: image/tiff for .tif COGs.
    • Cache-Control: public, max-age=31536000, immutable.

Acceptance criteria

  • Script successfully uploads all .pmtiles archives to the R2 bucket.
  • Public HTTP range request to the bucket returns 206 Partial Content with valid byte length.
  • Zero egress fees incurred on range reads.

Blocked by

  • Issue 21: [Backend] Unified multi-layer PMTiles batch builder script.

Authoritative Specifications & Reference Documentation

### What to build Set up an S3-compatible Cloudflare R2 bucket (`titik-gambut-tiles`) for zero-egress static tile distribution. Create an automated sync script to upload all compiled `.pmtiles` archives and asset bundles with correct MIME headers. ### Technical specifications 1. **Target files**: - `scripts/sync-tiles-r2.sh`: R2 upload script using AWS CLI / MinIO Client / rclone. - `.env.example`: Add R2 endpoint, access key, secret key, and public tile bucket URL configurations. 2. **Metadata headers**: - `Content-Type: application/x-protobuf` for `.pmtiles` files. - `Content-Type: image/tiff` for `.tif` COGs. - `Cache-Control: public, max-age=31536000, immutable`. ### Acceptance criteria - [ ] Script successfully uploads all `.pmtiles` archives to the R2 bucket. - [ ] Public HTTP range request to the bucket returns `206 Partial Content` with valid byte length. - [ ] Zero egress fees incurred on range reads. ### Blocked by - Issue 21: [Backend] Unified multi-layer PMTiles batch builder script. --- ### Authoritative Specifications & Reference Documentation - **Titik Gambut Architecture & Subsystem Contract**: [`docs/ARCHITECTURE.md`](https://git.nokopia.com/yuris/titik-gambut-next/src/branch/main/docs/ARCHITECTURE.md) - **Upstream RustGIS Engine & CLI**: [opengeos/RustGIS Repository](https://github.com/opengeos/RustGIS) — fast pure-Rust GIS with `rustgis-cli`, GeoLibre integration, and native FlatGeobuf/PMTiles/COG pipelines. - **RustGIS Documentation**: [rustgis.app](https://rustgis.app) - **Protomaps PMTiles Specification**: [protomaps/PMTiles GitHub](https://github.com/protomaps/PMTiles) — cloud-optimized single-file vector/raster tile format using HTTP 206 byte-range requests. - **Protomaps Basemaps Style & Docs**: [protomaps.com/docs](https://docs.protomaps.com/basemaps/) - **Cloudflare R2 Object Storage**: [developers.cloudflare.com/r2](https://developers.cloudflare.com/r2/) — Zero-egress HTTP 206 byte-range object storage. - **Cloudflare CDN Cache-Control**: [developers.cloudflare.com/cache](https://developers.cloudflare.com/cache/) — Edge caching and Range header behavior.
yuris changed title from Issue 24: [Backend] Cloudflare R2 object storage setup & PMTiles sync pipeline (scripts/sync-tiles-r2.sh) to [Backend] Cloudflare R2 object storage setup & PMTiles sync pipeline (scripts/sync-tiles-r2.sh) 2026-10-14 22:31:29 +00:00
yuris changed title from [Backend] Cloudflare R2 object storage setup & PMTiles sync pipeline (scripts/sync-tiles-r2.sh) to Cloudflare R2 object storage setup & PMTiles sync pipeline (scripts/sync-tiles-r2.sh) 2026-10-14 22:38:34 +00:00
Author
Owner

This was generated by AI during triage.

Closed as completed in PR #103 & #104 (scripts/upload-tiles-r2.mjs, secretspec.yaml, .forgejo/workflows/sync-tiles-r2.yml).

> *This was generated by AI during triage.* Closed as completed in PR #103 & #104 (scripts/upload-tiles-r2.mjs, secretspec.yaml, .forgejo/workflows/sync-tiles-r2.yml).
yuris closed this issue 2026-10-15 01:26:10 +00:00
Sign in to join this conversation.
No labels
backend
frontend
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yuris/titik-gambut-next#37
No description provided.