ipal-upgrade, PROGRAMISTA §6 item 51 and security.md point at 1.14.2 instead of "after 1.14.1". Co-Authored-By: Claude Opus 5.5 <[email protected]>
13 KiB
name, description
| name | description |
|---|---|
| ipal-upgrade | Upgrades an existing project to the latest @intecion/ipal-kit and replaces hand-written code that the plugin now provides — proxy, route handlers, consent wrapper, language switcher, rich text parser, form logic, noindex, redirects, env validation, privacy link label, 404 page, CTA field zoo. Use when the user asks to update ipal-kit, migrate an older project, or clean up duplicated logic in a project. |
ipal-upgrade
What changed in the version: node_modules/@intecion/ipal-kit/docs/CHANGELOG.md (the
"Requires project changes" sections — do all of them). List of changes: …/docs/dev/PROGRAMISTA.md §6.
Rule: when the plugin provides something the project has written by hand — remove the local version.
1. Update the package
pnpm add @intecion/ipal-kit@latest
pnpm payload generate:importmap # new admin panel components from the plugin (e.g. RowLabel)
rm -rf .next
Copy the skills again (AGENT.md §14) — they may have changed.
Postgres with migrations: new plugin fields (e.g. privacyLinkLabel) →
pnpm payload migrate:create.
1a. AGENT.md §0b set
After the update, a full ipal-audit shows a "missing: …" section — the missing items of
the MANDATORY SET (GEO: llms-full, Markdown, MCP; R2; Turnstile through
getTurnstileConfig…). Wire each one according to PROGRAMISTA §2 — it is part of the update,
not an extra. Skip one only with a client decision in AGENTS.md (ipal-audit-skip:).
1.8.x → 1.9.0 (PROGRAMISTA §6, items 17–21): twoFactor.plugin required;
getTurnstileConfig instead of turnstileSiteKey (with both keys set the token is
required — check that every form has the widget); clientIp(await headers()) in
the form action + IPAL_IP_HEADER in the production env; buildR2Storage wired.
→ 1.9.2 (PROGRAMISTA §6, items 28–33) — import instead of code, start with item 28 (security):
a custom FormRenderer passed the Emails tab (company addresses) to the HTML → a block with <RenderForm> +
formClasses.ts, remove the renderer. Then: layout → SiteProviders, page and 404 → createPageRoute /
createNotFoundPage, GEO routes → re-exports from lib/content, src/fields/section*.ts and
lib/navigation.ts → buildSection*Field, resolveNav, resolveLink. Check every item in
the browser (form: submission + email; page: 200, 404, metadata). Postgres: migrate:create
(new form field types and texts in Notifications).
→ 1.11.0 (PROGRAMISTA §6, items 34–37): remove the workarounds — a copy of publicForm (→ RenderForm values /
prepareBuilderForm), manual remotePatterns/dangerouslyAllowLocalIP (→ buildImagesConfig()), conditional
storage in ipalEnvRules, a custom product JSON-LD graph (→ pageJsonLd.entries + buildProductJsonLd),
a custom RenderBlocks for h1 (→ isFirst). Links to posts: buildLinkField({ relationTo: [...] }) with a data migration.
→ 1.11.1 (PROGRAMISTA §6, items 38–45): remove the workarounds (WORKAROUND ipal-kit comments) — the
NEXT_RUNTIME condition around the revalidatePath injected into buildRevalidateHook (a global's own afterChange hook keeps it — ipal-nav), the form focus guard, a custom theme (→ ThemeScript/ThemeSwitcher),
a custom table of contents (→ extractHeadings + TableOfContents + headingIds), catching notFound for a redirect
(→ onMissing: 'redirectHome'), background colour only for JPEG in <Media>, a custom type instead of CmsLink['appearance']
(→ per-shape types from generate:types: CmsLink, CmsLinkPlain, CmsLinkNoLabel, CmsLinkPlainNoLabel; style: LinkAppearance). Cookie banner: buttons.save →
buttons.savePreferences — in migrate:create choose rename for the column to keep the texts.
→ 1.12.3 (PROGRAMISTA §6, item 46): Postgres/SQLite: migrate:create (new Cookie banner group →
detailLabels, only new columns — no rename). A custom cookie settings window or a cookie list added to
the banner → <CookieBanner settings="detailed"> and remove the copy. With detailed: Cookie banner → Cookie list filled in
(scan, ipal-consent-check) and Detail labels in every language.
→ 1.13.0 (PROGRAMISTA §6, item 47; CHANGELOG "What projects must update" — do all 7, in order):
- Project without
access(norolesfield): every logged-in account can now use the plugin's admin and editor features (Site integrations, settings globals, test e-mail, stats, consent records, forms, form submissions); before, nobody could through the API. Check who can log in (grep -rn "auth:" src/collections, open sign-up, customer accounts). Untrusted accounts → addaccess(roles), or narrow withglobalOverrides,forms.formOverrides/forms.formSubmissionOverrides,consentLog.collectionOverrides,stats.collectionOverrides. Verify: log in as a non-staff account →GET /api/globals/site-integrationsis 403. - Project with
access: plainuseraccounts can no longer edit Site settings, Cookie banner, Notifications or forms, or create/delete users. List staff accounts in the panel (Users → Roles) and give themeditor/admin, or loosen withglobalOverrides,forms.formOverrides.access,access.authAccess. Verify: an editor saves Site settings. - Postgres/SQLite:
pnpm payload migrate:create→migrate(Site settings → Search engines:search_verification_*,ai_crawlers_policy, theai_crawlers_rulestable, localizedllms_intro). Withenabled: falsethe migration now keeps (or restores) the plugin's tables — check it has no DROP TABLE. MongoDB: nothing. pnpm payload generate:importmap,pnpm ipal:skills,rm -rf .next.- Behaviour to check (grep the project, fix what applies):
getSettings/getSiteShellread atdepth: 1(code that reads a relation of a relation →createContentHelpers({ settingsDepth: 2 }));sitemap()throws at runtime instead of returning[](sitemapRouteanswers 503); atwoFactor.collectionSlugother thanadmin.userstops startup (allowCollectionMismatch: true); requests without a client IP share one limited bucket (proxy hides the IP →IPAL_IP_HEADER, orsetUnknownIpFactor);RenderRichTextturns unsafe link URLs into#(safeLinks). - Review the new options with the user (AGENT.md §7.1):
consentMode: 'basic',revalidatePath,turnstileHostnames, Site settings → Search engines (verification codes, or keep DNS verification),app/robots.ts→export { getRobots as default }+force-dynamic,createSearchRoute({ …, isPathVisible }),access.firstUserAdmin. - Remove the workarounds: a plugin after
ipalKitthat addsafterChangeor access to the plugin globals →ipalKit({ revalidatePath })/globalOverrides; a hand-written global revalidation hook →buildGlobalRevalidateHook({ revalidatePath });consentFieldNamepassed only because the option was ignored →forms.consentFieldNameworks now; your own seed guard / upsert code →@intecion/ipal-kit/seed(createSeeder).
Every upgrade — Next.js 16.4.1 or later (AGENT.md §4 item 11): pnpm ls next sharp; below 16.4.1 →
pnpm add next@^16.4.1 eslint-config-next@^16.4.1 sharp@^0.35.5, rm -rf .next, build, redeploy on Coolify
(a new image ships the fixed next and sharp). Check: pnpm dev prints no security-upgrade warning.
Every upgrade — dependency advisories (AGENT.md §4 item 12): pnpm audit --prod; with payload 3.90.x add the
dompurify and undici overrides, pnpm install, audit again. Check: no high or critical.
→ 1.14.0 (PROGRAMISTA §6, items 48–49; CHANGELOG "What projects must update" — do all 8, in order):
pnpm payload generate:importmap—@intecion/ipal-kit/admin#FaviconCheck(hint under Site settings → Site icon) and theRowLabelentries are injected into every project; thenpnpm ipal:skills,rm -rf .next. Check: pick a 32×32 PNG as the site icon → a warning appears under the field; saving still works.- Node.js 20.9 or later (the plugin's
nodemailer10 needs it) — check the Coolify build image and.nvmrc/engines. Removenodemailerand@types/nodemailerfrom the project's ownpackage.jsonif someone added them (the plugin's copy is the onemailAdapteruses). Check: Site integrations → E-mail sending → send a test e-mail over SMTP (and over Microsoft Graph when the project uses it). - Next.js 16.4.1 or later — the "Every upgrade — Next.js" step above (
next@^16.4.3,sharp@^0.35.5). - Dependency advisories — the "Every upgrade — dependency advisories" step above (
dompurify/undicioverrides on payload 3.90.x). Check:pnpm audit --prod→ no high or critical. - Cookie list kept by hand → offer
cookieScanner: true(+crawl: truewithIPAL_COOKIE_SCAN_URL,IPAL_COOKIE_SCAN_TOKENand the site in the service'sIPAL_CRAWLER_SITES, cookie-scanner.md); an own image modal →lightbox: true+<SiteProviders lightbox>(PROGRAMISTA item 48). Turning either on → Postgres/SQLitemigrate:create→migrate. Without them: no schema change. - Admin languages: English and Polish by default when the project sets no
i18n.supportedLanguages. Ask the client; English only →i18n: { supportedLanguages: { en } }. Own admin texts →i18n.translations.<lang>.ipal. - Frontend texts: validator messages are full sentences and
pllocales get Polish fallbacks — grep the project's tests and code for the old strings ('required','invalid email') and update them. - Sidebar:
roles(users) and Cookie banner → Consent version moved to the sidebar — update editor instructions. Nothing else to change: the statistics tab title, the cookie scanner's integration names and the maintenance notice's close button follow the language by themselves.
→ 1.14.2 (PROGRAMISTA §6, item 51; 2FA setup loop; security.md) — required with 2FA on:
pnpm payload generate:importmap— the plugin swaps@clocklimited/payload-2fa/rsc#TOTPProviderfor@intecion/ipal-kit/admin#TotpRedirectProvider; commitimportMap.js,rm -rf .next, redeploy on Coolify. Check: log in as a new admin (or a throwaway one) →/admin/setup-totp?back=%2Fadminwith the QR code, no reloading; after the code → back on/admin. A project that wrote its ownx-pathnameproxy rule for/adminas a workaround can drop it.
→ 1.14.1 (PROGRAMISTA §6, item 50; X-Powered-By, CSP; security.md) — nothing required, recommended in this order:
- Hide
X-Powered-By—next.config.ts:export default withPayload(withSecurityConfig(nextConfig))(importwithSecurityConfigfrom@intecion/ipal-kit); remove a hand-writtenpoweredByHeader: falseor a header override if the project had one. Check:curl -sI localhost:3000/pl | grep -i x-powered-by→ nothing (also on/adminand/api/health). - CSP, report-only first — no CSP yet, or a hand-written one →
buildSecurityHeaders({ csp: { mode: 'report-only', reportUri: '/api/csp-report', r2Url: process.env.R2_PUBLIC_URL, <flags for what the site loads> } }), the admin rule{ source: '/admin/:path*', headers: buildAdminCspHeaders({ mode: 'report-only', reportUri: '/api/csp-report' }) }after the site-wide one, andsrc/app/api/csp-report/route.ts=export const POST = createCspReportRoute(). Flags: what the panel's Site integrations and the code load (analytics, metaPixel, linkedIn, tiktok, clarity, turnstile, youtube, googleMaps); anything else →extra. Check:curl -sI localhost:3000/pl | grep -iE 'content-security-policy-report-only|reporting-endpoints'; the main pages and/adminin a browser, accept the cookie banner → no[Report Only]lines in the console. Deploy. - Enforce later — after a few days of clean
[csp]lines in the Coolify logs:mode: 'enforce'in both places, redeploy, check the pages again. Record the date inAGENTS.md→ "Project decisions".
2. Inventory (no code changes)
For every item in the PROGRAMISTA §6 table show evidence (grep / file) of whether
it applies to the project. Run the ipal-audit skill (--quick) and attach the result.
Result: a prioritised to-do list — carry it out right away. Stop
only before an irreversible change (data migration with content → ipal-migrate-fields,
changing published slugs).
3. Item by item
One item = one change = one commit:
- read the docs file it points to,
- replace the local code with the plugin function, remove the old code (do not keep both),
pnpm build— it passes before you take the next item.
Items that rename fields in the database (e.g. the ctaLabel → links refactor)
need a data migration before the old fields are removed — ask
the user whether the project already has content.
4. Finish
A full ipal-audit with no errors + a list of things to check in the admin panel.