You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(deploy): start.sh --hosted upgrade checks the PROXY listener before the new web container answers, so Caddy stays on the plain listener and every visitor shares one address #4541
Build:v1.0.5-rc2 (af465288a) · Row: B15 of abilityai/trinity-enterprise#1189 · Env: DigitalOcean droplet made by trinity-do-create.sh at v1.0.0, untouched Caddyfile, upgraded with start.sh --hosted (driven by the public ops agent's scripts/update.sh, which runs start.sh --hosted --unattended)
What happens
On the upgrade run, Caddy is re-rendered on the ordinary listener (127.0.0.1:8081) and the run prints:
⚠️ Caddy: the web container's PROXY-protocol listener (127.0.0.1:18082) is not
answering, so Caddy uses the ordinary listener (127.0.0.1:8081). ... visitors' addresses are NOT yet passed through ...
On first boot this is expected — start.sh switches over once the stack is up.
The web image is rc2 and the listener exists. Seconds after the run, probe-proxy-listener.sh 18082 exits 0, and a plain re-run of start.sh --hosted --unattended switches Caddy to 18082 with proxy_protocol v2. So the check lost a race against the freshly recreated frontend container: the 5 × 2 s grace in start.sh before provision_caddyfile is too short.
Until someone re-runs start.sh, every visitor reaches Trinity as the proxy's address. The per-client sign-in limits and audit addresses from trinity-enterprise#873 then put the whole internet in one bucket: one wrong-code flood locks out everyone.
The update reports success (✓ hosted stack up; update.sh would also pass --verify, which checks HTML + asset + API, not client-address pass-through).
Repro
DO droplet at v1.0.0 (untouched).
Set TRINITY_IMAGE_TAG=v1.0.5-rc2 in .env, check out the tag, sudo ./scripts/deploy/start.sh --hosted --unattended.
grep reverse_proxy /etc/caddy/Caddyfile gives 127.0.0.1:8081; the warning above is in the output.
Re-run step 2's start.sh: 127.0.0.1:18082.
Seen 1 of 1 untouched v1.0.0 upgrade. A fresh rc2 install came up on 18082 directly.
Expected
The upgrade run waits for the listener the way it waits for FRONTEND_PORT (up to 90 s), so a single run ends on the PROXY listener. Optionally update.sh --verify flags a Caddy still on the ordinary listener when the running web image has the PROXY one.
Activity
test(deploy): hold the #4541 upgrade wait by running start.sh (#4541)
fix(deploy): wait for the PROXY listener before re-rendering Caddy on…