Commit Graph
6 Commits
Author SHA1 Message Date
Iuliia Ivashko dc100ed0da fix: bind web server to 127.0.0.1 by default and add --host CLI flag (#750)
## Summary

Fixes #736 — OpenChamber listens on `0.0.0.0` (all interfaces) by default, exposing the server to the network without warning. The log output shows `visit: http://127.0.0.1:...` which is misleading.

## Changes

- **Default bind address changed to `127.0.0.1`** — server is only accessible locally unless explicitly configured otherwise
- **New `--host` CLI flag** — `openchamber --host 0.0.0.0 -p 8080` to listen on all interfaces
- **`OPENCHAMBER_HOST` env var** — documented in help text and docker-compose.yml as an alternative to `--host`
- **Docker entrypoint** defaults to `OPENCHAMBER_HOST=0.0.0.0` so container port mapping continues to work
- **Startup logs** show the actual bind address instead of hardcoded `localhost`

### Resolution priority

```
--host flag  >  OPENCHAMBER_HOST env var  >  127.0.0.1 (default)
```

### What doesn't break

- **Desktop app** — already forces `OPENCHAMBER_HOST=127.0.0.1` via Tauri
- **VS Code extension** — doesn't use the web server
- **Docker** — entrypoint sets `OPENCHAMBER_HOST=0.0.0.0`, preserving current behavior
- **Tunnels** — cloudflared connects to `127.0.0.1` origin internally, works regardless of bind address

## Testing

Automated:
- `bun run type-check` / `bun run lint` — pass

Manual (CLI, direct `node` execution):
- Default bind → `127.0.0.1` (verified via `lsof`/netstat)
- `--host 0.0.0.0` → binds all interfaces
- `--host=0.0.0.0` (inline) → works
- `--host` without value → error exit 2
- `OPENCHAMBER_HOST` env var → respected
- `--host` flag overrides env var
- IPv6 `::1` → correct bracketed URL, health check 200
- CLI daemon start/stop → works
- `visit:` URL → correct
- Help text → `--host` in OPTIONS, `OPENCHAMBER_HOST` in ENVIRONMENT
- Browser UI → loads and works
- Tunnel via UI → works
- Desktop app → no regression

Docker (tested on Ubuntu with native Docker):
- SSH key generated successfully
- `OpenChamber server listening on 0.0.0.0:3000`
- Health check 200
- `uid=1000(openchamber)` confirmed
2026-03-23 15:07:16 +02:00
Iuliia Ivashko 1f8e875357 fix(docker): align container runtime with core tunnel flow (#661)
* fix(docker): align runtime with core startup flow

* docs: update tunnel and daemon usage examples

* docs: clarify managed-local tunnel config paths in Docker
2026-03-15 00:12:11 +02:00
nzlov 8eecf1c0e9 fix: docker run (#650) 2026-03-13 09:49:05 +02:00
nzlov 122a45a890 fix: docker build (#547) 2026-02-28 09:48:37 +02:00
nzlov eed5c8efcd fix: docker support (#532) 2026-02-27 09:34:51 +02:00
nzlov 6ca2b0da05 feat(container): add Docker deployment and terminal shell fallback (#520)
* feat(container): add Docker deployment and terminal shell fallback

Add Docker runtime assets (Dockerfile, compose file, and entrypoint) to run OpenChamber in containers with persistent config/data mounts.

Improve terminal PTY startup reliability by probing multiple shell candidates and falling back automatically across Unix and Windows environments.

* fix: add OMO install env

* docs: add Docker Compose instructions to README
2026-02-26 20:13:23 +02:00