Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

28 строки
743B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.MastodonAPI.InstanceController do
  5. use Pleroma.Web, :controller
  6. plug(OpenApiSpex.Plug.CastAndValidate)
  7. plug(
  8. :skip_plug,
  9. [Pleroma.Web.Plugs.OAuthScopesPlug, Pleroma.Web.Plugs.EnsurePublicOrAuthenticatedPlug]
  10. when action in [:show, :peers]
  11. )
  12. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.InstanceOperation
  13. @doc "GET /api/v1/instance"
  14. def show(conn, _params) do
  15. render(conn, "show.json")
  16. end
  17. @doc "GET /api/v1/instance/peers"
  18. def peers(conn, _params) do
  19. json(conn, Pleroma.Stats.get_peers())
  20. end
  21. end