Skip to content

Commit a2dcddd

Browse files
Merge pull request #222 from profullstack/codex/caddy-otr-alias-20261031
dev2-edge: preserve OTR pit.world alias on Caddy
2 parents ea40137 + a5eaaad commit a2dcddd

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎dev2/edge/edge.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
],
1313
"keep_on_nginx": {
1414
"//": "Names under a routed pattern that stay on nginx for now, with why.",
15-
"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",
16-
"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"
15+
"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"
1716
},
1817
"sites": [
1918
{ "hosts": ["pit.world"], "proxy": 8787, "max_body": "1MiB" },
2019
{ "hosts": ["www.pit.world"], "redirect": "https://pit.world{uri}" },
2120
{ "hosts": ["ad.network.pit.world"], "proxy": 8800, "max_body": "1MiB", "gzip": true },
2221
{ "hosts": ["agent.database.pit.world"], "proxy": 18080, "max_body": "512KiB", "gzip": true, "access_log": true, "sanitize_query": true },
22+
{ "hosts": ["otr.podcast.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,
23+
"//": "preserve the legacy pit.world alias route while the exact OTR host uses port 8814" },
2324
{ "hosts": ["group.call.pit.world"], "proxy": 8810, "max_body": "1MiB", "retry": "20s",
2425
"//": "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" },
2526
{ "hosts": ["*.*.pit.world", "*.*.*.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,

‎test/dev2-edge.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('dev2-edge render', () => {
135135
expect(stream).toMatch(/\n\s+chovy\.hacker\s+127\.0\.0\.1:8453;/);
136136
// an exact name under a routed wildcard can stay on nginx
137137
expect(stream).toMatch(/\n\s+live\.streaming\.pit\.world\s+127\.0\.0\.1:8444;/);
138-
expect(stream).toMatch(/\n\s+otr\.podcast\.pit\.world\s+127\.0\.0\.1:8444;/);
138+
expect(stream).toMatch(/\n\s+otr\.podcast\.pit\.world\s+127\.0\.0\.1:8453;/);
139139
expect(stream).toContain('hostnames;');
140140
});
141141

@@ -154,6 +154,8 @@ describe('dev2-edge render', () => {
154154
expect(caddy).toContain('protocols h1 h2');
155155
expect(caddy).not.toMatch(/on_demand|acme_ca|\bemail\b/);
156156
expect(caddy).toContain('header_up X-Real-IP {remote_host}');
157+
const otrAlias = caddy.slice(caddy.indexOf('https://otr.podcast.pit.world {'));
158+
expect(otrAlias).toContain('import edge_proxy 8787');
157159
for (const site of SPEC.sites) {
158160
const head = site.hosts.map((h: string) => `https://${h}`).join(', ') + ' {';
159161
expect(caddy).toContain(head);

0 commit comments

Comments
 (0)