Ryan Barrett
034236f4cf
AP: don't duplicate security context in @context in bot users
...
fixes #1003 . thanks @grishka!
2024-05-05 08:29:47 -07:00
Ryan Barrett
0781a4c695
AP inbox delivery: return 422 when a user with a bad handle follows the bot user
...
for #982
2024-05-04 13:39:39 -07:00
Ryan Barrett
2bf526ab7c
refactor validating handles in ATProto and elsewhere
...
for https://github.com/snarfed/bridgy-fed/issues/982
2024-05-03 15:18:16 -07:00
Ryan Barrett
073ce475e5
Protocol.receive: bridge replies to followers where in-reply-to already is
...
...ie if it's on the follower's protocol, either native or bridged.
for #981 , #950 , #949
not confident in this, despite the tests. worried it will either over- or under-deliver. guess we'll see.
2024-05-01 17:45:48 -07:00
Ryan Barrett
c8ca31554b
AP: strip Link attachments since fedi instances generate their own link previews
...
hopefully fixes #958
2024-04-29 15:13:12 -07:00
Ryan Barrett
cbe4b59206
convert Protocol.is_enabled_to to an instance method
...
next commit will move it to User
2024-04-27 20:27:33 -07:00
Ryan Barrett
0b00e6eb4b
AP: serve protocol bot users on their own subdomains
2024-04-22 16:07:54 -07:00
Ryan Barrett
10023d17fd
Protocol.enable_protocol: create copy user if necessary
2024-04-21 12:18:12 -07:00
Ryan Barrett
f357ea1698
ActivityPub: accept non-public DMs to protocol bot users
...
for #880
2024-04-21 08:36:03 -07:00
Ryan Barrett
1686a2ba91
opt in/out prompt: accept yes/no DMs to bot users to enable/disable protocols
...
for #880
2024-04-21 08:08:12 -07:00
Ryan Barrett
259b7d72dd
start on conditional opt in
...
* add Protocol.DEFAULT_ENABLED_PROTOCOLS
* add User.enabled_protocols
* move common.is_enabled to Protocol.is_enabled_to, include opt out/in
2024-04-17 16:43:10 -07:00
Ryan Barrett
f840c8b784
temporarily disable is_enabled checks in ATProto/ActivityPub.convert
...
for manual testing
2024-04-14 14:50:02 -07:00
Ryan Barrett
133d640f1d
improve rendering of ATProto interactions on user pages
...
for #825
2024-04-11 15:02:15 -07:00
Ryan Barrett
bf296802d8
pass from_user through to convert() in a few more places
2024-04-10 15:16:37 -07:00
Ryan Barrett
7009267bb0
use new handle_or_id kwarg in common.is_enabled calls
2024-04-10 11:49:53 -07:00
Ryan Barrett
f1531b44e7
bug fix for bad profile link on followers page
...
fixes #934
2024-04-01 23:06:57 -07:00
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