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
|
|
@ -3,6 +3,7 @@ package modhost
|
|||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"streamd/repo"
|
||||
|
|
@ -37,12 +38,32 @@ func ModulesDirOverride() string {
|
|||
return modulesDirOV
|
||||
}
|
||||
|
||||
// envModulesDir returns STREAMD_MODULES_DIR (preferred) or DRM_MODULES_DIR.
|
||||
func envModulesDir() string {
|
||||
v := strings.TrimSpace(os.Getenv("STREAMD_MODULES_DIR"))
|
||||
if v == "" {
|
||||
v = strings.TrimSpace(os.Getenv("DRM_MODULES_DIR"))
|
||||
}
|
||||
if v == "" {
|
||||
return ""
|
||||
}
|
||||
if abs, err := filepath.Abs(v); err == nil {
|
||||
return abs
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// EffectiveModulesDir is the directory that Discover/Open scan.
|
||||
// Prefer --modules-dir / STREAMD_MODULES_DIR / DRM_MODULES_DIR; else <root>/modules.
|
||||
// Prefer --modules-dir, then STREAMD_MODULES_DIR / DRM_MODULES_DIR, else <root>/modules.
|
||||
// Module binaries read the env here directly so they honour the panel store even
|
||||
// when they never call ApplyEnvModulesDir.
|
||||
func EffectiveModulesDir(root string) string {
|
||||
if ov := ModulesDirOverride(); ov != "" {
|
||||
return ov
|
||||
}
|
||||
if v := envModulesDir(); v != "" {
|
||||
return v
|
||||
}
|
||||
if root == "" {
|
||||
root = repo.Root()
|
||||
}
|
||||
|
|
@ -55,10 +76,7 @@ func ApplyEnvModulesDir() error {
|
|||
if ModulesDirOverride() != "" {
|
||||
return nil
|
||||
}
|
||||
v := os.Getenv("STREAMD_MODULES_DIR")
|
||||
if v == "" {
|
||||
v = os.Getenv("DRM_MODULES_DIR")
|
||||
}
|
||||
v := envModulesDir()
|
||||
if v == "" {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue