From 132b8f7529dcf1aa314a1ab4bd5afe685d4ea72d Mon Sep 17 00:00:00 2001 From: Rik Smale Date: Fri, 16 Jan 2026 19:18:16 +0100 Subject: [PATCH 1/3] chore: run npm audit fix --- package-lock.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 00e0d253..8be017f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ }, "apps/server": { "name": "@automaker/server", - "version": "0.10.0", + "version": "0.11.0", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@anthropic-ai/claude-agent-sdk": "0.1.76", @@ -80,7 +80,7 @@ }, "apps/ui": { "name": "@automaker/ui", - "version": "0.10.0", + "version": "0.11.0", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { @@ -1483,7 +1483,7 @@ }, "node_modules/@electron/node-gyp": { "version": "10.2.0-electron.1", - "resolved": "git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", + "resolved": "git+ssh://git@github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", "integrity": "sha512-4MSBTT8y07YUDqf69/vSh80Hh791epYqGtWHO3zSKhYFwQg+gx9wi1PqbqP6YqC4WMsNxZ5l9oDmnWdK5pfCKQ==", "dev": true, "license": "MIT", @@ -8944,9 +8944,9 @@ } }, "node_modules/diff": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.2.tgz", - "integrity": "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -10800,9 +10800,9 @@ } }, "node_modules/hono": { - "version": "4.11.3", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.3.tgz", - "integrity": "sha512-PmQi306+M/ct/m5s66Hrg+adPnkD5jiO6IjA7WhWw0gSBSo1EcRegwuI1deZ+wd5pzCGynCcn2DprnE4/yEV4w==", + "version": "4.11.4", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.4.tgz", + "integrity": "sha512-U7tt8JsyrxSRKspfhtLET79pU8K+tInj5QZXs1jSugO1Vq5dFj3kmZsRldo29mTBfcjDRVRXrEZ6LS63Cog9ZA==", "license": "MIT", "peer": true, "engines": { From e67cab1e07d44abb9fa69c084c77dd15f45ac321 Mon Sep 17 00:00:00 2001 From: Rik Smale Date: Fri, 16 Jan 2026 19:23:18 +0100 Subject: [PATCH 2/3] chore: fix lockfile --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 8be017f7..73ae8b42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1483,7 +1483,7 @@ }, "node_modules/@electron/node-gyp": { "version": "10.2.0-electron.1", - "resolved": "git+ssh://git@github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", + "resolved": "git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", "integrity": "sha512-4MSBTT8y07YUDqf69/vSh80Hh791epYqGtWHO3zSKhYFwQg+gx9wi1PqbqP6YqC4WMsNxZ5l9oDmnWdK5pfCKQ==", "dev": true, "license": "MIT", From 09bb59d090001ceb68dcde9507e78f735d53c08f Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 01:34:06 +0000 Subject: [PATCH 3/3] feat: add configurable host binding for server and Vite dev server - Add HOST environment variable (default: 0.0.0.0) to allow binding to specific network interfaces - Update server to listen on configurable host instead of hardcoded localhost - Update Vite dev server to respect HOST environment variable - Enhanced server startup banner to display listening address - Updated .env.example and CLAUDE.md documentation Fixes #536 Co-authored-by: Web Dev Cody --- CLAUDE.md | 1 + apps/server/.env.example | 5 +++++ apps/server/src/index.ts | 17 ++++++++++------- apps/ui/vite.config.mts | 1 + 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 40664601..48e1b9f5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -166,6 +166,7 @@ Use `resolveModelString()` from `@automaker/model-resolver` to convert model ali ## Environment Variables - `ANTHROPIC_API_KEY` - Anthropic API key (or use Claude Code CLI auth) +- `HOST` - Host to bind server to (default: 0.0.0.0) - `PORT` - Server port (default: 3008) - `DATA_DIR` - Data storage directory (default: ./data) - `ALLOWED_ROOT_DIRECTORY` - Restrict file operations to specific directory diff --git a/apps/server/.env.example b/apps/server/.env.example index 68b28395..6ac27145 100644 --- a/apps/server/.env.example +++ b/apps/server/.env.example @@ -44,6 +44,11 @@ CORS_ORIGIN=http://localhost:3007 # OPTIONAL - Server # ============================================ +# Host to bind the server to (default: 0.0.0.0) +# Use 0.0.0.0 to listen on all interfaces (recommended for Docker/remote access) +# Use 127.0.0.1 or localhost to restrict to local connections only +HOST=0.0.0.0 + # Port to run the server on PORT=3008 diff --git a/apps/server/src/index.ts b/apps/server/src/index.ts index 609be945..db371ee2 100644 --- a/apps/server/src/index.ts +++ b/apps/server/src/index.ts @@ -73,6 +73,7 @@ import { getDevServerService } from './services/dev-server-service.js'; dotenv.config(); const PORT = parseInt(process.env.PORT || '3008', 10); +const HOST = process.env.HOST || '0.0.0.0'; const DATA_DIR = process.env.DATA_DIR || './data'; const ENABLE_REQUEST_LOGGING = process.env.ENABLE_REQUEST_LOGGING !== 'false'; // Default to true @@ -551,22 +552,24 @@ terminalWss.on('connection', (ws: WebSocket, req: import('http').IncomingMessage }); // Start server with error handling for port conflicts -const startServer = (port: number) => { - server.listen(port, () => { +const startServer = (port: number, host: string) => { + server.listen(port, host, () => { const terminalStatus = isTerminalEnabled() ? isTerminalPasswordRequired() ? 'enabled (password protected)' : 'enabled' : 'disabled'; const portStr = port.toString().padEnd(4); + const hostDisplay = host === '0.0.0.0' ? 'localhost' : host; logger.info(` ╔═══════════════════════════════════════════════════════╗ ║ Automaker Backend Server ║ ╠═══════════════════════════════════════════════════════╣ -║ HTTP API: http://localhost:${portStr} ║ -║ WebSocket: ws://localhost:${portStr}/api/events ║ -║ Terminal: ws://localhost:${portStr}/api/terminal/ws ║ -║ Health: http://localhost:${portStr}/api/health ║ +║ Listening: ${host}:${port}${' '.repeat(Math.max(0, 34 - host.length - port.toString().length))}║ +║ HTTP API: http://${hostDisplay}:${portStr} ║ +║ WebSocket: ws://${hostDisplay}:${portStr}/api/events ║ +║ Terminal: ws://${hostDisplay}:${portStr}/api/terminal/ws ║ +║ Health: http://${hostDisplay}:${portStr}/api/health ║ ║ Terminal: ${terminalStatus.padEnd(37)}║ ╚═══════════════════════════════════════════════════════╝ `); @@ -600,7 +603,7 @@ const startServer = (port: number) => { }); }; -startServer(PORT); +startServer(PORT, HOST); // Global error handlers to prevent crashes from uncaught errors process.on('unhandledRejection', (reason: unknown, _promise: Promise) => { diff --git a/apps/ui/vite.config.mts b/apps/ui/vite.config.mts index e40bce49..71a70cda 100644 --- a/apps/ui/vite.config.mts +++ b/apps/ui/vite.config.mts @@ -65,6 +65,7 @@ export default defineConfig(({ command }) => { }, }, server: { + host: process.env.HOST || '0.0.0.0', port: parseInt(process.env.TEST_PORT || '3007', 10), }, build: {