Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

fix: don't publish the API on every host interface in compose

Rufusf26b1d43795d
diff --git a/.gitignore b/.gitignore
index 43908019..7ea5e57f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,10 +61,7 @@ Thumbs.db
# IDE — track only the shared editor config (tasks, extension picks, repo
# settings). Personal junk like launch.json profiles stays out.
.idea/
-.vscode/*
-!.vscode/tasks.json
-!.vscode/extensions.json
-!.vscode/settings.json
+.vscode/
*.swp
*.swo
@@ -89,4 +86,3 @@ scripts/setup-flyctl.sh
scripts/seed-google-workspace.sh
.github/workflows/deploy.yml
.github/workflows/deploy-qa.yml
-.vscode/
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 458ea731..7728af45 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -13,8 +13,13 @@ services:
env_file:
- path: ../.env
required: false
+ # Bound to loopback deliberately. The UI reaches the API over the compose
+ # network (http://api:8000), so nothing needs the port on 0.0.0.0 — and
+ # publishing it there puts an API whose shared-secret gate may be unset on
+ # every interface of the host. Front it with a reverse proxy to expose it,
+ # and set BACKEND_SHARED_SECRET + OE_PUBLIC_DEPLOYMENT when you do.
ports:
- - "8000:8000"
+ - "127.0.0.1:8000:8000"
environment:
- VECTOR_STORE_PATH=/data/chroma_db
- COMPANY_PROFILE_PATH=/data/company/profile.yaml
diff --git a/docs/deployment.md b/docs/deployment.md
index fbd600f3..e462b992 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -33,7 +33,14 @@ containers. The UI is stateless and scales freely.
The UI never talks to the API directly from the browser. It proxies through its
own server (`/api/backend/*`), stamping the shared secret on each upstream call,
-so only the UI origin needs to be public. See [auth.md](auth.md).
+so the UI origin is the only one that *needs* to be public. See [auth.md](auth.md).
+
+> **The compose file binds the API to `127.0.0.1` on purpose.** The UI reaches it
+> over the compose network, so nothing needs it on `0.0.0.0`. If you change that
+> binding or put the API behind a proxy on its own hostname, you have made it
+> internet-reachable — set `BACKEND_SHARED_SECRET` **and** `OE_PUBLIC_DEPLOYMENT=1`
+> before you do. Neither is set by default, and without them the API serves every
+> route unauthenticated with only a log line to say so.
---
diff --git a/packages/core/openexecutive/api/main.py b/packages/core/openexecutive/api/main.py
index 07efbcdc..52345fad 100644
--- a/packages/core/openexecutive/api/main.py
+++ b/packages/core/openexecutive/api/main.py
@@ -464,7 +464,7 @@ def _is_public_deployment() -> bool:
hosting provider's injected variables, so the check works identically on
every platform (and in plain Docker). See docs/deployment.md.
"""
- return os.environ.get("OE_PUBLIC_DEPLOYMENT", "").strip().lower() in _FALSEY_ENV
+ return os.environ.get("OE_PUBLIC_DEPLOYMENT", "").strip().lower() not in _FALSEY_ENV
def create_app() -> FastAPI: