Docs in English (part 1), seeding guide, Coolify deployment

- Translate to English every doc the code branches did not touch: AGENT.md,
  developer guide, vibe, CHANGELOG, docs index, module pages, all skills
  except ipal-seo-check (14 pages follow after the security/SEO merge).
  Placeholder marker is now [TO FILL: …]; skill resources renamed to
  section-code.md / nav-code.md. AGENT.md and the ipal-skills pointer
  block say the docs are in English.
- docs/seeding.md: create-only, natural keys, never delete, no users or
  secrets, empty-field globals, fallbackLocale: false, dry run, backup and
  restore, production update guard, seeds vs migrations, Coolify Terminal.
  Seed templates gain --dry-run, the SEED_UPDATE production guard
  (IPAL_SEED_ALLOW_PROD_UPDATE), skip of edited records and a summary.
  "Seeding on production" rule block in AGENT.md.
- Coolify is the single deployment path (deployment, env, developer guide,
  ipal-setup): build vs runtime env, migrations on container start
  (prodMigrations), health check and rolling updates, rollback, backups and
  restore, DNS/Let's Encrypt/CAA. R2: custom domain needs a Cloudflare zone;
  default is media served by the app (R2_PUBLIC_URL empty).
- docsConsistency: no Polish prose outside code/quoted data (pending pages
  listed); IPAL_* names may also be read by shipped skill templates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:39:03 +02:00
co-authored by Claude Opus 5.5
parent 6e3979bae6
commit 2d9f3e15d4
47 changed files with 6102 additions and 5355 deletions
+41 -41
View File
@@ -1,77 +1,77 @@
# integrations — global Site Integrations i status integracji w panelu
# integrations — the Site Integrations global and integration status in the admin panel
Klucze usług zewnętrznych edytowane w panelu oraz informacja dla redaktora, że któraś z nich
przestała działać — bez cronów i pollingu: status zapisuje serwer, gdy faktycznie używa integracji.
External service keys edited in the admin panel, plus a notice for the editor when one of them
stops working — no crons, no polling: the server records the status when it actually uses an integration.
Powiązane: [email.md](./email.md) (SMTP/Graph), [turnstile.md](./turnstile.md),
Related: [email.md](./email.md) (SMTP/Graph), [turnstile.md](./turnstile.md),
[analytics.md](./analytics.md), [seo.md](./seo.md) (IndexNow), [deployment.md](./deployment.md).
## Global `site-integrations` (panel: Settings → Site Integrations)
## The `site-integrations` global (panel: Settings → Site Integrations)
Dodawany przez plugin zawsze. Zakładki (nienazwane — dane płaskie, np. `ga4MeasurementId`):
Currently always added by the plugin. Tabs (unnamed — flat data, e.g. `ga4MeasurementId`):
| Zakładka | Pola |
| Tab | Fields |
|---|---|
| Analytics | `ga4MeasurementId`, `gtmContainerId`, `metaPixelId`, `clarityProjectId`, `linkedInPartnerId`, `tiktokPixelId` |
| Turnstile | `turnstileSiteKey`, `turnstileSecretKey`, ukryty `turnstileStatus` + baner |
| SMTP | `emailTransport` (`smtp` / `graph`), `smtpHost`, `smtpPort`, `smtpUser`, `smtpPassword`, `smtpFromAddress`, `smtpFromName`, przycisk testu, ukryty `emailStatus` + baner |
| IndexNow | `indexNowKey` (generowany przy pierwszym zapisie) |
| Custom | pola z opcji `integrationsFields` — tylko gdy podane |
| Turnstile | `turnstileSiteKey`, `turnstileSecretKey`, hidden `turnstileStatus` + banner |
| SMTP | `emailTransport` (`smtp` / `graph`), `smtpHost`, `smtpPort`, `smtpUser`, `smtpPassword`, `smtpFromAddress`, `smtpFromName`, test button, hidden `emailStatus` + banner |
| IndexNow | `indexNowKey` (generated on first save) |
| Custom | fields from the `integrationsFields` option — only when given |
Dostęp: odczyt i zapis tylko dla roli `admin` (sekrety) — anonimowi i redaktorzy nie dostaną nic
przez REST/GraphQL. Po stronie serwera czytaj przez Local API:
Access: read and write only for the `admin` role (secrets) — anonymous users and editors get nothing
over REST/GraphQL. On the server, read through the Local API:
```ts
import { getSiteIntegrations } from '@intecion/ipal-kit'
const integrations = await getSiteIntegrations<SiteIntegration>(payload) // overrideAccess — nie wysyłaj całości do przeglądarki
const integrations = await getSiteIntegrations<SiteIntegration>(payload) // overrideAccess — do not send the whole thing to the browser
```
Przycisk „Send test” (SMTP) woła `POST /api/ipal/test-email` (endpoint dodawany zawsze).
The "Send test" button (SMTP) calls `POST /api/ipal/test-email` (endpoint currently always added).
## Status integracji — alert na dashboardzie i baner na zakładce
## Integration status — dashboard alert and tab banner
- **Zapis:** `mailAdapter()` przy każdej wysyłce (`emailStatus`) i weryfikacja Turnstile przy
formularzu (`turnstileStatus`) wołają `recordIntegrationStatus`. Zapis tylko przy zmianie stanu
albo co najwyżej co 10 min, gdy błąd trwa; nigdy nie rzuca wyjątku.
- **Zmiana kluczy w panelu** (Turnstile, `emailTransport` / `smtp*`) czyści stary status tej integracji.
- **`IntegrationAlerts`** (`@intecion/ipal-kit/admin`) — plugin wpina go zawsze w
`admin.components.beforeDashboard`: lista integracji w stanie `degraded` + problemy z kluczami
Turnstile + link „Open Site Integrations” (z `adminRoute`). Gdy wszystko działa — nic nie renderuje.
- **`IntegrationStatusBanner`** (`/admin`) — baner na zakładce: czerwony przy błędzie (komunikat,
kod, od kiedy), zielona linia po naprawie, nic przed pierwszym użyciem.
- **Write:** `mailAdapter()` on every send (`emailStatus`) and Turnstile verification on a
form (`turnstileStatus`) call `recordIntegrationStatus`. It writes only when the state changes,
or at most every 10 min while an error lasts; it never throws.
- **Changing keys in the admin panel** (Turnstile, `emailTransport` / `smtp*`) clears that integration's old status.
- **`IntegrationAlerts`** (`@intecion/ipal-kit/admin`) — the plugin always wires it into
`admin.components.beforeDashboard`: a list of integrations in the `degraded` state + Turnstile key
problems + an "Open Site Integrations" link (from `adminRoute`). When everything works it renders nothing.
- **`IntegrationStatusBanner`** (`/admin`) — a banner on the tab: red on error (message,
code, since when), a green line after a fix, nothing before first use.
## Klocki do własnych integracji
## Building blocks for your own integrations
Ten sam mechanizm dla integracji projektu (pola przez `integrationsFields`):
The same mechanism for project integrations (fields via `integrationsFields`):
```ts
import { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus } from '@intecion/ipal-kit'
ipalKit({
integrationsFields: [
buildIntegrationStatusBanner('crmStatus', 'CRM'), // pole UI `crmStatusBanner`
buildIntegrationStatusBanner('crmStatus', 'CRM'), // UI field `crmStatusBanner`
{ name: 'crmApiKey', type: 'text' },
buildIntegrationStatusField('crmStatus'), // ukryta grupa: state, code, message, since, checkedAt
buildIntegrationStatusField('crmStatus'), // hidden group: state, code, message, since, checkedAt
],
})
// po wywołaniu CRM (previous = aktualny crmStatus z getSiteIntegrations)
// after calling the CRM (previous = the current crmStatus from getSiteIntegrations)
await recordIntegrationStatus(payload, 'crmStatus', previous, { state: 'degraded', code: 'http-500', message: 'CRM is down' })
await recordIntegrationStatus(payload, 'crmStatus', previous, { state: 'ok' })
```
Po dodaniu banera: `pnpm payload generate:importmap`; Postgres: `migrate:create`.
After adding the banner: `pnpm payload generate:importmap`; Postgres: `migrate:create`.
Typy: `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus`. Dashboardowy
`IntegrationAlerts` sprawdza domyślnie tylko `emailStatus` i `turnstileStatus` (prop `checks`) —
własną integrację pokażesz, wpinając drugi `IntegrationAlerts` z `checks: { crmStatus: 'CRM' }`
w `beforeDashboard`.
Types: `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus`. The dashboard
`IntegrationAlerts` checks only `emailStatus` and `turnstileStatus` by default (prop `checks`) —
to show your own integration, wire a second `IntegrationAlerts` with `checks: { crmStatus: 'CRM' }`
into `beforeDashboard`.
## Wyłącz / nadpisz
## Turn off / override
- Global `site-integrations`, endpoint `/api/ipal/test-email` i `IntegrationAlerts` na dashboardzie
są **obecnie zawsze dodawane** — nie ma opcji, żeby je wyłączyć. Obejście: plugin projektu
wpięty po `ipalKit()`, który usuwa / podmienia wpis w `config.globals`, `config.endpoints` albo
- The `site-integrations` global, the `/api/ipal/test-email` endpoint and `IntegrationAlerts` on the dashboard
are **currently always added** — there is no option to turn them off. Workaround: a project plugin
wired after `ipalKit()` that removes / replaces the entry in `config.globals`, `config.endpoints` or
`admin.components.beforeDashboard`.
- Rozszerzenie: `integrationsFields` (zakładka Custom). Zakładek, dostępu i etykiet pluginu nie da
się obecnie nadpisać opcją.
- Extension: `integrationsFields` (Custom tab). The plugin's tabs, access and labels cannot
currently be overridden with an option.