v0.1.1: external modules, publish YAML, proxy reset, binary-first README
- Host discovers/builds modules under modules/ (bbc, rte, tg4) - module-publish.yaml tracked; local module.yaml gitignored - drm --modules-dir / DRM_MODULES_DIR - drm proxy reset; Magisk reinject reliability - modules-v* Forgejo release workflow + build scripts - BBC full Explore channel map including S4C - README quickstart based on release binaries
This commit is contained in:
parent
1d36961a7c
commit
f9c28be3f1
52 changed files with 2915 additions and 636 deletions
|
|
@ -1,7 +1,9 @@
|
|||
# Writing an app module
|
||||
|
||||
A module teaches the binary how to drive one streaming app. It is a Go package, it
|
||||
is compiled in, and it contains no secrets.
|
||||
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 `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,
|
||||
license URL, manifest host and UI selectors before you can write any of this.
|
||||
|
|
@ -9,17 +11,21 @@ license URL, manifest host and UI selectors before you can write any of this.
|
|||
## Anatomy
|
||||
|
||||
```text
|
||||
apps/modules/myapp/
|
||||
config.go Config struct + defaults + flag binding
|
||||
myapp.go init(), the App type, Launch, AutoPlay, capability methods
|
||||
modules/myapp/
|
||||
main.go CLI: describe | launch | autoplay | catalog
|
||||
go.mod replace drmdecryption => ../../apps/pkg
|
||||
module.yaml your values (bbc published; others often gitignored)
|
||||
.bin/myapp.exe built on demand by drm
|
||||
|
||||
apps/modules/myapp/ (optional shared library used by the CLI)
|
||||
config.go Config struct + defaults
|
||||
myapp.go the App type, Launch, AutoPlay, capability methods
|
||||
steps.go navigation idioms specific to this app
|
||||
catalog.go optional: resolve channels without a phone
|
||||
mpd.go optional: manifest rewriting
|
||||
module.yaml GITIGNORED - your values
|
||||
```
|
||||
|
||||
Everything is registered from `init()`, and one line in `apps/modules/all/all.go`
|
||||
links it into the binary.
|
||||
See `modules/bbc/` for the reference external module.
|
||||
|
||||
## 1. Config
|
||||
|
||||
|
|
@ -317,22 +323,17 @@ func (a *App) TSReadyBytes() int64 { return 2 << 20 }
|
|||
Without this, streamd uses neutral defaults. This is what replaced guessing from
|
||||
app and stream names.
|
||||
|
||||
## 7. Link it in
|
||||
## 7. Drop it under modules/
|
||||
|
||||
```go
|
||||
// apps/modules/all/all.go
|
||||
import (
|
||||
_ "drmdecryption/modules/myapp"
|
||||
_ "drmdecryption/modules/rte"
|
||||
_ "drmdecryption/modules/tg4"
|
||||
)
|
||||
```
|
||||
No host rebuild. Put the CLI + `module.yaml` under `modules/myapp/`, then:
|
||||
|
||||
```bash
|
||||
go -C apps/cli build -o ../../bin/drm .
|
||||
./bin/drm modules
|
||||
./bin/drm capture --app myapp --channel …
|
||||
```
|
||||
|
||||
The host builds `modules/myapp/.bin/myapp` on first use (Go must be on PATH).
|
||||
|
||||
## 8. Test it
|
||||
|
||||
Assert the interfaces at compile time and prove no secrets leaked:
|
||||
|
|
@ -352,9 +353,12 @@ func TestNoHardcodedCredentials(t *testing.T) {
|
|||
}
|
||||
```
|
||||
|
||||
`apps/modules/all/all_test.go` already checks every registered module constructs
|
||||
with no values file present, reports a valid key mode, and — if it declares a
|
||||
rewriter name — actually registered one.
|
||||
Smoke-test the external CLI:
|
||||
|
||||
```bash
|
||||
go -C modules/myapp build -o .bin/myapp.exe .
|
||||
./modules/myapp/.bin/myapp.exe describe
|
||||
```
|
||||
|
||||
For anything needing the live service or your local values, use a build tag so the
|
||||
normal run stays hermetic:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue