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
22
apps/streamd/servecmd/update_unix.go
Normal file
22
apps/streamd/servecmd/update_unix.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//go:build unix
|
||||
|
||||
package servecmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// replaceBinary moves the live binary to archive, then moves next into place.
|
||||
func replaceBinary(target, next, archive string) error {
|
||||
if err := os.Rename(target, archive); err != nil {
|
||||
return fmt.Errorf("archive current binary: %w", err)
|
||||
}
|
||||
if err := os.Rename(next, target); err != nil {
|
||||
// Best-effort rollback.
|
||||
_ = os.Rename(archive, target)
|
||||
return fmt.Errorf("install new binary: %w", err)
|
||||
}
|
||||
_ = os.Chmod(target, 0o755)
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue