Both compared process.argv[1] with their own module path without resolving symlinks, so started through a link (macOS's /tmp is one) neither listened, and nothing said why. They now resolve it the way jev-secrets.ts and jev-fill.ts do.
- commit
- 84a6f75987515014c357b980a3807b7b8e275f46
- parent
- 9e09d033c64326660c1b101e332be4749cdddba4
- author
- cat <admin@dev.site>
- kind
- fix risk score 1.1 of 3, Jev's estimate
| M | lib/ | 2 | +- |
| M | lib/ | 2 | +- |
@@ -102,6 +102,6 @@ export function serveEvents(state: string, port: number): http.Server {
102102 }103103 104104 // Run directly: node lib/events-server.ts105-if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {105+if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {106106 serveEvents(process.env.FORGE_STATE || path.resolve('demo/root/.forge'), Number(process.env.FORGE_EVENTS_PORT || 8091));107107 }@@ -353,6 +353,6 @@ export function servePages(cfg: HostsConfig, port: number): http.Server {
353353 }354354 355355 // Run directly: node lib/pages-server.ts356-if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {356+if (process.argv[1] && fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {357357 servePages(hostsConfig(), Number(process.env.FORGE_PAGES_PORT || 8092));358358 }