Commit Graph

107 Commits

Author SHA1 Message Date
Mark Felder aa070c7daf Handle 401s as I have observed it in the wild 2023-12-28 23:09:33 -05:00
Mark Felder ad0a5deb67 Prevent requeuing Remote Fetcher jobs that exceed thread depth 2023-12-27 22:28:41 -05:00
Mark Felder a2708f7fe3 Leverage existing atoms as return errors for the object fetcher 2023-12-27 22:01:59 -05:00
Mark Felder 287f2c9719 Formatting 2023-12-27 21:55:07 -05:00
Mark Felder becb070603 Conslidate log messages for object fetcher failures and leverage Logger.metadata 2023-12-27 21:22:51 -05:00
Mark Felder 6c9929b809 Set Logger level to error 2023-12-27 20:18:14 -05:00
Mark Felder 73c4c6d7de Revert "Mark instances as unreachable when returning a 403 from an object fetch"
This reverts commit d472bafec1.
2023-12-26 17:20:36 -05:00
Mark Felder 67dd81e825 Consolidate the HTTP status code checking into the private get_object/1 2023-12-26 16:05:28 -05:00
Mark Felder d472bafec1 Mark instances as unreachable when returning a 403 from an object fetch
This is a definite sign the instance is blocked and they are enforcing authorized_fetch
2023-12-26 15:54:21 -05:00
Mark Felder 603e9f6a92 Fix Transmogrifier tests
These tests relied on the removed Fetcher.fetch_object_from_id!/2 function injecting the error tuple into a log message with the exact words "Object containment failed."

We will keep this behavior by generating a similar log message, but perhaps this should do a better job of matching on the error tuple returned by Transmogrifier.handle_incoming/1
2023-12-26 14:22:06 -05:00
Mark Felder ea0ec5fbcf Remove Fetcher.fetch_object_from_id!/2
It was only being called once and can be replaced with a case statement.
2023-12-26 14:20:35 -05:00
tusooa 819a82da99
Fix unused variable 2023-05-22 08:19:58 -04:00
tusooa 505e58d4eb
Fix ObjectTest 2023-05-22 08:14:20 -04:00
tusooa e170fc40dd
Fix build warning 2023-05-09 21:38:28 -04:00
tusooa be5c5118cb
Make sure object refetching follows update rules 2023-05-09 21:04:27 -04:00
lain e853cfe7c3 Revert "Merge branch 'copyright-bump' into 'develop'"
This reverts merge request !3825
2023-01-02 20:38:50 +00:00
marcin mikołajczak 10886eeaa2 Bump copyright year
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-01-01 12:13:06 +01:00
Haelwenn (lanodan) Monnier b2713357b9 Object.Fetcher: Set reachable on successful fetch 2022-11-13 16:51:12 +01:00
Tusooa Zhu cd19537f39
Make EnsureRePrepended history-aware 2022-07-23 17:48:39 -04:00
Tusooa Zhu eba9b0760f
Make MRF Keyword history-aware 2022-07-23 15:56:36 -04:00
Tusooa Zhu 069554e925
Guard against outdated Updates
It is possible for an earlier Update to be received by us later.
For this, we now
(1) only allows Updates to poll counts if there is no updated field,
    or the updated field is the same as the last updated date or
    creation date;
(2) does not allow updating anything if the updated field
    is older than the last updated date or creation date;
(3) allows updating updatable fields otherwise (normal updates);
(4) if only the updated field is changed, it does not create
    a new history item on its own.
2022-07-07 15:11:29 -04:00
Tusooa Zhu 40953a8f5c
Reuse formerRepresentations from remote if possible 2022-06-25 01:03:46 -04:00
Tusooa Zhu 99a6f50316
Unify the logic of updating objects 2022-06-25 00:32:22 -04:00
Tusooa Zhu fa31ae50e6
Inject history when object is refetched 2022-06-01 19:49:04 -04:00
Sean King 17aa3644be
Copyright bump for 2022 2022-02-25 23:11:42 -07:00
Haelwenn c4b4258374 Merge branch 'features/validators-note' into 'develop'
Pipeline Ingestion: Note

Closes #290

See merge request pleroma/pleroma!2984
2021-06-01 01:51:38 +00:00
Haelwenn (lanodan) Monnier 461123110b
Object.Fetcher: Fix getting transmogrifier reject reason 2021-04-05 19:19:12 +02:00
Haelwenn (lanodan) Monnier 96212b2e32
Fix addressing 2021-04-05 19:19:12 +02:00
Alexander Strizhakov 17f28c0507
mastodon pins 2021-03-25 13:03:40 +03:00
Haelwenn (lanodan) Monnier c4439c630f
Bump Copyright to 2021
grep -rl '# Copyright © .* Pleroma' * | xargs sed -i 's;Copyright © .* Pleroma .*;Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>;'
2021-01-13 07:49:50 +01:00
lain e1e7e4d379 Object: Rework how Object.normalize works
Now it defaults to not fetching, and the option is named.
2021-01-04 13:38:31 +01:00
rinpatch 2c55f7d7cb Remove FedSockets
Current FedSocket implementation has a bunch of problems. It doesn't
have proper error handling (in case of an error the server just doesn't
respond until the connection is closed, while the client doesn't match
any error messages and just assumes there has been an error after 15s)
and the code is full of bad descisions (see: fetch registry which uses
uuids for no reason and waits for a response by recursively querying a
 ets table until the value changes, or double JSON encoding).

Sometime ago I almost completed rewriting fedsockets from scrach to
adress these issues. However, while doing so, I realized that fedsockets
 are just too overkill for what they were trying to accomplish, which is
 reduce the overhead of federation by not signing every message.
This could be done without reimplementing failure states and endpoint
 logic we already have with HTTP by, for example, using TLS cert auth,
or switching to a more performant signature algorithm. I opened
https://git.pleroma.social/pleroma/pleroma/-/issues/2262 for further
discussion on alternatives to fedsockets.

From discussions I had with other Pleroma developers it seems like they
 would approve the descision to remove them as well,
therefore I am submitting this patch.
2020-11-17 17:28:30 +03:00
rinpatch 6ca709816f Fix object spoofing vulnerability in attachments
Validate the content-type of the response when fetching an object,
according to https://www.w3.org/TR/activitypub/#x3-2-retrieving-objects.

content-type headers had to be added to many mocks in order to support
this, some of this was done with a regex. While I did go over the
resulting files to check I didn't modify anything unrelated, there is a
 possibility I missed something.

Closes pleroma#1948
2020-11-12 15:25:33 +03:00
Steven Fuchs f2ef9735c5 Federate data through persistent websocket connections 2020-09-18 11:58:22 +00:00
Haelwenn (lanodan) Monnier f1f44069ae
Fetcher: Correctly return MRF reject reason 2020-09-11 20:00:41 +02:00
Haelwenn (lanodan) Monnier 921f926e96
Remove OStatus in testsuite 2020-09-08 18:43:57 +02:00
lain 9433311923 Merge branch 'bugfix/incoming-poll-emoji' into 'develop'
Fix emoji in Question, force generated context/context_id insertion

Closes #1870

See merge request pleroma/pleroma!2915
2020-09-03 11:50:30 +00:00
Alexander Strizhakov 79f65b4374
correct pool and uniform headers format 2020-09-02 09:16:51 +03:00
Haelwenn (lanodan) Monnier d9a21e4784
fetcher: Remove fix_object call for Question activities 2020-09-01 08:35:00 +02:00
Haelwenn (lanodan) Monnier b1fc4fe0ca
fetcher: fallback to [] when to/cc is nil
Related: https://git.pleroma.social/pleroma/pleroma/-/issues/2063
2020-08-18 02:02:20 +02:00
Haelwenn (lanodan) Monnier ac2598307d
Merge remote-tracking branch 'pleroma/develop' into features/poll-validation 2020-07-31 13:57:21 +02:00
Haelwenn (lanodan) Monnier 82895a4012
SideEffects: port ones from ActivityPub.do_create and ActivityPub.insert 2020-07-15 11:40:23 +02:00
Haelwenn (lanodan) Monnier ad867ccfa1
fetcher: Reinject Question through validator 2020-07-15 11:39:55 +02:00
Haelwenn (lanodan) Monnier 6b9c4bc1f1
fetcher: more descriptive variable names 2020-07-15 11:39:55 +02:00
Haelwenn (lanodan) Monnier ce243b107f
Use Logger.info for {:reject, reason} 2020-07-13 15:26:31 +02:00
Haelwenn (lanodan) Monnier 1566543bec
object/fetcher: Pass full Transmogrifier error 2020-06-26 20:10:47 +02:00
lain 349b9d86dc Merge branch 'remake-remodel-2' into 'develop'
Ingestion Pipeline Revamp

See merge request pleroma/pleroma!2315
2020-04-06 11:59:01 +00:00
lain 3c2c32b460 Merge branch 'remake-remodel' into develop 2020-03-19 18:00:55 +01:00
Alexander Strizhakov 509c81e4b1
Merge branch 'develop' into gun 2020-03-03 10:08:07 +03:00
Haelwenn (lanodan) Monnier 6da6540036
Bump copyright years of files changed after 2020-01-07
Done via the following command:
git diff fcd5dd259a --stat --name-only | xargs sed -i '/Pleroma Authors/c# Copyright © 2017-2020 Pleroma Authors <https:\/\/pleroma.social\/>'
2020-03-02 06:08:45 +01:00