From 41d72585d08d05a646bc6a1ce51bec8a20fc2f7f Mon Sep 17 00:00:00 2001 From: irresi Date: Sun, 5 Jul 2026 22:12:15 -0700 Subject: [PATCH] fix(security): #2624 banner shows 'from env' before non-TTY hidden guard Co-Authored-By: Claude Opus 4.8 --- src/commands/serve-http.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/serve-http.ts b/src/commands/serve-http.ts index c18b55eb2..20a165a50 100644 --- a/src/commands/serve-http.ts +++ b/src/commands/serve-http.ts @@ -2199,10 +2199,10 @@ export async function runServeHttp(engine: BrainEngine, options: ServeHttpOption ║ MCP: http://localhost:${port}/mcp${' '.repeat(Math.max(0, 21 - String(port).length))}║ ║ Health: http://localhost:${port}/health${' '.repeat(Math.max(0, 18 - String(port).length))}║ ╠══════════════════════════════════════════════════════╣ -${suppressBootstrapPrint - ? '║ Admin Token: hidden (non-TTY log-leak guard) ║\n║ set $GBRAIN_ADMIN_BOOTSTRAP_TOKEN, or pass ║\n║ --print-admin-token on a trusted terminal. ║\n╚══════════════════════════════════════════════════════╝' - : bootstrapFromEnv - ? '║ Admin Token: from $GBRAIN_ADMIN_BOOTSTRAP_TOKEN ║\n╚══════════════════════════════════════════════════════╝' +${bootstrapFromEnv + ? '║ Admin Token: from $GBRAIN_ADMIN_BOOTSTRAP_TOKEN ║\n╚══════════════════════════════════════════════════════╝' + : suppressBootstrapPrint + ? '║ Admin Token: hidden (non-TTY log-leak guard) ║\n║ set $GBRAIN_ADMIN_BOOTSTRAP_TOKEN, or pass ║\n║ --print-admin-token on a trusted terminal. ║\n╚══════════════════════════════════════════════════════╝' : `║ Admin Token (paste into /admin login): ║\n║ ${bootstrapToken.substring(0, 50)} ║\n║ ${bootstrapToken.substring(50).padEnd(50)} ║\n╚══════════════════════════════════════════════════════╝`} `); });