New frontend configuration mechanism.

This commit is contained in:
lain 2019-01-23 12:40:57 +01:00
commit e221c681dc
5 changed files with 68 additions and 0 deletions

View file

@ -284,6 +284,7 @@ defmodule Pleroma.Web.Router do
post("/help/test", TwitterAPI.UtilController, :help_test)
get("/statusnet/config", TwitterAPI.UtilController, :config)
get("/statusnet/version", TwitterAPI.UtilController, :version)
get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
end
scope "/api", Pleroma.Web do

View file

@ -216,6 +216,14 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
end
end
def frontend_configurations(conn, _params) do
config =
Pleroma.Config.get(:frontend_configurations, %{})
|> Enum.into(%{})
json(conn, config)
end
def version(conn, _params) do
version = Pleroma.Application.named_version()