From 8236bb6a171b1375a6be612b5f3aad280826819b Mon Sep 17 00:00:00 2001 From: chitcommit <208086304+chitcommit@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:48:26 +0000 Subject: [PATCH] fix(urls): repair workers.dev URLs broken by mothership rename The mothership->chittyid rename incorrectly transformed account-subdomain segments of workers.dev URLs. Cloudflare workers.dev URL shape is ..workers.dev, so notion-sync.chittyid-mothership.workers.dev had "chittyid-mothership" as the *account subdomain*, not the worker name. Renaming that segment to "chittyid" produced URLs that don't resolve. Also, this worker has workers_dev: false, so neither URL was ever live. - src/services/registry-client.js: read endpoint from env.CHITTYID_SERVICE_URL (matches src/client/index.js convention) / SERVICE_PUBLIC_URL, fallback to canonical route https://id.chitty.cc. - scripts/monitor-notion-sync.js: require NOTION_SYNC_WORKER_URL to be set explicitly; fail with a clear error otherwise. No notion-sync wrangler config deploys src/workers/notion-sync-worker.js in this repo, so guessing a canonical URL would be wrong. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/monitor-notion-sync.js | 8 +++++++- src/services/registry-client.js | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/monitor-notion-sync.js b/scripts/monitor-notion-sync.js index 393f38f..e480705 100644 --- a/scripts/monitor-notion-sync.js +++ b/scripts/monitor-notion-sync.js @@ -5,7 +5,13 @@ * Monitors sync health and alerts on failures */ -const WORKER_URL = process.env.NOTION_SYNC_WORKER_URL || 'https://notion-sync.chittyid.workers.dev'; +const WORKER_URL = process.env.NOTION_SYNC_WORKER_URL; +if (!WORKER_URL) { + console.error('ERROR: NOTION_SYNC_WORKER_URL is not set.'); + console.error('Set it to the deployed notion-sync worker URL, e.g.:'); + console.error(' export NOTION_SYNC_WORKER_URL=https://notion-sync.chitty.cc'); + process.exit(1); +} const ALERT_THRESHOLD = { schema_mismatch: 0, rate_limit_percentage: 2, diff --git a/src/services/registry-client.js b/src/services/registry-client.js index 7cef0fb..9e9f06a 100644 --- a/src/services/registry-client.js +++ b/src/services/registry-client.js @@ -18,12 +18,16 @@ export class RegistryClient { * Build service information for registration */ buildServiceInfo() { + const publicUrl = + this.env?.CHITTYID_SERVICE_URL || + this.env?.SERVICE_PUBLIC_URL || + 'https://id.chitty.cc'; return { service: 'chittyid', name: 'ChittyID', version: '2.0.0', description: 'Identity management system with hardened security pipeline', - endpoint: 'https://chittyid.chitty.workers.dev', + endpoint: publicUrl, domain: 'https://id.chitty.cc', health: '/api/health', priority: 1,