···99**Railway (Server Deployment):**
1010- Project: `amusing-courtesy`
1111- Service: `peek-node`
1212-- URL: `https://peek-node.up.railway.app`
1212+- URL: (set in .env as PEEK_PROD_URL)
1313- Link command: `cd backend/server && railway link -p amusing-courtesy`
1414- Deploy: `cd backend/server && railway up -d`
1515- Logs: `railway logs -n 50`
+1-1
DEVELOPMENT.md
···417417railway logs -n 50
418418419419# Health check
420420-curl https://peek-node.up.railway.app/
420420+curl $PEEK_PROD_URL/
421421```
422422423423**Deployment Order (Server + Mobile):**
+1-1
TODO.md
···1313Today
1414- [~][release] build and deploy release versions of desktop, ios, and server
1515- [ ][workflow] agents need policy to never read outside workspace; spawned explore agents don't inherit policies
1616-- [ ][security] remove production server endpoint from source - should only be in .env files or user-entered
17161817Later
1918- [ ][desktop] access to notes on filesystem, syncing them as markdown files in ~/sync/Notes/peek
···472471473472### 2026-W04
474473474474+- [x][security] remove production server endpoint from source - should only be in .env files or user-entered
475475- [x][desktop] fix groups extension - add visit tracking, filter for URLs only
476476- [x][workflow] fix TODO archival - updated agent templates with clearer instructions
477477- [x][workflow] clarify ./app rule - now about respecting front-end/back-end architecture boundary
+2-2
backend/electron/sync.ts
···103103 // If query fails, fall through to defaults
104104 }
105105106106- // Fall back to env var or default
107107- return process.env.SYNC_SERVER_URL || 'https://peek-node.up.railway.app';
106106+ // Fall back to env var (empty string disables sync)
107107+ return process.env.SYNC_SERVER_URL || '';
108108}
109109110110/**
+1-1
backend/server/.env.example
···6677# Production testing
88PEEK_PROD_KEY=your-production-api-key
99-PEEK_PROD_URL=https://peek-node.up.railway.app
99+PEEK_PROD_URL=https://your-server.railway.app
+7-1
backend/server/test-api.js
···2424 BASE_URL = "http://localhost:3000";
2525 API_KEY = process.env.PEEK_LOCAL_KEY;
2626} else if (isProd) {
2727- BASE_URL = process.env.PEEK_PROD_URL || "https://peek-node.up.railway.app";
2727+ BASE_URL = process.env.PEEK_PROD_URL;
2828 API_KEY = process.env.PEEK_PROD_KEY;
2929} else {
3030 // Fallback to legacy env vars for backwards compatibility
3131 BASE_URL = process.env.BASE_URL || "http://localhost:3000";
3232 API_KEY = process.env.API_KEY;
3333+}
3434+3535+if (isProd && !BASE_URL) {
3636+ console.error("ERROR: PEEK_PROD_URL not set for production tests");
3737+ console.error("Set PEEK_PROD_URL in .env or environment");
3838+ process.exit(1);
3339}
34403541if (!API_KEY) {
+7-4
backend/tests/sync-e2e-prod.test.js
···2525const __dirname = dirname(fileURLToPath(import.meta.url));
26262727// Configuration from environment
2828-const PROD_URL = process.env.PEEK_PROD_URL || 'https://peek-node.up.railway.app';
2828+const PROD_URL = process.env.PEEK_PROD_URL;
2929const PROD_KEY = process.env.PEEK_PROD_KEY;
30303131// Test marker for this run - used for identification and cleanup
···436436 console.log('');
437437438438 // Check for required env vars
439439- if (!PROD_KEY) {
440440- console.error('ERROR: PEEK_PROD_KEY environment variable is required');
439439+ if (!PROD_URL || !PROD_KEY) {
440440+ console.error('ERROR: Required environment variables missing');
441441+ if (!PROD_URL) console.error(' - PEEK_PROD_URL not set');
442442+ if (!PROD_KEY) console.error(' - PEEK_PROD_KEY not set');
441443 console.error('');
442442- console.error('Set it with:');
444444+ console.error('Set them with:');
445445+ console.error(' export PEEK_PROD_URL=https://your-server.railway.app');
443446 console.error(' export PEEK_PROD_KEY=your-api-key');
444447 console.error('');
445448 process.exit(1);