Add link session preparation flow

- wire front link resolve/prepare routes
- add orchestrator session command handling
- update admin dashboards and device/link logic
This commit is contained in:
user
2026-03-28 17:47:03 +02:00
parent 5da61ed853
commit 0a11be5006
20 changed files with 1099 additions and 175 deletions

View File

@@ -35,8 +35,8 @@ Currently in alpha. Greenfield. Subject to change.
### Device Management (Orchestrator + Admin)
- [ ] Device schema — DB model for a device (host VPS, container ID, status, `inUse`, assigned session, etc.)
- [ ] Device domain in `@pkg/logic` — controller + repository + errors
- [x] Device schema — DB model for a device (host VPS, container ID, status, `inUse`, assigned session, etc.)
- [x] Device domain in `@pkg/logic` — controller + repository + errors
- [ ] Orchestrator command interface — secured Hono routes the admin dashboard calls:
- [ ] `POST /devices/:id/start` — start a Docker-Android container
- [ ] `POST /devices/:id/stop` — stop a container
@@ -45,14 +45,14 @@ Currently in alpha. Greenfield. Subject to change.
- [ ] `GET /devices/:id` — page to view the device in more detail (info, live stream feed with ws-scrcpy)
- [ ] Device allocation logic — atomically mark a device as `inUse` when a validated link starts a session
- [ ] Device release logic — clear `inUse` when a session ends or fails during setup
- [ ] Admin dashboard: Devices page — list fleet, show status, trigger start/stop/restart
- [x] Admin dashboard: Devices page — list fleet, show status, trigger start/stop/restart
- [ ] Internal API key auth between `apps/main` and `apps/orchestrator`
### Link Management (Admin + Front App)
- [ ] Link schema — DB model (unique token, expiry, status, linked device ID, leased app identity)
- [ ] Link domain in `@pkg/logic` — controller + repository + errors
- [ ] Admin dashboard: Links page — generate links, view detail, configure linked device + leased app, revoke, delete
- [x] Link schema — DB model (unique token, expiry, status, linked device ID, leased app identity)
- [x] Link domain in `@pkg/logic` — controller + repository + errors
- [x] Admin dashboard: Links page — generate links, view detail, configure linked device + leased app, revoke, delete
- [ ] `apps/front`: validate incoming link token on request
- [ ] `apps/front`: during loading, reject the link if the assigned device is already `inUse`
- [ ] `apps/front`: call `apps/orchestrator` server-side to clean/reset the device and launch the leased app before handing off the session
@@ -69,8 +69,8 @@ Currently in alpha. Greenfield. Subject to change.
### Android Streaming (scrcpy + ws-scrcpy)
- [ ] Docker-Android image setup and validation on VPS
- [ ] ws-scrcpy WebSocket server running per container, exposed via orchestrator
- [x] Docker-Android image setup and validation on VPS
- [x] ws-scrcpy WebSocket server running per container, exposed via orchestrator
- [ ] `apps/front`: scrcpy client embedded in PWA — renders the Android stream in browser
- [ ] Input forwarding (touch/keyboard events → scrcpy → Android container)
- [ ] Session timeout + stream teardown on inactivity