Streamd v0.2.0: rename, modules panel, stable/beta channels
All checks were successful
release / build-and-upload (push) Successful in 7m5s
All checks were successful
release / build-and-upload (push) Successful in 7m5s
- Rename product/host binary to streamd (drm compat copy still shipped) - Go module path streamd; STREAMD_* env aliases; agent UA streamd-agent - Panel Modules store + agent pull sync (modstore / modsync) - Rolling stable + beta download tags; README/docs channel curl blocks - Release notes in docs/releases/v0.2.0.md attached by Forgejo Actions
This commit is contained in:
parent
066e018749
commit
da8e1123ec
140 changed files with 2949 additions and 851 deletions
|
|
@ -36,8 +36,8 @@ your own values. Each `providers/*.md` doc explains where to get them.
|
|||
## Build
|
||||
|
||||
```bash
|
||||
go -C apps/cli build -o ../../bin/drm . # Windows: -o ../../bin/drm.exe
|
||||
./bin/drm proxy build # once, for phone capture
|
||||
go -C apps/cli build -o ../../bin/streamd . # Windows: -o ../../bin/streamd.exe
|
||||
./bin/streamd proxy build # once, for phone capture
|
||||
```
|
||||
|
||||
There is no build script and no Makefile — `go build` is the build system.
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ things a downloader needs — **manifest URL**, **Widevine content keys**, and a
|
|||
|
||||
Two independent ways to get them:
|
||||
|
||||
1. **Catalog** (`drm catalog`) — the app's playback catalog is public, so a plain
|
||||
1. **Catalog** (`streamd catalog`) — the app's playback catalog is public, so a plain
|
||||
HTTPS request plus a local CDM is enough. No phone.
|
||||
2. **Phone capture** (`drm capture`) — launch the real app under an on-device
|
||||
2. **Phone capture** (`streamd capture`) — launch the real app under an on-device
|
||||
HTTPS MITM, drive its UI to the channel, and read the license exchange.
|
||||
|
||||
What it deliberately does not do: break DRM. The CDM used is a provisioned
|
||||
|
|
@ -20,7 +20,7 @@ real client performs.
|
|||
## Host + external modules
|
||||
|
||||
```text
|
||||
┌──────────────────────── bin/drm ────────────────────────┐
|
||||
┌──────────────────────── bin/streamd ────────────────────────┐
|
||||
│ capture catalog agent serve proxy │
|
||||
│ │ │
|
||||
│ └── modhost: discover / build / exec │
|
||||
|
|
@ -29,14 +29,14 @@ real client performs.
|
|||
modules/<name>/ (Go CLI + module.yaml + .bin/)
|
||||
```
|
||||
|
||||
`apps/cli` is the only host `main`. Providers are **not** linked into `drm.exe`.
|
||||
`apps/cli` is the only host `main`. Providers are **not** linked into `streamd`.
|
||||
Each `modules/<name>/` is a small CLI (`describe`, `launch`, `autoplay`, `catalog`)
|
||||
that the host builds on demand into `modules/<name>/.bin/` and runs as a
|
||||
subprocess. Shared library code may still live under `apps/modules/<name>/` for
|
||||
the external CLI to import via `replace`.
|
||||
|
||||
Adding a provider means adding a folder under `modules/` — no rebuild of `drm`.
|
||||
Point at another tree with `drm --modules-dir DIR` or `$DRM_MODULES_DIR`.
|
||||
Adding a provider means adding a folder under `modules/` — no rebuild of `streamd`.
|
||||
Point at another tree with `streamd --modules-dir DIR` or `$STREAMD_MODULES_DIR`.
|
||||
|
||||
Host releases use `v*` tags. Provider zips use separate `modules-v*` tags
|
||||
(`module-bbc-….zip`, `module-rte-….zip`, `module-tg4-….zip`). Tracked
|
||||
|
|
@ -64,13 +64,13 @@ local.
|
|||
Six modules, wired with `replace`:
|
||||
|
||||
```text
|
||||
apps/pkg drmdecryption shared, provider-neutral
|
||||
apps/modules drmdecryption/modules app modules -> pkg
|
||||
apps/capture drmdecryption/apps/capture capture command -> pkg
|
||||
apps/agent drmdecryption/apps/agent agent -> pkg
|
||||
apps/streamd drmdecryption/apps/streamd control plane -> pkg
|
||||
apps/proxy drmdecryption/apps/proxy MITM host CLI -> pkg
|
||||
apps/cli drmdecryption/apps/cli the binary -> all of the above
|
||||
apps/pkg streamd shared, provider-neutral
|
||||
apps/modules streamd/modules app modules -> pkg
|
||||
apps/capture streamd/apps/capture capture command -> pkg
|
||||
apps/agent streamd/apps/agent agent -> pkg
|
||||
apps/streamd streamd/apps/streamd control plane -> pkg
|
||||
apps/proxy streamd/apps/proxy MITM host CLI -> pkg
|
||||
apps/cli streamd/apps/cli the binary -> all of the above
|
||||
|
||||
apps/proxy/device appproxy standalone, cross-compiled for the phone
|
||||
```
|
||||
|
|
@ -100,7 +100,7 @@ Optional, detected by type assertion:
|
|||
|
||||
| Interface | Gives you |
|
||||
|---|---|
|
||||
| `app.Catalog` | `drm catalog --app <name>` works |
|
||||
| `app.Catalog` | `streamd catalog --app <name>` works |
|
||||
| `app.CatalogLister` | a richer `catalog --list` with catalog ids and provider flags |
|
||||
| `app.StreamDefaults` | streamd downloader settings (selectors, rewriter, buffering) |
|
||||
| `mpd.Rewriter` + `mpd.Register` | a named manifest rewrite streamd can resolve |
|
||||
|
|
@ -127,7 +127,7 @@ Nothing here names a streaming provider.
|
|||
## Phone capture pipeline
|
||||
|
||||
```text
|
||||
drm capture --app X --channel Y --auto-play
|
||||
streamd capture --app X --channel Y --auto-play
|
||||
│
|
||||
├─ push + start apps/proxy/device (appproxy) on the phone
|
||||
├─ set the phone's global http_proxy to 127.0.0.1:8080
|
||||
|
|
@ -171,7 +171,7 @@ bandwidths, codecs, resolution, segment templates, live-edge offset, window size
|
|||
The RTE module supplies origins and KIDs; when the upstream manifest is gone, a
|
||||
`mpd.KIDResolver` maps the KID from a previous capture back to its origin.
|
||||
|
||||
## Control plane (`drm serve`)
|
||||
## Control plane (`streamd serve`)
|
||||
|
||||
| Piece | Path |
|
||||
|---|---|
|
||||
|
|
@ -194,7 +194,7 @@ settingsFor(stream):
|
|||
The rewriter is a registry lookup on the stream's `rewriter` column, and HLS is
|
||||
detected from the manifest shape — not from an app name or a stream name.
|
||||
|
||||
## Agent (`drm agent run`)
|
||||
## Agent (`streamd agent run`)
|
||||
|
||||
```text
|
||||
poll streamd ──► durable SQLite queue ──► claim a free ADB device
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Using the capture binary
|
||||
|
||||
`drm capture` runs an HTTPS MITM **on the phone**, drives the app, and records the
|
||||
`streamd capture` runs an HTTPS MITM **on the phone**, drives the app, and records the
|
||||
DRM exchange. It is both the production capture path and the tool you use to
|
||||
discover everything a new module needs.
|
||||
|
||||
|
|
@ -8,8 +8,8 @@ discover everything a new module needs.
|
|||
|
||||
```bash
|
||||
adb devices # phone listed and authorised
|
||||
./bin/drm proxy build # cross-compile the on-device MITM (linux/arm64)
|
||||
./bin/drm proxy install-ca --reinject
|
||||
./bin/streamd proxy build # cross-compile the on-device MITM (linux/arm64)
|
||||
./bin/streamd proxy install-ca --reinject
|
||||
```
|
||||
|
||||
The phone must be rooted (Magisk). On first `install-ca`, the host **generates a
|
||||
|
|
@ -31,7 +31,7 @@ If an app still reports `tls: unknown certificate`, re-run the reinject and
|
|||
force-stop the app so it inherits the mount:
|
||||
|
||||
```bash
|
||||
./bin/drm proxy install-ca --reinject
|
||||
./bin/streamd proxy install-ca --reinject
|
||||
adb shell am force-stop <package>
|
||||
```
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ Nothing sets the global HTTP proxy.
|
|||
| Wi‑Fi `http_proxy` → appproxy | Often breaks / fights VPN | Yes |
|
||||
| `tcpdump` / pcap on `tun0` only | Yes | No (TLS ciphertext) |
|
||||
| **Transparent appproxy** | Yes | Yes |
|
||||
| `drm capture --app …` for BBC | Yes (uses transparent under the hood) | Yes |
|
||||
| `streamd capture --app …` for BBC | Yes (uses transparent under the hood) | Yes |
|
||||
|
||||
Install the binary on the phone, play while it records to
|
||||
`/data/local/tmp/capture/<package>/`, then pull. Ctrl+C on the host stops
|
||||
|
|
@ -72,17 +72,17 @@ iptables and pulls into `outputs/transparent/<stamp>/`.
|
|||
# 1. NordVPN (or other VPN) ON on the phone — UK egress for BBC
|
||||
|
||||
# 2. CA once (or after reboot if the conscrypt mount dropped)
|
||||
.\bin\drm.exe proxy install-ca --reinject
|
||||
.\bin\streamd.exe proxy install-ca --reinject
|
||||
adb shell am force-stop <package> # e.g. bbc.iplayer.android
|
||||
|
||||
# 3. Start transparent MITM (VPN stays on)
|
||||
.\bin\drm.exe proxy transparent --package <package>
|
||||
.\bin\streamd.exe proxy transparent --package <package>
|
||||
|
||||
# 4. Open the app and play on the phone
|
||||
# 5. Ctrl+C when done → stops iptables + pulls captures
|
||||
```
|
||||
|
||||
On Linux/macOS the same commands use `./bin/drm` instead of `.\bin\drm.exe`.
|
||||
On Linux/macOS the same commands use `./bin/streamd` instead of `.\bin\streamd.exe`.
|
||||
|
||||
### On-device artifacts
|
||||
|
||||
|
|
@ -104,11 +104,11 @@ adb pull /data/local/tmp/capture/bbc.iplayer.android .\bbc-cap
|
|||
A leftover REDIRECT breaks playback even after the host command exits. Clear it:
|
||||
|
||||
```powershell
|
||||
.\bin\drm.exe proxy stop
|
||||
.\bin\streamd.exe proxy stop
|
||||
adb shell "su -c 'sh /data/local/tmp/tproxy_iptables.sh stop; killall -9 appproxy 2>/dev/null; true'"
|
||||
```
|
||||
|
||||
Do not leave a hung `drm capture` or `proxy transparent` in another terminal —
|
||||
Do not leave a hung `streamd capture` or `proxy transparent` in another terminal —
|
||||
it will reinstall the redirect and break the app.
|
||||
|
||||
### CA cert/key mismatch
|
||||
|
|
@ -135,7 +135,7 @@ the app so the trusted CA hash still matches the cert appproxy signs with.
|
|||
### Passive — no module needed
|
||||
|
||||
```bash
|
||||
./bin/drm capture --wait 300
|
||||
./bin/streamd capture --wait 300
|
||||
```
|
||||
|
||||
Starts the MITM and nothing else. You open any app and play something; it records
|
||||
|
|
@ -145,7 +145,7 @@ whatever license, PSSH and manifest traffic appears and writes
|
|||
### Launch only
|
||||
|
||||
```bash
|
||||
./bin/drm capture --app myapp --wvd data/device.wvd
|
||||
./bin/streamd capture --app myapp --wvd data/device.wvd
|
||||
```
|
||||
|
||||
Launches the app, then waits while you navigate by hand. Useful while you are still
|
||||
|
|
@ -154,7 +154,7 @@ working out the UI sequence.
|
|||
### Full automation
|
||||
|
||||
```bash
|
||||
./bin/drm capture --app myapp --channel main --auto-play --wvd data/device.wvd
|
||||
./bin/streamd capture --app myapp --channel main --auto-play --wvd data/device.wvd
|
||||
```
|
||||
|
||||
Runs the module's `Launch` and `AutoPlay`, then waits for the required fields.
|
||||
|
|
@ -224,7 +224,7 @@ Live log while a capture runs: `.cache/appproxy-<serial>.log`.
|
|||
### 1. Record everything
|
||||
|
||||
```bash
|
||||
./bin/drm proxy discover --install-ca --reinject
|
||||
./bin/streamd proxy discover --install-ca --reinject
|
||||
# play the app on the phone; Ctrl+C when done
|
||||
```
|
||||
|
||||
|
|
@ -324,8 +324,8 @@ independent paths agreeing on the PSSH and key set is strong evidence both are
|
|||
right:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app myapp --channel main --keys --wvd data/device.wvd --json > a.json
|
||||
./bin/drm capture --app myapp --channel main --auto-play --wvd data/device.wvd
|
||||
./bin/streamd catalog --app myapp --channel main --keys --wvd data/device.wvd --json > a.json
|
||||
./bin/streamd capture --app myapp --channel main --auto-play --wvd data/device.wvd
|
||||
diff <(jq -r '.keys[]' a.json | sort) <(sort outputs/myapp/latest/key.txt)
|
||||
```
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ Also sanity-check that the KID you captured matches whatever you recorded in
|
|||
Clear the phone's proxy / transparent redirect if a run is interrupted:
|
||||
|
||||
```bash
|
||||
./bin/drm proxy stop
|
||||
./bin/drm proxy clear-proxy
|
||||
./bin/streamd proxy stop
|
||||
./bin/streamd proxy clear-proxy
|
||||
adb shell "su -c 'sh /data/local/tmp/tproxy_iptables.sh stop; killall -9 appproxy 2>/dev/null; true'"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
# Writing an app module
|
||||
|
||||
A module teaches the host how to drive one streaming app. Provider code lives
|
||||
under `modules/<name>/` on disk. The host (`drm`) discovers it, builds it, and
|
||||
runs it — it is **not** compiled into `drm.exe`. Shared library helpers may live
|
||||
under `modules/<name>/` on disk. The host (`streamd`) discovers it, builds it, and
|
||||
runs it — it is **not** compiled into `streamd`. Shared library helpers may live
|
||||
under `apps/modules/<name>/` and be imported by the external CLI via `replace`.
|
||||
|
||||
Work through [capture.md](capture.md) first — you need the app's package id,
|
||||
|
|
@ -13,9 +13,9 @@ license URL, manifest host and UI selectors before you can write any of this.
|
|||
```text
|
||||
modules/myapp/
|
||||
main.go CLI: describe | launch | autoplay | catalog
|
||||
go.mod replace drmdecryption => ../../apps/pkg
|
||||
go.mod replace streamd => ../../apps/pkg
|
||||
module.yaml your values (bbc published; others often gitignored)
|
||||
.bin/myapp.exe built on demand by drm
|
||||
.bin/myapp.exe built on demand by streamd
|
||||
|
||||
apps/modules/myapp/ (optional shared library used by the CLI)
|
||||
config.go Config struct + defaults
|
||||
|
|
@ -35,8 +35,8 @@ Embed `provider.Common` for the fields every module has, then add your own.
|
|||
package myapp
|
||||
|
||||
import (
|
||||
"drmdecryption/modcfg"
|
||||
"drmdecryption/modules/provider"
|
||||
"streamd/modcfg"
|
||||
"streamd/modules/provider"
|
||||
)
|
||||
|
||||
const Name = "myapp"
|
||||
|
|
@ -103,7 +103,7 @@ func loadConfig() (Config, modcfg.Result, error) {
|
|||
|
||||
`modcfg.Override` applies **flag → environment (`MYAPP_API_BASE`) → file**. A
|
||||
missing `module.yaml` is not an error: the module must still construct so
|
||||
`drm modules` can report it as unconfigured.
|
||||
`streamd modules` can report it as unconfigured.
|
||||
|
||||
## 2. The App type
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ phone; put real values in `module.yaml` if your app differs.
|
|||
|
||||
## 4. Optional: catalog
|
||||
|
||||
Implement `app.Catalog` and `drm catalog --app myapp` starts working.
|
||||
Implement `app.Catalog` and `streamd catalog --app myapp` starts working.
|
||||
|
||||
```go
|
||||
func (a *App) Resolve(channel string) (session.Stream, error) {
|
||||
|
|
@ -328,8 +328,8 @@ app and stream names.
|
|||
No host rebuild. Put the CLI + `module.yaml` under `modules/myapp/`, then:
|
||||
|
||||
```bash
|
||||
./bin/drm modules
|
||||
./bin/drm capture --app myapp --channel …
|
||||
./bin/streamd modules
|
||||
./bin/streamd capture --app myapp --channel …
|
||||
```
|
||||
|
||||
The host builds `modules/myapp/.bin/myapp` on first use (Go must be on PATH).
|
||||
|
|
@ -380,4 +380,4 @@ go -C apps/modules test -tags live ./myapp/ -v
|
|||
- [ ] `CaptureHints` asks only for fields the app really produces
|
||||
- [ ] `KeyMode` is correct (`raw` for binary challenges, `modulardrm` for JSON)
|
||||
- [ ] Added to `all/all.go`
|
||||
- [ ] `drm modules` lists it with the right channel count
|
||||
- [ ] `streamd modules` lists it with the right channel count
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ Full background: [capture.md — Transparent capture](../capture.md#transparent-
|
|||
|
||||
```powershell
|
||||
# NordVPN UK ON
|
||||
.\bin\drm.exe proxy install-ca --reinject
|
||||
.\bin\streamd.exe proxy install-ca --reinject
|
||||
adb shell am force-stop bbc.iplayer.android
|
||||
.\bin\drm.exe proxy transparent --package bbc.iplayer.android
|
||||
.\bin\streamd.exe proxy transparent --package bbc.iplayer.android
|
||||
# Play BBC One on the phone. Ctrl+C → stop iptables + pull.
|
||||
```
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ Explore → channel logo → Watch live (uiautomator scan, same idea as RTE/TG4)
|
|||
|
||||
```powershell
|
||||
# NordVPN UK ON. Magisk CA should already be mounted. Phone unlocked.
|
||||
.\bin\drm.exe capture --app bbc --channel bbcone --wait 120
|
||||
.\bin\streamd.exe capture --app bbc --channel bbcone --wait 120
|
||||
```
|
||||
|
||||
`--channel` implies interactive navigation. Drop the channel flag and play by hand
|
||||
|
|
@ -86,7 +86,7 @@ same fields (`mpd` required; no `key` / `pssh` for clear streams).
|
|||
### Cleanup if playback breaks after a run
|
||||
|
||||
```powershell
|
||||
.\bin\drm.exe proxy stop
|
||||
.\bin\streamd.exe proxy stop
|
||||
adb shell "su -c 'sh /data/local/tmp/tproxy_iptables.sh stop; killall -9 appproxy 2>/dev/null; true'"
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ The part before `/` is the package id.
|
|||
Run a discover session and play a channel ([capture.md](capture.md)):
|
||||
|
||||
```bash
|
||||
./bin/drm proxy discover --install-ca --reinject
|
||||
./bin/streamd proxy discover --install-ca --reinject
|
||||
grep -iE 'ModularDrm|widevine|license' outputs/discover/*/appproxy.log
|
||||
```
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ Take the full URL including its query string — the account reference in it is
|
|||
of the endpoint. The module also accepts it per run:
|
||||
|
||||
```bash
|
||||
./bin/drm capture --app rte --rte.license-url 'https://.../ModularDrm?...'
|
||||
./bin/streamd capture --app rte --rte.license-url 'https://.../ModularDrm?...'
|
||||
```
|
||||
|
||||
### `score.hosts` / `score.deny`
|
||||
|
|
@ -121,7 +121,7 @@ expires. Both come from a capture.
|
|||
**The KID** is in the capture session:
|
||||
|
||||
```bash
|
||||
./bin/drm capture --app rte --channel chanone --auto-play --wvd data/device.wvd
|
||||
./bin/streamd capture --app rte --channel chanone --auto-play --wvd data/device.wvd
|
||||
jq -r '.kid' outputs/rte/latest/session.json
|
||||
```
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ map key. So `https://host/live/tc-1/vc11/vc11.isml/` is keyed `vc11`.
|
|||
|
||||
```bash
|
||||
for ch in chanone chantwo; do
|
||||
./bin/drm capture --app rte --channel $ch --auto-play --wvd data/device.wvd
|
||||
./bin/streamd capture --app rte --channel $ch --auto-play --wvd data/device.wvd
|
||||
echo "$ch -> $(jq -r .kid outputs/rte/latest/session.json)"
|
||||
done
|
||||
```
|
||||
|
|
@ -215,8 +215,8 @@ the bandwidths. Segment duration and phase are learned at runtime, not configure
|
|||
## Verify
|
||||
|
||||
```bash
|
||||
./bin/drm modules # channel count should match your file
|
||||
./bin/drm capture --app rte --channel chanone --auto-play --wvd data/device.wvd
|
||||
./bin/streamd modules # channel count should match your file
|
||||
./bin/streamd capture --app rte --channel chanone --auto-play --wvd data/device.wvd
|
||||
go -C apps/modules test -tags live ./rte/ -v
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ The app fetches a JSON config at startup that carries the live stream ids and
|
|||
playback tokens. Find it in a discover session:
|
||||
|
||||
```bash
|
||||
./bin/drm proxy discover --install-ca --reinject
|
||||
./bin/streamd proxy discover --install-ca --reinject
|
||||
grep -oE 'https?://[^"]+(config|playback)[^"]*\.json' \
|
||||
outputs/discover/*/appproxy_traffic.jsonl | sort -u
|
||||
```
|
||||
|
|
@ -117,7 +117,7 @@ grep -oE 'pk=BCpkAD[A-Za-z0-9_-]+' outputs/discover/*/appproxy_traffic.jsonl \
|
|||
Treat it as a secret: keep it in this gitignored file, or pass it per run.
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel chanone --tg4.policy-key 'BCpkAD...'
|
||||
./bin/streamd catalog --app tg4 --channel chanone --tg4.policy-key 'BCpkAD...'
|
||||
export TG4_POLICY_KEY='BCpkAD...'
|
||||
```
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ still works.
|
|||
|
||||
### `channels.*.phone_only`
|
||||
|
||||
Set it for a channel that has no catalog entry. `drm catalog` then fails with a
|
||||
Set it for a channel that has no catalog entry. `streamd catalog` then fails with a
|
||||
message pointing at phone capture instead of a confusing "no video id" error.
|
||||
|
||||
### `ui.launch_resource_contains`
|
||||
|
|
@ -205,8 +205,8 @@ grep -oE '"host":"[^"]+"' outputs/discover/*/appproxy_traffic.jsonl \
|
|||
Catalog path first — it needs no phone:
|
||||
|
||||
```bash
|
||||
./bin/drm modules
|
||||
./bin/drm catalog --app tg4 --list
|
||||
./bin/streamd modules
|
||||
./bin/streamd catalog --app tg4 --list
|
||||
```
|
||||
|
||||
```text
|
||||
|
|
@ -225,7 +225,7 @@ channel the provider has switched off.
|
|||
Then resolve one for real:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel chanone --keys --wvd data/device.wvd
|
||||
./bin/streamd catalog --app tg4 --channel chanone --keys --wvd data/device.wvd
|
||||
```
|
||||
|
||||
Expect an HLS DVR manifest, a `/lic/wv?token=` license URL, a PSSH, and several
|
||||
|
|
@ -235,8 +235,8 @@ Finally, cross-check the phone path against it — independent routes agreeing o
|
|||
PSSH and the full key set is strong evidence both are configured correctly:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel chanone --keys --wvd data/device.wvd --json > a.json
|
||||
./bin/drm capture --app tg4 --channel chanone --auto-play --wvd data/device.wvd
|
||||
./bin/streamd catalog --app tg4 --channel chanone --keys --wvd data/device.wvd --json > a.json
|
||||
./bin/streamd capture --app tg4 --channel chanone --auto-play --wvd data/device.wvd
|
||||
diff <(jq -r '.keys[]' a.json | sort) <(sort outputs/tg4/latest/key.txt)
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export PATH="$GOROOT/bin:$PATH"
|
|||
git clone https://git.nulldrm.com/nulldrm/Null-DRM-Official.git
|
||||
cd Null-DRM-Official
|
||||
|
||||
go -C apps/cli build -o ../../bin/drm . # Windows: -o ../../bin/drm.exe
|
||||
go -C apps/cli build -o ../../bin/streamd . # Windows: -o ../../bin/streamd.exe
|
||||
```
|
||||
|
||||
That single command builds the whole toolchain: capture, catalog, agent, the
|
||||
|
|
@ -40,8 +40,8 @@ streamd control plane, the MITM host CLI, and every app module.
|
|||
Verify:
|
||||
|
||||
```bash
|
||||
./bin/drm help
|
||||
./bin/drm modules
|
||||
./bin/streamd help
|
||||
./bin/streamd modules
|
||||
```
|
||||
|
||||
Expected on a fresh clone — modules exist, values do not:
|
||||
|
|
@ -103,14 +103,14 @@ channels:
|
|||
Confirm it loaded:
|
||||
|
||||
```bash
|
||||
./bin/drm modules
|
||||
./bin/drm catalog --app tg4 --list
|
||||
./bin/streamd modules
|
||||
./bin/streamd catalog --app tg4 --list
|
||||
```
|
||||
|
||||
Nothing stored? Pass values per run instead:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel ioi \
|
||||
./bin/streamd catalog --app tg4 --channel ioi \
|
||||
--tg4.account-id 1234567890 --tg4.policy-key 'BCpkAD...'
|
||||
```
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ mechanical defaults (timeouts, DASH timescales, card geometry) have built-ins.
|
|||
If the app has a public playback catalog:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel ioi --keys --wvd data/device.wvd
|
||||
./bin/streamd catalog --app tg4 --channel ioi --keys --wvd data/device.wvd
|
||||
```
|
||||
|
||||
```text
|
||||
|
|
@ -149,8 +149,8 @@ One-time device setup:
|
|||
|
||||
```bash
|
||||
adb devices # your phone must be listed and authorised
|
||||
./bin/drm proxy build # cross-compiles the on-device MITM (linux/arm64)
|
||||
./bin/drm proxy install-ca --reinject
|
||||
./bin/streamd proxy build # cross-compiles the on-device MITM (linux/arm64)
|
||||
./bin/streamd proxy install-ca --reinject
|
||||
```
|
||||
|
||||
`install-ca` pushes the MITM CA and Magisk-mounts it into the system trust store.
|
||||
|
|
@ -160,7 +160,7 @@ if the reinject does not report success.
|
|||
Then capture:
|
||||
|
||||
```bash
|
||||
./bin/drm capture --app rte --channel rteone --auto-play --wvd data/device.wvd
|
||||
./bin/streamd capture --app rte --channel rteone --auto-play --wvd data/device.wvd
|
||||
```
|
||||
|
||||
What it does: start the on-device MITM → point the phone's HTTP proxy at it →
|
||||
|
|
@ -192,7 +192,7 @@ entirely for passive mode — the MITM records whatever you play.
|
|||
## 7. Control plane
|
||||
|
||||
```bash
|
||||
./bin/drm serve --bind 127.0.0.1:8083 --data .cache/streamd --token SECRET
|
||||
./bin/streamd serve --bind 127.0.0.1:8083 --data .cache/streamd --token SECRET
|
||||
```
|
||||
|
||||
Open <http://127.0.0.1:8083>. The app and channel pickers are populated from
|
||||
|
|
@ -201,7 +201,7 @@ Open <http://127.0.0.1:8083>. The app and channel pickers are populated from
|
|||
Create a stream from a capture:
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel ioi --keys --wvd data/device.wvd --json \
|
||||
./bin/streamd catalog --app tg4 --channel ioi --keys --wvd data/device.wvd --json \
|
||||
> /tmp/s.json
|
||||
|
||||
curl -X POST http://127.0.0.1:8083/api/streams \
|
||||
|
|
@ -216,11 +216,11 @@ credentials, claims a free phone, re-captures it and POSTs the result back.
|
|||
|
||||
```bash
|
||||
export STREAMD_TOKEN=SECRET
|
||||
./bin/drm agent run --config apps/agent/agent.yaml
|
||||
./bin/streamd agent run --config apps/agent/agent.yaml
|
||||
|
||||
./bin/drm agent devices # which phones it can use
|
||||
./bin/drm agent status # recent jobs
|
||||
./bin/drm agent enqueue --stream tg4-ioi --reason manual
|
||||
./bin/streamd agent devices # which phones it can use
|
||||
./bin/streamd agent status # recent jobs
|
||||
./bin/streamd agent enqueue --stream tg4-ioi --reason manual
|
||||
```
|
||||
|
||||
Details in [streamd.md](streamd.md).
|
||||
|
|
@ -243,10 +243,10 @@ go -C apps/modules test -tags live ./rte/ -v
|
|||
|
||||
| Symptom | Cause |
|
||||
|---|---|
|
||||
| `unknown module "x"` / `unknown app "x"` | missing under `modules/<name>/` — add the folder or check `drm modules` |
|
||||
| `channels 0` in `drm modules` | no `module.yaml`, or `channels:` is empty |
|
||||
| `unknown module "x"` / `unknown app "x"` | missing under `modules/<name>/` — add the folder or check `streamd modules` |
|
||||
| `channels 0` in `streamd modules` | no `module.yaml`, or `channels:` is empty |
|
||||
| `unknown channel "y"` | id not in `channels:` and not in `aliases:` |
|
||||
| `tls: unknown certificate` on the phone | CA not mounted — `drm proxy install-ca --reinject` |
|
||||
| `tls: unknown certificate` on the phone | CA not mounted — `streamd proxy install-ca --reinject` |
|
||||
| `wvkey requires --wvd` | pass `--wvd path/to/device.wvd` |
|
||||
| `timed out waiting for capture` | playback never started, or the app used a path the MITM missed — see [capture.md](capture.md) |
|
||||
| `INVALID_POLICY_KEY` | wrong or stale `policy_key` |
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Multi-platform releases
|
||||
|
||||
Host CLI (`drm`) and the on-device MITM (`proxy-android-arm64`) are plain Go
|
||||
Host CLI (`streamd`) and the on-device MITM (`proxy-android-arm64`) are plain Go
|
||||
binaries (`CGO_ENABLED=0`), so one machine can cross-compile every target.
|
||||
|
||||
## Local build
|
||||
|
|
@ -19,59 +19,79 @@ Writes `dist/release/`:
|
|||
|
||||
| File | Use |
|
||||
|---|---|
|
||||
| `drm-windows-amd64.exe` | Windows x86_64 host |
|
||||
| `drm-windows-arm64.exe` | Windows ARM64 host |
|
||||
| `drm-linux-amd64` | Linux x86_64 host |
|
||||
| `drm-linux-arm64` | Linux ARM64 host |
|
||||
| `drm-darwin-amd64` | macOS Intel |
|
||||
| `drm-darwin-arm64` | macOS Apple Silicon |
|
||||
| `proxy-android-arm64` | Phone MITM (`drm proxy push` / transparent) |
|
||||
| `streamd-windows-amd64.exe` | Windows x86_64 host |
|
||||
| `streamd-windows-arm64.exe` | Windows ARM64 host |
|
||||
| `streamd-linux-amd64` | Linux x86_64 host |
|
||||
| `streamd-linux-arm64` | Linux ARM64 host |
|
||||
| `streamd-darwin-amd64` | macOS Intel |
|
||||
| `streamd-darwin-arm64` | macOS Apple Silicon |
|
||||
| `proxy-android-arm64` | Phone MITM (`streamd proxy push` / transparent) |
|
||||
| `SHA256SUMS.txt` | SHA-256 of the above |
|
||||
|
||||
Releases **do not** ship a MITM private key. On each machine, the first
|
||||
`drm proxy install-ca --reinject` creates `data/proxy-ca.crt` + `data/proxy-ca.key`
|
||||
`streamd proxy install-ca --reinject` creates `data/proxy-ca.crt` + `data/proxy-ca.key`
|
||||
(unique per install). Users must not copy `data/` between PCs if they want
|
||||
separate CAs.
|
||||
|
||||
**Single-exe bootstrap:** drop `drm-windows-amd64.exe` anywhere and run it. On
|
||||
**Single-exe bootstrap:** drop `streamd-windows-amd64.exe` anywhere and run it. On
|
||||
first command it creates scaffold folders next to itself (`apps/pkg`, `bin/`,
|
||||
`outputs/`, …) and extracts `proxy-android-arm64`. It does **not** ship
|
||||
`apps/modules/*/module.yaml` — those stay out of the exe.
|
||||
|
||||
```text
|
||||
./
|
||||
drm.exe
|
||||
streamd.exe # drm.exe also shipped as a one-release compat copy
|
||||
README.md
|
||||
apps/pkg/go.mod
|
||||
apps/proxy/device/tproxy_iptables.sh
|
||||
apps/modules/<name>/module.yaml ← YOU add these (copy from GitHub / write your own)
|
||||
bin/drm.exe
|
||||
bin/streamd.exe
|
||||
bin/proxy-android-arm64
|
||||
configs/
|
||||
outputs/
|
||||
data/ ← after first install-ca (private CA)
|
||||
```
|
||||
|
||||
Existing files are never overwritten. `drm proxy build` is for full source
|
||||
Existing files are never overwritten. `streamd proxy build` is for full source
|
||||
checkouts only.
|
||||
|
||||
## Forgejo (git.nulldrm.com)
|
||||
|
||||
Push a version tag; Actions builds and attaches the same files to the release:
|
||||
### Stable vs beta
|
||||
|
||||
| Tag you push | Release | Rolling channel | README download |
|
||||
|---|---|---|---|
|
||||
| `v1.2.3` | Normal release | Retargets **`stable`** | `…/releases/download/stable/<asset>` |
|
||||
| `v1.2.3-beta.1` (also `-rc.N`, `-alpha.N`) | **Pre-release** | Retargets **`beta`** | `…/releases/download/beta/<asset>` |
|
||||
|
||||
```bash
|
||||
# Stable
|
||||
git tag v1.2.3
|
||||
git push origin v1.2.3
|
||||
|
||||
# Beta
|
||||
git tag v1.2.3-beta.1
|
||||
git push origin v1.2.3-beta.1
|
||||
```
|
||||
|
||||
CI uploads assets to the version tag **and** overrides the matching channel tag
|
||||
(`stable` or `beta`) so curl/PowerShell links in the README never need a version bump.
|
||||
|
||||
Optional per-tag notes: commit `docs/releases/<tag>.md` (e.g. `docs/releases/v0.2.0.md`).
|
||||
The release workflow attaches that file as the Forgejo release body when present.
|
||||
|
||||
Do **not** use Forgejo’s generic `/releases/latest` for host binaries — that page
|
||||
follows the newest release of any kind (including `modules-v*`). Prefer `stable` /
|
||||
`beta` or a concrete `v*` tag.
|
||||
|
||||
Workflow: [`.forgejo/workflows/release.yml`](../.forgejo/workflows/release.yml).
|
||||
Runner setup: [deploy/forgejo/README.md](../deploy/forgejo/README.md) § Actions / releases.
|
||||
|
||||
## Manual one-off cross-compile
|
||||
|
||||
```bash
|
||||
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go -C apps/cli build -o bin/drm.exe .
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go -C apps/cli build -o bin/drm-darwin-arm64 .
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go -C apps/cli build -o bin/drm-linux-amd64 .
|
||||
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go -C apps/cli build -o bin/streamd.exe .
|
||||
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go -C apps/cli build -o bin/streamd-darwin-arm64 .
|
||||
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go -C apps/cli build -o bin/streamd-linux-amd64 .
|
||||
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go -C apps/proxy/device build -o bin/proxy-android-arm64 .
|
||||
```
|
||||
|
|
|
|||
65
docs/releases/v0.2.0.md
Normal file
65
docs/releases/v0.2.0.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Streamd v0.2.0
|
||||
|
||||
First release under the **Streamd** product name. Host binary is `streamd`
|
||||
(`drm` is still shipped as an identical compatibility copy for this release).
|
||||
|
||||
## Highlights
|
||||
|
||||
### Renamed to Streamd
|
||||
- Host CLI / help / health report as **`streamd`**
|
||||
- Go module path is `streamd` (external provider CLIs use `streamd/modcli/<name>`)
|
||||
- Prefer `$STREAMD_MODULES_DIR` and `$STREAMD_API_KEY` / `$STREAMD_TOKEN` (legacy `DRM_*` still accepted)
|
||||
- Agent User-Agent is `streamd-agent/…`
|
||||
- Fresh MITM CAs use CN **Streamd Capture CA**
|
||||
- Docs and README updated; www/Forgejo stay on nulldrm.com / Null-DRM-Official for now
|
||||
|
||||
### Panel modules store
|
||||
- Dashboard **Modules** page (`#/modules`): drag-drop release `.zip`, list hashes/arches, edit `module.yaml`, delete
|
||||
- Panel is source of truth under `--data/modules/`
|
||||
- Agents with `sync_modules: true` **pull** packages/YAML into their data dir; `modules_changed` WS events trigger immediate sync
|
||||
- Soft-skip bad modules on `/api/apps` so one broken upload does not blank stream pickers
|
||||
|
||||
### Stable + beta download channels
|
||||
- Push `vX.Y.Z` → versioned release **and** rolling tag **`stable`**
|
||||
- Push `vX.Y.Z-beta.N` (also `-rc.N` / `-alpha.N`) → **pre-release** **and** rolling tag **`beta`**
|
||||
- Always-latest downloads (no version pin in docs):
|
||||
|
||||
```bash
|
||||
# Linux Intel / AMD 64-bit (stable)
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/stable/streamd-linux-amd64"
|
||||
chmod +x streamd
|
||||
```
|
||||
|
||||
```bash
|
||||
# Linux ARM 64-bit (stable)
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/stable/streamd-linux-arm64"
|
||||
chmod +x streamd
|
||||
```
|
||||
|
||||
```bash
|
||||
# Beta channel (Linux Intel / AMD 64-bit)
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/beta/streamd-linux-amd64"
|
||||
chmod +x streamd
|
||||
```
|
||||
|
||||
Avoid Forgejo’s generic `/releases/latest` for host binaries — it can point at a `modules-v*` release.
|
||||
|
||||
## Assets
|
||||
|
||||
| Asset | Platform |
|
||||
|---|---|
|
||||
| `streamd-windows-amd64.exe` | Windows x86_64 |
|
||||
| `streamd-windows-arm64.exe` | Windows ARM64 |
|
||||
| `streamd-linux-amd64` | Linux x86_64 |
|
||||
| `streamd-linux-arm64` | Linux ARM64 |
|
||||
| `streamd-darwin-amd64` | macOS Intel |
|
||||
| `streamd-darwin-arm64` | macOS Apple Silicon |
|
||||
| `drm-*` | Same bytes as matching `streamd-*` (compat) |
|
||||
| `proxy-android-arm64` | On-device MITM |
|
||||
| `SHA256SUMS.txt` | Checksums |
|
||||
|
||||
Built with `CGO_ENABLED=0`. Phone capture still needs Magisk + `streamd proxy install-ca --reinject`.
|
||||
Provider zips remain on separate **`modules-v*`** releases.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Streamd + agent on a Linux server (for dummies)
|
||||
|
||||
This guide is only for **streamd** (`drm serve`) and the **agent** (`drm agent run`)
|
||||
This guide is only for **streamd** (`streamd serve`) and the **agent** (`streamd agent run`)
|
||||
on a **Linux** box. Copy-paste the commands. Change the bits in `CAPS` or
|
||||
`<angle brackets>`.
|
||||
|
||||
|
|
@ -14,8 +14,8 @@ For the deep reference (every flag, every API route), see [streamd.md](streamd.m
|
|||
|
||||
| Piece | Command | Job |
|
||||
|---|---|---|
|
||||
| **streamd** | `drm serve` | Dashboard + API + pulls the MPD and serves HLS |
|
||||
| **agent** | `drm agent run` | Optional. Uses a phone to refresh MPD/keys when they expire |
|
||||
| **streamd** | `streamd serve` | Dashboard + API + pulls the MPD and serves HLS |
|
||||
| **agent** | `streamd agent run` | Optional. Uses a phone to refresh MPD/keys when they expire |
|
||||
|
||||
If you already have a working MPD URL and Widevine keys (`KID:KEY`), you can run
|
||||
**streamd alone**. Start the agent later when you want automatic refresh.
|
||||
|
|
@ -35,8 +35,8 @@ Check your CPU type:
|
|||
uname -m
|
||||
```
|
||||
|
||||
- `x86_64` → download `drm-linux-amd64`
|
||||
- `aarch64` → download `drm-linux-arm64`
|
||||
- `x86_64` → download `streamd-linux-amd64`
|
||||
- `aarch64` → download `streamd-linux-arm64`
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -47,24 +47,36 @@ mkdir -p ~/null-drm
|
|||
cd ~/null-drm
|
||||
```
|
||||
|
||||
Pick the matching line (replace `v0.1.4` if a newer `v*` release exists — check
|
||||
[releases](https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases)):
|
||||
Grab a rolling channel build (always the newest — no version pin). Pick **one**
|
||||
block for your CPU. Pin with a concrete tag (`v0.1.5`, `v0.2.0-beta.1`, …) when
|
||||
you need a fixed install.
|
||||
|
||||
**Linux Intel / AMD 64-bit (stable)**
|
||||
|
||||
```bash
|
||||
# Intel / AMD 64-bit
|
||||
curl -fL -o drm \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/v0.1.4/drm-linux-amd64"
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/stable/streamd-linux-amd64"
|
||||
```
|
||||
|
||||
# OR ARM 64-bit (Raspberry Pi 4+, many cloud ARM VMs)
|
||||
# curl -fL -o drm \
|
||||
# "https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/v0.1.4/drm-linux-arm64"
|
||||
**Linux ARM 64-bit (stable)** — Raspberry Pi 4+, many cloud ARM VMs
|
||||
|
||||
```bash
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/stable/streamd-linux-arm64"
|
||||
```
|
||||
|
||||
**Beta channel (Linux Intel / AMD 64-bit pre-release)**
|
||||
|
||||
```bash
|
||||
curl -fL -o streamd \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/beta/streamd-linux-amd64"
|
||||
```
|
||||
|
||||
Make it executable and check it works:
|
||||
|
||||
```bash
|
||||
chmod +x drm
|
||||
./drm help
|
||||
chmod +x streamd
|
||||
./streamd help
|
||||
```
|
||||
|
||||
You should see a list of commands including `serve` and `agent`.
|
||||
|
|
@ -73,7 +85,7 @@ Optional layout after first run:
|
|||
|
||||
```text
|
||||
~/null-drm/
|
||||
drm # the binary
|
||||
streamd # the binary
|
||||
.cache/streamd/ # created by serve (database, HLS, logs)
|
||||
.cache/agent/ # created by agent
|
||||
agent.yaml # you create this for the agent
|
||||
|
|
@ -92,7 +104,7 @@ not stuck hunting a setup token in the logs:
|
|||
```bash
|
||||
cd ~/null-drm
|
||||
|
||||
./drm serve \
|
||||
./streamd serve \
|
||||
--bind 0.0.0.0:8083 \
|
||||
--data .cache/streamd \
|
||||
--admin-user admin \
|
||||
|
|
@ -236,7 +248,7 @@ Skip this section if you will paste MPD/keys yourself forever.
|
|||
- `adb` on the server `PATH`
|
||||
- A rooted phone with the streaming app **already installed** (agent never installs apps)
|
||||
- USB debugging authorised (`adb devices` shows `device`)
|
||||
- Provider modules under `modules/` if you use phone capture for that app
|
||||
- Provider modules uploaded in the streamd **Modules** page (drag-drop `.zip`); agents pull them with `sync_modules: true`
|
||||
- A `.wvd` at `data/device.wvd` (or set `wvd:` in the config) for key fetch
|
||||
|
||||
### Config file
|
||||
|
|
@ -265,15 +277,15 @@ Save, then run:
|
|||
|
||||
```bash
|
||||
cd ~/null-drm
|
||||
./drm agent run --config agent.yaml
|
||||
./streamd agent run --config agent.yaml
|
||||
```
|
||||
|
||||
Useful checks:
|
||||
|
||||
```bash
|
||||
./drm agent devices
|
||||
./drm agent status
|
||||
./drm agent enqueue --stream city-news --reason manual
|
||||
./streamd agent devices
|
||||
./streamd agent status
|
||||
./streamd agent enqueue --stream city-news --reason manual
|
||||
```
|
||||
|
||||
In the dashboard, **Refresh keys** on a stream asks connected agents to capture now.
|
||||
|
|
@ -282,7 +294,7 @@ In the dashboard, **Refresh keys** on a stream asks connected agents to capture
|
|||
|
||||
## 6. Keep it running when you close the terminal
|
||||
|
||||
If you close SSH while `drm serve` is in the foreground, it dies. Pick one method.
|
||||
If you close SSH while `streamd serve` is in the foreground, it dies. Pick one method.
|
||||
|
||||
### Method A — `screen` (simplest)
|
||||
|
||||
|
|
@ -296,7 +308,7 @@ Start streamd inside a named screen:
|
|||
```bash
|
||||
cd ~/null-drm
|
||||
screen -S streamd
|
||||
./drm serve --bind 0.0.0.0:8083 --data .cache/streamd
|
||||
./streamd serve --bind 0.0.0.0:8083 --data .cache/streamd
|
||||
```
|
||||
|
||||
Detach without killing it: press **`Ctrl+A`**, then **`D`**.
|
||||
|
|
@ -312,7 +324,7 @@ Second screen for the agent:
|
|||
```bash
|
||||
screen -S agent
|
||||
cd ~/null-drm
|
||||
./drm agent run --config agent.yaml
|
||||
./streamd agent run --config agent.yaml
|
||||
# Ctrl+A then D
|
||||
```
|
||||
|
||||
|
|
@ -324,7 +336,7 @@ List sessions: `screen -ls`
|
|||
sudo apt-get install -y tmux
|
||||
cd ~/null-drm
|
||||
tmux new -s streamd
|
||||
./drm serve --bind 0.0.0.0:8083 --data .cache/streamd
|
||||
./streamd serve --bind 0.0.0.0:8083 --data .cache/streamd
|
||||
# Detach: Ctrl+B then D
|
||||
# Reattach: tmux attach -t streamd
|
||||
```
|
||||
|
|
@ -333,11 +345,11 @@ tmux new -s streamd
|
|||
|
||||
```bash
|
||||
cd ~/null-drm
|
||||
nohup ./drm serve --bind 0.0.0.0:8083 --data .cache/streamd > streamd.log 2>&1 &
|
||||
nohup ./streamd serve --bind 0.0.0.0:8083 --data .cache/streamd > streamd.log 2>&1 &
|
||||
echo $! > streamd.pid
|
||||
|
||||
# optional agent
|
||||
nohup ./drm agent run --config agent.yaml > agent.log 2>&1 &
|
||||
nohup ./streamd agent run --config agent.yaml > agent.log 2>&1 &
|
||||
echo $! > agent.pid
|
||||
```
|
||||
|
||||
|
|
@ -356,7 +368,7 @@ Create a user unit (no root binary needed). Paths assume install in `/home/ubunt
|
|||
```bash
|
||||
sudo tee /etc/systemd/system/streamd.service >/dev/null <<'EOF'
|
||||
[Unit]
|
||||
Description=Null-DRM streamd (drm serve)
|
||||
Description=Streamd (streamd serve)
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
|
|
@ -364,7 +376,7 @@ Wants=network-online.target
|
|||
Type=simple
|
||||
User=ubuntu
|
||||
WorkingDirectory=/home/ubuntu/null-drm
|
||||
ExecStart=/home/ubuntu/null-drm/drm serve --bind 0.0.0.0:8083 --data /home/ubuntu/null-drm/.cache/streamd
|
||||
ExecStart=/home/ubuntu/null-drm/streamd serve --bind 0.0.0.0:8083 --data /home/ubuntu/null-drm/.cache/streamd
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
# Optional first-boot admin (ignored once users exist):
|
||||
|
|
@ -374,9 +386,9 @@ RestartSec=5
|
|||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
sudo tee /etc/systemd/system/drm-agent.service >/dev/null <<'EOF'
|
||||
sudo tee /etc/systemd/system/streamd-agent.service >/dev/null <<'EOF'
|
||||
[Unit]
|
||||
Description=Null-DRM credentials agent
|
||||
Description=Streamd credentials agent
|
||||
After=network-online.target streamd.service
|
||||
Wants=network-online.target
|
||||
Requires=streamd.service
|
||||
|
|
@ -385,7 +397,7 @@ Requires=streamd.service
|
|||
Type=simple
|
||||
User=ubuntu
|
||||
WorkingDirectory=/home/ubuntu/null-drm
|
||||
ExecStart=/home/ubuntu/null-drm/drm agent run --config /home/ubuntu/null-drm/agent.yaml
|
||||
ExecStart=/home/ubuntu/null-drm/streamd agent run --config /home/ubuntu/null-drm/agent.yaml
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
|
|
@ -396,7 +408,7 @@ EOF
|
|||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable --now streamd.service
|
||||
# when ready for the agent:
|
||||
# sudo systemctl enable --now drm-agent.service
|
||||
# sudo systemctl enable --now streamd-agent.service
|
||||
```
|
||||
|
||||
Useful commands:
|
||||
|
|
@ -408,7 +420,7 @@ sudo systemctl restart streamd
|
|||
sudo systemctl stop streamd
|
||||
```
|
||||
|
||||
Same pattern with `drm-agent` for the agent unit.
|
||||
Same pattern with `streamd-agent` for the agent unit.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -418,7 +430,7 @@ Same pattern with `drm-agent` for the agent unit.
|
|||
cd ~/null-drm
|
||||
|
||||
# binary runs
|
||||
./drm help
|
||||
./streamd help
|
||||
|
||||
# streamd answers
|
||||
curl -sS http://127.0.0.1:8083/api/health
|
||||
|
|
@ -439,7 +451,7 @@ Play the m3u8 in VLC / ffplay / any HLS player using the server IP URL.
|
|||
|
||||
| Symptom | Fix |
|
||||
|---|---|
|
||||
| `Permission denied` running `./drm` | `chmod +x drm` |
|
||||
| `Permission denied` running `./streamd` | `chmod +x streamd` |
|
||||
| Browser cannot open the page | Use `--bind 0.0.0.0:8083`, open firewall port 8083, check `curl` from the server itself |
|
||||
| Stream will not start | MPD must be `http://` or `https://`. Encrypted streams need `KID:KEY` lines |
|
||||
| Agent does nothing | Operator API key wrong; stream **Enabled**; phone in `adb devices` as `device`; app installed |
|
||||
|
|
@ -458,11 +470,11 @@ Upgrade:
|
|||
```bash
|
||||
cd ~/null-drm
|
||||
# stop streamd first (systemctl stop streamd / kill / Ctrl+C)
|
||||
curl -fL -o drm.new \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/v0.1.4/drm-linux-amd64"
|
||||
chmod +x drm.new
|
||||
mv drm drm.bak
|
||||
mv drm.new drm
|
||||
curl -fL -o streamd.new \
|
||||
"https://git.nulldrm.com/nulldrm/Null-DRM-Official/releases/download/stable/streamd-linux-amd64"
|
||||
chmod +x streamd.new
|
||||
mv streamd streamd.bak
|
||||
mv streamd.new streamd
|
||||
# start again
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
# Control plane and agent
|
||||
|
||||
Two long-running pieces: `drm serve` holds the state and the dashboard, `drm agent
|
||||
Two long-running pieces: `streamd serve` holds the state and the dashboard, `streamd agent
|
||||
run` keeps credentials fresh using real phones.
|
||||
|
||||
**New to Linux servers?** Start with the copy-paste guide:
|
||||
[streamd-server-setup.md](streamd-server-setup.md) (download, chmod, add MPD
|
||||
streams, screen/systemd so it survives closing the terminal).
|
||||
|
||||
## drm serve
|
||||
## streamd serve
|
||||
|
||||
```bash
|
||||
./bin/drm serve --bind 127.0.0.1:8083 --data .cache/streamd
|
||||
./bin/streamd serve --bind 127.0.0.1:8083 --data .cache/streamd
|
||||
```
|
||||
|
||||
| Flag | Default | Purpose |
|
||||
|
|
@ -53,9 +53,14 @@ warning.
|
|||
| Route | Purpose |
|
||||
|---|---|
|
||||
| `GET /api/health` | liveness + uptime + `deps` paths |
|
||||
| `GET /api/apps` | modules under `modules/`, their channels, registered rewriters |
|
||||
| `GET /api/modules` | list `modules/<name>/` with `has_yaml` + `yaml_sha256` |
|
||||
| `PUT /api/modules/:name` | write `modules/<name>/module.yaml` (bearer; raw YAML or `{"yaml":…}`) |
|
||||
| `GET /api/apps` | modules under the panel store (`--data/modules`), channels, rewriters |
|
||||
| `GET /api/modules` | list panel modules with yaml/package hashes + arches |
|
||||
| `GET /api/modules/:name` | metadata; `?include=yaml` returns YAML (operator+) |
|
||||
| `GET /api/modules/:name/yaml` | raw `module.yaml` (operator / agent pull) |
|
||||
| `GET /api/modules/:name/package` | download `package.zip` (operator / agent pull) |
|
||||
| `PUT /api/modules/:name` | save `module.yaml` (operator; JSON `{"yaml":…}` or raw YAML) |
|
||||
| `POST /api/modules/upload` | multipart zip upload (`file` + optional `name`) |
|
||||
| `DELETE /api/modules/:name` | remove a module from the panel store |
|
||||
| `GET /api/streams` | all streams with runtime state |
|
||||
| `POST /api/streams` | create |
|
||||
| `PATCH /api/streams/:id` | update |
|
||||
|
|
@ -72,7 +77,7 @@ the UI or the schema.
|
|||
### Creating a stream
|
||||
|
||||
```bash
|
||||
./bin/drm catalog --app tg4 --channel ioi --keys --wvd data/device.wvd --json > s.json
|
||||
./bin/streamd catalog --app tg4 --channel ioi --keys --wvd data/device.wvd --json > s.json
|
||||
|
||||
curl -X POST http://127.0.0.1:8083/api/streams \
|
||||
-H 'Authorization: Bearer SECRET' -H 'Content-Type: application/json' \
|
||||
|
|
@ -113,13 +118,13 @@ The log line is `stream X: rewritten MPD http://127.0.0.1:…`. Streamd never im
|
|||
a provider package to do this — the module registered the rewriter under that name
|
||||
at init time.
|
||||
|
||||
## drm agent run
|
||||
## streamd agent run
|
||||
|
||||
```bash
|
||||
# Prefer an operator API key from the streamd dashboard (Settings → API keys).
|
||||
export STREAMD_API_KEY=ndk_…
|
||||
# or: export STREAMD_TOKEN=… (legacy alias)
|
||||
./bin/drm agent run --config apps/agent/agent.yaml
|
||||
./bin/streamd agent run --config apps/agent/agent.yaml
|
||||
```
|
||||
|
||||
What it does, in a loop:
|
||||
|
|
@ -139,10 +144,10 @@ push a capture immediately (`POST /api/streams/:id/capture` or the dashboard
|
|||
### Subcommands
|
||||
|
||||
```bash
|
||||
./bin/drm agent devices # phones it can use
|
||||
./bin/drm agent status # recent jobs
|
||||
./bin/drm agent enqueue --stream tg4-ioi --reason manual
|
||||
./bin/drm agent cancel --job 3
|
||||
./bin/streamd agent devices # phones it can use
|
||||
./bin/streamd agent status # recent jobs
|
||||
./bin/streamd agent enqueue --stream tg4-ioi --reason manual
|
||||
./bin/streamd agent cancel --job 3
|
||||
```
|
||||
|
||||
### Config
|
||||
|
|
@ -167,8 +172,15 @@ capture_wait_sec: 180
|
|||
# agent_id: defaults to hostname
|
||||
```
|
||||
|
||||
Providers are discovered under `modules/<name>/` next to the install (built and
|
||||
run by the host; not linked into `drm.exe`).
|
||||
### Modules on the panel
|
||||
|
||||
The dashboard **Modules** page is the source of truth for provider packages:
|
||||
|
||||
1. Upload a release zip (`bbc.zip`, `c4.zip`, … from `modules-v*` tags) via drag-and-drop.
|
||||
2. Edit `module.yaml` in the panel (fill secrets after upload — release zips ship the publish template).
|
||||
3. Agents with `sync_modules: true` **pull** `package.zip` + YAML into `<data_dir>/modules/` (default). YAML-only edits skip re-downloading the zip.
|
||||
|
||||
Panel storage is under `--data/modules/` (not the repo `modules/` tree). `/api/apps` channel pickers read that store. Local `streamd capture` without an agent still uses repo `modules/` unless `--modules-dir` / `STREAMD_MODULES_DIR` points at a synced cache.
|
||||
|
||||
`wvd` must be set (here or on the phone capture) or key fetches fail.
|
||||
|
||||
|
|
@ -176,18 +188,18 @@ run by the host; not linked into `drm.exe`).
|
|||
|
||||
```bash
|
||||
# terminal 1
|
||||
./bin/drm serve --bind 127.0.0.1:8083 --data .cache/streamd
|
||||
./bin/streamd serve --bind 127.0.0.1:8083 --data .cache/streamd
|
||||
|
||||
# terminal 2 — after creating an operator API key in the dashboard
|
||||
export STREAMD_API_KEY=ndk_…
|
||||
./bin/drm agent run --config apps/agent/agent.yaml
|
||||
./bin/streamd agent run --config apps/agent/agent.yaml
|
||||
```
|
||||
|
||||
Then create a stream, leave **Enabled** checked (required for on-demand wake),
|
||||
and watch the agent pick it up:
|
||||
|
||||
```bash
|
||||
./bin/drm agent status
|
||||
./bin/streamd agent status
|
||||
```
|
||||
|
||||
## External tools
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue