Container-ready via docker/ compose (frontend nginx + backend Node). Compose adjusted for Coolify on the prod server: frontend uses expose:80 (no host binding — host 8080 is taken by the Coolify proxy; Traefik routes visigine.de), backend ALLOWED_ORIGINS=https://visigine.de. Secrets stay in server/.env (git-ignored); see server/.env.example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
// Group B — llms.txt presence, structure, and accessibility.
|
|
export async function runLlmsChecks({ baseUrl, llmsTxt, llmsStatus, robotsTxt, fetchPage }) {
|
|
const ll = llmsTxt || ''
|
|
const rb = robotsTxt || ''
|
|
const present = (llmsStatus === 200) && ll.length > 0
|
|
|
|
const results = [
|
|
{
|
|
id: 'llms.present',
|
|
title: 'llms.txt fehlt',
|
|
severity: 'high',
|
|
passed: present,
|
|
},
|
|
{
|
|
id: 'llms.structured',
|
|
title: 'llms.txt: keine strukturierten Metadaten',
|
|
severity: 'high',
|
|
passed: /^[-*]\s*\w+:/m.test(ll),
|
|
},
|
|
{
|
|
id: 'llms.substantial',
|
|
title: 'llms.txt zu kurz (unter 500 Zeichen)',
|
|
severity: 'medium',
|
|
passed: ll.length >= 500,
|
|
},
|
|
{
|
|
id: 'llms.not-disallowed',
|
|
title: 'llms.txt ist in robots.txt blockiert',
|
|
severity: 'high',
|
|
passed: !/Disallow:\s*\/llms\.txt/i.test(rb),
|
|
},
|
|
]
|
|
|
|
// llms-full.txt is fetched lazily; only report fail when the base file is reachable.
|
|
let fullPassed = false
|
|
try {
|
|
const full = await fetchPage(`${baseUrl}/llms-full.txt`)
|
|
fullPassed = full.status === 200 && (full.body || '').length > 0
|
|
} catch {
|
|
fullPassed = false
|
|
}
|
|
results.push({
|
|
id: 'llms.full-version',
|
|
title: 'llms-full.txt fehlt (erweiterte Version)',
|
|
severity: 'low',
|
|
passed: fullPassed,
|
|
})
|
|
|
|
return results
|
|
}
|