summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-03-19 19:25:50 +0100
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-03-19 19:25:50 +0100
commita8aa91753024dbd211e5e3952f5b305debaa8b55 (patch)
tree01088f8cec46c4b437b338cb78aaaee65e5d8bc7
parentc1fd4f665335ba67336bd1b2fab2d9df5e247e08 (diff)
parent952cb589f47972bba8f9b94b2935a60f05e21bd3 (diff)
downloadpleroma-a8aa91753024dbd211e5e3952f5b305debaa8b55.tar.gz
pleroma-a8aa91753024dbd211e5e3952f5b305debaa8b55.zip
Merge remote-tracking branch 'pleroma/develop' into bugfix/apc2s_upload_activity
-rw-r--r--.gitlab-ci.yml28
-rw-r--r--.gitlab/issue_templates/Bug.md20
-rw-r--r--.gitlab/merge_request_templates/Release.md5
-rw-r--r--CHANGELOG.md3
-rw-r--r--config/benchmark.exs2
-rw-r--r--config/description.exs32
-rw-r--r--docs/API/differences_in_mastoapi_responses.md1
-rw-r--r--docs/configuration/cheatsheet.md3
-rw-r--r--lib/pleroma/notification.ex9
-rw-r--r--lib/pleroma/web/mastodon_api/mastodon_api.ex1
-rw-r--r--test/notification_test.exs8
-rw-r--r--test/plugs/rate_limiter_test.exs28
-rw-r--r--test/web/activity_pub/activity_pub_test.exs6
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs8
-rw-r--r--test/web/mastodon_api/views/notification_view_test.exs2
15 files changed, 66 insertions, 90 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5d0d3316a..1b7c03ebb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -62,19 +62,21 @@ unit-testing:
- mix ecto.migrate
- mix coveralls --preload-modules
-federated-testing:
- stage: test
- cache: *testing_cache_policy
- services:
- - name: minibikini/postgres-with-rum:12
- alias: postgres
- command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- script:
- - mix deps.get
- - mix ecto.create
- - mix ecto.migrate
- - epmd -daemon
- - mix test --trace --only federated
+# Removed to fix CI issue. In this early state it wasn't adding much value anyway.
+# TODO Fix and reinstate federated testing
+# federated-testing:
+# stage: test
+# cache: *testing_cache_policy
+# services:
+# - name: minibikini/postgres-with-rum:12
+# alias: postgres
+# command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+# script:
+# - mix deps.get
+# - mix ecto.create
+# - mix ecto.migrate
+# - epmd -daemon
+# - mix test --trace --only federated
unit-testing-rum:
stage: test
diff --git a/.gitlab/issue_templates/Bug.md b/.gitlab/issue_templates/Bug.md
new file mode 100644
index 000000000..66fbc510e
--- /dev/null
+++ b/.gitlab/issue_templates/Bug.md
@@ -0,0 +1,20 @@
+<!--
+### Precheck
+
+* For support use https://git.pleroma.social/pleroma/pleroma-support or [community channels](https://git.pleroma.social/pleroma/pleroma#community-channels).
+* Please do a quick search to ensure no similar bug has been reported before. If the bug has not been addressed after 2 weeks, it's fine to bump it.
+* Try to ensure that the bug is actually related to the Pleroma backend. For example, if a bug happens in Pleroma-FE but not in Mastodon-FE or mobile clients, it's likely that the bug should be filed in [Pleroma-FE](https://git.pleroma.social/pleroma/pleroma-fe/issues/new) repository.
+-->
+
+### Environment
+
+* Installation type:
+ - [ ] OTP
+ - [ ] From source
+* Pleroma version (could be found in the "Version" tab of settings in Pleroma-FE):
+* Elixir version (`elixir -v` for from source installations, N/A for OTP):
+* Operating system:
+* PostgreSQL version (`postgres -V`):
+
+
+### Bug description
diff --git a/.gitlab/merge_request_templates/Release.md b/.gitlab/merge_request_templates/Release.md
new file mode 100644
index 000000000..237f74e00
--- /dev/null
+++ b/.gitlab/merge_request_templates/Release.md
@@ -0,0 +1,5 @@
+### Release checklist
+* [ ] Bump version in `mix.exs`
+* [ ] Compile a changelog
+* [ ] Create an MR with an announcement to pleroma.social
+* [ ] Tag the release
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4168086e2..e3be2ea08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- **Breaking:** BBCode and Markdown formatters will no longer return any `\n` and only use `<br/>` for newlines
+### Removed
+- **Breaking:** removed `with_move` parameter from notifications timeline.
+
## [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 --git a/config/benchmark.exs b/config/benchmark.exs
index 84c6782a2..ff59395cf 100644
--- a/config/benchmark.exs
+++ b/config/benchmark.exs
@@ -61,8 +61,6 @@ config :web_push_encryption, :vapid_details,
config :web_push_encryption, :http_client, Pleroma.Web.WebPushHttpClientMock
-config :pleroma_job_queue, disabled: true
-
config :pleroma, Pleroma.ScheduledActivity,
daily_user_limit: 2,
total_user_limit: 3,
diff --git a/config/description.exs b/config/description.exs
index c0e403b2e..732c76734 100644
--- a/config/description.exs
+++ b/config/description.exs
@@ -1781,25 +1781,6 @@ config :pleroma, :config_description, [
]
},
%{
- group: :pleroma_job_queue,
- key: :queues,
- type: :group,
- description: "[Deprecated] Replaced with `Oban`/`:queues` (keeping the same format)"
- },
- %{
- group: :pleroma,
- key: Pleroma.Web.Federator.RetryQueue,
- type: :group,
- description: "[Deprecated] See `Oban` and `:workers` sections for configuration notes",
- children: [
- %{
- key: :max_retries,
- type: :integer,
- description: "[Deprecated] Replaced as `Oban`/`:queues`/`:outgoing_federation` value"
- }
- ]
- },
- %{
group: :pleroma,
key: Oban,
type: :group,
@@ -2578,19 +2559,6 @@ config :pleroma, :config_description, [
]
},
%{
- group: :tesla,
- type: :group,
- description: "Tesla settings",
- children: [
- %{
- key: :adapter,
- type: :module,
- description: "Tesla adapter",
- suggestions: [Tesla.Adapter.Hackney]
- }
- ]
- },
- %{
group: :pleroma,
key: :chat,
type: :group,
diff --git a/docs/API/differences_in_mastoapi_responses.md b/docs/API/differences_in_mastoapi_responses.md
index 476a4a2bf..b12d3092c 100644
--- a/docs/API/differences_in_mastoapi_responses.md
+++ b/docs/API/differences_in_mastoapi_responses.md
@@ -117,7 +117,6 @@ The `type` value is `pleroma:emoji_reaction`. Has these fields:
Accepts additional parameters:
- `exclude_visibilities`: will exclude the notifications for activities with the given visibilities. The parameter accepts an array of visibility types (`public`, `unlisted`, `private`, `direct`). Usage example: `GET /api/v1/notifications?exclude_visibilities[]=direct&exclude_visibilities[]=private`.
-- `with_move`: boolean, when set to `true` will include Move notifications. `false` by default.
## POST `/api/v1/statuses`
diff --git a/docs/configuration/cheatsheet.md b/docs/configuration/cheatsheet.md
index 2629385da..4012fe9b1 100644
--- a/docs/configuration/cheatsheet.md
+++ b/docs/configuration/cheatsheet.md
@@ -138,7 +138,8 @@ config :pleroma, :mrf_user_allowlist,
```
#### :mrf_object_age
-* `threshold`: Required age (in seconds) of a post before actions are taken.
+* `threshold`: Required time offset (in seconds) compared to your server clock of an incoming post before actions are taken.
+ e.g., A value of 900 results in any post with a timestamp older than 15 minutes will be acted upon.
* `actions`: A list of actions to apply to the post:
* `:delist` removes the post from public timelines
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
index 60dba3434..3ef3b3f58 100644
--- a/lib/pleroma/notification.ex
+++ b/lib/pleroma/notification.ex
@@ -77,7 +77,6 @@ defmodule Pleroma.Notification do
|> exclude_notification_muted(user, exclude_notification_muted_opts)
|> exclude_blocked(user, exclude_blocked_opts)
|> exclude_visibility(opts)
- |> exclude_move(opts)
end
defp exclude_blocked(query, user, opts) do
@@ -107,14 +106,6 @@ defmodule Pleroma.Notification do
|> where([n, a, o, tm], is_nil(tm.user_id))
end
- defp exclude_move(query, %{with_move: true}) do
- query
- end
-
- defp exclude_move(query, _opts) do
- where(query, [n, a], fragment("?->>'type' != 'Move'", a.data))
- end
-
@valid_visibilities ~w[direct unlisted public private]
defp exclude_visibility(query, %{exclude_visibilities: visibility})
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api.ex b/lib/pleroma/web/mastodon_api/mastodon_api.ex
index 3fe2be521..a2dc9bc71 100644
--- a/lib/pleroma/web/mastodon_api/mastodon_api.ex
+++ b/lib/pleroma/web/mastodon_api/mastodon_api.ex
@@ -72,7 +72,6 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do
exclude_visibilities: {:array, :string},
reblogs: :boolean,
with_muted: :boolean,
- with_move: :boolean,
account_ap_id: :string
}
diff --git a/test/notification_test.exs b/test/notification_test.exs
index 56a581810..d240ede94 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -667,17 +667,13 @@ defmodule Pleroma.NotificationTest do
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
ObanHelpers.perform_all()
- assert [] = Notification.for_user(follower)
-
assert [
%{
activity: %{
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
- ] = Notification.for_user(follower, %{with_move: true})
-
- assert [] = Notification.for_user(other_follower)
+ ] = Notification.for_user(follower)
assert [
%{
@@ -685,7 +681,7 @@ defmodule Pleroma.NotificationTest do
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
- ] = Notification.for_user(other_follower, %{with_move: true})
+ ] = Notification.for_user(other_follower)
end
end
diff --git a/test/plugs/rate_limiter_test.exs b/test/plugs/rate_limiter_test.exs
index 81e2009c8..c6e494c13 100644
--- a/test/plugs/rate_limiter_test.exs
+++ b/test/plugs/rate_limiter_test.exs
@@ -51,7 +51,7 @@ defmodule Pleroma.Plugs.RateLimiterTest do
Config.put([:rate_limit, limiter_name], {scale, limit})
plug_opts = RateLimiter.init(name: limiter_name)
- conn = conn(:get, "/")
+ conn = build_conn(:get, "/")
for i <- 1..5 do
conn = RateLimiter.call(conn, plug_opts)
@@ -65,7 +65,7 @@ defmodule Pleroma.Plugs.RateLimiterTest do
Process.sleep(50)
- conn = conn(:get, "/")
+ conn = build_conn(:get, "/")
conn = RateLimiter.call(conn, plug_opts)
assert {1, 4} = RateLimiter.inspect_bucket(conn, limiter_name, plug_opts)
@@ -85,7 +85,7 @@ defmodule Pleroma.Plugs.RateLimiterTest do
base_bucket_name = "#{limiter_name}:group1"
plug_opts = RateLimiter.init(name: limiter_name, bucket_name: base_bucket_name)
- conn = conn(:get, "/")
+ conn = build_conn(:get, "/")
RateLimiter.call(conn, plug_opts)
assert {1, 4} = RateLimiter.inspect_bucket(conn, base_bucket_name, plug_opts)
@@ -99,9 +99,9 @@ defmodule Pleroma.Plugs.RateLimiterTest do
plug_opts = RateLimiter.init(name: limiter_name, params: ["id"])
- conn = conn(:get, "/?id=1")
+ conn = build_conn(:get, "/?id=1")
conn = Plug.Conn.fetch_query_params(conn)
- conn_2 = conn(:get, "/?id=2")
+ conn_2 = build_conn(:get, "/?id=2")
RateLimiter.call(conn, plug_opts)
assert {1, 4} = RateLimiter.inspect_bucket(conn, limiter_name, plug_opts)
@@ -120,9 +120,9 @@ defmodule Pleroma.Plugs.RateLimiterTest do
id = "100"
- conn = conn(:get, "/?id=#{id}")
+ conn = build_conn(:get, "/?id=#{id}")
conn = Plug.Conn.fetch_query_params(conn)
- conn_2 = conn(:get, "/?id=#{101}")
+ conn_2 = build_conn(:get, "/?id=#{101}")
RateLimiter.call(conn, plug_opts)
assert {1, 4} = RateLimiter.inspect_bucket(conn, base_bucket_name, plug_opts)
@@ -138,8 +138,8 @@ defmodule Pleroma.Plugs.RateLimiterTest do
plug_opts = RateLimiter.init(name: limiter_name)
- conn = %{conn(:get, "/") | remote_ip: {127, 0, 0, 2}}
- conn_2 = %{conn(:get, "/") | remote_ip: {127, 0, 0, 3}}
+ conn = %{build_conn(:get, "/") | remote_ip: {127, 0, 0, 2}}
+ conn_2 = %{build_conn(:get, "/") | remote_ip: {127, 0, 0, 3}}
for i <- 1..5 do
conn = RateLimiter.call(conn, plug_opts)
@@ -179,7 +179,7 @@ defmodule Pleroma.Plugs.RateLimiterTest do
plug_opts = RateLimiter.init(name: limiter_name)
user = insert(:user)
- conn = conn(:get, "/") |> assign(:user, user)
+ conn = build_conn(:get, "/") |> assign(:user, user)
for i <- 1..5 do
conn = RateLimiter.call(conn, plug_opts)
@@ -201,10 +201,10 @@ defmodule Pleroma.Plugs.RateLimiterTest do
plug_opts = RateLimiter.init(name: limiter_name)
user = insert(:user)
- conn = conn(:get, "/") |> assign(:user, user)
+ conn = build_conn(:get, "/") |> assign(:user, user)
user_2 = insert(:user)
- conn_2 = conn(:get, "/") |> assign(:user, user_2)
+ conn_2 = build_conn(:get, "/") |> assign(:user, user_2)
for i <- 1..5 do
conn = RateLimiter.call(conn, plug_opts)
@@ -230,8 +230,8 @@ defmodule Pleroma.Plugs.RateLimiterTest do
opts = RateLimiter.init(name: limiter_name)
- conn = conn(:get, "/")
- conn_2 = conn(:get, "/")
+ conn = build_conn(:get, "/")
+ conn_2 = build_conn(:get, "/")
%Task{pid: pid1} =
task1 =
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs
index 3dd3dd04d..d86c8260e 100644
--- a/test/web/activity_pub/activity_pub_test.exs
+++ b/test/web/activity_pub/activity_pub_test.exs
@@ -1955,11 +1955,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
activity = %Activity{activity | object: nil}
- assert [%Notification{activity: ^activity}] =
- Notification.for_user(follower, %{with_move: true})
+ assert [%Notification{activity: ^activity}] = Notification.for_user(follower)
- assert [%Notification{activity: ^activity}] =
- Notification.for_user(follower_move_opted_out, %{with_move: true})
+ assert [%Notification{activity: ^activity}] = Notification.for_user(follower_move_opted_out)
end
test "old user must be in the new user's `also_known_as` list" do
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index d452ddbdd..dbe9a7fd7 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -407,7 +407,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert length(json_response(conn, 200)) == 1
end
- test "see move notifications with `with_move` parameter" do
+ test "see move notifications" do
old_user = insert(:user)
new_user = insert(:user, also_known_as: [old_user.ap_id])
%{user: follower, conn: conn} = oauth_access(["read:notifications"])
@@ -416,11 +416,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
Pleroma.Tests.ObanHelpers.perform_all()
- ret_conn = get(conn, "/api/v1/notifications")
-
- assert json_response(ret_conn, 200) == []
-
- conn = get(conn, "/api/v1/notifications", %{"with_move" => "true"})
+ conn = get(conn, "/api/v1/notifications")
assert length(json_response(conn, 200)) == 1
end
diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs
index 4df9c3c03..d04c3022f 100644
--- a/test/web/mastodon_api/views/notification_view_test.exs
+++ b/test/web/mastodon_api/views/notification_view_test.exs
@@ -120,7 +120,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
old_user = refresh_record(old_user)
new_user = refresh_record(new_user)
- [notification] = Notification.for_user(follower, %{with_move: true})
+ [notification] = Notification.for_user(follower)
expected = %{
id: to_string(notification.id),