SPB Git

Repository Public

INTEGRATION.md 4.1 KB 72 lines markdown

1<!--2MacLustr Storage Node3File: docs/INTEGRATION.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# MacLustr integration and operations guide89## Where things run1011| What | Where |12|---|---|13| Coordinator + gateway | mld app `maclustr-storage`, pinned on **m4mn**, dir `~/apps/maclustr-storage` (a clone of this repository), PM2 `storage-coordinator` (8870 gateway, 8871 LAN HTTPS) and `storage-backup` (03:45) |14| Public route | `https://storage.spboucher.ai` — DNS `A → 51.161.112.61` (GoDaddy, created 2026-12-01), Caddy route on BHS64 posted by `mld deploy` |15| Data | `m4mn:~/maclustr-storage/` — `fragments/`, `coordinator.db`, `uploads/`, `backups/` |16| Secrets | `m4mn:~/.config/maclustr-storage/` — `master.key`, `ticket.key`, `admin.token`, LAN certificate. Generated on the node at first start. Copy kept outside git on the operator's Mac |17| Dashboard | Command Center (`M4M64c`), page `/mobile-storage`; reads `MCC_STORAGE_URL` with the token file `~/.config/mcc/storage-admin.token` |18| mld manifest | `M1M32:~/dispatch/apps/maclustr-storage.json` |1920Do not run `mld move` (data and keys do not follow) nor `mld adopt` (the repository has another name than the app).2122## Deploying a change2324Server code lives in `server/`. On the node: `cd ~/apps/maclustr-storage && git pull && pm2 restart storage-coordinator`.25There is nothing to build (Node runs the TypeScript directly) and no dependency to install. Run `node server/test/e2e.ts`26before pushing. First installation on another node: clone, `bash server/scripts/setup.sh`, write an mld manifest like the27existing one, `mld deploy`, then restore `~/.config/maclustr-storage` and `~/maclustr-storage` if moving.2829Settings are environment variables in the manifest (`server/src/config.ts`): `MSC_FRAGMENT_MIB` (8), `MSC_MOBILE_REPLICAS`30(2), `MSC_VERIFY_INTERVAL_S` (21600), `MSC_OFFLINE_AFTER_S` (100), `MSC_LAN_PORT` (8871, 0 = off), `MSC_BONJOUR`.3132## Daily use (`mlstore`, on the node)3334```bash35cd ~/apps/maclustr-storage && alias mlstore='node server/bin/mlstore.ts'36mlstore status                      # stable store, mobile nodes, capacities, integrity37mlstore pair "iPhone de Simon"      # pairing code + QR payload (the dashboard shows the QR code)38mlstore put big.tar archive-2026.tar --class=archive39mlstore ls ; mlstore show <object> ; mlstore get <object> out.tar ; mlstore rm <object>40mlstore node <name|id>              # detail, events, transfers, tasks, benchmark41mlstore verify <node> ; mlstore retrieve <node> 442mlstore suspend|resume|drain|revoke|forget <node>43mlstore events 50 ; mlstore transfers 5044```45From another machine: `MSC_URL=https://storage.spboucher.ai MSC_ADMIN_TOKEN=… node server/bin/mlstore.ts status`.4647## Using the fabric from another MacLustr service4849`PUT /admin/v1/objects?name=&class=` with the raw body, keep the returned `id` and `sha256`; `GET50/admin/v1/objects/{id}/content` to read (API.md). Suitable for what the brief lists: archives, secondary backups, datasets,51model files, research artefacts, rarely read data. Not suitable as a primary store: the stable copy is on one node today52(ARCHITECTURE.md §8).5354## Adding a device5556Dashboard → Mobile Storage Nodes → Add a device → scan the QR code in the app (or type the code) → choose the capacity →57Activate. Revoking, draining and suspending are in the node's drawer. A revoked or drained node disappears from the list58with `mlstore forget`.5960## Backups and recovery6162- `storage-backup` writes a consistent copy of the catalog to `~/maclustr-storage/backups` daily (14 kept) — same disk.63- To recover on a new node you need **both** `~/.config/maclustr-storage/master.key` and a catalog: without them the64  fragments (stable or on phones) cannot be decrypted.65- If stable fragments are lost but the catalog and key survive, the coordinator pulls what the phones hold as they come online.6667## Apple side6869Bundle `ai.spboucher.maclustr.storage` (App ID `L2G5ZM34K3`), App Store Connect `6841553137`, team `3YM54G49SN`. App ID and70record were created through the signed-in Safari session (`Scripts/portal/`). Release: bump `CURRENT_PROJECT_VERSION` in71`project.yml`, then `Scripts/release.sh all` and `python3 Scripts/testflight.py --apply`.72
Files main
Menu

Theme