mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-22 06:36:16 +00:00
expose bubble instances via nodeinfo (#136)
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/136
This commit is contained in:
parent
55b86e45ec
commit
c3eea8dc7d
|
@ -70,7 +70,8 @@ defmodule Pleroma.Web.Nodeinfo.Nodeinfo do
|
|||
features: features,
|
||||
restrictedNicknames: Config.get([Pleroma.User, :restricted_nicknames]),
|
||||
skipThreadContainment: Config.get([:instance, :skip_thread_containment], false),
|
||||
privilegedStaff: Config.get([:instance, :privileged_staff])
|
||||
privilegedStaff: Config.get([:instance, :privileged_staff]),
|
||||
localBubbleInstances: Config.get([:instance, :local_bubble], [])
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -88,7 +88,8 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
|||
mailerEnabled: Config.get([Pleroma.Emails.Mailer, :enabled], false),
|
||||
features: features,
|
||||
restrictedNicknames: Config.get([Pleroma.User, :restricted_nicknames]),
|
||||
skipThreadContainment: Config.get([:instance, :skip_thread_containment], false)
|
||||
skipThreadContainment: Config.get([:instance, :skip_thread_containment], false),
|
||||
localBubbleInstances: Config.get([:instance, :local_bubble], [])
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
@ -188,6 +188,25 @@ defmodule Pleroma.Web.NodeInfoTest do
|
|||
end
|
||||
end
|
||||
|
||||
test "Bubble instances", %{conn: conn} do
|
||||
clear_config([:instance, :local_bubble], [])
|
||||
|
||||
response =
|
||||
conn
|
||||
|> get("/nodeinfo/2.1.json")
|
||||
|> json_response(:ok)
|
||||
|
||||
assert response["metadata"]["localBubbleInstances"] == []
|
||||
clear_config([:instance, :local_bubble], ["example.com"])
|
||||
|
||||
response =
|
||||
conn
|
||||
|> get("/nodeinfo/2.1.json")
|
||||
|> json_response(:ok)
|
||||
|
||||
assert response["metadata"]["localBubbleInstances"] == ["example.com"]
|
||||
end
|
||||
|
||||
describe "MRF SimplePolicy" do
|
||||
setup do
|
||||
clear_config([:mrf, :policies], [Pleroma.Web.ActivityPub.MRF.SimplePolicy])
|
||||
|
|
Loading…
Reference in a new issue