Add public OBS overlay modes, themes and token protection

This commit is contained in:
larssand
2026-03-22 16:02:08 +01:00
parent 94df6ece34
commit 5c96f2e421
5 changed files with 779 additions and 10 deletions

View File

@@ -268,6 +268,16 @@ app.post("/api/export/pdf", (req, res) => {
}
});
const PUBLIC_OVERLAY_TOKEN = String(process.env.PUBLIC_OVERLAY_TOKEN || "").trim();
app.get(["/public-overlay", "/public-overlay/:mode"], (req, res) => {
if (PUBLIC_OVERLAY_TOKEN && String(req.query.token || "").trim() !== PUBLIC_OVERLAY_TOKEN) {
res.status(403).type("text/plain").send("Forbidden");
return;
}
res.sendFile(path.join(__dirname, "index.html"));
});
app.use(
express.static(__dirname, {
setHeaders: (res, filePath) => {