From c6de0cbb4ae0cf2b04db5e1be79fab6138cbe71a Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Thu, 17 Oct 2019 22:31:20 +0000 Subject: [PATCH] config: disable Websub and Salmon publisher modules --- config/config.exs | 8 +--- config/description.exs | 4 +- test/web/federator_test.exs | 87 ------------------------------------- 3 files changed, 2 insertions(+), 97 deletions(-) diff --git a/config/config.exs b/config/config.exs index f4d92102f..d0766a6e2 100644 --- a/config/config.exs +++ b/config/config.exs @@ -59,10 +59,6 @@ _ -> [] end -scheduled_jobs = - scheduled_jobs ++ - [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}] - config :pleroma, Pleroma.Scheduler, global: true, overlap: true, @@ -243,9 +239,7 @@ federation_incoming_replies_max_depth: 100, federation_reachability_timeout_days: 7, federation_publisher_modules: [ - Pleroma.Web.ActivityPub.Publisher, - Pleroma.Web.Websub, - Pleroma.Web.Salmon + Pleroma.Web.ActivityPub.Publisher ], allow_relay: true, rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy, diff --git a/config/description.exs b/config/description.exs index b007cf69c..571c64bc1 100644 --- a/config/description.exs +++ b/config/description.exs @@ -581,9 +581,7 @@ type: [:list, :module], description: "List of modules for federation publishing", suggestions: [ - Pleroma.Web.ActivityPub.Publisher, - Pleroma.Web.Websub, - Pleroma.Web.Salmo + Pleroma.Web.ActivityPub.Publisher ] }, %{ diff --git a/test/web/federator_test.exs b/test/web/federator_test.exs index 43a715706..bdaefdce1 100644 --- a/test/web/federator_test.exs +++ b/test/web/federator_test.exs @@ -111,93 +111,6 @@ test "it federates only to reachable instances via AP" do all_enqueued(worker: PublisherWorker) ) 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 describe "Receive an activity" do