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:
404errordeveloper 2026-10-10 18:05:51 +02:00
parent da8e1123ec
commit 8fc7e4c0b8
57 changed files with 4031 additions and 257 deletions

View file

@ -402,6 +402,7 @@ export function streamView(root, id, tab = "live") {
const tags = el("input", { value: s.tags || "" });
const mpd = el("input", { value: s.mpd || "" });
const key = el("textarea", { rows: "3", placeholder: s.has_key ? "unchanged — type to replace" : "none", spellcheck: "false" });
const egress = el("select", el("option", { value: "", text: "Direct (no tunnel)", selected: !s.egress }));
const proxy = el("input", { placeholder: s.has_proxy ? "unchanged — type to replace" : "none" });
const headers = el("input", { placeholder: s.has_headers ? "unchanged — type to replace" : "{}" });
const drm = el("select",
@ -482,6 +483,23 @@ export function streamView(root, id, tab = "live") {
if (s.rewriter && !rewriters.includes(s.rewriter)) {
rewriter.append(el("option", { value: s.rewriter, text: `${s.rewriter} (stored)`, selected: true }));
}
try {
const eg = await api.egress();
clear(egress);
egress.append(el("option", { value: "", text: "Direct (no tunnel)", selected: !s.egress }));
for (const p of eg.profiles || []) {
egress.append(el("option", {
value: p.name,
text: `${p.name} (${p.kind}${p.status ? ", " + p.status : ""})`,
selected: s.egress === p.name,
}));
}
if (s.egress && !(eg.profiles || []).some((p) => p.name === s.egress)) {
egress.append(el("option", { value: s.egress, text: `${s.egress} (stored)`, selected: true }));
}
} catch {
// Older servers without /api/egress.
}
})();
const revealBtn = el("button.ghost.sm", {
@ -514,7 +532,8 @@ export function streamView(root, id, tab = "live") {
el("label", el("span.lbl", { text: "Audio select" }), audioSel),
el("label.span2", el("span.lbl", { text: "Manifest URL" }), mpd),
el("label.span2", el("span.lbl", { text: "Keys" }), key),
el("label", el("span.lbl", { text: "Origin proxy" }), proxy),
el("label", el("span.lbl", { text: "Egress tunnel" }), egress),
el("label", el("span.lbl", { text: "Origin proxy URL" }), proxy),
el("label", el("span.lbl", { text: "Headers JSON" }), headers),
el("label", el("span.lbl", { text: "Idle timeout (s)" }), idle),
el("label", el("span.lbl", { text: "Segment seconds" }), hlsTime),
@ -560,6 +579,7 @@ export function streamView(root, id, tab = "live") {
};
// Only send a credential when it was actually typed, so saving the form
// does not wipe a key the browser was never given.
body.egress = egress.value.trim();
if (key.value.trim()) body.key = key.value.trim();
if (proxy.value.trim()) body.proxy = proxy.value.trim();
if (headers.value.trim()) {