Wykres commitów

287 Commity (c0747c33aa55253faeddd119242c30c55408e4b1)

Autor SHA1 Wiadomość Data
Ryan Barrett da5d434595
bug fix for deleting bridged fediverse actors: translate object as actor id
...not as object id. for #783, 81319a7628
2024-06-14 12:54:55 -07:00
Ryan Barrett 81319a7628
when a Bluesky user blocks the ap.brid.gy bot, delete their bridged fediverse profile
for #783
2024-06-13 21:47:19 -07:00
Ryan Barrett fdca3b6d55
Protocol.receive: don't attempt to deliver to followers on non-enabled protocols
mostly just handles this more gracefully. these deliveries were failing anyway, just not cleanly. fixes eg https://console.cloud.google.com/errors/detail/CMHloZaRmPXQZQ;time=P30D?project=bridgy-federated , probably others too
2024-06-13 12:02:54 -07:00
Ryan Barrett 796edf2033
Protocol.receive: drop direct targets if user isn't bridged into their protocol
fixes https://console.cloud.google.com/errors/detail/CMHloZaRmPXQZQ;time=P30D?project=bridgy-federated
2024-06-08 15:08:12 -07:00
Ryan Barrett aca0a060a3
Protocol.send_task: only interpret HTTP exceptions as failures; re-raise others
this contributed to hiding the root cause of #1121. log:

```
Running send task 6251425858687873358
Params: [('obj', 'ahBicmlkZ3ktZmVkZXJhdGVkclYLEgZPYmplY3QiSmh0dHBzOi8vaW5kaWV3ZWIuc29jaWFsL3VzZXJzL3NuYXJmZWQvc3RhdHVzZXMvMTEyNTgyNzgwNzcwODQzNjQ1L2FjdGl2aXR5DA'), ('orig_obj', ''), ('protocol', 'atproto'), ('url', 'https://atproto.brid.gy'), ('user', 'ahBicmlkZ3ktZmVkZXJhdGVkcjYLEgtBY3Rpdml0eVB1YiIlaHR0cHM6Ly9pbmRpZXdlYi5zb2NpYWwvdXNlcnMvc25hcmZlZAw')]
Sending https://indieweb.social/users/snarfed/statuses/112582780770843645/activity AS1: ...
Using server at https://api.bsky.app
Determining protocol for id https://indieweb.social/users/snarfed/statuses/112582780770843645
  Key('Object', 'https://indieweb.social/users/snarfed/statuses/112582780770843645') owned by source_protocol activitypub
Can't translate object id https://indieweb.social/users/snarfed/statuses/112582780770843645 to atproto , haven't copied it there yet!
Determining protocol for id https://indieweb.social/users/snarfed
  Key('Object', 'https://indieweb.social/users/snarfed') owned by source_protocol activitypub
Using server at https://bsky.social/
"name 'link_length' is not defined
Traceback (most recent call last):
  File "/workspace/protocol.py", line 1611, in send_task
    sent = PROTOCOLS[protocol].send(obj, url, from_user=user, orig_obj=orig_obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/atproto.py", line 423, in send
    record = to_cls.convert(base_obj, fetch_blobs=True, from_user=from_user)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/protocol.py", line 540, in convert
    converted = cls._convert(obj, from_user=from_user, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/atproto.py", line 610, in _convert
    ret = bluesky.from_as1(cls.translate_ids(obj.as1), blobs=blobs,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "granary/bluesky.py", line 577, in from_as1
    text = src.truncate(full_text, None, OMIT_LINK)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "granary/source.py", line 908, in truncate
    truncated = brevity.shorten(content, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "brevity.py", line 247, in shorten
    base_length = total_length(tokens)
                  ^^^^^^^^^^^^^^^^^^^^
  File "brevity.py", line 188, in total_length
    return sum(token_length(t) for t in tokens)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "brevity.py", line 188, in <genexpr>
    return sum(token_length(t) for t in tokens)
               ^^^^^^^^^^^^^^^
  File "brevity.py", line 183, in token_length
    return link_length
           ^^^^^^^^^^^
NameError: name 'link_length' is not defined"
```
2024-06-08 13:20:34 -07:00
Ryan Barrett e761f23324
Protocol: noop, comment tweak and TODO 2024-06-08 13:14:56 -07:00
Ryan Barrett 026d99edc0
pass ignore_links=True to html_to_text everywhere
for #976
2024-06-06 18:14:35 -07:00
Ryan Barrett 27fc843825
Protocol.add_source_links bug fixes, handle actors inside create/update activities
for #976
2024-06-06 11:40:25 -07:00
Ryan Barrett be30afd55a
ATProto: use plain text URLs domains in "bridged by Bridgy Fed" profile text
for #976
2024-06-06 08:58:09 -07:00
Ryan Barrett 9e18b7f110
tweak "bridged by Bridgy Fed" links in profile: use handle, add source protocol
for #976
2024-06-06 08:58:09 -07:00
Ryan Barrett ad81b1883e
refactor Protocol.convert, extract out new add_source_links method
for #976
2024-06-06 08:58:08 -07:00
Ryan Barrett 3fe402e54c
drop Object cache in Protocol.load 2024-06-04 14:27:04 -07:00
Ryan Barrett 5e2dacc21f
Protocol.send_task: if send returns False, return 204, not 304
send returns False when the object or target URL are undeliverable. retries shouldn't fix this, so we don't want to retry.
2024-06-04 12:30:50 -07:00
Ryan Barrett 712da61181
auth error reporting: standardize messages, include HTTP context
trying to collect them into two top-level Error Reporting errors, with details for each one in the user field

for #566
2024-06-04 11:27:17 -07:00
Ryan Barrett cc564a2b19
turn on authorization checks! HTTP sig matches actor, actor is allowed to modify object
for #566
2024-06-03 14:12:08 -07:00
Ryan Barrett 24559c8f17
Protocol.receive: normalize ids before resolving
for #959, and possibly others
2024-06-02 08:41:52 -07:00
Ryan Barrett 5266974731
Protocol.for_id: make Web own bot actor AP ids, not bot protocol 2024-06-02 08:21:18 -07:00
Ryan Barrett a2376f8f14
prune more logging messages 2024-06-01 07:17:44 -07:00
Ryan Barrett 7e594e3227
authz: move NO_AUTH_DOMAINS (a.gup.pe) from Protocol.receive to activitypub.inbox
for #566
2024-05-30 13:34:14 -07:00
Ryan Barrett 9f33767f33
authz: move LD Sig check from Protocol.receive to activitypub.inbox
for #566
2024-05-29 21:17:38 -07:00
Ryan Barrett 8f5d8221a9
add ids.profile_id, use everywhere
for #566
2024-05-29 16:18:15 -07:00
Ryan Barrett bfbae4b280
authz: normalize user ids before comparing, in both receive and Object.get_or_create
for #566
2024-05-29 12:29:38 -07:00
Ryan Barrett d8910d52cd
LIMITED_DOMAINS bug fix, read lines from file separately 2024-05-28 20:40:48 -07:00
Ryan Barrett ea0f61f446
authz: when comparing domains, handle common subdomains like www
for #566
2024-05-28 20:36:18 -07:00
Ryan Barrett f2a64c8b5c
Object.get_or_create: rename actor => authed_as, add to all calls
for #566
2024-05-28 16:07:32 -07:00
Ryan Barrett 820f7fa4f4
authz: add protocol.NO_AUTH_DOMAINS for domains we can't authorize yet
...eg a.gup.pe. https://github.com/snarfed/bridgy-fed/issues/566#issuecomment-2130714037
2024-05-28 15:23:22 -07:00
Ryan Barrett fc14298f0d
authz: expand LD Sigs check to any signature field, regardless of creator
for #566
2024-05-28 15:15:23 -07:00
Ryan Barrett 03672679b9
activitypub, protocol: misc noop logging and code style tweaks 2024-05-27 20:38:49 -07:00
Ryan Barrett 6f84a98a5d
Protocol.receive: more authz log message tweaks
for #566
2024-05-24 20:00:23 -07:00
Ryan Barrett 4ca02824c9
Protocol.receive: tweak authz logging messages
for #566
2024-05-24 19:30:31 -07:00
Ryan Barrett 6ffc4a3c3b
infra: add new router flex service, switch tasks to run on it
receive, send, webmention, and poll-feed
2024-05-23 20:40:54 -07:00
Ryan Barrett aa5ec4cccd
Protocol.maybe_delete_copy: minor tweaks
for #783
2024-05-23 11:43:02 -07:00
Ryan Barrett 9de5eb400c
Protocol.targets: don't add ATProto for reposts of/replies to non-bridged posts 2024-05-22 23:28:53 -07:00
Ryan Barrett 15af8b2585
limited domains bug fix: don't count protocol bot user follows 2024-05-22 22:33:57 -07:00
Ryan Barrett f39392e225
Protocol: when disabling a protocol, also delete that protocol's copy user
for #783
2024-05-22 16:33:13 -07:00
Ryan Barrett 45ba0fb69f
Protocol.send_task: handle missing url or protocol param 2024-05-22 14:28:17 -07:00
Ryan Barrett 1778a1145e
Protocol.bot_follow: send in separate task instead of inline
fixes #1041
2024-05-22 14:28:17 -07:00
Ryan Barrett 06e2e61b1e
ATProto: switch to granary's logic to populate strongRefs, via DatastoreClient
for #1007
2024-05-16 13:11:29 -07:00
Ryan Barrett e4f9966686
Protocol.receive: second part of making explicit opt in override implicit opt out
for #1052, #974
2024-05-15 11:41:20 -07:00
Ryan Barrett 03c5638bc1
Protocol.receive bug fix: resolve ids before checking for bot user follow, not after
for #1017
2024-05-14 17:01:20 -07:00
Ryan Barrett f6798f2725
abstract "bridged from Bridgy Fed" profile label across protocols
for #976
2024-05-14 16:03:42 -07:00
Ryan Barrett 79e5d2be07
bug fix for User.status handling: check for false-ness, not is None
we have some users in the datastore with status None, some with False. 😕 fixes #1048
2024-05-12 19:02:07 -07:00
Ryan Barrett 348987f0b4
add Protocol.REQUIRES_OLD_ACCOUNT, enable for ActivityPub 2024-05-11 19:20:33 -07:00
Ryan Barrett 59b9e9c904
add protocol.LIMITED_DOMAINS 2024-05-11 17:39:04 -07:00
Ryan Barrett de0af66979
basic anti-spam: add new Protocol.REQUIRES_AVATAR/NAME constants
...and start returning `blocked` from User.status for them
2024-05-11 16:03:07 -07:00
Ryan Barrett 389e2d9205
Protocol.targets: don't add trailing slash to PDS URL https://atproto.brid.gy
fixes #1032
2024-05-08 09:37:47 -07:00
Ryan Barrett f533479e0b
noop: drop unused flask.g imports 2024-05-07 17:14:59 -07:00
Ryan Barrett 4da00192b0
when someone follows a bot user to opt in, have the bot user follow them back
fixes #999. this makes sure we start receiving posts from AP users immediately, instead of waiting until a Bluesky opted in user follows them.
2024-05-07 10:54:18 -07:00
Ryan Barrett 2fa1ae73eb
when someone follows a bot user, refresh their profile first
...so that we're up to date on whether they're opted out or not

fixes #1017
2024-05-06 11:30:33 -07:00
Ryan Barrett 515be28cdd
Protocol.receive: automatically send to ATProto PDS if user has ATProto enabled
for #999
2024-05-05 17:21:24 -07:00