logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 619ff5b9e3dee50bdda0cb78ffbfee97f0a9a41b
parent 30839063ef82404091c1b72d00c66e50e3cec891
Author: Phantasm <phantasm@centrum.cz>
Date:   Thu,  8 Jan 2026 00:28:29 +0100

Remove /pleroma/oban and /phoenix/live_dashboard from API routes

This is needed to prevent admin frontend overrides from misbehaving when
overriding AdminFE located at /pleroma/admin, since API routes are
interpreted as the first portion of their full path, ie:
/api/v1/pleroma/admin -> /api

Diffstat:

Mlib/pleroma/web/router.ex6++++++
Mtest/pleroma/web/plugs/frontend_static_plug_test.exs1-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex @@ -1091,9 +1091,15 @@ defmodule Pleroma.Web.Router do options("/*path", RedirectController, :empty) end + # /pleroma/oban/* needs to get filtered out from api routes for frontend configuration + # to not drop admin overrides for /pleroma/admin. + # Also removing /phoenix since it is not an API route + @non_api_routes ["/phoenix/live_dashboard", "/pleroma/oban"] + def get_api_routes do Phoenix.Router.routes(__MODULE__) |> Enum.reject(fn r -> r.plug == Pleroma.Web.Fallback.RedirectController end) + |> Enum.reject(fn r -> String.starts_with?(r.path, @non_api_routes) end) |> Enum.map(fn r -> r.path |> String.split("/", trim: true) diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -106,7 +106,6 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do "manifest.json", "auth", "proxy", - "phoenix", "test", "user_exists", "check_password"