From 17c7ae38394a81dad7acce7a63e344b35f3b30dc Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Fri, 17 Apr 2026 07:13:45 -0700 Subject: [PATCH] Correct Worker name to isamples-data; account_id; route ordering Discovered during initial deploy that data.isamples.org was already served by a Cloudflare Worker named 'isamples-data' (not 'data-isamples-org' as I'd named the new one). Also found two wrangler.toml issues: - `routes` appearing after [[r2_buckets]] got TOML-scoped to that table - No explicit account_id meant non-interactive deploys failed with "more than one account available" Fixes: - Rename Worker to 'isamples-data' so `wrangler deploy` atomically replaces the existing Worker at that name (preserving the route binding in one step). - Add account_id for Raymond.yee@gmail.com's account. - Move `routes` above [[r2_buckets]] so TOML parses it as a top-level key. - Update README to document the name choice. Deployed 2026-04-17, verified: Cache-Control: public, max-age=31536000, immutable is now returned for isamples_202601_*.parquet files. Range requests continue to work (206 + Content-Range). Co-Authored-By: Claude Opus 4.7 --- workers/data-isamples-org/README.md | 10 ++++++---- workers/data-isamples-org/wrangler.toml | 18 +++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/workers/data-isamples-org/README.md b/workers/data-isamples-org/README.md index d55297b..37c4b0e 100644 --- a/workers/data-isamples-org/README.md +++ b/workers/data-isamples-org/README.md @@ -55,10 +55,12 @@ wrangler deploy This publishes the Worker and installs the route `data.isamples.org/*`. -> ⚠️ If another Worker is already bound to `data.isamples.org/*` (e.g. a -> legacy proxy from the original setup), `wrangler deploy` will **replace** -> it. Check `wrangler deployments list` or the Cloudflare dashboard -> (Workers → Routes) before deploying if you want to be cautious. +> The Worker is named `isamples-data` in `wrangler.toml` to match the +> pre-existing Worker that owned `data.isamples.org/*` before this repo +> existed. `wrangler deploy` atomically replaces the existing Worker at +> that name. If you rename, also unassign the old Worker from the route +> first (Cloudflare dashboard → Workers → Routes) or the deploy will +> fail with "already assigned to another worker." ## Verifying diff --git a/workers/data-isamples-org/wrangler.toml b/workers/data-isamples-org/wrangler.toml index 9b2b66c..2762e9e 100644 --- a/workers/data-isamples-org/wrangler.toml +++ b/workers/data-isamples-org/wrangler.toml @@ -4,18 +4,16 @@ # caches can treat versioned parquets as immutable. See README.md for deploy # instructions. -name = "data-isamples-org" +name = "isamples-data" main = "src/index.js" compatibility_date = "2026-04-01" -# Bind the R2 bucket that holds the iSamples parquet files. -# The binding name (BUCKET) matches env.BUCKET in src/index.js. -[[r2_buckets]] -binding = "BUCKET" -bucket_name = "isamples-ry" +# Raymond.yee@gmail.com's account — owner of the isamples.org zone and the +# isamples-ry R2 bucket. +account_id = "75e8a095c424e5a4e18fd6f5e6145064" # Route: everything under data.isamples.org goes through this Worker. -# Zone is inferred from isamples.org being in the same Cloudflare account. +# (Declared before [[r2_buckets]] so TOML doesn't scope it to that table.) routes = [ { pattern = "data.isamples.org/*", zone_name = "isamples.org" }, ] @@ -23,3 +21,9 @@ routes = [ # Observability: enable Worker logs in the Cloudflare dashboard. [observability] enabled = true + +# Bind the R2 bucket that holds the iSamples parquet files. +# The binding name (BUCKET) matches env.BUCKET in src/index.js. +[[r2_buckets]] +binding = "BUCKET" +bucket_name = "isamples-ry"