Admin link previews: site name, description, preview image, noindex; technology support credit

- adminMeta (default on, with or without whiteLabel): robots noindex/nofollow,
  title suffix "— <site> | Panel", og:site_name and en/pl description from
  Site settings, preview image GET /api/ipal/admin-og (next/og, from the logo
  or name, no external service) and icon GET /api/ipal/admin-icon
- the site name sits in a process-wide store read through getters, so link
  previews stay current after a Site settings save and across config loads
- agency option (default Intecion.com) feeds the credit, description and image;
  credit reads "Technology support: Intecion.com" (pl: Wsparcie technologiczne)
- the project's own admin.meta keys always win; adminMeta: false / agency: false
- dev: whiteLabel on; docs: white-label.md, AGENT.md, ipal-reference/setup/upgrade

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 11:31:42 +01:00
co-authored by Claude Opus 5.5
parent 6998b44431
commit 3c828d963d
16 changed files with 647 additions and 38 deletions
+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`.