mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 04:46:59 +01:00
Docs truth-sweep against ground truth (package.json, CI workflows): - npm → pnpm across evergreen docs (pnpm 11.25.0 is the package manager; npx tsx → pnpm exec tsx, npx ts-prune/jscpd → pnpm dlx, npm ci → pnpm install --frozen-lockfile, package-lock.json → pnpm-lock.yaml) - Jest → Vitest in README, CONTRIBUTING, COMMANDS (vitest 4 is installed) - Node claims: README 20+ → 22.13+ (engines) with CI/deploy on 24; deployment.md "Setup Node 20 (npm cache)" → Node 24 (pnpm cache), and the pipeline line now shows `pnpm run verify` as CI actually runs - TypeScript 5.x claims → 6 (typescript ^6.0.3); Next.js 14 → 16 in BLOG_SYSTEM, guides/ARCHITECTURE, AI_BOT_SYSTEM_PROMPT - COMMANDS.md: dropped nonexistent `dev:cms` script; services list fixed to db/meilisearch/listmonk (no redis in compose) - HR_RUNBOOK: `npm run test -- src/…` → `pnpm run test src/…` (pnpm passes args without the `--` separator) Historical records (docs/archive/**, dated audit reports, UPGRADE_PLAN) left as-is — they describe what was true when written. Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Reliability Hardening Summary
This project is configured to favor reliability of Auth and Database while keeping CMS disabled by default.
What’s configured
-
CMS disabled by default
ENABLE_CMS=falsegates all CMS API routes and client calls.cms_apiservice is commented out indocker-compose.yml.
-
Database hardening
- New migration
scripts/db/migrations/005_auth_hardening_and_indexes.sql:- Enforces case-insensitive emails via
CITEXTwith a safety pre-check. - Ensures Auth.js timestamp columns exist (
users."emailVerified","createdAt","updatedAt"). - Adds critical indexes for interactions, preferences, segments, workshop instances, registrations, service appointments, and JSONB fields.
- Enforces case-insensitive emails via
- Migration runner updated to apply all migrations in order.
- New migration
-
Redis-backed rate limiter and lockout (optional)
- Enable via env:
ENABLE_REDIS_RATE_LIMITER=trueREDIS_URL=redis://localhost:6380
- Falls back to in-memory if Redis client is not available.
- Enable via env:
How to run migrations
pnpm run db:up
bash scripts/db/run-migration.sh
This applies all scripts/db/migrations/*.sql in order.
Recommended production settings
- Managed HA Postgres (Multi-AZ, PITR) and PgBouncer (transaction pooling)
- Enforce Postgres timeouts:
statement_timeout(~15s),idle_in_transaction_session_timeout(~30s) - Enable Redis rate limiting (
ENABLE_REDIS_RATE_LIMITER=true) - Admin 2FA (TOTP) and backup codes (future enhancement)