| 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 |
|