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,