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
View File
@@ -7,6 +7,11 @@ export type IpalEnvFeatures = {
databaseVar?: string
/** Microsoft Graph e-mail (graphAdapter). Adds the GRAPH_* vars. */
emailGraph?: boolean
/**
* Require IPAL_IP_HEADER in production — the header the rate limit trusts for
* the client IP (see clientIp). Outside production it stays optional.
*/
ipHeader?: boolean
/** Override the Payload secret var. Default 'PAYLOAD_SECRET'. */
secretVar?: string
/** Override the site-URL var. Default 'NEXT_PUBLIC_SERVER_URL'. */
@@ -44,6 +49,7 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
const {
databaseVar = 'DATABASE_URI',
emailGraph = false,
ipHeader = false,
secretVar = 'PAYLOAD_SECRET',
serverUrlVar = 'NEXT_PUBLIC_SERVER_URL',
storage = false,
@@ -94,6 +100,15 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
)
}
if (ipHeader) {
rules.push({
name: 'IPAL_IP_HEADER',
description: 'Header holding the real client IP, e.g. cf-connecting-ip (Cloudflare) or x-forwarded-for',
required: process.env.NODE_ENV === 'production',
validate: (v) => (/^[a-z0-9-]+$/i.test(v) ? true : `IPAL_IP_HEADER must be a header name (got "${v}")`),
})
}
if (turnstile) {
const names = typeof turnstile === 'object' ? turnstile : {}
rules.push(