Commit Graph
13 Commits
Author SHA1 Message Date
tiago-neves d6a7edda38 Budget realtime connections per API instance and Postgres superuser reserve
ci / rust (push) Successful in 11m46s
ci / typescript (push) Successful in 15m42s
dbConnectionBudget() only subtracted the API's Prisma pool and the worker's
own 1-connection remote broadcaster, so it never counted the 3 connections
each API process opens for realtime (attachRealtime: a 2-connection publish
pool plus a dedicated LISTEN client), nor the connections Postgres reserves
for superuser roles below max_connections -- exactly what "remaining
connection slots are reserved for roles with the SUPERUSER attribute" means.
With 2 API instances that gap was 9 connections, enough for the worker and
API together to run the cluster right up against the ceiling.

dbConnectionBudget() now takes realtimePerInstance and superuserReserved
(new DB_SUPERUSER_RESERVED_CONNECTIONS env var, default 3) and subtracts
both explicitly instead of leaving them to be absorbed by headroom.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-31533
Paperclip-Run: fc6639aa-bf73-43f0-b3f6-85835a1f809b
2026-10-19 04:13:14 +01:00
tiago-neves 7b08b78b40 Budget worker DB connections against the APIs cluster, not just one pool
ci / rust (push) Successful in 7m0s
ci / typescript (push) Successful in 10m8s
The worker sized its pool to leave room for only the APIs 10 default pg
connections, but infra/pm2/api.config.cjs runs it as 2 cluster instances
(20 total) and the realtime broadcaster holds one more. On a busy host
the worker and API pools together could reach Postgres default
max_connections, which is why session.findFirst() -- run on every
authenticated request -- was the query that hit "too many clients
already".

dbConnectionBudget() now derives the worker pool cap from the APIs
actual cluster size and pool size, plus headroom for admin/migration
connections, instead of a hardcoded 80. Both are configurable
(API_DB_POOL_SIZE, API_INSTANCES, DB_MAX_CONNECTIONS) for installs that
tune Postgres or PM2 differently.

Paperclip-Agent: José Alves (urlKey jos-alves; id 11179220-3cec-4f0f-880d-2771ff64fce8)
Paperclip-Issue: BIT-31519
Paperclip-Run: f5442a27-6b3b-4c5a-a1ab-8b2b4177be7c
2026-10-19 03:27:08 +01:00
sparkandClaude Opus 5.5 64d52fc691 Errors to errors.bitreport.pt from API, worker, app, desktop, sites and print agent
ci / rust (push) Successful in 15m6s
ci / typescript (push) Successful in 18m21s
API and worker report error log lines, unhandled 5xx and crashes to the hub with the
photoreport ingest key (ERROR_REPORTING_TOKEN); browsers (app, desktop webview, sites),
Next server renders and the print agent send through POST /v1/client-errors so the key
stays on the server. Repeats folded, rate-limited. docs/errors.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-14 19:32:54 +01:00
sparkandClaude Opus 5.5 3ef00ef86e Worker: concurrency sized from the container's CPUs and memory; archive yields when busy
ci / rust (push) Successful in 11m35s
ci / typescript (push) Successful in 19m25s
Ingest, archive, faces, render and delivery concurrency come from the container's
cores and memory at start (logged as capacity); env values only pin them. The
archive takes less while live work keeps the CPUs busy (cgroup CPU pressure, or the
load average) or memory runs short, and all of it again when quiet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-14 18:12:28 +01:00
spark 1177565c8a Desktop 0.3.0: local catalogue, self-updates through the API, offline start
ci / rust (push) Successful in 7m2s
ci / typescript (push) Failing after 9m5s
The catalogue indexes the photographer's own folders by SHA-256 so the editor opens those originals from disk
(incremental rescans, read-only). The shell updates itself from the latest desktop-v* Gitea release, which the API
reads with a read-only token and passes through (signed installers; no key, no updates). Without network the
window opens the web app bundled in the installer. Also fixes two tests that tampered with a signature by setting
a character that could already be the same one.

Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-13 03:33:39 +01:00
sparkandClaude Opus 5.5 57ed2154be feat(faces): shirt numbers from our own model
ci / rust (push) Successful in 6m54s
ci / typescript (push) Successful in 7m47s
Torso crops reviewed in the app; a ResNet18 trained on Mac (MPS) and exported to ONNX.
The worker reads numbers when JERSEY_MODEL_DIR is set.
A group with no face match is suggested a player by shirt number when exactly one player of the two teams wears it.
The faces worker now applies EXIF orientation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 23:31:00 +01:00
sparkandClaude Opus 5.5 e631e04ec0 feat(ingest): FTP passwords made in the app; SFTPGo authenticates cameras via the API
ci / typescript (push) Has been cancelled
ci / rust (push) Has been cancelled
SFTPGo keeps no users: its external authentication hook asks /v1/sftpgo/auth, which checks the login's argon2 password and answers with the upload-only home folder <INGEST_ROOT>/<login>. Passwords are generated, shown once, and can be replaced from the app.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 22:36:51 +01:00
sparkandClaude Opus 5.5 8947a51d83 feat(shop): galleries on the public sites, Stripe checkout and rendered downloads
ci / typescript (push) Successful in 15m12s
ci / rust (push) Successful in 22m16s
Sites per domain with two skins (PhotoReport, ShootYourMove) in apps/site (Next.js); public, unlisted and private galleries with watermarked photos; products, cart, orders with VIES reverse charge; the organization's own Stripe Checkout and signed webhooks; bought files rendered from the original with edits and IPTC, emailed; Vendas module in the app.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 22:36:16 +01:00
sparkandClaude Opus 5.5 64da90d2f2 feat(develop): Revelar, the synced editor with one engine on web, desktop and server
ci / typescript (push) Successful in 9m59s
ci / rust (push) Successful in 21m53s
engine/core renders with the LightCraft pipeline; engine/wasm runs it in the browser; workers/render replays op logs and renders originals natively. Op log with live fan-out and offline outbox; edited thumbnails and deliveries rendered from the original. Revelar page with Basic and optional modules, crop with aspect presets and straighten, before/after, undo/redo, copy/paste settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 22:36:02 +01:00
sparkandClaude Opus 5.5 3f702c4e23 feat(faces): detect, group and name players by face; squad reference photos
ci / rust (push) Successful in 2m3s
ci / typescript (push) Successful in 4m26s
Faces end to end (YuNet + AuraFace worker in Rust, grouping per event, confirm/merge/ignore, suggestions from known people, loupe boxes), blurred faces kept out of groups (sharpness gate tuned on a real football match), and reference photos for the squad.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 18:41:07 +01:00
sparkandClaude Opus 5.5 fca9281f4e feat: phase 1 ingest, library, IPTC and Nextcloud delivery
ci / rust (push) Successful in 2m20s
ci / typescript (push) Successful in 5m23s
- packages/metadata: {variable} templates, Photo Mechanic code replacement, IPTC fields of the current pad (title = persons shown), IIM/XMP mapping, delivery folder and file-name templates (FPA, Liga)
- API: events with agenda and IPTC template, FTP logins, ingest worker (hash, dedupe, EXIF in Lisbon time, routing by agenda + capture time, previews), library culling, IPTC preview, code list, signed file URLs
- Realtime: Socket.io with Postgres LISTEN/NOTIFY fan-out
- Delivery: queue with fixed sequence numbers, 4000 px JPEG 100 with IPTC via ExifTool, WebDAV upload with retries, OCS share links, encrypted app passwords
- Web app: approved type and Lightroom-style workspace, grid/loupe with keyboard culling, players, IPTC panel, delivery queue, code list editor

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 15:46:07 +01:00
sparkandClaude Opus 5.5 02eb41060e feat(api): accounts, organizations and auth schema; CI with Postgres (1/10)
ci / rust (push) Failing after 53s
ci / typescript (push) Failing after 1m44s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 14:39:11 +01:00
sparkandClaude Opus 5.5 500bb9fd87 feat: API skeleton, edit contracts and app/package placeholders
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 13:53:01 +01:00