Null-DRM-Official/apps/streamd/README.md
404errordeveloper 066e018749
All checks were successful
release / build-and-upload (push) Successful in 6m18s
modules-release / build-and-upload (push) Successful in 5m18s
streamd: preview quality picker, dashboard polish, C4 wrap keys
- Preview player can select FHD/HD/SD (or ABR master) from publish links
- Embed dashboard screenshots in README; Linux streamd+agent setup guide
- C4 Widevine wrap license mode + require --wvd; prefer Widevine PSSH
- Channel 4 and My5 modules; streamd auth, variants, schedules, HLS gate
2026-10-09 20:57:43 +02:00

73 lines
2.6 KiB
Markdown

# streamd
Control plane: REST API, SQLite, dashboard and media supervisor. Hosted by the
single binary as `drm serve`.
```text
apps/streamd/
servecmd/ the command body, imported by apps/cli
internal/api HTTP handlers
internal/auth sessions, API keys, roles
internal/db SQLite store
internal/ui dashboard
internal/supervisor downloader + ffmpeg supervision
internal/ws agent + dashboard websockets
```
## Run
```bash
./bin/drm serve --bind 127.0.0.1:8083 --data .cache/streamd
```
`--bind` defaults to **`127.0.0.1:8083`** (loopback). Binding `0.0.0.0` (or any
non-loopback address) logs a startup warning — put TLS in front, or keep loopback
and reverse-proxy. Port 8083 stays clear of anything already on 8080/8081.
On start, missing media tools are downloaded into `bin/` (ffmpeg, N_m3u8DL-RE,
mp4decrypt) unless you pass `--skip-deps`.
### Auth
The old shared bearer token is optional and discouraged. Prefer:
1. First-run setup creates an **admin** account (or `--admin-user` / `--admin-pass`).
2. Sign in at the dashboard (session cookie + CSRF).
3. Create **API keys** (Settings → API keys) for agents and scripts — roles
`admin` / `operator` / `viewer`.
Legacy `--token` / `STREAMD_TOKEN` still works as an admin API key and logs a
warning so you can migrate.
`GET /api/health` stays readable without a principal (liveness only). Stream list,
credentials, and mutations need a session or API key.
## API (short)
| Method | Path | Notes |
|---|---|---|
| GET | `/api/health` | liveness (+ deps when authenticated) |
| GET | `/api/apps` | modules, channels, rewriters |
| GET | `/api/streams` | list + runtime (agent polls this) |
| POST | `/api/streams` | create (`enabled` defaults false unless set; use the form checkbox) |
| GET/PATCH/DELETE | `/api/streams/:id` | detail / edit / delete |
| POST | `/api/streams/:id/start\|stop\|restart` | desired state |
| POST | `/api/streams/:id/capture` | ask connected agents to refresh credentials now |
| POST | `/api/streams/:id/credentials` | `{mpd,key?,…}` — restarts if enabled |
| POST | `/api/streams/:id/claim` | agent lease |
HLS output is served from `--data/www` at `/hls/<name>/index.m3u8`.
Installation-wide settings (`idle_timeout_s`, `default_on_demand`,
`default_outputs`, packager knobs) apply when creating a stream that omits those
fields, or at the next media start for packager knobs.
## No provider knowledge
App/channel pickers come from `/api/apps`. Downloader settings resolve at start:
```text
stored row -> app module (StreamDefaults) -> installation settings -> neutral defaults
```
**Full guide: [docs/streamd.md](../../docs/streamd.md)**