chore: configurable host (#247)

* make host configurable

* update host var name
This commit is contained in:
Gabriel Gordon-Hall
2025-07-17 16:29:35 +01:00
committed by GitHub
parent ddc692fa77
commit 3ed807f327
2 changed files with 5 additions and 3 deletions

View File

@@ -86,6 +86,7 @@ The following environment variables can be configured at build time or runtime:
| `POSTHOG_API_ENDPOINT` | Build-time | Empty | PostHog analytics endpoint (disables analytics if empty) | | `POSTHOG_API_ENDPOINT` | Build-time | Empty | PostHog analytics endpoint (disables analytics if empty) |
| `BACKEND_PORT` | Runtime | `0` (auto-assign) | Backend server port | | `BACKEND_PORT` | Runtime | `0` (auto-assign) | Backend server port |
| `FRONTEND_PORT` | Runtime | `3000` | Frontend development server port | | `FRONTEND_PORT` | Runtime | `3000` | Frontend development server port |
| `HOST` | Runtime | `127.0.0.1` | Backend server host |
| `DISABLE_WORKTREE_ORPHAN_CLEANUP` | Runtime | Not set | Disable git worktree cleanup (for debugging) | | `DISABLE_WORKTREE_ORPHAN_CLEANUP` | Runtime | Not set | Disable git worktree cleanup (for debugging) |
**Build-time variables** must be set when running `pnpm run build`. **Runtime variables** are read when the application starts. **Build-time variables** must be set when running `pnpm run build`. **Runtime variables** are read when the application starts.
@@ -100,4 +101,4 @@ By default, Vibe Kanban uses Bloop AI's GitHub OAuth app for authentication. To
4. Build with your client ID: 4. Build with your client ID:
```bash ```bash
GITHUB_CLIENT_ID=your_client_id_here pnpm run build GITHUB_CLIENT_ID=your_client_id_here pnpm run build
``` ```

View File

@@ -233,10 +233,11 @@ fn main() -> anyhow::Result<()> {
0 0
}); // Use 0 to find free port if no specific port provided }); // Use 0 to find free port if no specific port provided
let listener = tokio::net::TcpListener::bind(format!("127.0.0.1:{port}")).await?; let host = std::env::var("HOST").unwrap_or_else(|_| "127.0.0.1".to_string());
let listener = tokio::net::TcpListener::bind(format!("{host}:{port}")).await?;
let actual_port = listener.local_addr()?.port(); // get → 53427 (example) let actual_port = listener.local_addr()?.port(); // get → 53427 (example)
tracing::info!("Server running on http://127.0.0.1:{actual_port}"); tracing::info!("Server running on http://{host}:{actual_port}");
if !cfg!(debug_assertions) { if !cfg!(debug_assertions) {
tracing::info!("Opening browser..."); tracing::info!("Opening browser...");