[object Object]

← back to Dw Pitch Followup

pitch: signpost 9768 (own listen port) vs 9850 (GEORGE client URL) — prevent the misread; keep PORT hardcoded to dodge pm2 stale-env

6330e759be00d559a123a73f7f72f55e49acc60f · 2026-07-30 14:16:20 -0700 · Steve

Files touched

Diff

commit 6330e759be00d559a123a73f7f72f55e49acc60f
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Jul 30 14:16:20 2026 -0700

    pitch: signpost 9768 (own listen port) vs 9850 (GEORGE client URL) — prevent the misread; keep PORT hardcoded to dodge pm2 stale-env
---
 server.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server.js b/server.js
index 01d4f1f..280cf25 100644
--- a/server.js
+++ b/server.js
@@ -21,6 +21,10 @@ import path from 'node:path';
 import { fileURLToPath } from 'node:url';
 
 const __dirname = path.dirname(fileURLToPath(import.meta.url));
+// This app's OWN listen port. NOTE: 9768 (not 9850). The 9850 below is GEORGE's
+// port — the Gmail relay we CALL, owned by the george-gmail process — NOT ours.
+// Intentionally left as a hardcoded default: no PORT in .env, so pm2 can't read a
+// stale PORT on restart (see the pm2-reload-stale-env fleet gotcha).
 const PORT = Number(process.env.PORT || 9768);
 const DATA_DIR = path.join(__dirname, 'data');
 const LISTS = path.join(DATA_DIR, 'lists.json');
@@ -33,6 +37,7 @@ function addSuppress(emails) {
   try { fs.writeFileSync(SUPPRESS_FILE, JSON.stringify([...set], null, 0)); } catch {}
   return { added, total: set.size };
 }
+// 9850 = the george-gmail relay we CALL (Gmail send/search). NOT this app's port (=9768 above).
 const GEORGE = process.env.GEORGE_URL || 'http://127.0.0.1:9850';
 // Resolve George secrets: prefer our own env, else read them straight from george-gmail/.env
 // (same fallback George itself uses — launchd/pm2 don't load .env into process.env).

← 1ffa37a pitch: 30-day already-emailed guard now shows date AND time  ·  back to Dw Pitch Followup  ·  pitch: enable Send-now over the public tunnel via ALLOW_TUNN 56a35bd →