IAPL rename: the old names keep working, and a second cookie name and counter key for new sites

- exports: ipalKit, IpalOptions, ipalEnvRules, IpalEnvFeatures, ipalT, ipalVar, IPAL_TOKENS,
  IPAL_BREAKPOINTS, IpalTokenName, IpalGlobalSlug are aliases of the iapl names
- env: IAPL_* is read first, IPAL_* as fallback (readEnv; EnvRule.aliases for assertEnv);
  the crawler service reads IPAL_CRAWLER_SITES too
- doctor: reads ipal-doctor.json when it is the only one, the old pointer block, ipal-audit-skip
  and old skill folders; new rule legacy-names (info) and storage-names (warning)
- iapl-skills: installs iapl-*, removes the 16 old folders by exact name, rewrites the old
  pointer block in place; a project's own ipal-* skill stays
- storageNames: 'ipal' (default) | 'iapl': the cookie the scanner declares and the 2FA counter's
  kv prefix; <PageStats visitorCookie>, IAPL_VISITOR_COOKIE, verifyLimit.keyPrefix
- test/legacyNames.test.ts: 24 tests for all of the above

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 17:31:13 +01:00
co-authored by Claude Fable 5.2
parent 0a4f001797
commit 425fac14fb
43 changed files with 683 additions and 82 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# ipal cookie crawler — one shared service for all sites (docs/cookie-scanner.md → Coolify).
# IAPL cookie crawler — one shared service for all sites (docs/cookie-scanner.md → Coolify).
# The Playwright image ships Chromium and its system libraries; the npm package
# version must match the image tag.
FROM mcr.microsoft.com/playwright:v1.64.0-noble
+1 -1
View File
@@ -1,4 +1,4 @@
# ipal cookie crawler
# IAPL cookie crawler
The browser half of IAPL's cookie scanner: one shared service that crawls a site twice (no
consent / after "Accept all") and posts cookies, storage keys and third-party hosts back to the
+1 -1
View File
@@ -1,4 +1,4 @@
// Pure helpers of the ipal cookie crawler (no browser, no network) — tested in
// Pure helpers of the IAPL cookie crawler (no browser, no network) — tested in
// test/cookieCrawler.test.ts. Wire format: src/modules/consent/scanner/crawl/result.ts.
import { createHash, timingSafeEqual } from 'node:crypto'
+2 -2
View File
@@ -1,4 +1,4 @@
// ipal cookie crawler — HTTP service (deploy: docs/cookie-scanner.md → "Scanner service on Coolify").
// IAPL cookie crawler — HTTP service (deploy: docs/cookie-scanner.md → "Scanner service on Coolify").
//
// GET /health → { ok, running, queued }
// POST /crawl → Authorization: Bearer <the site's token>
@@ -139,7 +139,7 @@ export function createCrawlerServer({
// Run directly: `node server.mjs`
if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
const sites = parseSites(process.env.IAPL_CRAWLER_SITES)
const sites = parseSites(process.env.IAPL_CRAWLER_SITES?.trim() ? process.env.IAPL_CRAWLER_SITES : process.env.IPAL_CRAWLER_SITES) // IPAL_CRAWLER_SITES: the name before 1.17.0, still read
if (!sites.length) {
console.error('[crawler] IAPL_CRAWLER_SITES is empty — set "host=token" pairs (token ≥ 16 chars).')
process.exit(1)