Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev2/edge/edge.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
{ "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": ["auctions.pit.world", "art.auctions.pit.world"], "proxy": 8787, "max_body": "30MiB", "gzip": true,
"//": "Art Auctions House: exact root and nested hosts served by pit.world" },
{ "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,
Expand Down
9 changes: 9 additions & 0 deletions test/dev2-edge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,15 @@ describe('dev2-edge render', () => {
expect(caddy).toMatch(/\(edge_tls_moshpit\) \{\s+tls \{\s+load \/etc\/caddy\/edge-certs\s+protocols tls1\.3/);
});

it('routes both Art Auctions House hosts through the pit.world app', () => {
const { stream, caddy } = render();
expect(stream).toMatch(/\n\s+auctions\.pit\.world\s+127\.0\.0\.1:8453;/);
expect(stream).toMatch(/\n\s+art\.auctions\.pit\.world\s+127\.0\.0\.1:8453;/);
const route = caddy.slice(caddy.indexOf('https://auctions.pit.world, https://art.auctions.pit.world {'));
expect(route).toContain('request_body {\n\t\tmax_size 30MiB\n\t}');
expect(route).toContain('import edge_proxy 8787');
});

it('every name the stream sends to Caddy has a Caddy site', () => {
const { stream } = render();
const routed = [...stream.matchAll(/^\s+(\S+)\s+127\.0\.0\.1:8453;/gm)].map((m) => m[1]!);
Expand Down
Loading