Wykres commitów

991 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett 91876a7d22
web.poll_feed_task: handle when feed content and Content-Type don't match
fixes https://console.cloud.google.com/errors/detail/CIX--Oz-w4D_Xg;time=P30D?project=bridgy-federated
2024-01-11 13:01:45 -08:00
Ryan Barrett ab4427c182
web.poll_feed_task: handle missing Content-Type header
fixes https://console.cloud.google.com/errors/detail/CKiskJSXi5z9gwE;time=P30D?project=bridgy-federated
2024-01-11 13:01:45 -08:00
Ryan Barrett 81e675f79b
web.poll_feed_task: default actor/author to user 2024-01-09 16:02:41 -08:00
Ryan Barrett aac85cedca
web feed polling: if we get Content-Type application/xml, use the link's type
fixes eg https://simonwillison.net/atom/everything/
2024-01-09 12:00:44 -08:00
Ryan Barrett bab5270c3b
start clearing Object.our_as1 again on updates
fixes #778. bug was that when we fetched a web object, we'd populate the new `mf2` value, but still keep the old `our_as1`, which then overrode it in `as1`. ugh.

partially reverts commit 62ca4022fb for #721.
2024-01-08 13:03:44 -08:00
Ryan Barrett 178b5ccde3
/convert: handle missing protocols
fixes https://console.cloud.google.com/errors/detail/CLHg5u_DuYGWaw;time=P30D?project=bridgy-federated
2024-01-08 07:53:18 -08:00
Ryan Barrett e82555ad91
Web: add poll feed task for new users, drop task if they've sent a webmention 2024-01-06 13:57:11 -10:00
Ryan Barrett 28fa7eba8c
User.get_or_create: set transient User.existing attribute
would have used new, but it's already a method
2024-01-06 13:19:43 -10:00
Ryan Barrett 1db5358688
Web: test a couple poll feed errors 2024-01-06 13:04:22 -10:00
Ryan Barrett 5f1c521500
Web: add last_polled_feed property 2024-01-06 12:56:37 -10: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 6025925c26
web: start removing superfeedr code 2024-01-04 16:32:39 -10:00
Ryan Barrett 72df4d7d42
web: enforce https (SSL) requirement
fixes https://console.cloud.google.com/errors/detail/CP2isf7noqyZjAE;time=P30D?project=bridgy-federated . thanks for finding @tantek!
2024-01-03 16:32:57 -10:00
Ryan Barrett beb865bc07
web feed fetching: add next poll task
use average of time between posts in feed as ETA

for #550
2024-01-01 20:12:33 -10:00
Ryan Barrett 9347651349
web feed fetching: test RSS, store feed index in AS1
for #550
2024-01-01 20:12:33 -10:00
Ryan Barrett 7e702305bf
Web: add poll_feed_task for ingesting Atom/RSS feeds
also demotes Web.atom to informational only, we're switching to populate feed entries into our_as1 because we can't easily extract individual items from feedparser.

for #550
2024-01-01 20:12:33 -10:00
Ryan Barrett 95e699f5b5
/r/: serve Vary: Accept header 2023-12-31 09:21:04 -08:00
Ryan Barrett 49eb9b8541
add Mastodon instance info at /api/v1/instance
https://docs.joinmastodon.org/methods/instance/#v1

right now just for FediSeer: https://fediseer.com/faq/eng#how-can-i-claim-my-instance
2023-12-31 08:42:26 -08:00
Ryan Barrett e9a8d81d43
testutil noop: remove unused import 2023-12-29 21:00:08 -08:00
Ryan Barrett 94b821bef5
test_ids: fix shadowed test method
woo, thanks for the catch flake8!
2023-12-24 10:26:12 -08:00
Ryan Barrett 199fb65dd6
ids.translate_object_id: handle Web.ap_subdomain
for https://github.com/snarfed/bridgy-fed/discussions/768
2023-12-24 10:20:04 -08:00
Ryan Barrett 2fafd83344
ids.translate_user_id: handle Web.ap_subdomain
for https://github.com/snarfed/bridgy-fed/discussions/768
2023-12-24 10:04:01 -08: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 07177e7d93
fix tests for lexrpc v0.5 2023-12-14 15:46:54 -08:00
Ryan Barrett 79af59b951
upgrade mf2py to 2.0.1, add test for resolving relative URLs in content
fixes #390, re https://github.com/microformats/mf2py/issues/181 . thank you again @angelogladding!
2023-12-08 10:02:07 -08:00
Ryan Barrett afc2511e62
refactor follow/unfollow web UI to use Protocol.receive 2023-12-06 10:11:36 -08:00
Ryan Barrett cf17c5ce47
disable superfeedr subscribe/unsubscribe
for #550
2023-12-05 13:07:21 -08:00
Ryan Barrett 8f3b4c1c9b
Web: ignore superfeedr subscribe failures
it's pretty unreliable right now 😕

for #550
2023-12-05 13:07:17 -08:00
Ryan Barrett 0e5866dbd9
Object.as1 from atom: override more ids with urls when necessary 2023-12-05 12:39:40 -08:00
Ryan Barrett b7129703cd
Web: don't subscribe to Superfeedr if user has webfinger redirects
for #550
2023-12-05 09:28:19 -08:00
Ryan Barrett 9a088f5b7f
Web: unsubscribe from superfeedr on first webmention
for #550
2023-12-05 08:59:29 -08:00
Ryan Barrett d14b1bc04c
add Web.maybe_superfeedr_unsubscribe
for #550
2023-12-05 08:51:27 -08:00
Ryan Barrett b0f278e033
Web: when subscribing to superfeedr, handle returned posts
for #550
2023-12-05 06:52:33 -08:00
Ryan Barrett 8650a90bf5
Web: integrate superfeedr subscribe into get_or_create
for #550
2023-12-04 11:34:19 -08:00
Ryan Barrett ba010e74b0
Web.maybe_superfeedr_subscribe: add feed discovery
for #550
2023-12-04 11:18:00 -08:00
Ryan Barrett eb4e11ae3d
Web: add superfeedr_subscribed prop, populate it in maybe_superfeedr_subscribe
for #550
2023-12-04 10:54:49 -08:00
Ryan Barrett b113521f94
Web: start on Superfeedr subscribe
for #550
2023-12-04 10:35:05 -08:00
Ryan Barrett 637128a05c
add Web.last_webmention_in property
for #550
2023-12-03 21:46:31 -08:00
Ryan Barrett c54df36164
start to add superfeedr notify handler
for #550
2023-12-02 21:18:22 -08:00
Ryan Barrett 5485cbeece
Object.as1 from atom: extract object, override id with url 2023-12-02 20:56:07 -08:00
Ryan Barrett e217419747
add Object.atom property
for #550
2023-12-02 14:30:14 -08:00
Ryan Barrett 2c19a5a3af
drop obsolete unwrap in Object.as1 when converting from as2 2023-12-02 14:25:38 -08:00
Ryan Barrett d0f7264db7
webfinger: handle users without handles
fixes https://console.cloud.google.com/errors/detail/CJ7P7OGD5oz_Dw;time=P30D?project=bridgy-federated
2023-12-01 15:46:37 -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 2f4bae8dc9
change Web.ap_subdomain default to 'web' 2023-11-30 20:08:41 -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 d33832be1c
add Web.ap_subdomain property, use it in webfinger
Originally, BF served Web users' AP actor ids on fed.brid.gy, eg
https://fed.brid.gy/snarfed.org . When we started adding new protocols, we
switched to per-protocol subdomains, eg https://web.brid.gy/snarfed.org .
However, we need to preserve the old users' actor ids as is. So, this property
tracks which subdomain a given Web user's AP actor uses.
2023-11-30 15:43:38 -08:00
Ryan Barrett e03a2b6517
update tests for moving metaformats h-card code to webutil
for snarfed/webutil@f4d35301f6
2023-11-30 14:43:06 -08:00
Ryan Barrett 520b2fd3b0
User.ap_address() => handle_as(ActivityPub) 2023-11-29 21:06:55 -08:00
Ryan Barrett a5f9daa46f
change Web.ap_address to use has_redirects instead of direct
for #551
2023-11-29 16:41:11 -08:00
Ryan Barrett c816be48ba
ids.translate_handle: add enhanced kwarg
for #551
2023-11-29 16:41:09 -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 911814dba2
Web.fetch: use util.parse_mf2's new metaformats support 2023-11-29 13:21:13 -08:00
Ryan Barrett 18f79d2626
Web: start adding metaformats support
for #551
2023-11-29 12:00:48 -08:00
Ryan Barrett aaf115347e
add manual opt-out list 2023-11-29 10:25:45 -08:00
Ryan Barrett 62ca4022fb
stop clearing Object data properties
...so that we have original data preserved when we override it in our_as1. fixes #721
2023-11-28 06:39:34 -08:00
Ryan Barrett 1ec1fc2482
genericize user handles on UI follower/following pages 2023-11-27 21:40:01 -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 ee373095e2
send follow accepts to protocols that support them
for #710
2023-11-27 16:32:22 -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 8f0d2d8650
AP: handle opted out users in following/ers, outbox collections 2023-11-27 11:32:30 -08:00
Ryan Barrett fe8b710cce
User.get_by_id: handle opt-out 2023-11-27 11:28:05 -08:00
Ryan Barrett b81fa2090b
Protocol.receive: handle opted out users 2023-11-27 06:53:22 -08:00
Ryan Barrett dd62f472da
User.get_or_create: return None if opted out 2023-11-27 06:53:22 -08:00
Ryan Barrett d79e2badf4
fix tests for dc3b23f80b 2023-11-26 21:39:31 -08:00
Ryan Barrett dc3b23f80b
Web.fetch: ignore uid if set; we use URL as id
props and thanks to @fluffy-critter for being my unintentional edge case QA department 😆🙏

fixes https://console.cloud.google.com/errors/detail/CKLuk-v4x8X0NQ;time=P30D?project=bridgy-federated
2023-11-26 16:31:29 -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 fae7769d2b
Web.get_or_create bug fix: handle opted out users
fixes https://console.cloud.google.com/errors/detail/CJ2U0_Hq6cHnUA;time=P30D?project=bridgy-federated
2023-11-26 15:37:39 -08:00
Ryan Barrett 6091cd4063
drop the rest of g.user!
for #690
2023-11-25 20:38:28 -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 e947891d75
Protocol.receive: fail if incoming activity doesn't have actor or author
for #690
2023-11-25 14:50:08 -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 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 f27e914a89
User.handle_as: handle when handle isn't set
for https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:05 -08:00
Ryan Barrett e5abdc097f
implement outbox
only first page. for #383
2023-11-22 21:40:36 -08:00
Ryan Barrett 48f89cebc0
User.handle_as: handle web users with custom usernames
bug fix for b255962, fixes https://console.cloud.google.com/errors/detail/CPiAj72alvDYNQ;time=P30D?project=bridgy-federated
2023-11-22 19:00:02 -08:00
Ryan Barrett f6af56f1c4
test_activitypub: use our_as1 for test web user, not as2 2023-11-22 17:59:18 -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 c593a80ee9
fix test_integrations for g.user minimizing in #690 2023-11-19 21:53:39 -08:00
Ryan Barrett 2c6a470058
drop g.user in lots of tests
for #690
2023-11-19 21:53:39 -08:00
Ryan Barrett fefcbbb77e
drop Protocol.actor_key's default_g_user kwarg
for #690
2023-11-19 21:53:38 -08:00
Ryan Barrett bee313fb67
drop User.atproto_did, switch to using copies 2023-11-15 19:08:06 -08:00
Ryan Barrett 4d095fa3d9
misc cleanup
* remove obsolete TODOs, commented out code
* remove obsolete circular imports of per-protocol modules
* minimize Object put in Protocol.load
* remove duplicated Protocol.load tests in test_activitypub
* re-enable rest of ActivityPubUtilsTest.test_postprocess_as2_idempotent
* drop default cls=Web in TestCase.make_user
2023-11-15 14:23:08 -08:00
Ryan Barrett 507cb19c32
test_integrations: import test_web instead of WebTest to avoid duplicating
before this, unittest thought the imported WebTest was a new test class and ran it again.
2023-11-15 12:40:59 -08:00
Ryan Barrett d237d9611c
atproto: store extra `cid` field in Object.bsky, populate in record strongRefs 2023-11-14 19:24:37 -08:00
Ryan Barrett 95631396b7
atproto: fill in createdAt
for snarfed/granary@a0795b8c34
2023-11-14 15:24:51 -08:00
Ryan Barrett 81838df113
atproto.poll_posts: store record, not #postView 2023-11-14 14:21:22 -08:00
Ryan Barrett a5b5078729
ATProto: first pass at polling posts (timelines)
for #694
2023-11-14 12:30:14 -08:00
Ryan Barrett 9c5adab4f4
ATProto.send: support likes, reposts, follows
snarfed/bridgy-fed#717
2023-11-14 10:56:52 -08:00
Ryan Barrett ac6f98f54c
integration test for #720
BF's first integration test! hopefully more to come, eg snarfed/bridgy-fed#689

actual fix is in snarfed/granary@3c782f9
2023-11-13 14:37:16 -08:00
Ryan Barrett cbbea104fc
cache Protocol.for_id
fixes #727
2023-11-13 14:18:32 -08:00
Ryan Barrett 91c25f6955
testutil noop, TestCase.make_user: include source_protocol in profile Object 2023-11-13 14:08:21 -08:00
Ryan Barrett 00fb4dd14d
move test_atproto.KEY to testutil.ATPROTO_KEY 2023-11-13 14:08:21 -08:00
Ryan Barrett 12158eba64
Protocol.targets bug fix, handle composite inReplyTo 2023-11-13 14:08:21 -08:00
Ryan Barrett 0364ece4a8
stop resolving ids in Protocol.targets, since Protocol.receive already did it 2023-11-12 13:21:35 -08:00
Ryan Barrett 3d0c5ecea5
Object.resolve_ids: handle multiple inReplyTo 2023-11-12 13:15:08 -08:00
Ryan Barrett a08a76c672
Object.resolve_ids bug fix: handle both protocol LABEL and ABBREV 2023-11-12 10:33:08 -08:00
Ryan Barrett 2a7c0adf0f
bug fixes for suppressing mentions of in-reply-to-authors
for 84324c0c0b, #686
2023-11-11 14:52:21 -08:00
Ryan Barrett 3975c143d7
fix atproto tests for arroba TID bug fixes in c8e6b30, 7170bf7 2023-11-11 10:38:48 -08:00
Ryan Barrett 84324c0c0b
Protocol.targets: suppress mentions of in-reply-to authors
fixes #686
2023-11-10 14:39:40 -08:00
Ryan Barrett 535494f21b
Object.to_as1 from bsky: pass at:// uri so we get id/url more often
for #715
2023-11-09 20:50:48 -08:00
Ryan Barrett 2be1229488
ATProto.send: store copy id in base object 2023-11-09 14:09:45 -08:00
Ryan Barrett f97b837960
cache follower/following counts for 2h 2023-11-08 12:03:56 -08:00
Ryan Barrett d576d2b2e4
move pages.count_followers to User, use it in activitypub.actor 2023-11-08 11:56:01 -08:00
Ryan Barrett 242a4a3ad3
fix activitypub actor tests for ae2cb2825b 2023-11-08 11:53:32 -08:00
Ryan Barrett d2dee8752f
/convert/: if dest protocol is AP, don't assume source protocol is Web 2023-11-08 11:28:17 -08:00
Ryan Barrett 9327565095
/convert/: drop req't that ids are web URLs
for abstracting across protocols. also other minor tweaks.
2023-11-08 11:28:17 -08:00
Ryan Barrett 4b7926b3a8
/convert/: drop protocol regexps in URL path routes 2023-11-08 11:28:17 -08:00
Ryan Barrett bca034c4f8
ids: use subdomain-wrapped URLs to convert ATProto to Web/AP 2023-11-06 20:17:23 -08:00
Ryan Barrett 98bb29b333
drop Object.proxy_url, switch callers to ids.translate_object_id 2023-11-06 12:18:11 -08:00
Ryan Barrett 06275324fd
Web.convert: call translate_ids 2023-11-03 15:52:37 -07:00
Ryan Barrett aa5c6a396e
ActivityPub: translate ids in convert 2023-11-03 15:11:21 -07:00
Ryan Barrett fdc5b8e1e9
Protocol.translate_ids bug fix: handle create/update user profile activities 2023-11-03 15:10:05 -07:00
Ryan Barrett cada99e407
ids.translate_user_id: follow use_instead 2023-11-03 14:53:19 -07:00
Ryan Barrett 6410d0ef1a
ids.translate_object_id: special case Web => AP
also preserve local hosts
2023-11-03 11:37:36 -07:00
Ryan Barrett 37d8b5d4fc
ids.translate_user_id: for Web, normalize home page URLs to domains 2023-11-03 11:00:34 -07:00
Ryan Barrett 1f6a227aee
Object.actor_link bug fix: handle composite url field
fixes https://console.cloud.google.com/errors/detail/CJTXq6ri48XtKQ;time=P30D?project=bridgy-federated
2023-11-03 06:53:33 -07:00
Ryan Barrett 625eb66d53
AP actor ids: redirect web and fed.brid.gy/ap/[domain] to fed.brid.gy/[domain] 2023-11-03 06:53:33 -07:00
Ryan Barrett 0725b72812
ids.translate_user_id: special case Web => AP to fed.brid.gy/domain 2023-11-03 06:53:33 -07:00
Ryan Barrett 4d44363693
fold Object.as_bsky into ATProto.convert, translate ids 2023-11-02 17:41:31 -07:00
Ryan Barrett def5638a64
Protocol.translate: distinguish between object and user ids 2023-11-02 13:08:24 -07:00
Ryan Barrett 72e180f854
User/Object.get_copy: return key id if proto is the source protocol 2023-11-02 13:08:23 -07:00
Ryan Barrett 0ca49e837a
add Object.get_copy, User.get_copy 2023-11-02 13:08:23 -07:00
Ryan Barrett 9aff3122c0
noop: rename get_for_copy[ies] => get_for_original[s] 2023-11-02 13:08:23 -07:00
Ryan Barrett 02e8208e32
test_atproto: noop, did:plc:foo => did:plc:user 2023-11-02 13:08:23 -07:00
Ryan Barrett c9a66cfc7c
test_protocol: test send task handler 2023-10-31 13:33:22 -07:00
Ryan Barrett db646909e2
delivery: switch from threads to tasks, one per send
for #652
2023-10-31 12:49:27 -07:00
Ryan Barrett b7e890b4bb
heuristic: assume no AP actor id is the root path on its host
this lets us assume home pages are Web users without making any network requests
2023-10-26 17:58:10 -07:00
Ryan Barrett c280a3f213
switch Protocol.translate_ids from using subdomain_wrap to translate_object_id 2023-10-26 17:18:01 -07:00
Ryan Barrett 8e4e95914d
test_ids: remove unnecessary test for translate_object_id 2023-10-26 17:03:14 -07:00
Ryan Barrett dc82fd02e1
TestCase.as2_req: support POSTs with data kwarg 2023-10-26 16:56:30 -07:00
Ryan Barrett c5959e00f4
add ids.translate_object_id 2023-10-26 16:20:30 -07:00
Ryan Barrett cfbfba654e
move User.get_for_copy/ies to module level, add Object results 2023-10-26 16:00:03 -07:00
Ryan Barrett 5843235fd1
rename ids.convert_id => translate_user_id, convert_handle => translate_handle 2023-10-26 13:53:31 -07:00
Ryan Barrett f74be7b0e5
add Protocol.convert_wrap 2023-10-26 13:53:31 -07:00
Ryan Barrett 43424259a5
noop: use as2.PUBLIC_AUDIENCE more in test_activitypub 2023-10-26 13:53:31 -07:00
Ryan Barrett ca8b7484c0
drop User.as2, Object.as_as2, switch callers to Protocol.convert 2023-10-25 13:28:01 -07:00
Ryan Barrett e833eb04dc
Object.resolve_ids: compact output objects with just id to bare string ids 2023-10-25 12:31:52 -07:00
Ryan Barrett acb1c703a3
rename Protocol.serve => .convert, move Content-Type to class constant 2023-10-25 12:31:52 -07:00
Ryan Barrett 6a867ca2c4
update for granary.as2's new PropertyValue attachment handling
snarfed/granary@20d6c3f065
2023-10-24 16:02:16 -07:00
Ryan Barrett 5a07e154ef
use subdomain_wrap in ids.convert 2023-10-24 15:58:03 -07:00
Ryan Barrett 422a240183
Resolve protocol-subdomain-wrapped ids/URLs by stripping the subdomain wrapping
Renames Object.replace_copies_with_originals => resolve_ids. As a side effect, also fixes https://console.cloud.google.com/errors/detail/CK3U3PONxv5Q;time=P30D?project=bridgy-federated
2023-10-24 10:47:44 -07:00
Ryan Barrett d12fd99b03
noop: move Protocol.subdomain_url to common.subdomain_wrap 2023-10-23 15:44:32 -07:00
Ryan Barrett 9a87d7261f
fix crash on RSS/Atom feeds for users without obj or obj.as1
fixes https://console.cloud.google.com/errors/detail/CKSZq8OU-tCRXA;time=P30D?project=bridgy-federated
2023-10-23 13:11:40 -07:00
Ryan Barrett 158200d9fd
bug fix for opt out, handle HTML 2023-10-21 20:51:54 -07:00
Ryan Barrett b32045d494
postprocess_as2: duplicate content into contentMap.en
for #681. this suppresses Mastodon's Translate link. longer term "right" fix is to actually detect the source's language, if available, and use it instead.
2023-10-20 13:37:54 -07:00
Ryan Barrett 1fa205af30
User.get_or_create: only fetch user profile if we don't already have it 2023-10-20 11:23:43 -07:00
Ryan Barrett 39c0d0e734
atproto: hard code our PDS URL to atproto.brid.gy
even on localhost
2023-10-20 11:16:23 -07:00
Ryan Barrett d31f470178
Web.is_web_url: ignore www subdomain
for 3b88b0f
2023-10-19 16:25:04 -07:00
Ryan Barrett 3b88b0f315
AP: don't create "receiving" user in inbox, don't set actor to g.user in send
more iffy kinda scary changes. gulp. important though, baby step toward killing g.user! #690
2023-10-19 16:15:40 -07:00
Ryan Barrett fe3a9b693c
User.get_or_create: load user profile object, fetch if it doesn't exist 2023-10-19 15:01:19 -07:00
Ryan Barrett 4faf551f8f
testutil: generate activitypub._DEFAULT_SIGNATURE_USER proactively 2023-10-19 13:09:19 -07:00
Ryan Barrett 89cd73831b
rework g.user
* it's always sending user ie actor
* don't pass it to task from atproto.poll_notifications (we were incorrectly passing the receiving user)
* in Protocol.receive, default g.user to actor/author
* in ActivityPub.signed_request, if g.user is ActivityPub, it won't have AP keys, so use default signing user instead

kinda scary and iffy. 🤞🤞🤞
2023-10-18 13:56:53 -07:00
Ryan Barrett 7e3613ab6c
fix ATProto.target_for: it should always return our base URL as the PDS 2023-10-18 12:01:17 -07:00
Ryan Barrett 9e1acf1cf7
replace copy ids with originals in Protocol.load
honestly not sure if this is necessary yet, and it's moderately expensive, two serial datastore queries with an IN filter. we'll see.
2023-10-18 11:18:20 -07:00
Ryan Barrett d7a51916ad
/r/ redirect: handle bad URLs
fixes https://console.cloud.google.com/errors/detail/CJ30oPbsoqmI7QE;time=P30D?project=bridgy-federated
2023-10-18 11:03:22 -07:00
Ryan Barrett efdf84a023
Protocol.receive: replace copy ids with originals, related bug fixes 2023-10-18 11:03:22 -07:00
Ryan Barrett e486c28919
testutil noop, fix class names in Fake log messages 2023-10-18 11:03:22 -07:00
Ryan Barrett c1b07acfa5
cloud tasks only 2023-10-18 11:03:22 -07:00
Ryan Barrett ff88c082ef
try not clearing Object.bsky
now that we're starting to replace copies with originals in ids, actors, etc, it'd be nice to preserve the original source object data.
2023-10-18 11:03:22 -07:00
Ryan Barrett 96b84511eb
add Object.replace_copies_with_originals 2023-10-18 11:03:22 -07:00
Ryan Barrett b8c7d1cd96
receive_task: set object.new to force receive to process it 2023-10-18 11:03:21 -07:00
Ryan Barrett 4a3607325f
canonicalize domain: redirect UI requests on other domains to fed.brid.gy 2023-10-16 14:02:17 -07:00
Ryan Barrett 325ba64c66
authorization: block external requests to cloud task handlers
...by checking for a GAE Cloud Tasks header: https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_task_request_headers
2023-10-16 13:04:34 -07:00
Ryan Barrett db3a5e7fd6
authorization: pass and accept authed_as in receive task handler
for #566
2023-10-16 12:45:27 -07:00
Ryan Barrett f292a7d957
authorization: allow actor to update/delete itself
for #566
2023-10-16 12:25:29 -07:00
Ryan Barrett c83c77a73e
authorization: log when authed user doesn't match activity's author/actor
for #566. just logging for now, want to see if we're already hitting this at all.
2023-10-16 11:13:38 -07:00
Ryan Barrett 7466a000a5
testutil: add assertLogs wrapper that enables/disables logs 2023-10-16 10:53:58 -07:00
Ryan Barrett 55c8d9bec6
authorization: log updates, deletes, creates from the wrong actor
for #566. just logging for now, want to see if we're already hitting this at all.
2023-10-16 06:37:52 -07:00
Ryan Barrett f3039fc87a
Protocol.send: bring back log_data kwarg 2023-10-13 18:29:28 -07:00
Ryan Barrett d0da119b07
add opt out via #nobridge or #nobot text in user profile bio
fixes #666

(unfortunate issue number 😆)
2023-10-13 12:36:31 -07:00
Ryan Barrett 2d8fb1f57f
webfinger: handle unknown protocol subdomain 2023-10-12 17:55:44 -07:00
Ryan Barrett 9808bed1b4
ActivityPub.postprocess_as2: add Mention tags to cc 2023-10-12 16:22:57 -07:00
Ryan Barrett d2e6dd18c2
/convert: on localhost, serve two-protocol paths instead of redirecting 2023-10-12 16:22:56 -07:00
Ryan Barrett 215578f33f
render notifications feeds as snippets, not whole activities 2023-10-12 10:40:55 -07:00
Ryan Barrett ff168231d6
Object.actor_link: add image kwarg 2023-10-12 10:37:22 -07:00
Ryan Barrett 8f4c353936
Object.actor_link: add sized kwarg 2023-10-12 10:19:59 -07:00
Ryan Barrett 84e9b2bcfd
AP: strip @context from Object.as2 before storing in datastore
we don't do LD, and many other servers' @contexts are big, so this saves disk space.

fixes #426
2023-10-11 16:35:05 -07:00
Ryan Barrett 15a325c928
AP: compact outgoing actor, author, and attributedTo fields to string ids
hope this improves compatibility with many other AP implementations that choke on objects instead of ids. fixes #658
2023-10-11 16:17:43 -07:00
Ryan Barrett dfab9f55d1
user page redesign: Object.actor_link: load actor from datastore
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett bd19cab870
Object.actor_link bug fix: handle actor/author objects with only id field
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett b1b2478b66
user page redesign: add notifications feeds, other minor tweaks
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett f37baeba58
user page redesign: misc tweaks
* separate source protocol from user in user labels
* make bridged protocol labels generic
* other visual tweaks

for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett cc62d4cdb1
user page redesign: feeds bug fix, fix tests 2023-10-11 12:25:38 -07:00
Ryan Barrett c1e0a08f72
user page redesign: add home, notifications pages
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett afa16d3864
start redesigning user pages
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett 1b78e86e6c
add Protocol.LOGO_HTML constant, change user page to link to external user
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett 5bf081afdb
make Protocol/Web.key_for() follow use_instead
fixes #662. probably more to do here eventually though, eg #665.
2023-10-10 09:58:07 -07:00
Ryan Barrett d5499acaf3
AP: parallelize inbox delivery with a thread pool
fixes #652. this should make inbox deliveries roughly 10x faster.
2023-10-07 15:08:02 -07:00
Ryan Barrett 59abcb00bc
Protocol.send: drop log_data kwarg
protocols are responsible for logging objects themselves
2023-10-07 12:54:32 -07:00
Ryan Barrett 7e7962fe45
add orig_obj kwarg to Protocol.send 2023-10-07 12:49:39 -07:00
Ryan Barrett 37188f3cca
User.get_or_create: if propagate=True, always reload user profile remotely 2023-10-07 11:51:21 -07:00
Ryan Barrett 4909c0814e
deliver self-replies to all followers
fixes #639
2023-10-06 14:59:47 -07:00