logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

instance_controller.ex (748B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 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(Pleroma.Web.ApiSpec.CastAndValidate)
  7. plug(:skip_auth when action in [:show, :show2, :peers])
  8. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.InstanceOperation
  9. @doc "GET /api/v1/instance"
  10. def show(conn, _params) do
  11. render(conn, "show.json")
  12. end
  13. @doc "GET /api/v2/instance"
  14. def show2(conn, _params) do
  15. render(conn, "show2.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