From: Egor Kislitsyn Date: Fri, 20 Mar 2020 18:08:34 +0000 (+0400) Subject: Merge branch 'develop' into global-status-expiration X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=80e15716102e03323b117ade919035402cc7408f;p=akkoma Merge branch 'develop' into global-status-expiration --- 80e15716102e03323b117ade919035402cc7408f diff --cc CHANGELOG.md index 77cd35990,15a073c64..79b4bbb53 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@@ -6,8 -6,18 +6,19 @@@ The format is based on [Keep a Changelo ## [unreleased] ### Changed - **Breaking:** BBCode and Markdown formatters will no longer return any `\n` and only use `
` for newlines +- MFR policy to set global expiration for all local Create activities + ### Removed + - **Breaking:** removed `with_move` parameter from notifications timeline. + + ### Added + - NodeInfo: `pleroma:api/v1/notifications:include_types_filter` to the `features` list. + - Configuration: `:restrict_unauthenticated` setting, restrict access for unauthenticated users to timelines (public and federate), user profiles and statuses. +
+ API Changes + - Mastodon API: Support for `include_types` in `/api/v1/notifications`. +
+ ## [2.0.0] - 2019-03-08 ### Security - Mastodon API: Fix being able to request enourmous amount of statuses in timelines leading to DoS. Now limited to 40 per request. diff --cc test/web/activity_pub/activity_pub_test.exs index 8c599faf3,a43dd34f0..31d441d38 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@@ -1970,20 -1968,4 +1968,20 @@@ defmodule Pleroma.Web.ActivityPub.Activ ActivityPub.move(old_user, new_user) end end + + describe "global activity expiration" do - clear_config([:instance, :rewrite_policy]) ++ setup do: clear_config([:instance, :rewrite_policy]) + + test "creates an activity expiration for local Create activities" do + Pleroma.Config.put( + [:instance, :rewrite_policy], + Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy + ) + + {:ok, %{id: id_create}} = ActivityBuilder.insert(%{"type" => "Create", "context" => "3hu"}) + {:ok, _follow} = ActivityBuilder.insert(%{"type" => "Follow", "context" => "3hu"}) + + assert [%{activity_id: ^id_create}] = Pleroma.ActivityExpiration |> Repo.all() + end + end end diff --cc test/workers/cron/purge_expired_activities_worker_test.exs index 11b696bd8,5864f9e5f..85ae1e5ef --- a/test/workers/cron/purge_expired_activities_worker_test.exs +++ b/test/workers/cron/purge_expired_activities_worker_test.exs @@@ -11,8 -11,7 +11,10 @@@ defmodule Pleroma.Workers.Cron.PurgeExp import Pleroma.Factory import ExUnit.CaptureLog - clear_config([ActivityExpiration, :enabled]) - clear_config([:instance, :rewrite_policy]) - setup do: clear_config([ActivityExpiration, :enabled]) ++ setup do ++ clear_config([ActivityExpiration, :enabled]) ++ clear_config([:instance, :rewrite_policy]) ++ end test "deletes an expiration activity" do Pleroma.Config.put([ActivityExpiration, :enabled], true)