aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuna <git@l4.pm>2019-02-01 03:55:10 -0300
committerLuna <git@l4.pm>2019-02-01 03:55:10 -0300
commitc05928dbdabfafc536512341e8d64b240b097f62 (patch)
tree84da2cd9204d9c0717dcfd4dc854a9b480f2a050 /lib
parent0340fcaecadae858b9c8fe39cc18bc25aef3e495 (diff)
downloadpleroma-c05928dbdabfafc536512341e8d64b240b097f62.tar.gz
use nodeinfo 2.1, add repository field
that is the only change from nodeinfo 2.0 to 2.1 also this makes the nodeinfo tests use 2.1.json instead of 2.0.json
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/application.ex2
-rw-r--r--lib/pleroma/web/nodeinfo/nodeinfo_controller.ex15
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex
index 40bff08c7..8b50bcf8c 100644
--- a/lib/pleroma/application.ex
+++ b/lib/pleroma/application.ex
@@ -8,9 +8,11 @@ defmodule Pleroma.Application do
@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], "")}>"
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
index 11b97164d..de7256dda 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
@@ -17,8 +17,8 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
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"
}
]
}
@@ -26,8 +26,8 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
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)
@@ -99,10 +99,11 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|> 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: %{
@@ -146,7 +147,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
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