X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fnodeinfo%2Fnodeinfo_controller.ex;h=58009b2792f541803e4b616e554c1143b301d987;hb=931d663a3a9da845b9f789ed9c2b5e35140df22f;hp=486b9f6a4dce7d685a92e08ea42de1610f7445f5;hpb=e27d78e7687c6d0a1b7b6b66bc802b474a1e7e2f;p=akkoma
diff --git a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
index 486b9f6a4..58009b279 100644
--- a/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
+++ b/lib/pleroma/web/nodeinfo/nodeinfo_controller.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
@@ -33,12 +33,16 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
# under software.
def raw_nodeinfo do
stats = Stats.get_stats()
-
- quarantined = Config.get([:instance, :quarantined_instances], [])
+ exclusions = Config.get([:instance, :mrf_transparency_exclusions], [])
+
+ quarantined =
+ Config.get([:instance, :quarantined_instances], [])
+ |> Enum.filter(fn x -> !Enum.member?(exclusions, x) end)
staff_accounts =
User.all_superusers()
|> Enum.map(fn u -> u.ap_id end)
+ |> Enum.filter(fn u -> not Enum.member?(Config.get([:instance, :staff_transparency]), u) end)
federation_response =
if Config.get([:instance, :mrf_transparency]) do
@@ -46,10 +50,10 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
data
|> Map.merge(%{quarantined_instances: quarantined})
- |> Map.put(:enabled, Config.get([:instance, :federating]))
else
%{}
end
+ |> Map.put(:enabled, Config.get([:instance, :federating]))
features =
[
@@ -60,6 +64,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
"pleroma_explicit_addressing",
"shareable_emoji_packs",
"multifetch",
+ "pleroma:api/v1/notifications:include_types_filter",
if Config.get([:media_proxy, :enabled]) do
"media_proxy"
end,
@@ -69,9 +74,6 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
if Config.get([:chat, :enabled]) do
"chat"
end,
- if Config.get([:suggestions, :enabled]) do
- "suggestions"
- end,
if Config.get([:instance, :allow_relay]) do
"relay"
end,
@@ -95,20 +97,16 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
openRegistrations: Config.get([:instance, :registrations_open]),
usage: %{
users: %{
- total: stats.user_count || 0
+ total: Map.get(stats, :user_count, 0)
},
- localPosts: stats.status_count || 0
+ localPosts: Map.get(stats, :status_count, 0)
},
metadata: %{
nodeName: Config.get([:instance, :name]),
nodeDescription: Config.get([:instance, :description]),
private: !Config.get([:instance, :public], true),
suggestions: %{
- enabled: Config.get([:suggestions, :enabled], false),
- thirdPartyEngine: Config.get([:suggestions, :third_party_engine], ""),
- timeout: Config.get([:suggestions, :timeout], 5000),
- limit: Config.get([:suggestions, :limit], 23),
- web: Config.get([:suggestions, :web], "")
+ enabled: false
},
staffAccounts: staff_accounts,
federation: federation_response,
@@ -120,6 +118,12 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
banner: Config.get([:instance, :banner_upload_limit]),
background: Config.get([:instance, :background_upload_limit])
},
+ fieldsLimits: %{
+ maxFields: Config.get([:instance, :max_account_fields]),
+ maxRemoteFields: Config.get([:instance, :max_remote_account_fields]),
+ nameLength: Config.get([:instance, :account_field_name_length]),
+ valueLength: Config.get([:instance, :account_field_value_length])
+ },
accountActivationRequired: Config.get([:instance, :account_activation_required], false),
invitesEnabled: Config.get([:instance, :invites_enabled], false),
mailerEnabled: Config.get([Pleroma.Emails.Mailer, :enabled], false),