1.16.7 upgrade notes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
14c44d082d
commit
bc0fa65fd7
@@ -37,7 +37,7 @@ through this procedure. Ask only when you are missing something you cannot get y
|
||||
| the 2FA code screen answers "Too many codes were tried…" (`429` from `/api/verify-totp`) | more than 5 verify attempts for that account in 10 minutes (`twoFactor.verifyLimit`); repeated lines `[ipal] 2FA: too many verify attempts` in the log without the owner trying = someone has the password | wait for the window, enter the current code once; unexplained attempts: change that account's password. Tests that log in often: `verifyLimit: { max: … }` for that environment |
|
||||
| `isAdmin(req.user)` says `false` for a real administrator on the server, in a process that loads two Payload configs (tests, a multi-site script) | a call without a source counts only collections that are staff in **every** config of the process | pass the source: `isAdmin(req.user, req.payload)` — with it each config gets its own answer |
|
||||
| `isAdmin(user)` / `isEditor(user)` is always `false` in a client component or in `proxy.ts` | the staff collections are not known there (no config in the browser bundle / middleware), and the predicates fail closed | `isAdmin(user, config)` with `useConfig()`, imported from `@intecion/ipal-kit/client`; in middleware `isAdmin(user, { staffCollections: ['users'] })` |
|
||||
| `next build --webpack`: `'server-only' cannot be imported from a Client Component module … caused by importing '@intecion/ipal-kit/dist/index.js'` | a `'use client'` file imports the main entry (Turbopack lets it pass) | import from `@intecion/ipal-kit/client` (role predicates are there after 1.16.6; types: `import type` from the main entry is fine); data the browser needs → a prop from a server component |
|
||||
| `next build --webpack`: `'server-only' cannot be imported from a Client Component module … caused by importing '@intecion/ipal-kit/dist/index.js'` | a `'use client'` file imports the main entry (Turbopack lets it pass) | import from `@intecion/ipal-kit/client` (role predicates are there since 1.16.7; types: `import type` from the main entry is fine); data the browser needs → a prop from a server component |
|
||||
| an account logs in but every page and request answers 403 / the setup screen says "The time to set up two-step verification has passed" | 2FA setup required: the account did not set TOTP up within the window (72 h from its creation, an admin's reset, or the first start after the upgrade) | an administrator opens the account in the panel → Two-step verification → "Reopen setup" (or `POST /api/ipal/two-factor/reset` `{ userId }`); every administrator is blocked: security.md "Every administrator is blocked" — a script with the Local API, `payload.update({ collection: 'users', id, data: { totpSetupFrom: new Date().toISOString() } })` (`pnpm payload run`), then log in and set TOTP up; or `requireSetup: { windowHours: false }`, redeploy, set up, put it back |
|
||||
| a new account gets `403` from the API although its role allows the request | 2FA setup required: until TOTP is set up the account reaches only the setup screen | set TOTP up (log in to the panel); an integration: use an API key, or `twoFactor.requireSetup.exempt` |
|
||||
| after an upgrade EVERY panel login answers `500` (also `/api/users/init`), administrators with 2FA included; log: `[ipal] 2FA: the column for "totpSetupFrom" is missing … NOBODY CAN LOG IN` or `column users.totp_setup_from does not exist` | Postgres/SQLite: the migration that adds the 2FA column has not run (needed whenever 2FA is on) | `pnpm payload migrate:create` if no migration has it, commit, and redeploy with migrations run when the new container starts — `prodMigrations` in the adapter or the start command `pnpm payload migrate && pnpm start` (deployment.md §4.3; not Coolify's Pre-deployment command, which runs in the old container); nothing is lost. `ipal-doctor` reports a project whose migrations lack `totp_setup_from` |
|
||||
|
||||
@@ -351,7 +351,7 @@ for every site:**
|
||||
`grep -rnE "isAdmin\(|isEditor\(|hasMinimumRole\(" src` — a call in a **client component** or in `proxy.ts` /
|
||||
middleware now returns `false` without a source: `isAdmin(user, config)` (`useConfig()`), or
|
||||
`isAdmin(user, { staffCollections: ['users'] })`. A **client component imports them from
|
||||
`@intecion/ipal-kit/client`** (not in 1.16.4–1.16.6: go to the next version); the main entry there fails with
|
||||
`@intecion/ipal-kit/client`** (not in 1.16.4–1.16.6: go to 1.16.7); the main entry there fails with
|
||||
`next build --webpack` (`'server-only' cannot be imported from a Client Component module`).
|
||||
4. `pnpm exec ipal-doctor --url <site>` (with the doctor token) → accounts without 2FA must be 0. An account that
|
||||
has not set TOTP up opens everything with its password alone: have its owner set it up now, or remove it.
|
||||
@@ -423,7 +423,7 @@ site without steps 1–3 and a deploy day agreed with the owner. Steps 2, 3 and
|
||||
setup screen with "Set up two-step verification by …"; after the code it is in. As an administrator open that
|
||||
account → "Two-step verification: Set up." and the reset button; delete the account.
|
||||
|
||||
**→ the release with `accounts` / `secrets` (CHANGELOG "Unreleased — hardening"; PROGRAMISTA §6, item 69) — read every point, most sites change nothing:**
|
||||
**→ 1.16.7 (hardening; CHANGELOG 1.16.7; PROGRAMISTA §6, item 69) — not a routine patch: agree the deploy with the owner, read every point, most sites change nothing:**
|
||||
1. Update the package, `pnpm install`, `pnpm ipal:skills`, `pnpm payload generate:types`. No import-map change, **no
|
||||
schema change and no migration** on any database (the verify count uses Payload's own `payload-kv`
|
||||
collection). `grep -n "staffCollections\|authCollection" src/payload.config.ts`: every slug there must be an
|
||||
@@ -489,6 +489,9 @@ account → "Two-step verification: Set up." and the reset button; delete the ac
|
||||
9. **Dashboard alerts.** Editors now see "An integration needs attention. Ask an administrator." instead of the
|
||||
error text; accounts with only `user` see no alerts. `dashboardAlerts: { integrations: 'all' }` restores it
|
||||
(`'all'` checks no role and no second factor).
|
||||
10. **Role checks in client components.** `grep -rlE "^['\"]use client" src | xargs grep -nE "from '@intecion/ipal-kit'"`
|
||||
— a file that imports `isAdmin`, `isEditor` or `hasMinimumRole` there: change the import to
|
||||
`@intecion/ipal-kit/client` and keep the second argument (`isAdmin(user, config)`). `import type` may stay.
|
||||
**Check:** `pnpm exec ipal-doctor --url <site>` (new rules: `access-missing`, `csrf-empty`, `open-signup`,
|
||||
`staff-accounts-open`, `staff-own-roles`, `turnstile-degraded`, `turnstile-env-key`); as an admin `GET /api/globals/site-integrations` shows
|
||||
`"smtpPassword":"********"`; a test e-mail and a test form still work; an editor and an admin still log in.
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ Write everything in this file in English.
|
||||
<!-- /starter:decisions -->
|
||||
|
||||
<!-- ipal-kit:start -->
|
||||
## ipal-kit 1.16.6 — agent guide
|
||||
## ipal-kit 1.16.7 — agent guide
|
||||
|
||||
<!-- Managed by `pnpm exec ipal-skills` — edits between the markers are overwritten. -->
|
||||
This project is built on `@intecion/ipal-kit` (a Payload CMS 3 plugin). Before you write code:
|
||||
|
||||
Reference in New Issue
Block a user