diff --git a/docs/ingester.md b/docs/ingester.md index 038a677e..b00153de 100644 --- a/docs/ingester.md +++ b/docs/ingester.md @@ -249,6 +249,13 @@ By default the ingester exposes a FastAPI control plane on `127.0.0.1:8765`. Set `ingester.api.auth_token` to require a Bearer token; without one the API stays open and the service logs a warning. +!!! warning "Non-loopback binds need a token" + Loopback (`127.0.0.1`) is local-only and safe to leave open. If + you bind to any other interface (`0.0.0.0`, a LAN IP, behind a + reverse proxy) **set `auth_token`** — the control plane can + cancel jobs, retry from the DLQ, and trigger source refreshes. + The startup warning is your only signal that you forgot. + | Method | Path | Purpose | |---|---|---| | `GET` | `/` | browser dashboard (HTML; unauthenticated, the JS attaches the bearer on its own JSON fetches) | @@ -276,7 +283,7 @@ ingester: enabled: true host: 127.0.0.1 port: 8765 - auth_token: ${INGESTER_TOKEN} # null → unauthenticated + auth_token: secret # null → unauthenticated ``` ## Operating diff --git a/examples/docker/README.md b/examples/docker/README.md index 9cf8c1d0..822b7cb5 100644 --- a/examples/docker/README.md +++ b/examples/docker/README.md @@ -113,6 +113,15 @@ export ANTHROPIC_API_KEY=your-key-here docker compose up -d ``` +The ingester container binds the control plane to `0.0.0.0` so the host +port-mapping works. The example config requires a bearer token via +`INGESTER_TOKEN`; set it in `.env` (gitignored) alongside the API keys +before bringing the stack up: + +```bash +echo "INGESTER_TOKEN=$(openssl rand -hex 32)" >> .env +``` + ## Documentation - [Remote Processing](https://ggozad.github.io/haiku.rag/remote-processing/) diff --git a/examples/docker/docker-compose.yml b/examples/docker/docker-compose.yml index b616ac34..f45cdd61 100644 --- a/examples/docker/docker-compose.yml +++ b/examples/docker/docker-compose.yml @@ -67,6 +67,9 @@ services: # Logfire emits spans when this is set; stays silent (no telemetry) when unset. # Set LOGFIRE_TOKEN in examples/docker/.env (gitignored) to enable. - LOGFIRE_TOKEN=${LOGFIRE_TOKEN:-} + # Bearer token the control plane requires when host isn't loopback. + # Set INGESTER_TOKEN in examples/docker/.env (gitignored). + - INGESTER_TOKEN=${INGESTER_TOKEN:-} depends_on: docling-serve-1: condition: service_healthy diff --git a/examples/docker/haiku.rag.yaml.example b/examples/docker/haiku.rag.yaml.example index 129cdab8..839b4c42 100644 --- a/examples/docker/haiku.rag.yaml.example +++ b/examples/docker/haiku.rag.yaml.example @@ -13,6 +13,9 @@ ingester: api: # Bind to all interfaces inside the container so docker port-mapping works. host: 0.0.0.0 + # Non-loopback bind: set a bearer token. Source from an env var so the + # token doesn't sit in this file checked into ops repos. + auth_token: ${INGESTER_TOKEN} sources: - type: fs id: docs