Scope just server bindings by execution context
Problem
All just server recipes (playground, cloud, docs) bind to 0.0.0.0 regardless of execution context, exposing development servers to the local network when running on a developer's machine. This is unnecessary for local development and has been flagged as a security policy concern during code reviews. The 0.0.0.0 binding is only needed inside cbox containers where the host needs to reach the container's server. Without context-aware binding, developers must manually override the host or accept the blanket exposure, and reviewers repeatedly flag the same issue without resolution.
Context
- 12 justfile server recipes (
evals,core,alie,cloud,playground,asql-playground,asql-docs,nimble,docs,plans) hardcode--host 0.0.0.0or--dev-addr 0.0.0.0:PORT, exposing dev servers to the local network. - Only
tasksalready binds to127.0.0.1. - The
Procfilealso uses0.0.0.0but that is for GCP/container deployment and should stay as-is. - The
serveandworktree-serveorchestrator recipes already echo127.0.0.1URLs — but the underlying recipes they call still bind to0.0.0.0, so the echo is misleading. - Container/cbox environments need
0.0.0.0so the host can reach the container's server; local dev does not.
Possible Solutions
- A — Leave all recipes bound to
0.0.0.0: Simplest, but keeps avoidable LAN exposure and fails principle of least privilege. Reviewers keep flagging it. - B — Recommended: env-var-driven host default. Add a top-level
host := env_var_or_default("DFT_HOST", "127.0.0.1")variable. All server recipes use{{host}}. Local dev gets loopback automatically; container environments setDFT_HOST=0.0.0.0. - C — Force loopback everywhere: Safer locally but breaks container workflows with no override path.
Plan
- Add
hostvariable to justfile top-level, defaulting to127.0.0.1viaDFT_HOST. - Replace every hardcoded
0.0.0.0in server recipes with{{host}}. - Update echo messages to use
{{host}}for consistency. - Update the README example that shows
--host 0.0.0.0. - Leave
Procfileunchanged (deployment context). - Validate with
just --evaluateand task validate.
Implementation Progress
- [x] Audit justfile recipes for
0.0.0.0bindings (12 recipes found). - [x] Add
hostvariable withDFT_HOSTenv override. - [x] Replace all
0.0.0.0in recipes and echo messages with{{host}}. - [x] Update README example.
- [x] Validate justfile parses and task file is well-formed.
Review Feedback
2026-03-26: Updatedserveandworktree-serveecho output to use{{host}}soDFT_HOST=0.0.0.0no longer prints misleading loopback URLs for those services.2026-03-26: Kept the README--host 0.0.0.0example, but clarified that it is an explicit override for network access rather than the default behavior.2026-03-26: Documented that the Tasks service remains loopback-only, so itsserve/worktree-serveURLs intentionally stay on127.0.0.1.- [x] Review cleared