feat(editor): bridge the advanced photo editor into the event workflow
CI / build (push) Has been cancelled

Event photos can now be opened in Lumenroom, a WebGL2 develop module, from the
photo editor's Advanced button. The dashboard signs a short-lived token scoped
to one user and event; Lumenroom exchanges it, imports the event's photo list
and proxies bytes on demand, so nothing is copied and the temporary catalog
expires with the bridge session. Saving in Lumenroom renders the photo and
writes it back as the event's edited JPEG, with the advanced recipe kept in
event_photos.advanced_edit_json.

Lumenroom is vendored under lumenroom/ and built as a second compose service,
so one clone and `docker compose up -d --build` deploys both apps.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-21 01:34:20 +00:00
parent 982f9048e1
commit 0cb315ea88
89 changed files with 22087 additions and 1 deletions
+81
View File
@@ -594,6 +594,86 @@ git switch main
- [ ] Media storage share configured in Settings → Media storage and writable (required for event photos and videos).
- [ ] The `/api/dev/*` prefix is historical: the guards, not the URL, are the security boundary.
### 15. Advanced photo editor bridge (optional)
Event photos can also be opened in a separate Lumenroom deployment for a much
deeper develop module (WebGL2 tone/colour pipeline, HSL mixer, split toning,
per-channel curves, texture/dehaze/grain, history and presets). The simple
editor stays the default; the advanced one is reached from the photo editor's
**Advanced** button.
The two apps never share a database. The dashboard opens a scoped bridge
session, sends the browser to Lumenroom with a short-lived signed token, and
Lumenroom mirrors the event's photo list. Photo bytes are proxied on demand, so
nothing is copied at login; the imported event is temporary and is deleted when
that bridge session expires (12 hours by default).
**One deployment.** Lumenroom is vendored under `lumenroom/`, and
`docker-compose.yml` builds it as a second service next to the app. One clone
and one command deploy both:
```bash
docker compose up -d --build
```
Values in `.env` (all optional except the secret):
```dotenv
# Browser-facing URL of the editor. Users' devices must reach it.
LUMENROOM_URL=http://<lan-ip>:8787
# One long random string, shared by both services.
BRIDGE_SECRET=<64+ random characters>
# Optional tuning
# GLENLOCH_URL=http://app:3000 # internal; the service default
# LUMENROOM_PORT=8787
# LUMENROOM_BIND=0.0.0.0 # set 127.0.0.1 behind a proxy
# LUMENROOM_BRIDGE_TTL_HOURS=12
# LUMENROOM_INVITE=our-team
```
`BRIDGE_SECRET` only signs bridge tokens; it is never sent to the browser as a
credential. The token minted when you click **Advanced** expires in 10 minutes
and is scoped to one user and one event. With `BRIDGE_SECRET` empty the button
is visible but reports that the editor is not configured.
`GLENLOCH_URL` is server-to-server inside the Compose network (default
`http://app:3000`), so it needs no TLS. `LUMENROOM_URL` is different: the user's
browser is redirected there, so it must be a reachable address — the host's LAN
IP for a local stack, or an HTTPS hostname in production.
**Reverse proxy.** Lumenroom's UI fetches `/api/...` from the root of its own
origin, so give it a hostname, not a path prefix:
```caddy
edit.example.org {
reverse_proxy lumenroom:8787
}
```
Then set `LUMENROOM_URL=https://edit.example.org` and
`LUMENROOM_BIND=127.0.0.1`. Putting both apps on the same site
(`media.example.org`, `edit.example.org`) keeps the redirect and its cookie
first-party.
**Data.** `lumenroom` keeps only temporary bridge data in the `lumenroom-data`
volume (SQLite catalog, cached previews and thumbnails); originals stay on the
media share and the edited JPEGs are written back there. That volume can be
left out of backups. To run the editor on its own instead, its
`lumenroom/docker-compose.yml` still works standalone.
**How it behaves.** Clicking **Advanced** in the photo editor opens the same
event in Lumenroom already signed in — no second password. Lumenroom shows a
banner with **Save to event** (renders the open photo at full size and stores it
as the event photo's edited JPEG, so thumbnails, delivery exports and the
`variant=edited` viewer use it) and **Back to dashboard**. Photos remain on the
media share; only the temporary catalog rows, thumbnails and previews live in
Lumenroom's data volume. RAW files get a 4000 px JPEG proxy generated by the dashboard's
RAW decoder (cached in Lumenroom) instead of the simple editor's 1800 px
preview, so advanced RAW exports are larger than the simple editor's.
The advanced recipe is stored in `event_photos.advanced_edit_json`, separate from
the simple editor's recipe; saving in either editor replaces the generated JPEG
that the gallery shows.
## Project structure
```text
@@ -602,6 +682,7 @@ git switch main
├── docs/ Product spec, architecture, build plan, current state
├── drizzle/ Migrations, snapshots, journal
├── e2e/ Playwright specs and shared helpers
├── lumenroom/ Advanced photo editor (Vite + Node), built by compose
├── public/ Static assets
├── src/
│ ├── app/ Pages, layouts, API route handlers