Ryan Barrett
5c470a4647
consider opted out Web domains in ActivityPub.status, not is_blocklisted
...
follow-up to df321234c0
2024-03-31 18:50:01 -07:00
Ryan Barrett
7bf29d411f
atproto: only enable indieweb.org and snarfed.org, for now
2024-03-13 13:07:30 -07:00
Ryan Barrett
95e46c5ebb
Revert "cache outbound HTTP request responses, locally to each inbound request"
...
This reverts commit 30debfc8fa
.
seemed promising, but broke in production. Saw a lot of `IncompleteRead`s on both GETs and POSTs. Rolled back for now.
```
('Connection broken: IncompleteRead(9172 bytes read, -4586 more expected)', IncompleteRead(9172 bytes read, -4586 more expected))
...
File "oauth_dropins/webutil/util.py", line 1673, in call
resp = getattr((session or requests), fn)(url, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 102, in get
return self.request('GET', url, params=params, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 158, in request
return super().request(method, url, *args, headers=headers, **kwargs) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 205, in send
response = self._send_and_cache(request, actions, cached_response, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 233, in _send_and_cache
self.cache.save_response(response, actions.cache_key, actions.expires)
File "requests_cache/backends/base.py", line 89, in save_response
cached_response = CachedResponse.from_response(response, expires=expires)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/response.py", line 102, in from_response
obj.raw = CachedHTTPResponse.from_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/raw_response.py", line 69, in from_response
_ = response.content # This property reads, decodes, and stores response content
^^^^^^^^^^^^^^^^
File "requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
```
2024-03-11 15:31:30 -07:00
Ryan Barrett
30debfc8fa
cache outbound HTTP request responses, locally to each inbound request
...
using requests-cache. pretty straightforward! for #588
2024-03-08 12:34:49 -08:00
Ryan Barrett
4f239c92e5
activitypub: drop japanese spam flood mitigation
...
this stopped (at least to BF) as of 2/24
2024-03-01 12:15:45 -08:00
Ryan Barrett
0610c3c175
activitypub.actor: check enabled protocols
2024-02-29 12:52:49 -08:00
Ryan Barrett
d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user
2024-02-28 12:07:06 -08:00
Ryan Barrett
942452f176
AP: ignore unlisted posts
...
for #832
2024-02-27 12:05:18 -08:00
Ryan Barrett
9489204d64
AP: add profile to Content-Type: application/ld+json
...
for #895
2024-02-27 11:38:00 -08:00
Ryan Barrett
8288390cfd
AP inbox delivery, Protocol.receive: error on blocklisted ids
...
fixes https://console.cloud.google.com/errors/detail/CN278MyjhZbtOQ;time=P30D?project=bridgy-federated , https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-02-27 06:42:19 -08:00
Ryan Barrett
0c98e88a9d
another tweak to heuristic for Feb 2024 Japanese mention spam flood
...
sometimes there's no image. example: https://kish.social/@kj2hevtalc/111954393290908177
2024-02-18 13:56:21 -08:00
Ryan Barrett
e55ef252ab
minor tweak to heuristic for Feb 2024 Japanese mention spam flood
2024-02-18 13:49:37 -08:00
Ryan Barrett
7d9467fa19
temporary heuristic to ignore Feb 2024 Japanese mention spam flood
2024-02-18 13:24:53 -08:00
Ryan Barrett
21ba279b31
ActivityPub.convert: fill in context in obj.as2
2024-01-28 18:15:37 -08:00
Ryan Barrett
fcef6c21ab
Revert "heuristic: assume no AP actor id is the root path on its host"
...
This reverts commit b7e890b4bb
.
it was a nice idea, but we're now hitting AP actor ids that are the root path on their host. this is evidently how microblog.pub does AP; 0x3b0b's site https://bw3.dev/ is an example. general info on https://docs.microblog.pub/user_guide.html#activitypub but not this specifically.
fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-01-26 12:59:54 -08:00
Ryan Barrett
8ab09511bd
bug fix for following from web UI with custom username
...
thanks again for reporting @campegg!
2024-01-26 06:52:03 -08:00
Ryan Barrett
3bcef0d37d
follow UI: specific error message for trying to follow bridged accounts
...
thanks for the nudge @campegg!
2024-01-25 17:05:26 -08:00
Ryan Barrett
a832a4edf6
follow UI: error on bridged accounts
...
also make ActivityPub.owns_handle return False for bridged accounts
fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-01-15 07:57:03 -08:00
Ryan Barrett
b6989a4f2e
if a web user has the webfinger redirects, use AS2 type Person, not Application
2024-01-14 13:53:28 -08:00
Ryan Barrett
f34175de43
minor disclaimer tweak: switch newlines to <br>s
2024-01-11 17:43:56 -08:00
Ryan Barrett
e9194b0a66
AP: default actors to type Application, add disclaimer with links to profile bio
...
thanks for the nudge @fromjasonstuff!
2024-01-11 16:37:10 -08:00
Ryan Barrett
26de4097ae
AP: switch default signing actor to real fed.brid.gy instance actor
...
https://seb.jambor.dev/posts/understanding-activitypub-part-4-threads/#the-instance-actor
2024-01-06 11:59:31 -10:00
Ryan Barrett
b999cfe59a
ActivityPub.convert bug fix: don't call postprocess_as2_actor without user
...
fixes https://console.cloud.google.com/errors/detail/CKmOubHj-8H84AE;time=P30D?project=bridgy-federated
2023-12-14 15:48:02 -08:00
Ryan Barrett
4d732e5d3e
ActivityPub.postprocess_as2: don't default inner obj's id to orig obj's id
2023-12-06 10:03:48 -08:00
Ryan Barrett
d538928fe6
activitypub.postprocess_as2_actor: bug fix for publicKey w/Web.ap_subdomain
2023-12-01 13:06:59 -08:00
Ryan Barrett
7dce96d984
activitypub.actor: handle subdomains vs local domains better
...
for curl --connect-to
2023-12-01 12:57:21 -08:00
Ryan Barrett
6e236e2d70
switch User.ap_actor to id_as, use Web.ap_subdomain property
2023-11-30 17:10:18 -08:00
Ryan Barrett
520b2fd3b0
User.ap_address() => handle_as(ActivityPub)
2023-11-29 21:06:55 -08:00
Ryan Barrett
e079cec77c
ActivityPub.convert: omit acct: URIs
...
for #738 , https://github.com/Automattic/wordpress-activitypub/issues/571
2023-11-29 14:51:56 -08:00
Ryan Barrett
004726d397
fix followers/ing UI page for AP users
...
fixes #718
2023-11-27 21:01:02 -08:00
Ryan Barrett
8f7facda97
don't automatically accept follows from protocols that support them natively
...
for #710 . adds per-protocol `HAS_FOLLOW_ACCEPTS` constant
2023-11-27 14:44:05 -08:00
Ryan Barrett
443506c425
activitypub.postprocess_as2_actor: remove obsolete wrap kwarg
2023-11-27 11:51:52 -08:00
Ryan Barrett
32b38eed07
AP: move Accept object actor handling from postprocess_as2 to convert
2023-11-27 11:49:14 -08:00
Ryan Barrett
3c460c88ad
activitypub.outbox and follower_collection bug fix: pass user to convert
...
fixes https://console.cloud.google.com/errors/detail/CNCD9uP8oaH9AQ;time=P30D?project=bridgy-federated
2023-11-26 15:59:20 -08:00
Ryan Barrett
d7d55864ad
activitypub.actor bug fix: handle opted out users
...
fixes https://console.cloud.google.com/errors/detail/CKOs59zx0rSXQg;time=P30D?project=bridgy-federated
2023-11-26 15:44:43 -08:00
Ryan Barrett
03315891aa
drop a lot of g.user
...
for #690
2023-11-25 20:23:19 -08:00
Ryan Barrett
1591dfb641
pass user to Protocol.send/convert instead of using g.user
...
for #690
2023-11-25 20:07:14 -08:00
Ryan Barrett
face71c9eb
ActivityPub.convert noop, kwargs => orig_obj
2023-11-25 16:07:06 -08:00
Ryan Barrett
69ac7eabca
activitypub: move postprocess_as2_actor out of postprocess_as2
...
...and into ActivityPub.convert and actor handler directly. for #690
2023-11-24 09:20:52 -08:00
Ryan Barrett
ee571e5b25
activitypub: move compacting actors from postprocess_as2 to convert
...
for #690
2023-11-24 08:34:39 -08:00
Ryan Barrett
5d0b275ca8
ActivityPub.convert: compact actor to just id
2023-11-24 08:01:06 -08:00
Ryan Barrett
33c5c3a4d2
AP: add HEAD support to followers/ing, outbox collections
...
for #383
2023-11-23 22:41:52 -08:00
Ryan Barrett
579f55d965
AP: add paging to outbox
...
finishes / fixes #383
2023-11-23 22:35:38 -08:00
Ryan Barrett
db2668ffab
activitypub.postprocess_as2_actor: handle user without handle
...
fixes https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:11 -08:00
Ryan Barrett
dcd7081d48
activitypub.actor: remove redundant preferredUsername
...
no clue why this triggered these flaky test failures, they happened when I ran all tests, but not test_pages on its own. grr.
2023-11-23 22:09:11 -08:00
Ryan Barrett
22b80e4eaf
bug fix for e5abdc0: set g.user before activitypub.postprocess_as2
...
for #383
2023-11-23 07:57:39 -08:00
Ryan Barrett
e5abdc097f
implement outbox
...
only first page. for #383
2023-11-22 21:40:36 -08:00
Ryan Barrett
b255962fde
activitypub: genericize preferredUsername across protocols
2023-11-22 17:24:08 -08:00
Ryan Barrett
9b67d5273f
remove g.user in a few more places in activitypub
...
for #690
2023-11-20 16:21:20 -08:00
Ryan Barrett
eb7da31873
minimize g.user in activitypub.actor
...
for #690
2023-11-19 21:53:39 -08:00