Hugh Rundle
f0e1767bc9
black code
2023-01-22 16:10:30 +11:00
Hugh Rundle
803bba71a6
fix error handling
...
- when using raise_for_status we need to catch an HTTPError, not a ConnectionError
- simplify instance actor - use internal email address since it will never be used anyway, and make default username less likely to already be in use.
2023-01-22 15:59:19 +11:00
Hugh Rundle
317fa5cdfd
black
2023-01-20 20:05:14 +11:00
Hugh Rundle
e8452011f7
handle get_data exceptions better
...
Makes exception handling more precise, only raising status for 401s.
Also fixes a string pylint was complaining about.
2023-01-20 19:55:38 +11:00
Hugh Rundle
f8c9df4aff
pylint fixes
2023-01-20 18:20:18 +11:00
Hugh Rundle
4108238716
resolve SECURE_FETCH bugs
...
ERROR HANDLING FIXES
- use raise_for_status() to pass through response code
- handle exceptions where no response object is passed through
INSTANCE ACTOR
- models.User.objects.create_user function cannot take an ID
- allow instance admins to determine username and email for instance actor in settings.py
2023-01-20 16:32:17 +11:00
Hugh Rundle
d66e2fe861
merge in latest changes
2023-01-18 14:12:01 +11:00
Fedor Indutny
cdc833657f
Fix serialization of JSON-LD subarrays
...
Properties like "tag" could be lists containing multiple subclasses of
ActivityObject. Make sure to serialize them recursively instead of
outputting them as they are, because otherwise we could get a bunch of
nulls in the resulting JSON and that wouldn't necessarily be a valid
JSON-LD object.
Fix : #2451
2022-12-04 18:12:39 -08:00
Mouse Reeve
b37a4322de
Change log level to info for connector exceptions
...
These errors in resolve_remote_id aren't really errors, they're
routine problems that we can expect from dealing with the outside world,
like a connection timeout, a server being down, a server being blocked,
et cetera. It's cluttering up the logs and causing unnecessary worry.
2022-11-17 12:35:19 -08:00
André Jaenisch
530d7de309
Use variable instead of string
...
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-11-13 16:59:05 +01:00
Mouse Reeve
7eb2a82e5f
Merge branch 'main' into misc/add_signatures_to_requests_for_masto_compat
2022-07-26 15:46:18 -07:00
Mouse Reeve
77a7dfa924
Merge pull request #2133 from bookwyrm-social/activitypub-connection-erorr
...
Don't throw an error when unable to connect to remote data
2022-05-26 10:12:18 -07:00
Mouse Reeve
88b2cffcf2
Merge pull request #2035 from bookwyrm-social/stopped-shelf
...
Stopped shelf
2022-05-26 10:11:32 -07:00
Mouse Reeve
3e54a5f4a3
Python formatting
2022-05-26 09:00:45 -07:00
Mouse Reeve
0bfe1e9dfc
Don't throw an error when unable to connect to remote data
2022-05-25 13:24:11 -07:00
Mouse Reeve
b2775c5160
Check unsupported types before attempting to serialize
2022-05-16 10:21:54 -07:00
Mouse Reeve
fd43b56d31
Fixes celery error encountering Article type activities
2022-05-16 10:17:21 -07:00
Mouse Reeve
819458e82a
Improves error reporting on activitypub parser
2022-03-16 13:53:54 -07:00
Mouse Reeve
d2dab0f2db
Merge branch 'main' into misc/add_signatures_to_requests_for_masto_compat
2022-03-01 10:20:39 -08:00
Mouse Reeve
c06817e9ff
Python formatting
2022-02-09 12:23:01 -05:00
Mouse Reeve
6323b0e700
Use correct model type for federated links
2022-02-09 12:20:11 -05:00
Mouse Reeve
8cc4427e60
Merge branch 'main' into misc/add_signatures_to_requests_for_masto_compat
2022-01-13 11:37:54 -08:00
Mouse Reeve
d1183fd003
Python formatting
2022-01-12 17:11:24 -08:00
Mouse Reeve
5fcdc284ce
Removes duplicate atomic block
2022-01-12 16:41:23 -08:00
Mouse Reeve
6c78a7b6ef
Add user attribution to links and domains
2022-01-10 13:20:31 -08:00
Mouse Reeve
4dfe9fd714
Support links with no name
2022-01-10 11:21:43 -08:00
Mouse Reeve
32e3fdb438
Adds admin view
2022-01-10 10:12:28 -08:00
Mouse Reeve
70fe7e17af
Removes name ap field
2022-01-09 14:25:22 -08:00
Renato "Lond" Cerqueira
e2ee3d27a7
WIP
2022-01-05 15:47:05 +01:00
Renato "Lond" Cerqueira
097d86454a
Add signatures to requests to mastodon to support authorized fetch mode
...
When mastodon is in authorized fetch mode any request has to be signed
or it fails with 401. This adds the needed signature to the requests
made to discover the actor when receiving something from mastodon (such
as a follow request)
2022-01-05 15:46:42 +01:00
Mouse Reeve
5c99f142f9
Serialize links for books
2021-12-15 17:12:53 -08:00
Mouse Reeve
86b294afd7
Re-structures link models
2021-12-15 16:23:21 -08:00
Mouse Reeve
377a4e1ef1
Updating string format syntax part 1
2021-09-17 21:39:18 -07:00
Mouse Reeve
de3f18655c
Set priorities on tasks
2021-09-07 16:33:43 -07:00
Mouse Reeve
53d9ff87d9
Look up followers url to determine post privacy
2021-08-28 10:40:52 -07:00
Mouse Reeve
bbe5ad7ce1
Suppresses pylint warning
2021-08-17 10:49:11 -07:00
Mouse Reeve
ad0fff7030
Prevent overwriting data on import form outside data source
2021-08-17 10:08:07 -07:00
Mouse Reeve
21a954c7df
Always use underscores in html ids
...
Plus some other shifting around
2021-08-08 19:44:12 -07:00
Mouse Reeve
a84a744e8d
Track changed fields in activity to model code
2021-08-03 08:48:15 -07:00
Mouse Reeve
4479864008
Updates code for linter
2021-06-18 14:12:56 -07:00
Mouse Reeve
3ade2d3bb1
New version of black, new whitespace
2021-04-26 09:15:42 -07:00
Mouse Reeve
caa261f4bf
Gracefully handle expect, unsupported activities
2021-04-16 15:12:38 -07:00
Mouse Reeve
af6cab2e3f
Don't reutnr an error when discarding activity objects
2021-04-08 20:03:29 -07:00
Mouse Reeve
a39cd670ef
Fixes boosted remote statuses coming in as Notes
2021-04-05 18:05:06 -07:00
Mouse Reeve
d8c83fa31c
Return activities for existing objs in resolve_remote_id
2021-03-24 12:58:39 -07:00
Mouse Reeve
28dc67bf5c
Fixes ignore test for valid remote statuses
2021-03-24 12:37:42 -07:00
Mouse Reeve
db426d71ee
Fixes failed serialization of empty avatar field
2021-03-17 09:22:45 -07:00
Mouse Reeve
919b166241
Catch error in serializing unknown boosts
2021-03-13 08:13:20 -08:00
Mouse Reeve
70296e760b
Runs black
2021-03-08 08:49:10 -08:00
Mouse Reeve
71bbea83f9
Adds discard check to favs
2021-03-07 09:42:31 -08:00