MCP site tools, Turnstile key alert, required 2FA injection, a11y, more tests

- MCP: new get_site_info and list_pages tools (public by design, published
  and indexable content only); search results collapse the homepage to root.
  New listContent() helper shared with searchContent.
- Dashboard alert when Turnstile is half-configured (it is silently off then).
- twoFactor.plugin is now required; the dynamic-import fallback (which never
  worked under Next and caused a Turbopack warning) is gone.
- a11y: cookie category checkboxes are labelled, buttons have type, test-email
  input is labelled; tab labels keep localized collection labels.
- IPAL_IP_HEADER: one-time production warning when unset, opt-in
  ipalEnvRules({ ipHeader: true }).
- Tests: SEO/robots/sitemap/hreflang, CSP, Markdown, consent, MCP, and a real
  Payload + SQLite integration test for forms and the roles guard (74 total).
- Drop unused mongodb-memory-server; dev .env.example for SQLite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-16 01:15:19 +02:00
co-authored by Claude Opus 5.5
parent 86e69b0bcf
commit ab854ef37a
36 changed files with 708 additions and 328 deletions
+15 -4
View File
@@ -2,6 +2,8 @@ import type { Payload } from 'payload'
import type { IntegrationStatus } from './status.js'
import { turnstileKeyProblem } from '../turnstile/config.js'
type Props = {
/** Admin route, for the link. Default '/admin'. */
adminRoute?: string
@@ -25,8 +27,17 @@ export async function IntegrationAlerts({ adminRoute = '/admin', checks = { emai
return null
}
const failing = Object.entries(checks)
.map(([field, label]) => ({ label, status: doc?.[field] as IntegrationStatus | undefined }))
.filter((x) => x.status?.state === 'degraded')
.map(([field, label]) => {
const status = doc?.[field] as IntegrationStatus | undefined
return { label, message: status?.state === 'degraded' ? (status.message ?? status.code ?? 'error') : null }
})
.filter((x): x is { label: string; message: string } => x.message !== null)
// Configuration problems no request will ever record (nothing is verified
// while Turnstile is off) — checked live from the saved keys.
const keyProblem = turnstileKeyProblem(doc ?? {})
if (keyProblem && !failing.some((f) => f.label === 'Turnstile')) {
failing.push({ label: 'Turnstile', message: keyProblem })
}
if (!failing.length) {return null}
return (
@@ -42,9 +53,9 @@ export async function IntegrationAlerts({ adminRoute = '/admin', checks = { emai
>
<strong>Integration problem — the site still works, but something needs attention.</strong>
<ul style={{ margin: '0.5rem 0 0', paddingLeft: '1.2rem' }}>
{failing.map(({ label, status }) => (
{failing.map(({ label, message }) => (
<li key={label}>
<strong>{label}:</strong> {status?.message ?? status?.code ?? 'error'}
<strong>{label}:</strong> {message}
</li>
))}
</ul>