Files and paths (IAWL ideas 12, 13, 36): resolved --dest, starter refuses links and escaping paths, Office ZIP entries with trailing dots, proxy matcher ends api/admin/_next at /
- iapl-skills: --dest is compared with the project root after resolving links; a folder that is the root or holds it (.., /) is refused - starter: collectBundle refuses symbolic links (their target would ship in the published bundle); writeFiles refuses absolute or escaping paths - form files: a program inside a DOCX/XLSX is found with trailing dots or spaces (Windows drops them) - proxy matcher: (?!(?:api|admin|_next)(?:/|$)|...) so /administracja, /apis get the proxy; doctor rule proxy-matcher reports the old literal - pnpm: @swc/core in ignoredBuiltDependencies (its postinstall only checks the native binary, already installed) Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e821d52d19
commit
498b3dbf38
+1
-1
@@ -528,7 +528,7 @@ No abbreviations (`HeroSection`, not `HeroSec`). Do not create `lib/pages.ts`,
|
||||
|
||||
1. **`proxy.ts`, never `middleware.ts`.** middleware.ts exists → delete it. Proxy:
|
||||
`export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })`, the matcher
|
||||
as an **inline literal** (`['/((?!api|admin|_next|.*\\..*).*)']`), not an import.
|
||||
as an **inline literal** (`['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)']`), not an import.
|
||||
2. **No explicit `<head>` in the layout.** It pushes metadata into `<body>`.
|
||||
`<MediaPreconnect/>` in `<body>` (React 19 hoists it).
|
||||
3. **ISR:** `export const revalidate = 3600` in `page.tsx`. Refresh after save:
|
||||
|
||||
@@ -265,7 +265,7 @@ import { i18nConfig } from '@/i18n.config'
|
||||
export const proxy = createProxy(i18nConfig, { markdown: true, NextResponse })
|
||||
|
||||
// Inline LITERAL — Next reads the matcher statically (importing DEFAULT_PROXY_MATCHER breaks /admin)
|
||||
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
|
||||
```
|
||||
|
||||
## Collections and globals
|
||||
|
||||
@@ -399,7 +399,7 @@ import { createProxy } from '@intecion/ipal-kit'
|
||||
import { i18nConfig } from '@/i18n.config'
|
||||
export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })
|
||||
// Inline LITERAL (importing DEFAULT_PROXY_MATCHER = 500 on /admin); with adminRoute '/its' write `its` instead of `admin`
|
||||
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
|
||||
```
|
||||
`src/lib/content.ts` = PROGRAMISTA §2.7 1:1: `createContentHelpers({ config, content: contentConfig, i18n: i18nConfig,
|
||||
baseUrl: process.env.NEXT_PUBLIC_SERVER_URL, markdownAlternate: true, summaryField: 'aiSummary', mcp: { serverName:
|
||||
|
||||
@@ -245,7 +245,7 @@ import { i18nConfig } from '@/i18n.config'
|
||||
export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })
|
||||
|
||||
// Inline literal — Next analyzes it statically; importing a variable = proxy on /admin → 500
|
||||
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
|
||||
```
|
||||
Sets `x-locale` / `x-pathname`, the language cookie with consent, redirects `/`.
|
||||
The headers are for dynamic routes (API, route handlers) — in SSG/ISR pages,
|
||||
|
||||
@@ -101,6 +101,7 @@ Turn off: `iapl({ doctor: false })`. Adapt: `iapl({ doctor: { tokenVar: 'MY_TOKE
|
||||
| | `env-live` | error | (deep) the project's env rules pass in the real environment |
|
||||
| security | `security-headers` | error | `buildSecurityHeaders`; live: HSTS, nosniff, Referrer-Policy, Permissions-Policy, frame protection |
|
||||
| | `powered-by` | error | `withSecurityConfig`; live: no `X-Powered-By` on `/` and the admin |
|
||||
| | `proxy-matcher` | warning | `src/proxy.ts`: a matcher that skips `api`, `admin` or `_next` without ending them at "/" (`(?!api|admin|…)`) also skips every page whose first segment only starts with them (`/administracja`): no locale redirect, no proxy CSP. Fix: the literal in i18n.md (1.17.1) |
|
||||
| | `client-hints` | info | `withSecurityConfig` is the outer wrapper (`withSecurityConfig(withPayload(…))`), so Payload's colour-scheme client hints go to the admin only; live: `/` sends no `Critical-CH: Sec-CH-Prefers-Color-Scheme`. Not reported with `adminClientHints: false` |
|
||||
| | `csp` | warning / info | CSP on the site and the admin; report-only is info, a warning after 4 weeks (`seen`) |
|
||||
| | `2fa` | error | `twoFactor: { plugin: payloadTotp }` + the package; deep: 0 users without TOTP (the message says how many of them are blocked because their setup window has passed); error: a Postgres / SQLite project whose migrations do not mention the 2FA column `totp_setup_from` (every login would answer 500; a warning when there is no migrations folder — the doctor cannot see a schema that gets there another way); warning: `twoFactor.requireSetup: false`; info: no setup window (`windowHours: false`) |
|
||||
|
||||
+4
-4
@@ -132,7 +132,7 @@ See [proxy in this section](#proxy-formerly-middleware) below.
|
||||
> import { createProxy } from '@intecion/ipal-kit'
|
||||
> import { i18nConfig } from '@/i18n.config'
|
||||
> export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true }) // markdown: GEO, content.md
|
||||
> export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
> export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
|
||||
> ```
|
||||
> Use the manual variant below only when you need your own logic in the proxy.
|
||||
|
||||
@@ -171,7 +171,7 @@ export function proxy(req) {
|
||||
return res
|
||||
}
|
||||
|
||||
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] } // = DEFAULT_MIDDLEWARE_MATCHER, inline
|
||||
export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] } // = DEFAULT_MIDDLEWARE_MATCHER, inline
|
||||
```
|
||||
|
||||
Behavior:
|
||||
@@ -182,7 +182,7 @@ Behavior:
|
||||
|
||||
`DEFAULT_MIDDLEWARE_MATCHER` excludes `api`, `admin`, `_next`, static files.
|
||||
The `admin` prefix is hard-coded — with a custom `adminRoute` (e.g. `/its`) add
|
||||
it to the matcher (`'/((?!api|its|_next|.*\\..*).*)'`), otherwise the proxy redirects the admin panel
|
||||
it to the matcher (`'/((?!(?:api|its|_next)(?:/|$)|.*\\..*).*)'`), otherwise the proxy redirects the admin panel
|
||||
to `/pl/its`.
|
||||
|
||||
## Locale cookie and consent (GDPR)
|
||||
@@ -398,7 +398,7 @@ in the proxy/middleware file, not an import/variable. Even though the plugin exp
|
||||
|
||||
```ts
|
||||
// proxy.ts — matcher INLINE (not an import)
|
||||
export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] }
|
||||
export const config = { matcher: ['/((?!(?:api|admin|_next)(?:/|$)|.*\\..*).*)'] }
|
||||
```
|
||||
|
||||
Use `DEFAULT_PROXY_MATCHER` as a reference value, but if Next complains
|
||||
|
||||
Reference in New Issue
Block a user