Skip to content

Phase 8: Bind api.nemar.org custom domain on SCCN worker - #351

Merged
neuromechanist merged 2 commits into
devfrom
feature/issue-329-phase8-dns-cutover
Apr 25, 2026
Merged

neuromechanist merged 2 commits into
devfrom
feature/issue-329-phase8-dns-cutover

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Add Workers Custom Domain route for api.nemar.org in backend/wrangler-sccn.toml
  • Update SCCN worker API_BASE_URL var from https://nemar-api.sccn-org.workers.dev to https://api.nemar.org
  • Cloudflare auto-manages proxy DNS record + TLS cert via custom_domain = true

This is the DNS-side cutover for Phase 8 of the SCCN migration epic (#314). The CLI default URL flip is Phase 9 (#330) — old api.osc.earth/nemar keeps serving traffic from personal account in MAINTENANCE_MODE=read-only until then.

Why custom_domain instead of routes + DNS record

  • One config line vs route-pattern + separate CNAME + manual TLS
  • Catches the entire hostname (no /* path pattern needed)
  • Cloudflare manages cert renewal

Test plan

  • Deploy succeeded: Deployed nemar-api triggers ... api.nemar.org (custom domain)
  • curl https://api.nemar.org/health → 200, {"status":"ok","version":"0.1.0"}
  • curl https://api.nemar.org/datasets → 200, response byte-identical to https://nemar-api.sccn-org.workers.dev/datasets
  • workers.dev URL still answers (kept as fallback)
  • Authed admin endpoint smoke test (post-merge, before Phase 9 ships)
  • Old api.osc.earth/nemar unchanged (still serves in read-only)

D1 parity (verified pre-deploy)

  • users, datasets, tokens, publication_requests, user_s3_permissions content identical
  • nemar_catalog: 1 row drift (ds006963, known, self-heals via catalog-sync cron)
  • Schema CREATE statements identical
  • Migration tracking: cosmetic 1-row diff (column already exists on both)

Refs

Adds Workers Custom Domain route for api.nemar.org and updates
API_BASE_URL var to match. Cloudflare auto-manages the proxy DNS
record and TLS cert; no separate DNS step needed.

Tested:
- curl https://api.nemar.org/health -> 200 (worker version 0.1.0)
- curl https://api.nemar.org/datasets -> 200, response identical to
  https://nemar-api.sccn-org.workers.dev/datasets
- workers.dev URL still answers (kept as buffer)

Refs #329
@github-actions

github-actions Bot commented Apr 25, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR351

Version: 0.7.26-PR351.16db16d
Commit: 16db16d


🤖 Updated on each push.

- wrangler-sccn.toml header no longer warns against production use;
  this is now the canonical SCCN config.
- CLAUDE.md SCCN API URL line points to api.nemar.org with the
  workers.dev URL noted as fallback.

Refs #329
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review pass: addressed

Two findings actioned in commit 16db16d:

  • wrangler-sccn.toml:4 stale 'Do NOT use for production' header replaced with canonical-config wording
  • CLAUDE.md:47 SCCN API URL updated to api.nemar.org (workers.dev noted as fallback)

Two informational findings deferred:

  • Zone Rules / Cache pipeline: custom_domain = true bypasses zone-level Rules. Confirmed nemar.org zone has no API-relevant Rules configured for api.nemar.org (DNS list shows no page rules / transforms scoped to that hostname).
  • API_BASE_URL + '/nemar' string-join sweep: deferred to Phase 9 (Phase 9: Update CLI default API URL and backward compatibility #330) which is exactly the CLI default-URL flip — that's the right place to grep for path-prefix assumptions.

Reviews:

  • code-reviewer: 'Ship it' — diff matches stated intent, no AI attribution, no emojis, env.dev correctly retains workers.dev binding.
  • comment-analyzer: comments now explain why not what; stale references removed.

@neuromechanist
neuromechanist merged commit a1e1bd8 into dev Apr 25, 2026
8 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-329-phase8-dns-cutover branch April 25, 2026 21:24
neuromechanist added a commit that referenced this pull request Sep 21, 2026
A lot of its state moved on 2026-09-20 and 2026-09-21. #387 and #397
merged, #399 landed the Python 3.12 floor and the Pyodide-bounded
dependency floors, #402 corrected #399, and #403 is open to merge
develop into the epic branch.

Records the correction rather than quietly restating the conclusion:
only compiled floors are a ceiling in the browser, because the test is
whether the package publishes a pure-Python wheel and not whether
Pyodide bundles it. The earlier claim that threadpoolctl>=3.6.0 was a
live broken install was wrong.

Also records the integration bug #403 exposed, since it is the argument
for not letting the epic branch drift again: MemmapData.__array_function__
returned NotImplemented for everything except copyto and put, and
defining that method opts a type into numpy's dispatch protocol where
NotImplemented raises rather than falling back. Develop's #351 test
covers that path and the epic branch never had it.

Notes that the case for holding #386 is weaker now that the epic branch
is no longer behind, and carries #400 and #401 as open.

This branch was previously deployed

1 inactive deployment
npm — 16db16d4 Deployed Apr 25, 2026 by neuromechanist via publish #609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant