registrations_open: true,
federating: true,
rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
- public: true
+ public: true,
+ quarantined_instances: []
config :pleroma, :activitypub, accept_blocks: true
end
end
+ @quarantined_instances Keyword.get(@instance, :quarantined_instances, [])
+
+ def should_federate?(inbox, public) do
+ if public do
+ true
+ else
+ inbox_info = URI.parse(inbox)
+ inbox_info.host not in @quarantined_instances
+ end
+ end
+
def publish(actor, activity) do
followers =
if actor.follower_address in activity.recipients do
[]
end
+ public = is_public?(activity)
+
remote_inboxes =
(Pleroma.Web.Salmon.remote_users(activity) ++ followers)
|> Enum.filter(fn user -> User.ap_enabled?(user) end)
(data["endpoints"] && data["endpoints"]["sharedInbox"]) || data["inbox"]
end)
|> Enum.uniq()
+ |> Enum.filter(fn inbox -> should_federate?(inbox, public) end)
{:ok, data} = Transmogrifier.prepare_outgoing(activity.data)
json = Jason.encode!(data)