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
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 2s
This commit is contained in:
parent
9e38fe1327
commit
4a21526be1
1 changed files with 9 additions and 2 deletions
|
@ -9,7 +9,7 @@ import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts";
|
||||||
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
||||||
import metrics from "metrics";
|
import metrics from "metrics";
|
||||||
import health from "./health.ts";
|
import health from "./health.ts";
|
||||||
import info from "./info.ts"
|
import info from "./info.ts";
|
||||||
|
|
||||||
export const routes = (
|
export const routes = (
|
||||||
app: Hono,
|
app: Hono,
|
||||||
|
@ -28,7 +28,14 @@ export const routes = (
|
||||||
app.route("/youtubei/v1", youtubeApiPlayer);
|
app.route("/youtubei/v1", youtubeApiPlayer);
|
||||||
app.route("/latest_version", invidiousRouteLatestVersion);
|
app.route("/latest_version", invidiousRouteLatestVersion);
|
||||||
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
|
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("/metrics", metrics);
|
||||||
app.route("/healthz", health);
|
app.route("/healthz", health);
|
||||||
|
|
||||||
|
|
Reference in a new issue