Merge branch 'develop' into 'vips'
# Conflicts: # mix.exs
This commit is contained in:
commit
906b121a10
11 changed files with 24 additions and 10 deletions
|
|
@ -224,6 +224,12 @@ defmodule Pleroma.Web.Router do
|
|||
post("/remote_interaction", UtilController, :remote_interaction)
|
||||
end
|
||||
|
||||
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
|
||||
pipe_through(:pleroma_api)
|
||||
|
||||
get("/federation_status", InstancesController, :show)
|
||||
end
|
||||
|
||||
scope "/api/v1/pleroma", Pleroma.Web do
|
||||
pipe_through(:pleroma_api)
|
||||
post("/uploader_callback/:upload_path", UploaderController, :callback)
|
||||
|
|
@ -604,7 +610,6 @@ defmodule Pleroma.Web.Router do
|
|||
scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
|
||||
pipe_through(:api)
|
||||
get("/accounts/:id/scrobbles", ScrobbleController, :index)
|
||||
get("/federation_status", InstancesController, :show)
|
||||
end
|
||||
|
||||
scope "/api/v2/pleroma", Pleroma.Web.PleromaAPI do
|
||||
|
|
|
|||
|
|
@ -345,13 +345,16 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
|
|||
end
|
||||
|
||||
def healthcheck(conn, _params) do
|
||||
with true <- Config.get([:instance, :healthcheck]),
|
||||
with {:cfg, true} <- {:cfg, Config.get([:instance, :healthcheck])},
|
||||
%{healthy: true} = info <- Healthcheck.system_info() do
|
||||
json(conn, info)
|
||||
else
|
||||
%{healthy: false} = info ->
|
||||
service_unavailable(conn, info)
|
||||
|
||||
{:cfg, false} ->
|
||||
service_unavailable(conn, %{"error" => "Healthcheck disabled"})
|
||||
|
||||
_ ->
|
||||
service_unavailable(conn, %{})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue