plugs/instance_static: use pipeline fallback for serving frontend

This commit is contained in:
Haelwenn (lanodan) Monnier 2024-08-24 15:46:40 +02:00
parent 58f646bcda
commit f41a76c22f
No known key found for this signature in database

View file

@ -16,11 +16,9 @@ defmodule Pleroma.Web.Plugs.InstanceStatic do
instance_path =
Path.join(Pleroma.Config.get([:instance, :static_dir], "instance/static/"), path)
frontend_path = Pleroma.Web.Plugs.FrontendStatic.file_path(path, :primary)
static_path = Path.join(Application.app_dir(:pleroma, "priv/static/"), path)
(File.exists?(instance_path) && instance_path) ||
(frontend_path && File.exists?(frontend_path) && frontend_path) ||
Path.join(Application.app_dir(:pleroma, "priv/static/"), path)
(File.exists?(instance_path) && instance_path) || (File.exists?(static_path) && static_path)
end
def init(opts) do