Add local and public QR sharing for training profiles

This commit is contained in:
larssand
2026-09-03 20:15:13 +02:00
parent 4f847610dc
commit 2d56b74731
15 changed files with 965 additions and 226 deletions

View File

@@ -135,7 +135,7 @@ Owns:
- file watching for app version
- AMMC config + process state
- public overlay route serving via same frontend shell
- tokenized public driver training profile API and standalone mobile shell
- tokenized public driver training profile API, locally generated QR SVG, configurable public base URL, and standalone mobile shell
- PDF export endpoint
Delegates public training token validation and response shaping to `server/public_training_profile.js`; `server.js` does not duplicate those rules.
@@ -143,6 +143,7 @@ Delegates public training token validation and response shaping to `server/publi
Main API groups:
- `/api/health`
- `/api/app-version`
- `/api/network/public-address` (explicit UI action only; never polled)
- `/api/backups` (`GET` list, `POST` create only)
- `/api/state`
- `/api/passings`
@@ -613,7 +614,7 @@ Loads:
- `/src/public_training.css`
- `/src/public_training.js`
Served only after `server.js` validates the enabled share token in `/public-training/:shareToken`.
Served only after `server.js` validates the enabled share token in `/public-training/:shareToken`. QR images use `/public-training/qr/:shareToken` and validate the same token. `baseUrl=local` prefers a private 192.168.x.x or 10.x.x.x RaceCore server address and otherwise uses the first LAN address; an explicit HTTP(S) `baseUrl` is normalized to its origin for the public QR. The saved public value is `settings.publicBaseUrl`.
### `src/public_training.js`
Type: