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
This commit is contained in:
Phantasm 2026-01-08 00:28:29 +01:00 committed by Henry Jameson
commit 421187dbfa
2 changed files with 6 additions and 1 deletions

View file

@ -1092,9 +1092,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)

View file

@ -106,7 +106,6 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do
"manifest.json",
"auth",
"proxy",
"phoenix",
"test",
"user_exists",
"check_password"