Commit 8a0fca2
fix(container): APP_HOST defaults to 127.0.0.1 (HCG tier-2 E1 prereq)
Tightens three sites that feed the Zig adapter binary's `--host` flag
in production deployments, materialising the ADR-0004 §1 invariant
that BoJ's back-side bind is not externally routable when fronted by
http-capability-gateway (HCG tier-2).
This is action item #7 from the Phase E consumer-side audit on
hyperpolymath/standards#100 — companion to actions #6 (boj-server#130,
Cowboy bind in the Elixir path) and #8 (boj-server#131, k8s Service
ClusterIP). Together the three layers give defence in depth: Elixir
Cowboy binds loopback, Zig adapter binds loopback, k8s Service is
internal-only.
Changes:
- `stapeln.toml` [targets.production]: `APP_HOST = "[::]"`
-> `APP_HOST = "127.0.0.1"`. Adds a comment block explaining the
Phase E posture and the override path for legacy deployments.
- `container/entrypoint.sh` lines 40 + 140: `${APP_HOST:-[::]}`
-> `${APP_HOST:-127.0.0.1}`. Adds a comment at the exec line
pointing to ADR-0004 + the runbook.
- `container/compose.prod.yaml` services.boj-rest.environment:
`APP_HOST: "[::]"` -> `APP_HOST: "127.0.0.1"`. Adds an inline
comment block.
Audit-residue follow-ups (deliberately NOT in this PR):
- `container/Containerfile` line 125: `ENV PHX_HOST=0.0.0.0` is
vestigial — nothing in the codebase reads PHX_HOST (verified via
grep). Leave alone or remove in a hygiene PR; not load-bearing.
- Unifying APP_HOST (Zig adapter) and BOJ_BIND_IP (Elixir Cowboy)
into one envelope is broader scope; file as a separate issue if
the divergence proves annoying in operation.
Override path for legacy/standalone deployments without HCG in front:
set APP_HOST=0.0.0.0 (IPv4 all-interfaces) or APP_HOST=:: (IPv6
all-interfaces) in the deployment config — the in-repo defaults
remain loopback.
Refs hyperpolymath/standards#100
Refs hyperpolymath/standards#91
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fb15cd2 commit 8a0fca2
4 files changed
Lines changed: 33 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
0 commit comments