Cut the edge over from nginx and certbot to Caddy
Caddy takes nginx's place in compose: ports 80/443, the fixed address 172.28.255.251 that cloudflared pins the public names to, the network aliases, the healthcheck and the autoheal label. nginx and certbot are removed from compose; Caddy already holds its own certificates in ./caddy/data, obtained while it ran beside nginx. `traffic` now tails logs/caddy/payloads.log, and the dev override switches Caddy to its dev sites instead of putting nginx in DEV_MODE. Docs and comments that described nginx's behaviour now describe Caddy's: CLAUDE.md, DEPLOYMENT.md (topology, boot paths, TLS, rate limits, runbook with a rollback, rough edges), the READMEs, .env.example and the comments in the backend, Python service, Vue source and infra files. nginx/ and certbot/ stay in the repo as the rollback until this has settled. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
The Vue frontend splits the response on newlines and JSON-parses each line, so
|
||||
the contract under test is: one complete JSON object per line, the documented
|
||||
event names, the right payload key per event kind, `exclude_none` dropping
|
||||
absent keys, and the framing headers that stop nginx buffering the stream.
|
||||
absent keys, and the framing headers that stop a buffering proxy holding the stream.
|
||||
|
||||
No scraping and no network happens here: `_run_events` takes the upstream
|
||||
generator as a callable, so a fake generator stands in for travelodge and the
|
||||
@@ -134,8 +134,8 @@ def test_ndjson_omits_none_fields():
|
||||
def test_ndjson_headers_defeat_proxy_buffering():
|
||||
response = main._ndjson(iter([]))
|
||||
assert response.media_type == "application/x-ndjson"
|
||||
# Without X-Accel-Buffering nginx holds the whole response and the stream
|
||||
# is pointless.
|
||||
# Without X-Accel-Buffering an nginx-style proxy holds the whole response
|
||||
# and the stream is pointless. (Caddy streams it regardless.)
|
||||
assert response.headers["x-accel-buffering"] == "no"
|
||||
assert response.headers["cache-control"] == "no-cache"
|
||||
|
||||
|
||||
@@ -125,8 +125,8 @@ def test_route_returns_reading(fake_claude, http):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("header", ["X-Real-IP", "X-Forwarded-For"])
|
||||
def test_route_refuses_requests_proxied_by_nginx(fake_claude, http, header):
|
||||
"""nginx sets these on everything it forwards; the Go backend sets neither."""
|
||||
def test_route_refuses_requests_proxied_by_the_edge(fake_claude, http, header):
|
||||
"""Caddy sets these on everything it forwards; the Go backend sets neither."""
|
||||
res = http.post("/internal/rowing/read", json=BODY, headers={header: "203.0.113.9"})
|
||||
assert res.status_code == 404
|
||||
assert fake_claude.calls == []
|
||||
|
||||
Reference in New Issue
Block a user