streamd: optional keys, per-stream proxy, auto deps; agent module.yaml sync; RTE AutoPlay; Telegram release announces
- streamd: MPD-only start, proxy field, ffmpeg/NRE/mp4decrypt auto-install - GET/PUT /api/modules for module.yaml sync; agent sync_modules - RTE Live-tab AutoPlay fixes; modules zip named bbc/rte/tg4.zip - Telegram notify scripts wired into Forgejo release workflows
This commit is contained in:
parent
f9c28be3f1
commit
ac8701b5a6
36 changed files with 1460 additions and 143 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"drmdecryption/apps/streamd/internal/db"
|
||||
"drmdecryption/apps/streamd/internal/deps"
|
||||
)
|
||||
|
||||
type Supervisor interface {
|
||||
|
|
@ -23,6 +24,7 @@ type Handler struct {
|
|||
Token string
|
||||
Supervisor Supervisor
|
||||
StartedAt time.Time
|
||||
Deps deps.Status
|
||||
}
|
||||
|
||||
func (h *Handler) Mount(mux *http.ServeMux) {
|
||||
|
|
@ -30,6 +32,8 @@ func (h *Handler) Mount(mux *http.ServeMux) {
|
|||
mux.HandleFunc("/api/streams", h.streams)
|
||||
mux.HandleFunc("/api/streams/", h.streamAction)
|
||||
mux.HandleFunc("/api/apps", h.apps)
|
||||
mux.HandleFunc("/api/modules", h.modules)
|
||||
mux.HandleFunc("/api/modules/", h.modules)
|
||||
}
|
||||
|
||||
func (h *Handler) auth(w http.ResponseWriter, r *http.Request) bool {
|
||||
|
|
@ -64,6 +68,7 @@ func (h *Handler) health(w http.ResponseWriter, r *http.Request) {
|
|||
"service": "streamd",
|
||||
"uptime_s": time.Since(h.StartedAt).Seconds(),
|
||||
"started_at": h.StartedAt.UTC().Format(time.RFC3339),
|
||||
"deps": h.Deps,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -310,8 +315,8 @@ func writeErr(w http.ResponseWriter, code int, msg string) {
|
|||
writeJSON(w, code, map[string]any{"error": msg})
|
||||
}
|
||||
|
||||
// credentialsChanged is true when the patch touched mpd, key, or headers that
|
||||
// the live NRE/ffmpeg worker is already using.
|
||||
// credentialsChanged is true when the patch touched mpd, key, headers, or proxy
|
||||
// that the live NRE/ffmpeg worker is already using.
|
||||
func credentialsChanged(before, after db.Stream, in db.PatchStream) bool {
|
||||
if in.MPD != nil && strings.TrimSpace(before.MPD) != strings.TrimSpace(after.MPD) {
|
||||
return true
|
||||
|
|
@ -322,5 +327,8 @@ func credentialsChanged(before, after db.Stream, in db.PatchStream) bool {
|
|||
if in.HeadersJSON != nil && strings.TrimSpace(before.HeadersJSON) != strings.TrimSpace(after.HeadersJSON) {
|
||||
return true
|
||||
}
|
||||
if in.Proxy != nil && strings.TrimSpace(before.Proxy) != strings.TrimSpace(after.Proxy) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue