1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
6 use Pleroma.Web, :controller
8 alias Pleroma.Web.Endpoint
9 alias Pleroma.Web.Nodeinfo.Nodeinfo
11 def schemas(conn, _params) do
15 rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
16 href: Endpoint.url() <> "/nodeinfo/2.0.json"
19 rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
20 href: Endpoint.url() <> "/nodeinfo/2.1.json"
28 # Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
29 # and https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
30 def nodeinfo(conn, %{"version" => version}) do
31 case Nodeinfo.get_nodeinfo(version) do
33 render_error(conn, :not_found, "Nodeinfo schema version not handled")
39 "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"