@@ -8,6 +8,8 @@ From this directory:
88``` bash
99cp calciforge.env.example .env
1010mkdir -p data data-security-proxy data-clashd
11+ openssl rand -base64 32 > data/gateway-api-key
12+ chmod 600 data/gateway-api-key
1113docker compose --env-file .env build calciforge
1214docker compose --env-file .env up -d
1315docker compose --env-file .env exec calciforge \
@@ -29,11 +31,18 @@ to the Compose mounts before starting the container. The sample Compose file
2931uses ` /config ` for clean trials; live migrations should keep paths stable unless
3032they are intentionally changing layout.
3133
32- The example starts :
34+ The example publishes each service on ` ${CALCIFORGE_HOST_BIND:-127.0.0.1} ` by default :
3335
34- - ` calciforge ` on ` ${CALCIFORGE_PROXY_PORT:-18792} `
35- - ` security-proxy ` on ` ${CALCIFORGE_SECURITY_PROXY_PORT:-8888} `
36- - ` clashd ` on ` ${CALCIFORGE_CLASHD_PORT:-9001} `
36+ - ` calciforge ` on ` ${CALCIFORGE_HOST_BIND:-127.0.0.1}:${CALCIFORGE_PROXY_PORT:-18792} `
37+ - ` security-proxy ` on ` ${CALCIFORGE_HOST_BIND:-127.0.0.1}:${CALCIFORGE_SECURITY_PROXY_PORT:-8888} `
38+ - ` clashd ` on ` ${CALCIFORGE_HOST_BIND:-127.0.0.1}:${CALCIFORGE_CLASHD_PORT:-9001} `
39+
40+ Keep the default loopback host binding for local trials. If you intentionally set
41+ ` CALCIFORGE_HOST_BIND=0.0.0.0 ` or another non-loopback address for LAN staging,
42+ first provision a strong gateway key in ` data/gateway-api-key ` and require clients
43+ to send it as ` Authorization: Bearer <key> ` . Do not expose the security proxy to
44+ untrusted networks; it is intended for controlled agent egress, not as a public
45+ forward proxy.
3746
3847The Compose file builds the shared ` calciforge:local ` image through the
3948` calciforge ` service and reuses that image for the sidecars. Build the
@@ -45,7 +54,9 @@ small staging hosts; increase it only on builders with enough RAM.
4554
4655The default Calciforge config points the model gateway at an OpenAI-compatible
4756service on the host machine at ` http://host.docker.internal:11434/v1 ` , which
48- matches common Ollama-compatible local testing. Edit ` config.example.toml ` or set
57+ matches common Ollama-compatible local testing. It also reads the client-facing
58+ gateway bearer token from ` /var/lib/calciforge/gateway-api-key ` , backed by the
59+ ` data/gateway-api-key ` file created above. Edit ` config.example.toml ` or set
4960` CALCIFORGE_CONFIG ` before using it for real traffic.
5061
5162Subprocess-backed agents run inside the Calciforge container. If you configure
0 commit comments