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,33 +1,33 @@
# payload-helpers
Typowany dostęp do globali pluginu (SiteSettings, SiteIntegrations) przez
Local API. Zgodnie z zasadą: helpery przyjmują `payload` jako argument —
plugin nigdy nie woła `getPayload` sam.
Typed access to the plugin's globals (SiteSettings, SiteIntegrations) through the
Local API. Following the rule: helpers take `payload` as an argument —
the plugin never calls `getPayload` itself.
## Config
Globale `site-settings` (`SITE_SETTINGS_SLUG`), `site-integrations` (`SITE_INTEGRATIONS_SLUG`),
`cookie-settings` i `notifications` są **obecnie zawsze dodawane** przez plugin (gdy
`enabled !== false`) — nie ma opcji, żeby je pominąć albo zmienić im slug.
The `site-settings` (`SITE_SETTINGS_SLUG`), `site-integrations` (`SITE_INTEGRATIONS_SLUG`),
`cookie-settings` and `notifications` globals are **currently always added** by the plugin (when
`enabled !== false`) — there is no option to skip them or change their slug.
| Opcja `ipalKit()` | Co robi |
| `ipalKit()` option | What it does |
|---|---|
| `siteSettingsFields?: Field[]` | dodatkowe pola SiteSettings w osobnym tabie **„Custom”** (dane płasko: `settings.mojePole`) |
| `integrationsFields?: Field[]` | dodatkowe pola SiteIntegrations w tabie „Custom” |
| `siteSettingsFields?: Field[]` | extra SiteSettings fields in a separate **"Custom"** tab (flat data: `settings.myField`) |
| `integrationsFields?: Field[]` | extra SiteIntegrations fields in the "Custom" tab |
Taby SiteSettings (nienazwane — dane płaskie): **General** (`siteName`, `siteDescription`,
SiteSettings tabs (unnamed — flat data): **General** (`siteName`, `siteDescription`,
`titleOrder`, `titleSeparator`, `logo`, `defaultShareImage`, `sameAs`, `favicon`, …),
**Theme** (`defaultTheme`, `allowThemeToggle`, `themeToggleLabel`), **System Pages**
(z `pages` / `content`), **Emails** (z `forms.emailLayout`), **Under construction**
(z `pages`), **Custom** (z `siteSettingsFields`).
(from `pages` / `content`), **Emails** (from `forms.emailLayout`), **Under construction**
(from `pages`), **Custom** (from `siteSettingsFields`).
**Dostęp:** SiteSettings ma `read: () => true` — **cały global, także pola z
`siteSettingsFields`, jest publiczny** przez REST/GraphQL (`/api/globals/site-settings`).
Nie trzymaj tam niczego poufnego (do tego SiteIntegrations, `read`/`update` tylko admin).
SiteSettings nie ustawia `update` — obowiązuje domyślne Payloada (każdy zalogowany
użytkownik kolekcji auth).
**Access:** SiteSettings has `read: () => true` — **the whole global, including fields from
`siteSettingsFields`, is public** over REST/GraphQL (`/api/globals/site-settings`).
Keep nothing confidential there (use SiteIntegrations for that, `read`/`update` admin only).
SiteSettings does not set `update` — Payload's default applies (any logged-in
user of an auth collection).
## Front — odczyt globali
## Front end — reading globals
```ts
import { getSiteSettings, getSiteIntegrations } from '@intecion/ipal-kit'
@@ -35,50 +35,50 @@ import type { SiteSetting, SiteIntegration } from '@/payload-types'
const payload = await getPayload({ config })
// SiteSettings (publiczne — siteName, logo, favicon, theme, system pages)
// SiteSettings (public — siteName, logo, favicon, theme, system pages)
const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })
// SiteIntegrations (admin-only; Local API omija access control)
// SiteIntegrations (admin-only; the Local API bypasses access control)
const integrations = await getSiteIntegrations<SiteIntegration>(payload)
```
Generyk `<T>` pozwala wstrzyknąć wygenerowany typ klienta. Bez niego zwraca
The generic `<T>` lets you inject the client's generated type. Without it, it returns
`Record<string, unknown>`.
Opcje (`GlobalQueryOptions`): `locale` (kod albo `'all'`; brak → domyślny Payloada),
`depth` (brak → domyślny Payloada). Helpery nie łapią błędów i nie cache'ują — w
Next używaj `getSettings(locale)` z `@/lib/content` (React `cache()`, `depth: 2`).
Options (`GlobalQueryOptions`): `locale` (a code or `'all'`; none → Payload's default),
`depth` (none → Payload's default). The helpers don't catch errors and don't cache — in
Next use `getSettings(locale)` from `@/lib/content` (React `cache()`, `depth: 2`).
## ⚠️ SiteIntegrations zawiera sekrety
## ⚠️ SiteIntegrations holds secrets
Local API domyślnie omija access control (`overrideAccess: true`), więc
`getSiteIntegrations` **zwróci sekrety** (SMTP password, Turnstile secret,
R2 keys) mimo bariery admin-only na globalu. To zamierzone — logika serwerowa
tego potrzebuje.
The Local API bypasses access control by default (`overrideAccess: true`), so
`getSiteIntegrations` **returns secrets** (SMTP password, Turnstile secret,
R2 keys) despite the admin-only barrier on the global. This is intended — server logic
needs them.
**Nigdy nie przekazuj surowego wyniku do przeglądarki.** Czytaj konkretne
wartości server-side, do klienta wysyłaj tylko bezpieczne (np. `turnstileSiteKey`,
nie `turnstileSecretKey`):
**Never pass the raw result to the browser.** Read specific
values server-side, send only safe ones to the client (e.g. `turnstileSiteKey`,
not `turnstileSecretKey`):
```ts
// ŹLE — wyciek sekretów do klienta
// WRONG — leaks secrets to the client
return <Form data={await getSiteIntegrations(payload)} />
// DOBRZE — tylko publiczna wartość
// RIGHT — only the public value
const { turnstileSiteKey } = await getSiteIntegrations(payload)
return <Form siteKey={turnstileSiteKey} />
```
## Niższy poziom: getGlobal
## Lower level: getGlobal
```ts
import { getGlobal } from '@intecion/ipal-kit'
const data = await getGlobal<MyType>(payload, 'moj-global', { locale: 'pl', depth: 1 })
const data = await getGlobal<MyType>(payload, 'my-global', { locale: 'pl', depth: 1 })
```
## Wyłączenie, nadpisanie, rozszerzenie
## Turn off, override, extend
- Globale pluginu są obecnie zawsze dodawane (brak opcji wyłączenia / zmiany slugów); `enabled: false` usuwa cały plugin, razem z nimi.
- Rozszerzenie: `siteSettingsFields` / `integrationsFields` (tab „Custom”); kształt istniejących tabów jest stały.
- Dostęp, hooki i pola globalu zmienisz tylko nadpisując go w configu po `ipalKit` (własny plugin mapujący `config.globals`, przykład w hooks.md).
- `getGlobal(payload, slug, { locale, depth })` działa z dowolnym globalem projektu.
- The plugin's globals are currently always added (no option to turn them off / change slugs); `enabled: false` removes the whole plugin, including them.
- Extension: `siteSettingsFields` / `integrationsFields` (the "Custom" tab); the shape of the existing tabs is fixed.
- You can change a global's access, hooks and fields only by overriding it in the config after `ipalKit` (your own plugin mapping `config.globals`, example in hooks.md).
- `getGlobal(payload, slug, { locale, depth })` works with any project global.