Skip to content

Commit 47faec1

Browse files
dev2-edge: route Art Auctions House hosts (#239)
Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
1 parent 999046f commit 47faec1

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎dev2/edge/edge.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
{ "hosts": ["agent.database.pit.world"], "proxy": 18080, "max_body": "512KiB", "gzip": true, "access_log": true, "sanitize_query": true },
2323
{ "hosts": ["otr.podcast.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,
2424
"//": "preserve the legacy pit.world alias route while the exact OTR host uses port 8814" },
25+
{ "hosts": ["auctions.pit.world", "art.auctions.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,
26+
"//": "Art Auctions House: exact root and nested hosts served by pit.world" },
2527
{ "hosts": ["group.call.pit.world"], "proxy": 8810, "max_body": "1MiB", "retry": "20s",
2628
"//": "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" },
2729
{ "hosts": ["*.*.pit.world", "*.*.*.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,

‎test/dev2-edge.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,15 @@ describe('dev2-edge render', () => {
175175
expect(caddy).toMatch(/\(edge_tls_moshpit\) \{\s+tls \{\s+load \/etc\/caddy\/edge-certs\s+protocols tls1\.3/);
176176
});
177177

178+
it('routes both Art Auctions House hosts through the pit.world app', () => {
179+
const { stream, caddy } = render();
180+
expect(stream).toMatch(/\n\s+auctions\.pit\.world\s+127\.0\.0\.1:8453;/);
181+
expect(stream).toMatch(/\n\s+art\.auctions\.pit\.world\s+127\.0\.0\.1:8453;/);
182+
const route = caddy.slice(caddy.indexOf('https://auctions.pit.world, https://art.auctions.pit.world {'));
183+
expect(route).toContain('request_body {\n\t\tmax_size 30MiB\n\t}');
184+
expect(route).toContain('import edge_proxy 8787');
185+
});
186+
178187
it('every name the stream sends to Caddy has a Caddy site', () => {
179188
const { stream } = render();
180189
const routed = [...stream.matchAll(/^\s+(\S+)\s+127\.0\.0\.1:8453;/gm)].map((m) => m[1]!);

0 commit comments

Comments
 (0)