config: disable Websub and Salmon publisher modules

This commit is contained in:
Ariadne Conill 2019-10-17 22:31:20 +00:00
parent 4e270964d7
commit c6de0cbb4a
3 changed files with 2 additions and 97 deletions

View File

@ -59,10 +59,6 @@ scheduled_jobs =
_ -> [] _ -> []
end end
scheduled_jobs =
scheduled_jobs ++
[{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}]
config :pleroma, Pleroma.Scheduler, config :pleroma, Pleroma.Scheduler,
global: true, global: true,
overlap: true, overlap: true,
@ -243,9 +239,7 @@ config :pleroma, :instance,
federation_incoming_replies_max_depth: 100, federation_incoming_replies_max_depth: 100,
federation_reachability_timeout_days: 7, federation_reachability_timeout_days: 7,
federation_publisher_modules: [ federation_publisher_modules: [
Pleroma.Web.ActivityPub.Publisher, Pleroma.Web.ActivityPub.Publisher
Pleroma.Web.Websub,
Pleroma.Web.Salmon
], ],
allow_relay: true, allow_relay: true,
rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy, rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,

View File

@ -581,9 +581,7 @@ config :pleroma, :config_description, [
type: [:list, :module], type: [:list, :module],
description: "List of modules for federation publishing", description: "List of modules for federation publishing",
suggestions: [ suggestions: [
Pleroma.Web.ActivityPub.Publisher, Pleroma.Web.ActivityPub.Publisher
Pleroma.Web.Websub,
Pleroma.Web.Salmo
] ]
}, },
%{ %{

View File

@ -111,93 +111,6 @@ defmodule Pleroma.Web.FederatorTest do
all_enqueued(worker: PublisherWorker) all_enqueued(worker: PublisherWorker)
) )
end end
test "it federates only to reachable instances via Websub" do
user = insert(:user)
websub_topic = Pleroma.Web.OStatus.feed_path(user)
sub1 =
insert(:websub_subscription, %{
topic: websub_topic,
state: "active",
callback: "http://pleroma.soykaf.com/cb"
})
sub2 =
insert(:websub_subscription, %{
topic: websub_topic,
state: "active",
callback: "https://pleroma2.soykaf.com/cb"
})
dt = NaiveDateTime.utc_now()
Instances.set_unreachable(sub2.callback, dt)
Instances.set_consistently_unreachable(sub1.callback)
{:ok, _activity} = CommonAPI.post(user, %{"status" => "HI"})
expected_callback = sub2.callback
expected_dt = NaiveDateTime.to_iso8601(dt)
ObanHelpers.perform(all_enqueued(worker: PublisherWorker))
assert ObanHelpers.member?(
%{
"op" => "publish_one",
"params" => %{
"callback" => expected_callback,
"unreachable_since" => expected_dt
}
},
all_enqueued(worker: PublisherWorker)
)
end
test "it federates only to reachable instances via Salmon" do
user = insert(:user)
_remote_user1 =
insert(:user, %{
local: false,
nickname: "nick1@domain.com",
ap_id: "https://domain.com/users/nick1",
info: %{salmon: "https://domain.com/salmon"}
})
remote_user2 =
insert(:user, %{
local: false,
nickname: "nick2@domain2.com",
ap_id: "https://domain2.com/users/nick2",
info: %{salmon: "https://domain2.com/salmon"}
})
remote_user2_id = remote_user2.id
dt = NaiveDateTime.utc_now()
Instances.set_unreachable(remote_user2.ap_id, dt)
Instances.set_consistently_unreachable("domain.com")
{:ok, _activity} =
CommonAPI.post(user, %{"status" => "HI @nick1@domain.com, @nick2@domain2.com!"})
expected_dt = NaiveDateTime.to_iso8601(dt)
ObanHelpers.perform(all_enqueued(worker: PublisherWorker))
assert ObanHelpers.member?(
%{
"op" => "publish_one",
"params" => %{
"recipient_id" => remote_user2_id,
"unreachable_since" => expected_dt
}
},
all_enqueued(worker: PublisherWorker)
)
end
end end
describe "Receive an activity" do describe "Receive an activity" do