@name "Pleroma"
@version Mix.Project.config()[:version]
+ @repository "https://git.pleroma.social/pleroma/pleroma"
def name, do: @name
def version, do: @version
def named_version(), do: @name <> " " <> @version
+ def repository, do: @repository
def user_agent() do
info = "#{Pleroma.Web.base_url()} <#{Pleroma.Config.get([:instance, :email], "")}>"
response = %{
links: [
%{
- rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
- href: Web.base_url() <> "/nodeinfo/2.0.json"
+ rel: "http://nodeinfo.diaspora.software/ns/schema/2.1",
+ href: Web.base_url() <> "/nodeinfo/2.1.json"
}
]
}
json(conn, response)
end
- # Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.0/schema.json
- def nodeinfo(conn, %{"version" => "2.0"}) do
+ # Schema definition: https://github.com/jhass/nodeinfo/blob/master/schemas/2.1/schema.json
+ def nodeinfo(conn, %{"version" => "2.1"}) do
instance = Application.get_env(:pleroma, :instance)
media_proxy = Application.get_env(:pleroma, :media_proxy)
suggestions = Application.get_env(:pleroma, :suggestions)
|> Enum.filter(& &1)
response = %{
- version: "2.0",
+ version: "2.1",
software: %{
name: Pleroma.Application.name(),
- version: Pleroma.Application.version()
+ version: Pleroma.Application.version(),
+ repository: Pleroma.Application.repository(),
},
protocols: ["ostatus", "activitypub"],
services: %{
conn
|> put_resp_header(
"content-type",
- "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.0#; charset=utf-8"
+ "application/json; profile=http://nodeinfo.diaspora.software/ns/schema/2.1#; charset=utf-8"
)
|> json(response)
end
conn =
conn
- |> get("/nodeinfo/2.0.json")
+ |> get("/nodeinfo/2.1.json")
assert result = json_response(conn, 200)
test "nodeinfo shows restricted nicknames", %{conn: conn} do
conn =
conn
- |> get("/nodeinfo/2.0.json")
+ |> get("/nodeinfo/2.1.json")
assert result = json_response(conn, 200)
|> json_response(404)
conn
- |> get("/nodeinfo/2.0.json")
+ |> get("/nodeinfo/2.1.json")
|> json_response(404)
instance =
|> json_response(200)
conn
- |> get("/nodeinfo/2.0.json")
+ |> get("/nodeinfo/2.1.json")
|> json_response(200)
end
end