From 861ffc306aa25da68c3946d217708cfe7618f429 Mon Sep 17 00:00:00 2001 From: KoalaDev <6156589+Shik3i@users.noreply.github.com> Date: Wed, 15 Jul 2026 04:53:29 +0200 Subject: [PATCH] test(website): validate canonical relay URL --- scripts/test-website-theme.mjs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/test-website-theme.mjs b/scripts/test-website-theme.mjs index 09e5b19..8c02b38 100644 --- a/scripts/test-website-theme.mjs +++ b/scripts/test-website-theme.mjs @@ -63,7 +63,16 @@ for (const section of requiredLlmsSections) { if (/\bWebRTC\b|\bport 54000\b|peer-to-peer by design/i.test(llmsText)) { throw new Error('llms.txt must describe the current WebSocket relay architecture without obsolete WebRTC or port claims'); } -if (!llmsText.includes('wss://syncserver.koalastuff.net') || !llmsText.includes('internally on port 3000')) { +const documentedRelayUrls = [...llmsText.matchAll(/`(wss:\/\/[^`\s]+)`/g)].map(([, value]) => new URL(value)); +const hasCanonicalPublicRelay = documentedRelayUrls.some((url) => ( + url.protocol === 'wss:' && + url.hostname === 'syncserver.koalastuff.net' && + url.port === '' && + url.pathname === '/' && + url.search === '' && + url.hash === '' +)); +if (!hasCanonicalPublicRelay || !llmsText.includes('internally on port 3000')) { throw new Error('llms.txt must distinguish the public TLS relay URL from the internal self-hosting port'); }