Merge claude/admin-white-label-meta: admin link previews, agency option

adminMeta (default on): panel title suffix, description, og:site_name, preview
image (/api/ipal/admin-og) and icon (/api/ipal/admin-icon) from Site settings,
robots noindex,nofollow on /admin; per-piece overrides, adminMeta: false, the
project's admin.meta wins. agency option (default Intecion.com, false = none).

Merge resolution:
- docs/CHANGELOG.md: one Unreleased section covering storage-keys and this
  branch (Changed: credit text; New: adminMeta, agency; upgrade step 4).
- dev importMap.js: regenerated with IPAL_DEV_2FA=1, so it keeps the TOTP
  entries (2FA fix) and adds AdminIcon, AdminLogo, IntecionCredit (whiteLabel).
This commit is contained in:
Radosław Smoliński
2026-10-29 11:38:17 +01:00
17 changed files with 670 additions and 31 deletions
+23 -1
View File
@@ -11,7 +11,8 @@ once there are more than 20.
## Unreleased
The theme choice moves to the standard `theme` key, the cookie scanner declares the plugin's own browser-storage
key, and the cookie list tells cookies from browser storage.
key, and the cookie list tells cookies from browser storage. A pasted `/admin` link now shows the site's own name,
description and preview image instead of Payload's, and search engines are told not to index the panel.
### Changed
- **Theme key** `ipal-theme` → **`theme`** (`THEME_STORAGE_KEY`), the key and `light` / `dark` values next-themes uses.
@@ -19,6 +20,8 @@ key, and the cookie list tells cookies from browser storage.
(no flash) and removes the old key; `useTheme` / `<ThemeSwitcher>` do the same on pages without the script
(`migrateThemeStorage`, `LEGACY_THEME_STORAGE_KEY`). A project that also runs next-themes now shares the key —
set `ipalKit({ theme: { storageKey } })` to keep them apart.
- **White-label credit text** "Technology supported by Intecion.com" → **"Technology support: Intecion.com"** (pl:
"Wsparcie technologiczne: Intecion.com"), with the name from the `agency` option.
### New
- **`theme.storageKey`** option (`ThemeOptions`): `getSiteShell().theme.storageKey` → `<ThemeScript>` →
@@ -32,6 +35,19 @@ key, and the cookie list tells cookies from browser storage.
`<CookieTable>` adds a **Type** column when the list has a storage entry (`storageColumn`, `storageTypes`,
`COOKIE_STORAGE_LABELS`). `CookieTableRow.storage`, `texts.details.storage` / `.storageTypes`, type `ConsentStorage`.
The approval page marks storage entries.
- **Admin link previews** (`adminMeta`, default on): the panel's `<title>` suffix, description, `og:site_name`,
preview image and favicon come from Site settings (site name, logo, site icon), and `/admin` gets
`robots: noindex, nofollow`. The preview image is `GET /api/ipal/admin-og` (1200×630 PNG rendered with next/og:
the logo or site name, "Administration panel", a technology-support line) and the icon `GET /api/ipal/admin-icon`.
Both are public, like the link previews that fetch them, and show only what Site settings already serves
publicly (name, logo, icon). Per piece: `adminMeta: { description, image, icons, robots, titleSuffix, language }`
(`false` for a piece = Payload's own); `adminMeta: false` turns it all off; keys the project sets in its own
`admin.meta` always win. Building blocks: `buildAdminMeta`, `adminMetaForSite`, `syncAdminMeta`,
`buildAdminImageEndpoints`, `ADMIN_META_TEXTS`, types `AdminMetaOptions`, `ResolvedAdminMeta` (white-label.md).
- **`agency`** option (default `{ name: 'Intecion.com', url: 'https://intecion.com' }`, `AgencyOption`,
`DEFAULT_AGENCY`): the technology-support name in the white-label credit, the admin description and the preview
image. Another agency: `agency: { name, url }`; none anywhere: `agency: false`. The credit itself still turns off
with `whiteLabel: { credit: false }`.
### What projects must update
1. **Migration (Postgres / SQLite):** `pnpm payload migrate:create cookie-storage-type` — it only adds
@@ -40,6 +56,12 @@ key, and the cookie list tells cookies from browser storage.
2. A project that reads `localStorage.getItem('ipal-theme')` itself: use `THEME_STORAGE_KEY` (or `documentThemeStorageKey()`).
3. Cookie list: after the next **Scan cookies**, approve the new *theme* entry; remove an old *ipal-theme* row from
*Cookies → Cookie list* once the site runs this version.
4. **Admin link previews:** nothing required — the preview, noindex and favicon come from Site settings by default.
Remove a hand-written `admin.meta` that only set the panel title, description, `openGraph` or `robots: noindex`
(keep any key you really want: your `admin.meta` keys win). With `whiteLabel`, the credit reads "Technology support:
Intecion.com"; `agency: false` or `whiteLabel: { credit: false }` to remove it. No new admin components (the import
map is unchanged). **Check:** `curl -s $URL/admin/login | grep -E 'og:|robots'`, open `$URL/api/ipal/admin-og`, and
paste an `/admin` link in Slack or Messenger.
## 1.14.4
+1
View File
@@ -954,6 +954,7 @@ project → **plugin gap**, not a copy.
| Mail | `email: mailAdapter()`, `sendEmail` | email.md |
| Env validation, health | `assertEnv(ipalEnvRules({…}))` (`/env`), `healthRoute` | env.md |
| 2FA, white-label, headers | `twoFactor: { issuer, plugin: payloadTotp }`, `whiteLabel`, `buildSecurityHeaders` | security.md, white-label.md |
| Panel link preview + noindex (site name, description, preview image, technology support credit) | on by default (`adminMeta`, `agency`) — do not hand-write `admin.meta` for it; override single keys in `admin.meta` or `adminMeta: { … }` | white-label.md |
| Rate limit (forms, MCP, search) | built in; IP from `IPAL_IP_HEADER`; several instances → `setRateLimitStore` | forms.md |
**Compliance (PL/EU) — the mechanism from the plugin, the content from the client:** policy pages
+3 -1
View File
@@ -39,7 +39,9 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
| `whiteLabel.settingsSlug` | `'site-settings'` | global it reads the logo/name from | — |
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site settings | any upload/text field |
| `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — |
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks` | `false`; `{ text, url }` overrides |
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks`: "Technology support: Intecion.com" (en/pl, from `agency`) | `false`; `{ text, url }` overrides |
| `agency` | `{ name: 'Intecion.com', url: 'https://intecion.com' }` | the credit line, the panel's link description and preview image | `{ name, url }` = another agency; `false` = none anywhere |
| `adminMeta` | on (with or without `whiteLabel`) | panel `<head>`: `robots` noindex/nofollow, `titleSuffix` "— <site> \| Panel", `og:site_name` + description from Site settings (refreshed on save), `og:image` `GET /api/ipal/admin-og` (1200×630 from the logo or name), icon `GET /api/ipal/admin-icon` (favicon or initials); no import map step | `false` = Payload defaults; `{ robots, titleSuffix, description, image, icons, language }` (each `false` or your value; `{site}`, `{agency}` placeholders); your own `admin.meta` keys always win. Check: `curl -s $URL/admin/login \| grep -E 'og:\|robots'` (white-label.md) |
| `pages` | none | Site settings → **System pages** (page roles) and **Maintenance** tabs | omit → neither tab |
| `pages.slug` | — (required in `pages`) | the project's pages collection (System pages relations, construction, IndexNow) | — |
| `pages.roles` | all: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` | which assignments to show | subset of the array |
@@ -32,7 +32,11 @@ Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT
| `CookieCrawlAlert` | `@intecion/ipal-kit/admin` | Server Component: dashboard warning — "Waiting for approval: N" with a link to the approval view, and with the crawl violations or a failed crawl; renders nothing otherwise. Props `approval`, `crawl`. Injected with `cookieScanner` (`approval.dashboard: false` / `crawl.dashboard: false` drop its parts); after turning it on, `pnpm generate:importmap`. |
| `CookieScanButton` | `@intecion/ipal-kit/admin` | "Scan cookies" box above the *Cookie review* list: integrations in use, optional extra names, runs `POST /api/ipal/cookie-scan`. Injected by the plugin with `cookieScanner`; after turning it on, `pnpm generate:importmap`. |
| `TotpRedirectProvider` | `@intecion/ipal-kit/admin` | Client admin provider: sends a user without TOTP to `/admin/setup-totp?back=…` and a user whose session has not passed TOTP to `/admin/verify-totp?back=…` (path read in the browser; never redirects away from those screens or logout; renders nothing while redirecting). Injected by the plugin with `twoFactor` in place of the package's header-based provider; swap with `twoFactor.provider`. After upgrading, `pnpm generate:importmap`. Check: a new admin lands on `setup-totp?back=%2Fadmin` with the QR code. Props type `TotpRedirectProviderProps` (`forceSetup`) |
| `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology supported by Intecion.com" below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }`. |
| `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology support: Intecion.com" (admin language; `agency` prop = the name) below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }` or `agency: false`. |
| `buildAdminMeta({ agency, apiRoute?, defaultLocale?, meta?, options? })` | `@intecion/ipal-kit` | The `adminMeta` step: static panel meta (robots, preview image, icon) without overwriting keys in `meta`; returns `{ meta, resolved }` |
| `adminMetaForSite(site, resolved)`, `syncAdminMeta(payload, resolved, { nameField?, settingsSlug? })` | `@intecion/ipal-kit` | Site-name parts (suffix, description, siteName); `syncAdminMeta` writes them into the live config (onInit + Site settings afterChange, never throws) |
| `buildAdminImageEndpoints(resolved, { settingsSlug?, nameField?, logoField?, iconField? })` | `@intecion/ipal-kit` | `GET /api/ipal/admin-og` (1200×630 PNG via `next/og`) and `GET /api/ipal/admin-icon` (favicon redirect or initials) — already added by `adminMeta` |
| `DEFAULT_AGENCY`, `ADMIN_META_TEXTS` | `@intecion/ipal-kit` | Default agency `{ name: 'Intecion.com', url }`; en/pl meta texts (`{site}`, `{agency}`). Types `AdminMetaOptions`, `AgencyOption`, `ResolvedAdminMeta` |
## Readable array rows in the panel (`admin-ui`) — details: `node_modules/@intecion/ipal-kit/docs/links.md`
+4
View File
@@ -163,6 +163,10 @@ the panel shows Site settings, Site integrations, Cookie banner, Notifications,
win; a function `(global) => global` takes over). Without `revalidatePath` global saves wait for the ISR window.
- `whiteLabel: { credit: false, titleSuffix, settingsSlug, logoField, … }`; with `whiteLabel` the plugin overrides
`graphics.Logo/Icon` — your own graphics only without it.
- Panel link preview (`adminMeta`, on): noindex/nofollow, "— <site> | Panel" suffix, site name, description and
preview image (`/api/ipal/admin-og`) from Site settings; `agency` names who supports the technology (default
Intecion.com). Turn off: `adminMeta: false`, `agency: false`; your own `admin.meta` keys win. Check:
`curl -s localhost:3000/admin/login | grep -E 'og:|robots'` → `noindex, nofollow`, `og:site_name` = Site settings name.
- Mail: any Payload adapter instead of `mailAdapter()`; `mailAdapter({ fallbackFromAddress, smtp, graph })`.
- R2: other storage-s3 options (prefix, clientUploads) → call `s3Storage` yourself instead of `buildR2Storage`.
- `forms: { adminGroup, fields, formOverrides, formSubmissionOverrides, beforeEmail, emailLayout }` (forms.md).
+5
View File
@@ -159,6 +159,11 @@ Cookies in every language; the dashboard shows the reminder while cookies wait.
**Check:** one **Cookies** entry in the admin navigation; its tabs list the review entries and the site check;
type a cookie purpose in one language and save → the other languages show it, and a language with its own text keeps it.
**→ panel link preview (`adminMeta`, `agency`):** remove a hand-written `admin.meta` that only set
the panel title, description, `openGraph` or `robots: noindex` — the plugin now fills them from Site settings
(keep any key you really want: your `admin.meta` keys win). The credit reads "Technology support: Intecion.com".
Check: `curl -s $URL/admin/login | grep -E 'og:|robots'` and paste an `/admin` link in Slack.
## 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.
+51 -14
View File
@@ -43,29 +43,66 @@ whiteLabel: {
| `nameField` | `'siteName'` | text fallback (localized → current locale, then the first available) |
| `logoField` | `'logo'` | `graphics.Logo` → `AdminLogo` |
| `iconField` | `'favicon'` | `graphics.Icon` → `AdminIcon` (max 28×28 px) |
| `titleSuffix` | none | `admin.meta.titleSuffix` |
| `titleSuffix` | none (`adminMeta` builds one from the site name) | static `admin.meta.titleSuffix`, wins over `adminMeta` |
| `credit` | `true` | `false` or `{ text?, url? }` |
The plugin overrides `admin.components.graphics.Logo` / `Icon` from the project config (its
values win over yours); `afterLogin` / `afterNavLinks` are appended.
## Vendor credit — "Technology supported by Intecion.com"
## Technology support credit — "Technology support: Intecion.com"
A discreet credit **"Technology supported by Intecion.com"** (a link to
`https://intecion.com`) appears in **two places**:
A discreet line **"Technology support: Intecion.com"** (pl `Wsparcie technologiczne: Intecion.com`,
a link to `https://intecion.com`) appears in **two places**:
- **under the panel navigation** (`afterNavLinks`, variant `nav` — left-aligned),
- **at the bottom of the login screen** (`afterLogin`, variant `login` — centered).
It is a credit for the technology VENDOR (Intecion provides the ipal-kit framework) — the client's
brand still owns the logo and name; this is just a "who supports the technology" line.
It credits who supports the technology — the client's brand still owns the logo and name.
The agency comes from the top-level `agency` option (default `{ name: 'Intecion.com', url: 'https://intecion.com' }`),
the same one the panel's link preview uses (below).
On by default with `whiteLabel`. Control:
```ts
whiteLabel: { credit: false } // hide (both places)
whiteLabel: { credit: { text: 'Powered by Intecion', url: 'https://intecion.com' } } // custom text/url
ipalKit({ agency: { name: 'Studio X', url: 'https://studio.example' } }) // another agency, everywhere
ipalKit({ agency: false }) // no agency anywhere
whiteLabel: { credit: false } // hide the line (both places)
whiteLabel: { credit: { text: 'Powered by Intecion', url: 'https://intecion.com' } } // own text/url
```
The default text follows the admin language (key `brandingCredit`, `{{agency}}` placeholder);
override it per language in `i18n.translations.<lang>.ipal.brandingCredit`.
## Link previews and search engines — `adminMeta` (on by default)
A pasted `/admin` link (Slack, Messenger, Teams…) used to show "Payload App" and Payload's generic
image. The plugin now fills the panel's `<head>` from Site settings, **with or without `whiteLabel`**:
| Piece | Default | Turn off / override |
|---|---|---|
| robots | `noindex, nofollow` on every panel page | `adminMeta: { robots: false }` or `{ robots: { index, follow } }`; your `admin.meta.robots` wins |
| title suffix | `— <site name> \| Panel` | `adminMeta: { titleSuffix: '· {site} admin' }` or `false`; `whiteLabel.titleSuffix` / your `admin.meta.titleSuffix` win |
| `og:site_name` | the site name | your `admin.meta.openGraph.siteName` wins |
| description | "Administration panel of <site>. Built on Payload CMS, technology support: Intecion.com." (Polish when the site's default locale is `pl`) | `adminMeta: { description: 'Panel of {site}' }` (string or `{ en, pl }`), `false`; `language: 'en' \| 'pl'`; your `admin.meta.description` wins |
| preview image | `GET /api/ipal/admin-og` — 1200×630 PNG: the site's logo (or name), "Administration panel", "Technology support: Intecion.com" | `adminMeta: { image: '/my-og.png' }` or `false`; your `admin.meta.openGraph.images` wins |
| icon | `GET /api/ipal/admin-icon` — redirects to the site's favicon, or draws the initials | `adminMeta: { icons: false }`; your `admin.meta.icons` win |
| everything | on | `adminMeta: false` = Payload's defaults |
- **How:** Payload builds every panel page's metadata from `config.admin.meta`. The plugin sets the
static parts at config time and fills the site-name parts on start and after every Site settings save
(`syncAdminMeta`). Keys you set in `admin.meta` are never touched.
- **The image** is drawn on the server with `next/og` (no external service, cached 1 h). The logo is
read from the upload itself: PNG, JPG, GIF or SVG; a WebP/AVIF logo falls back to the site name.
The image endpoints are public (link previews fetch without a session) and show only the logo and
name the site shows anyway. Fields: `whiteLabel.settingsSlug` / `nameField` / `logoField` / `iconField`.
- **No import map step** — no new admin components (endpoints only).
- **Search engines:** besides the `noindex, nofollow` meta, `getRobots()` already disallows `/admin`
(and `/api`) in robots.txt; `IPAL_NOINDEX=1` adds `X-Robots-Tag` to every response on staging.
- **Building blocks:** `buildAdminMeta`, `adminMetaForSite`, `syncAdminMeta`, `buildAdminImageEndpoints`,
`DEFAULT_AGENCY`, `ADMIN_META_TEXTS`; types `AdminMetaOptions`, `AgencyOption`, `ResolvedAdminMeta`.
- **Verify:** `curl -s $URL/admin/login | grep -E 'og:|robots|<title'` → `noindex, nofollow`,
`og:site_name` = the site name, `og:image` = `/api/ipal/admin-og`; open `$URL/api/ipal/admin-og` → the
preview image; paste the link in Slack → the site's name and image.
## Logo on the login screen
`AdminLogo` is the LARGE logo on the login screen (Payload uses `graphics.Icon` for
@@ -87,9 +124,8 @@ through `AdminIcon`.
## Limits
- **`titleSuffix` is static** — the browser tab title is set in the
config (build time), so it is not read from the database. The logo and icon (what you see) are
dynamic from SiteSettings; give the title suffix in the option if you want one.
- **`whiteLabel.titleSuffix` is static** (config time). Without it, `adminMeta` builds the suffix from
the site name in Site settings and refreshes it after every save.
- **This is panel branding, not the front end** — you build the public site's look as before
(blocks, project styles). White-label applies only to the admin panel.
- Set the panel path (`/admin → /its`) separately with `adminRoute` — see
@@ -104,9 +140,10 @@ through `AdminIcon`.
## Turn off, override, extend
- **Turn off:** without `whiteLabel` (default) the panel has Payload branding; `credit: false` hides the credit.
- **Turn off:** without `whiteLabel` (default) the panel has Payload branding; `credit: false` hides the credit;
`agency: false` removes the agency everywhere; `adminMeta: false` restores Payload's link preview.
- **Override:** other fields / global (`settingsSlug`, `nameField`, `logoField`, `iconField`), credit text and URL,
`titleSuffix`. With `whiteLabel` on, the plugin overrides `graphics.Logo` / `Icon` from the project
config — set your own graphics components without `whiteLabel`.
- **Extend:** `AdminLogo`, `AdminIcon`, `IntecionCredit` from `@intecion/ipal-kit/admin` can be wired
manually into `admin.components` with your own `serverProps`.
- **Extend:** `AdminLogo`, `AdminIcon`, `IntecionCredit` (props `agency`, `text`, `url`, `variant`) from
`@intecion/ipal-kit/admin` can be wired manually into `admin.components` with your own `serverProps`.