From a5eaaad58391f2baf6f64c2ca4d011128145e013 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sat, 31 Oct 2026 11:02:43 +0000 Subject: [PATCH] dev2-edge: preserve OTR pit.world alias on Caddy --- dev2/edge/edge.json | 5 +++-- test/dev2-edge.test.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dev2/edge/edge.json b/dev2/edge/edge.json index 9d51243..f2d8aca 100644 --- a/dev2/edge/edge.json +++ b/dev2/edge/edge.json @@ -12,14 +12,15 @@ ], "keep_on_nginx": { "//": "Names under a routed pattern that stay on nginx for now, with why.", - "live.streaming.pit.world": "per-path routing to two nixamp servers with a 404 fallback (error_page @server2); move after it has its own Caddy rehearsal", - "otr.podcast.pit.world": "the new OTR Caddy site changes this legacy pit.world alias from 200 to 301; preserve the current nginx response until the alias is rehearsed" + "live.streaming.pit.world": "per-path routing to two nixamp servers with a 404 fallback (error_page @server2); move after it has its own Caddy rehearsal" }, "sites": [ { "hosts": ["pit.world"], "proxy": 8787, "max_body": "1MiB" }, { "hosts": ["www.pit.world"], "redirect": "https://pit.world{uri}" }, { "hosts": ["ad.network.pit.world"], "proxy": 8800, "max_body": "1MiB", "gzip": true }, { "hosts": ["agent.database.pit.world"], "proxy": 18080, "max_body": "512KiB", "gzip": true, "access_log": true, "sanitize_query": true }, + { "hosts": ["otr.podcast.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true, + "//": "preserve the legacy pit.world alias route while the exact OTR host uses port 8814" }, { "hosts": ["group.call.pit.world"], "proxy": 8810, "max_body": "1MiB", "retry": "20s", "//": "group.call (moshcoder/group.call): no gzip, so the room page's server-sent events are not held back; retry holds Telnyx webhooks across a deploy instead of 502" }, { "hosts": ["*.*.pit.world", "*.*.*.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true, diff --git a/test/dev2-edge.test.ts b/test/dev2-edge.test.ts index f5821d1..cb2553d 100644 --- a/test/dev2-edge.test.ts +++ b/test/dev2-edge.test.ts @@ -135,7 +135,7 @@ describe('dev2-edge render', () => { expect(stream).toMatch(/\n\s+chovy\.hacker\s+127\.0\.0\.1:8453;/); // an exact name under a routed wildcard can stay on nginx expect(stream).toMatch(/\n\s+live\.streaming\.pit\.world\s+127\.0\.0\.1:8444;/); - expect(stream).toMatch(/\n\s+otr\.podcast\.pit\.world\s+127\.0\.0\.1:8444;/); + expect(stream).toMatch(/\n\s+otr\.podcast\.pit\.world\s+127\.0\.0\.1:8453;/); expect(stream).toContain('hostnames;'); }); @@ -154,6 +154,8 @@ describe('dev2-edge render', () => { expect(caddy).toContain('protocols h1 h2'); expect(caddy).not.toMatch(/on_demand|acme_ca|\bemail\b/); expect(caddy).toContain('header_up X-Real-IP {remote_host}'); + const otrAlias = caddy.slice(caddy.indexOf('https://otr.podcast.pit.world {')); + expect(otrAlias).toContain('import edge_proxy 8787'); for (const site of SPEC.sites) { const head = site.hosts.map((h: string) => `https://${h}`).join(', ') + ' {'; expect(caddy).toContain(head);