streamd: serve start/stop/update, streamd.yaml, egress, module panel fixes
- Add streamd serve start|stop|restart|status|update with auto-written streamd.yaml - Panel modules: STREAMD_MODULES_DIR for describe, YAML channel fallback, textarea value fix - Per-stream WireGuard/SOCKS egress profiles + Settings UI - Drop drm-* from release builds; track streamd-bg.sh / streamd-update.sh wrappers - Docs: streamd-server-setup lifecycle and update flow
This commit is contained in:
parent
da8e1123ec
commit
8fc7e4c0b8
57 changed files with 4031 additions and 257 deletions
45
apps/streamd/internal/api/apps_test.go
Normal file
45
apps/streamd/internal/api/apps_test.go
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"streamd/apps/streamd/internal/modstore"
|
||||
)
|
||||
|
||||
func TestChannelsFromStoreYAML(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
store := modstore.New(root)
|
||||
modDir := filepath.Join(root, "rte")
|
||||
if err := os.MkdirAll(modDir, 0o755); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
yaml := []byte(`package: air.RTE
|
||||
channels:
|
||||
rteone:
|
||||
label: RTE One
|
||||
rtetwo:
|
||||
label: RTE 2
|
||||
`)
|
||||
if err := os.WriteFile(filepath.Join(modDir, "module.yaml"), yaml, 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
chans := channelsFromStoreYAML(store, "rte")
|
||||
if len(chans) != 2 {
|
||||
t.Fatalf("got %d channels: %+v", len(chans), chans)
|
||||
}
|
||||
if chans[0].ID != "rteone" || chans[0].Label != "RTE One" {
|
||||
t.Fatalf("first channel: %+v", chans[0])
|
||||
}
|
||||
if chans[1].ID != "rtetwo" {
|
||||
t.Fatalf("second channel: %+v", chans[1])
|
||||
}
|
||||
}
|
||||
|
||||
func TestChannelsFromStoreYAMLMissing(t *testing.T) {
|
||||
store := modstore.New(t.TempDir())
|
||||
if chans := channelsFromStoreYAML(store, "nope"); chans != nil {
|
||||
t.Fatalf("expected nil, got %+v", chans)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue