Merge branch 'nodeinfo-federation-enabled' into 'develop'
report federating status in nodeinfo See merge request pleroma/pleroma!1971
This commit is contained in:
commit
e27d78e768
2 changed files with 25 additions and 0 deletions
|
@ -46,6 +46,7 @@ def raw_nodeinfo do
|
||||||
|
|
||||||
data
|
data
|
||||||
|> Map.merge(%{quarantined_instances: quarantined})
|
|> Map.merge(%{quarantined_instances: quarantined})
|
||||||
|
|> Map.put(:enabled, Config.get([:instance, :federating]))
|
||||||
else
|
else
|
||||||
%{}
|
%{}
|
||||||
end
|
end
|
||||||
|
|
|
@ -84,6 +84,30 @@ test "it returns the safe_dm_mentions feature if enabled", %{conn: conn} do
|
||||||
Pleroma.Config.put([:instance, :safe_dm_mentions], option)
|
Pleroma.Config.put([:instance, :safe_dm_mentions], option)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "it shows if federation is enabled/disabled", %{conn: conn} do
|
||||||
|
original = Pleroma.Config.get([:instance, :federating])
|
||||||
|
|
||||||
|
Pleroma.Config.put([:instance, :federating], true)
|
||||||
|
|
||||||
|
response =
|
||||||
|
conn
|
||||||
|
|> get("/nodeinfo/2.1.json")
|
||||||
|
|> json_response(:ok)
|
||||||
|
|
||||||
|
assert response["metadata"]["federation"]["enabled"] == true
|
||||||
|
|
||||||
|
Pleroma.Config.put([:instance, :federating], false)
|
||||||
|
|
||||||
|
response =
|
||||||
|
conn
|
||||||
|
|> get("/nodeinfo/2.1.json")
|
||||||
|
|> json_response(:ok)
|
||||||
|
|
||||||
|
assert response["metadata"]["federation"]["enabled"] == false
|
||||||
|
|
||||||
|
Pleroma.Config.put([:instance, :federating], original)
|
||||||
|
end
|
||||||
|
|
||||||
test "it shows MRF transparency data if enabled", %{conn: conn} do
|
test "it shows MRF transparency data if enabled", %{conn: conn} do
|
||||||
config = Pleroma.Config.get([:instance, :rewrite_policy])
|
config = Pleroma.Config.get([:instance, :rewrite_policy])
|
||||||
Pleroma.Config.put([:instance, :rewrite_policy], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
|
Pleroma.Config.put([:instance, :rewrite_policy], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
|
||||||
|
|
Loading…
Reference in a new issue