SPB Git forge

spb/rareindex

Public
54commits 1branches 0releases
7.1 MBsize
maindefault branch
10 days agolast push
TypeScript 61.9% HTML 37.2% SQL 0.7%

docs: production moved to OVH BHS128b (native PM2/Postgres, 270 GB image store), release procedure; M3U96a copy kept cold

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed 10 days ago (Sep 14, 2026) parent f83c5da

2 changed files +15 −6

modified CLAUDE.md +2 −1
@@ -182,7 +182,8 @@ One canonical asset graph containing every collectible, every important variatio
182 182 ## Repository conventions (added by the implementation)
183 183
184 184 - Package manager `pnpm`; `pnpm typecheck`, `pnpm test`, `pnpm build`. Workers run with `tsx`.
185 −- Secrets only in `.env` (git-ignored) or the `mld` manifest on the cluster. Never in code or fixtures.
185 +- Secrets only in `.env` (git-ignored) or the PM2 config on the server (`BHS128b:~/apps/pm2.rareindex.config.cjs`, generated from the former `mld` manifest kept in `~/apps/.manifests/`). Never in code or fixtures.
186 +- Production (since 2026-09-14): OVH server **BHS128b**, outside `mld` — Postgres 17 native, image store `~/apps/rareindex/data/images` (270 GB), PM2 under systemd, route `https://www.rareindex.io → wg1 10.67.0.62:8210`. Release procedure and details in `README.md` → Deployment. The M3U96a copy is a cold copy.
186 187 - Add a connector: `pnpm connector:new <id> --url … [--adapter shopify|woocommerce]` → `connectors/<engine>/<id>/{meta.json,index.ts,index.test.ts,README.md}` + real fixtures in `data/fixtures/<id>/`, source entry in `data/sources/entries/<group>.json`, host policy in `connectors/domains.d/<group>.json`; then `pnpm registry`, `pnpm sources:build`, `pnpm db:seed`. Guide: `docs/connectors/ADDING_A_CONNECTOR.md`; catalogue: `docs/connectors/SOURCES.md`.
187 188 - DB changes: edit `packages/database/src/schema/*`, run `pnpm db:generate`, commit the SQL migration.
188 189 - UI: dense, neutral, tabular numbers (`num` utility), `<Unavailable/>` for missing evidence, every number with its sample size / confidence / freshness when it is an estimate.
modified README.md +13 −5
@@ -344,11 +344,19 @@ Build and verify: `pnpm typecheck`, `pnpm test`, `pnpm build`. Schema change: ed
344 344
345 345 ## Deployment
346 346
347 −Production runs on the **MacLustr** cluster ([www.maclustr.io](https://www.maclustr.io)) — node
348 −M3U96a (Mac Studio, PostgreSQL 17 + pgvector local) — orchestrated by the `mld` gateway and published
349 −through the MacLustr Tunnel (WireGuard + Caddy on an OVH gateway) at **https://www.rareindex.io**.
350 −PM2 processes: `rareindex-web` (8210), `rareindex-api` (8211), `rareindex-worker`. Secrets live only
351 −in the `mld` manifest.
347 +**Since 2026-09-14 production runs on the OVH server BHS128b** (`ssh BHS128b`, ubuntu@51.161.112.85, Ubuntu 24.04,
348 +16 threads / 128 GB), outside `mld`: code in `~/apps/rareindex`, PostgreSQL 17 native (db/role `rareindex`/`rareindex`,
349 +pgvector + pg_trgm + unaccent, en_US.UTF-8, ~150 GB), image store `~/apps/rareindex/data/images` (270 GB, ~5 M files:
350 +`orig` + `w96/w192/w384/w768/w1200`, two-level hex sharding), PM2 under systemd (`pm2-ubuntu`) with
351 +`~/apps/pm2.rareindex.config.cjs` generated from the mld manifest by `~/apps/.manifests/gen-pm2.py` (secrets, 0600).
352 +PM2 processes: `rareindex-web` (8210), `rareindex-api` (8211), `rareindex-worker` (cron 04:30 + autorestart). Published through the
353 +MacLustr Tunnel: BHS64 Caddy → wg1 `10.67.0.62:8210` (`mlt add www.rareindex.io BHS128b:8210`).
354 +Release on BHS128b: `rsync -az --exclude node_modules --exclude .git --exclude 'apps/web/.next' --exclude data --exclude logs . BHS128b:apps/rareindex/`
355 +then `ssh BHS128b 'cd apps/rareindex && pnpm install --frozen-lockfile && DATABASE_URL=postgres://rareindex:rareindex@127.0.0.1:5432/rareindex pnpm db:migrate && DATABASE_URL=postgres://rareindex:rareindex@127.0.0.1:5432/rareindex NEXT_PUBLIC_SITE_URL=https://www.rareindex.io API_URL=http://127.0.0.1:8211 pnpm --filter @rareindex/web build && pm2 restart rareindex-api rareindex-web rareindex-worker && pm2 save'`.
356 +pnpm ≥ 10 needs `onlyBuiltDependencies` (esbuild, sharp, @tailwindcss/oxide, unrs-resolver) in `pnpm-workspace.yaml` on a fresh install.
357 +Former home (kept as a cold copy, retired from `mld` with `--keep-dir`): MacLustr node M3U96a (Mac Studio, PostgreSQL 17 + pgvector),
358 +orchestrated by the `mld` gateway; the migration moved a 179 GB database (parallel `pg_dump -Fd -j 4`, 14 GB compressed, restored with
359 +`pg_restore -j 8` in 21 min) and the 270 GB image store (rsync streams capped at 20 MB/s each so the Mac's 1 Gbit/s link stayed usable).
352 360
353 361 Release procedure: commit → `git archive HEAD` synced to the node → `pnpm db:migrate` →
354 362 `pnpm --filter @rareindex/web run build` (detached, ~15 min: 146 static pages) → `pm2 restart`.
355 363