IAPL rename: docs, agent guide, skills, reference site and starter on the new names; changelog draft
- docs, AGENT.md, the 16 skills, PROGRAMISTA and README use the preferred names (scripted, same list of forms); past CHANGELOG entries and the proposals in docs/dev are not rewritten - AGENT.md: 'Names: IAPL and ipal-kit' — old name, new name, state in 1.x; what is not renamed; storageNames - iapl-upgrade '→ 1.17.0', PROGRAMISTA §6 item 72, CHANGELOG 1.17.0 (draft): nothing required - env.md, doctor.md (legacy-names, storage-names), stats.md, security.md, project-starter.md, iapl-reference, iapl-setup - skill scripts read ipal-audit-skip and IPAL_IP_HEADER too; audit rule ids stay what they were - reference site: iapl(), iapl-doctor.json, iapl-* skills, storageNames: 'iapl'; INDEX.md regenerated Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
425fac14fb
commit
b91984fbcd
+17
-17
@@ -24,13 +24,13 @@ DATABASE_URI=mongodb://user:pass@mongo:27017/intecioncom_prod?authSource=admin
|
||||
# dev: …/intecioncom_dev, or file:./dev.db
|
||||
|
||||
# Payload secret (signs sessions/tokens) — random, long
|
||||
PAYLOAD_SECRET=<random-string-min-32-chars> # ipalEnvRules: ≥ 32 characters in production (secretMinLength)
|
||||
PAYLOAD_SECRET=<random-string-min-32-chars> # iaplEnvRules: ≥ 32 characters in production (secretMinLength)
|
||||
|
||||
# Public site URL (canonical, hreflang, OG, manifest)
|
||||
NEXT_PUBLIC_SERVER_URL=https://klient.pl # dev: http://localhost:3000
|
||||
```
|
||||
|
||||
**`PAYLOAD_SECRET` — length and changing it.** `ipalEnvRules` refuses a secret shorter than 32 characters in
|
||||
**`PAYLOAD_SECRET` — length and changing it.** `iaplEnvRules` refuses a secret shorter than 32 characters in
|
||||
production (`secretMinLength`; `0` turns the check off, outside production nothing is checked). Payload (3.94)
|
||||
derives its signing key from it (`sha256(secret)`, first 32 hex characters). Changing it on a live site therefore:
|
||||
- **logs everyone out** — every login token (the `payload-token` cookie, JWTs from login / refresh / password reset)
|
||||
@@ -40,7 +40,7 @@ derives its signing key from it (`sha256(secret)`, first 32 hex characters). Cha
|
||||
- **breaks stored API keys** (only in collections with `useAPIKey`) — Payload stores them encrypted with the secret
|
||||
and finds them by an HMAC of it: they no longer authenticate and cannot be revealed — generate new ones;
|
||||
- fails uploads that are in progress (client upload receipts are signed with it).
|
||||
ipal-kit itself derives nothing from it. Change it only with the owner's OK, at a quiet time, and tell the editors
|
||||
IAPL itself derives nothing from it. Change it only with the owner's OK, at a quiet time, and tell the editors
|
||||
they will have to log in again.
|
||||
|
||||
### Email — Graph (OPTIONAL, agency-level, when transport = Graph)
|
||||
@@ -75,7 +75,7 @@ URLs point at that domain. Outside production, `R2_PUBLIC_URL` alone → read-on
|
||||
| `DATABASE_URI` | ✅ | infra | database connection (read by the project config, not the plugin) |
|
||||
| `PAYLOAD_SECRET` | ✅ | infra | Payload secret (as above) |
|
||||
| `NEXT_PUBLIC_SERVER_URL` | ✅ | infra | public URL (canonical, OG, sitemap, IndexNow) |
|
||||
| `NODE_ENV` | ⬜ | infra | `production` tightens `ipalEnvRules` (R2 keys, `IPAL_IP_HEADER`) and turns off read-only media mode |
|
||||
| `NODE_ENV` | ⬜ | infra | `production` tightens `iaplEnvRules` (R2 keys, `IAPL_IP_HEADER`) and turns off read-only media mode |
|
||||
| `GRAPH_TENANT_ID` | ⬜ | email | Azure tenant (Graph) |
|
||||
| `GRAPH_CLIENT_ID` | ⬜ | email | Azure app id |
|
||||
| `GRAPH_CLIENT_SECRET` | ⬜ | email | Azure secret |
|
||||
@@ -85,14 +85,14 @@ URLs point at that domain. Outside production, `R2_PUBLIC_URL` alone → read-on
|
||||
| `R2_ACCESS_KEY_ID` | ⬜ (✅ prod) | storage | R2 key |
|
||||
| `R2_SECRET_ACCESS_KEY` | ⬜ (✅ prod) | storage | R2 secret |
|
||||
| `R2_PUBLIC_URL` | ⬜ (✅ prod only with `storage: { requirePublicUrl: true }`) | storage | media domain attached to the bucket; empty = media through the app (§6); dev: also the `/media` path |
|
||||
| `IPAL_IP_HEADER` | ⬜ (✅ prod) | forms | header with the real IP for the rate limit (`cf-connecting-ip`, `x-forwarded-for`); without it, a warning in the log |
|
||||
| `IAPL_IP_HEADER` | ⬜ (✅ prod) | forms | header with the real IP for the rate limit (`cf-connecting-ip`, `x-forwarded-for`); without it, a warning in the log |
|
||||
| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | ⬜ | forms | fallback when the Turnstile keys are not in Site integrations. **`TURNSTILE_SECRET_KEY` is deprecated** — put the secret key into the panel (turnstile.md); the variable keeps working until a later, announced release |
|
||||
| `INDEXNOW_KEY` | ⬜ | SEO | IndexNow key (takes precedence over the key from the panel) |
|
||||
| `IPAL_COOKIE_SCAN_URL`, `IPAL_COOKIE_SCAN_TOKEN` | ⬜ (✅ prod with `ipalEnvRules({ cookieCrawl: true })`) | consent | cookie crawl (`cookieScanner.crawl`): the shared scanner service's URL and this site's token ([cookie-scanner.md](./cookie-scanner.md#browser-crawl)) |
|
||||
| `IPAL_NOINDEX` | ⬜ | SEO | `1`/`true`/`yes` **on staging only** — the whole site is noindex (robots, meta, `X-Robots-Tag`) |
|
||||
| `IPAL_DOCTOR_TOKEN` | ⬜ | ops | ≥ 32 characters turns on the `ipal-doctor` status endpoint `GET /api/ipal/doctor` (404 without it) — [doctor.md](./doctor.md) |
|
||||
| `IAPL_COOKIE_SCAN_URL`, `IAPL_COOKIE_SCAN_TOKEN` | ⬜ (✅ prod with `iaplEnvRules({ cookieCrawl: true })`) | consent | cookie crawl (`cookieScanner.crawl`): the shared scanner service's URL and this site's token ([cookie-scanner.md](./cookie-scanner.md#browser-crawl)) |
|
||||
| `IAPL_NOINDEX` | ⬜ | SEO | `1`/`true`/`yes` **on staging only** — the whole site is noindex (robots, meta, `X-Robots-Tag`) |
|
||||
| `IAPL_DOCTOR_TOKEN` | ⬜ | ops | ≥ 32 characters turns on the `iapl-doctor` status endpoint `GET /api/ipal/doctor` (404 without it) — [doctor.md](./doctor.md) |
|
||||
|
||||
"✅ prod" = required by `ipalEnvRules({ storage: true })` / `({ ipHeader: true })` with
|
||||
"✅ prod" = required by `iaplEnvRules({ storage: true })` / `({ ipHeader: true })` with
|
||||
`NODE_ENV=production` — as long as the project runs the validation (env.md). The plugin itself does not stop
|
||||
startup when these variables are missing.
|
||||
|
||||
@@ -120,7 +120,7 @@ a template for the next person. Commit it; never commit `.env` (with values).
|
||||
- [ ] Media: R2 (served through the app, or a media domain on Cloudflare — §6), or a persistent volume (§4.8)
|
||||
- [ ] Media migration local→R2 (if you switch)
|
||||
- [ ] Policy pages + cookie banner ([PROGRAMISTA.md §5](./dev/PROGRAMISTA.md))
|
||||
- [ ] `IPAL_NOINDEX` NOT set in production
|
||||
- [ ] `IAPL_NOINDEX` NOT set in production
|
||||
|
||||
---
|
||||
|
||||
@@ -181,7 +181,7 @@ export const revalidate = 3600 // 1h; or shorter, or on-demand
|
||||
NOTE: ISR and `force-dynamic` are MUTUALLY EXCLUSIVE. Pages → ISR (revalidate).
|
||||
sitemap/robots → force-dynamic (they generate on request). Do not mix them on one
|
||||
route. Content from the panel: ISR = the editor waits for revalidation; consider on-demand
|
||||
revalidation (`buildRevalidateHook` on collections; plugin globals — `ipalKit({ revalidatePath })`; your own globals —
|
||||
revalidation (`buildRevalidateHook` on collections; plugin globals — `iapl({ revalidatePath })`; your own globals —
|
||||
`buildGlobalRevalidateHook`). See [seo.md](./seo.md), [hooks.md](./hooks.md).
|
||||
|
||||
## 3a3. SSG and database access at build time (IMPORTANT for SEO)
|
||||
@@ -275,7 +275,7 @@ Every project uses the same names, on MongoDB and Postgres: the site's domain **
|
||||
Mongo connection string), and set `DATABASE_URI` on the app to it.
|
||||
- A leading `www.` is not part of the name; a hyphen in the domain stays (quote the name in SQL:
|
||||
`CREATE DATABASE "my-sitepl_prod"`).
|
||||
- **Check:** `ipalEnvRules({ databaseName: true })` warns at startup (never fails) when the name in `DATABASE_URI`
|
||||
- **Check:** `iaplEnvRules({ databaseName: true })` warns at startup (never fails) when the name in `DATABASE_URI`
|
||||
does not match the domain in `NEXT_PUBLIC_SERVER_URL` (skipped for localhost). `{ domain: 'intecion.com' }` sets the
|
||||
domain, `{ warn }` replaces the console warning; leave the option out to turn the check off. Helpers:
|
||||
`databaseNamesFor`, `databaseNameFromUri`, `checkDatabaseName` from `@intecion/ipal-kit/env` (env.md).
|
||||
@@ -290,9 +290,9 @@ checkbox; default: both). A changed variable takes effect only after a **redeplo
|
||||
|---|---|---|---|
|
||||
| `NEXT_PUBLIC_SERVER_URL`, `NEXT_PUBLIC_TURNSTILE_SITE_KEY` (all `NEXT_PUBLIC_*`) | ✅ | ✅ | `next build` inlines them into the client bundle — missing at build = missing in the browser |
|
||||
| `DATABASE_URI`, `PAYLOAD_SECRET` | ✅ only if the build prerenders from the database (§3a3), otherwise ⬜ | ✅ | SSG (`generateStaticParams`) needs the database during `pnpm build`; DB-reading routes stay `force-dynamic` either way (§3b) |
|
||||
| `R2_*`, `GRAPH_*`, `TURNSTILE_SECRET_KEY`, `INDEXNOW_KEY`, `IPAL_IP_HEADER` | ⬜ | ✅ | read at runtime only — keep secrets out of the build |
|
||||
| `R2_*`, `GRAPH_*`, `TURNSTILE_SECRET_KEY`, `INDEXNOW_KEY`, `IAPL_IP_HEADER` | ⬜ | ✅ | read at runtime only — keep secrets out of the build |
|
||||
| `NODE_ENV` | — | — | do not set by hand: `next build` / `next start` use `production` |
|
||||
| `IPAL_NOINDEX` | — | ✅ staging only | never on production |
|
||||
| `IAPL_NOINDEX` | — | ✅ staging only | never on production |
|
||||
|
||||
Multiline values (keys) → mark *Multiline*; values containing `$` → mark *Literal* (otherwise Coolify interpolates
|
||||
them). Coolify adds its own variables (`COOLIFY_FQDN`, `COOLIFY_URL`, `SOURCE_COMMIT`, `PORT`, `HOST`) — do not use
|
||||
@@ -327,7 +327,7 @@ answers; a failed migration leaves the old container serving. Note: `prodMigrati
|
||||
with `NODE_ENV=production` — also during `next build` when the build reaches the database (§3a3).
|
||||
|
||||
**Backward-compatible migrations only.** During a rolling update the old container still serves on the migrated
|
||||
schema: add columns/tables first, drop or rename in a later release (`ipal-migrate-fields` skill). Take a
|
||||
schema: add columns/tables first, drop or rename in a later release (`iapl-migrate-fields` skill). Take a
|
||||
**Backup now** (§4.6) before a large migration.
|
||||
|
||||
### 4.4 Health check and rolling updates
|
||||
@@ -367,7 +367,7 @@ export const GET = createHealthRoute({ getCachedPayload, collection: 'pages' })
|
||||
Response (`content-type: application/json`, `cache-control: no-store`):
|
||||
- 200: `{ status: 'ok', db: 'up', timestamp, tookMs, …extra }`
|
||||
- 503: `{ status: 'error', db: 'down', timestamp, tookMs }` — no error details (they go to the
|
||||
server log: `[ipal] createHealthRoute: database unreachable`). An exception from `extra` also gives `db: 'down'`.
|
||||
server log: `[iapl] createHealthRoute: database unreachable`). An exception from `extra` also gives `db: 'down'`.
|
||||
|
||||
**Turn off / override:** the route is opt-in — without the file `app/api/health/route.ts` nothing is created;
|
||||
you can also write your own route from scratch (or point the health check at the home page — no database check).
|
||||
@@ -498,7 +498,7 @@ be attached. Options, in order of preference:
|
||||
|
||||
1. **Serve media through the app (default)** — leave `R2_PUBLIC_URL` empty. Files are stored in R2, Payload serves
|
||||
them at `/api/media/file/<name>` on the site's own domain: no DNS record, works on any zone. Cost: media traffic
|
||||
passes through the app (next/image caches optimized variants); `ipalEnvRules({ storage: true })` accepts an
|
||||
passes through the app (next/image caches optimized variants); `iaplEnvRules({ storage: true })` accepts an
|
||||
empty `R2_PUBLIC_URL` (env.md). Details: storage.md.
|
||||
2. **A dedicated media domain on Cloudflare** — a separate domain whose zone is in our Cloudflare account (e.g.
|
||||
`klient-media.com`), attached as the bucket's Custom Domain → `R2_PUBLIC_URL=https://<that domain>`. CDN and
|
||||
|
||||
Reference in New Issue
Block a user