feat: disallow access to /videoplayback if an external videoplayback proxy has been defined
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 2s

This commit is contained in:
Fijxu 2025-03-02 21:17:45 -03:00
parent 9e38fe1327
commit 4a21526be1
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -9,7 +9,7 @@ import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts";
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
import metrics from "metrics";
import health from "./health.ts";
import info from "./info.ts"
import info from "./info.ts";
export const routes = (
app: Hono,
@ -28,7 +28,14 @@ export const routes = (
app.route("/youtubei/v1", youtubeApiPlayer);
app.route("/latest_version", invidiousRouteLatestVersion);
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
app.route("/videoplayback", videoPlaybackProxy);
if (
!Deno.env.get("EXTERNAL_VIDEOPLAYBACK_PROXY") &&
!(konfigStore.get(
"networking.external_videoplayback_proxy",
) as string ?? undefined)
) {
app.route("/videoplayback", videoPlaybackProxy);
}
app.route("/metrics", metrics);
app.route("/healthz", health);