1 defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
2 use Pleroma.Web, :controller
4 alias Pleroma.Web.Nodeinfo
8 @instance Application.get_env(:pleroma, :instance)
10 def schemas(conn, _params) do
14 rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
15 href: Web.base_url() <> "/nodeinfo/2.0.json"
23 # Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
24 def nodeinfo(conn, %{"version" => "2.0"}) do
29 version: Keyword.get(@instance, :version)
31 protocols: ["ostatus", "activitypub"],
36 openRegistrations: Keyword.get(@instance, :registrations_open),
39 total: Stats.get_stats().user_count || 0
41 localPosts: Stats.get_stats().status_count || 0
49 "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"
54 def nodeinfo(conn, _) do
57 |> json(%{error: "Nodeinfo schema version not handled"})