Commit graph

9889 commits

Author SHA1 Message Date
Mark Felder
bc16f09d7b Dialyzer: the pattern can never match the type
The original error was for the chat controller:

lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:104:pattern_match The pattern can never match the type {:error, :content_too_long | :forbidden | :no_content | :not_found} | {:user, nil}.

Improve typespecs for the Pipeline and apply them where it could be encountered
2024-09-06 11:12:15 -04:00
Mark Felder
fc3ea94a1c Dialyzer: the pattern can never match the type 2024-09-06 09:58:03 -04:00
feld
2c916ccd89 Merge branch 'following-state-bug' into 'develop'
Fix Following status bug

See merge request pleroma/pleroma!4251
2024-09-06 13:27:06 +00:00
Mark Felder
1797f5958a App orphans should only be removed if they are older than 15 mins 2024-09-05 20:55:28 +00:00
Mark Felder
4d76692db3 Fix Following status bug 2024-09-05 16:14:13 -04:00
Mark Felder
53744bf146 Limit the number of orphaned to delete at 100 every 10 mins due to the cascading queries that have to check oauth_authorizations and oauth_tokens tables.
This should keep ahead of most app registration spam and not overwhelm lower powered servers.
2024-09-04 11:45:05 -04:00
Mark Felder
a1951f3af7 Add Cron worker to clean up orphaned apps hourly 2024-09-04 10:59:58 -04:00
Mark Felder
7bd0750787 Ensure apps are assigned to users 2024-09-04 10:40:37 -04:00
Mark Felder
427da7a99a Rate Limit the OAuth App spam 2024-09-04 09:22:58 -04:00
feld
92d5f0ac14 Revert "Merge branch 'oauth-app-spam' into 'develop'"
This reverts merge request !4244
2024-09-04 02:22:25 +00:00
feld
9077d0925b Merge branch 'oauth-app-spam' into 'develop'
Fix OAuth app spam

See merge request pleroma/pleroma!4244
2024-09-01 18:24:06 +00:00
feld
61e4be396f Merge branch 'drop-unknown-deletes' into 'develop'
Drop unwanted activities from unknown actors

See merge request pleroma/pleroma!4236
2024-09-01 18:08:07 +00:00
Mark Felder
751d63d4bb Support OAuth App updating the website URL 2024-09-01 13:55:45 -04:00
Mark Felder
5a1144208d Prevent OAuth App flow from creating duplicate entries 2024-09-01 12:27:16 -04:00
Mark Felder
11ee94ae17 InboxGuardPlug: Add early rejection of unknown activity types 2024-08-30 10:05:09 -04:00
Mark Felder
e38f5f1a81 Add recognized activity types to a constant and use it in the test 2024-08-30 09:47:45 -04:00
feld
5205e846eb Update allowed activity types from strangers
Move is emitted from the old account
EmojiReact is ~ Like
Announced TBD
2024-08-30 09:30:33 -04:00
Mark Felder
990b2058df Remove unnecessary error match in ReceiverWorker 2024-08-29 16:05:40 -04:00
Mark Felder
e2cdae2c88 Change relay inbox response when not federating to a 403 for consistency 2024-08-29 16:05:40 -04:00
Mark Felder
16a9b34876 Convert to an Plug called InboxGuard 2024-08-29 16:05:36 -04:00
Mark Felder
06deacd58e Formatting 2024-08-29 11:59:42 -04:00
feld
27fcc42171 Use Pleroma.Object.Containment.get_actor/1 to reliably find the actor of an incoming activity or object 2024-08-29 11:59:42 -04:00
Mark Felder
1c394dd18c Move the check to the inbox 2024-08-29 11:59:42 -04:00
Mark Felder
4bc6f334f4 Revert unintentional change 2024-08-29 11:59:42 -04:00
Mark Felder
ceffb8a891 Drop incoming Delete activities from unknown actors 2024-08-29 11:59:42 -04:00
feld
62856ab18f Merge branch 'todo-fixes' into 'develop'
Clean up Elixir 1.13 TODOs

See merge request pleroma/pleroma!4233
2024-08-29 15:27:53 +00:00
Mark Felder
b5814dc9b3 Merge remote-tracking branch 'origin/develop' into todo-fixes 2024-08-29 11:01:02 -04:00
feld
8d07034608 Merge branch 'pleroma-http-stream' into 'develop'
Pleroma.HTTP: support streaming response bodies

See merge request pleroma/pleroma!4239
2024-08-29 14:54:01 +00:00
Mark Felder
c17a78c55a Rich Media: add stream byte counting as an extra protection against malicious URLs 2024-08-29 09:37:11 -04:00
Mark Felder
8ab4dd20df Update comments, remove solved TODO 2024-08-28 19:52:29 -04:00
Mark Felder
0bf82a1745 Add an AdapterHelper for Finch so we can support streaming request bodies 2024-08-28 19:50:51 -04:00
Mark Felder
1821ef4f15 Move user active check into Federator.perform/1 2024-08-28 18:35:09 -04:00
Mark Felder
8a3efa7152 More error annotations 2024-08-28 18:02:35 -04:00
Mark Felder
c5ca806aa0 Add back one of the duplicate checks to fix a test, document where it comes from 2024-08-28 17:57:34 -04:00
Mark Felder
380a6a6df3 :validate_object is not a real error returned from anywhere 2024-08-28 17:45:31 -04:00
Mark Felder
2346807ac9 Annotate error cases 2024-08-28 17:44:33 -04:00
Mark Felder
6ae629cfe0 Cancel ReceiverWorker jobs if the user account has been disabled / deactivated 2024-08-28 17:24:59 -04:00
Mark Felder
fc450fdefc ReceiverWorker: cancel job if user fetch is forbidden
An instance block with authenticated fetch being required can cause this as we couldn't get the user to find their public key to verify the signature. Commonly observed if someone boosts/Announces a post from an instance that blocked you.
2024-08-28 15:45:16 -04:00
Mark Felder
0804b73c0a This error is not returned by Tesla
Upstream has a bug filed for this as they aren't handling this error internally, so it was raising
2024-08-27 22:08:31 -04:00
Mark Felder
44901502ff Fix incorrect identifier for the with statement 2024-08-27 21:56:02 -04:00
Mark Felder
116fe77b77 Tesla.Middleware.Timeout breaks streaming bodies
These are executed by Oban now and Oban can enforce the timeout if the regular HTTP timeout is not sufficient.
2024-08-27 21:55:07 -04:00
Mark Felder
0a86d2b3ac Handle streaming response errors 2024-08-27 21:22:59 -04:00
Mark Felder
ec8db9d4ee RichMedia: skip the HTTP HEAD request for adapters that support streaming the response body 2024-08-27 21:09:15 -04:00
Mark Felder
bb279c2802 Pleroma.HTTP add AdapterHelper.can_stream? to assist with discovering if the current adapter supports returning a Stream body 2024-08-27 21:08:25 -04:00
Mark Felder
5f6506d864 Pleroma.HTTP: option stream: true will return a stream as the body for Gun adapter 2024-08-27 20:39:32 -04:00
Mark Felder
39108c5f12 Remove unnecessary re-fetch of the actor 2024-08-22 13:43:01 -04:00
Mark Felder
a9aa810d3d Change imports to generate an Oban job per each task 2024-08-22 13:24:07 -04:00
Mark Felder
649e51b581 Fix Oban jobs for imports 2024-08-22 11:35:55 -04:00
Mark Felder
e65555e8c5 Remove workaround for URI.merge bug on nil fields before Elixir 1.13
https://github.com/elixir-lang/elixir/issues/10771
2024-08-21 15:11:42 -04:00
Mark Felder
010edcbcb5 Use Map.filter now that minimum Elixir version is 1.13 2024-08-21 14:50:19 -04:00