Ryan Barrett
4e489a4ee0
activitypub.inbox: store seen activity ids in memcache, short circuit on seen ids earlier
2024-06-13 13:54:37 -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
3ccce1bc89
start using memorystore memcached for ndb global cache
2024-06-04 15:40:32 -07:00
Ryan Barrett
3fe402e54c
drop Object cache in Protocol.load
2024-06-04 14:27:04 -07:00
Ryan Barrett
07517f1685
ndb global cache: limit to users and profile objects, not other objects/activities
2024-06-04 14:27:04 -07:00
Ryan Barrett
441849a22a
Revert "Revert "start using an ndb in memory global cache in the frontends and router""
...
This reverts commit 0cbcf81ecc
.
trying again!
2024-06-04 14:27:02 -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
0cbcf81ecc
Revert "start using an ndb in memory global cache in the frontends and router"
...
This reverts commit 7e77d7a463
.
This slows down receive task processing, tasks all start taking longer and longer, can't figure out why. some kind of lock starvation in the global cache?
will experiment with this more in the ndb-global-cache branch.
2024-06-01 07:04:38 -07:00
Ryan Barrett
7e77d7a463
start using an ndb in memory global cache in the frontends and router
...
lol yolo 982f8a70df/google/cloud/ndb/global_cache.py (L200-L202)
> Not intended for production use. Uses a single process wide dictionary to
> keep an in memory cache. For use in testing and to have an easily grokkable
> reference implementation. Thread safety is potentially a little sketchy.
2024-05-31 13:08:25 -07:00
Ryan Barrett
93f302d5de
noop: tests: drop unused flask.g imports
2024-05-30 13:50:52 -07:00
Ryan Barrett
3301da3031
noop: add Fake.web_url
2024-05-29 16:46:16 -07:00
Ryan Barrett
8f5d8221a9
add ids.profile_id, use everywhere
...
for #566
2024-05-29 16:18:15 -07:00
Ryan Barrett
83211cddc2
testutil: noop refactoring, remove path arg in assert_task
2024-05-24 22:16:20 -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
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
e214bc0a43
ATProto firehose: more tests
...
for #978
2024-05-08 10:39:03 -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
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
f4a0c3deaa
fix tests for 7b3fa6e82b
2024-05-02 20:22:35 -07:00
Ryan Barrett
b6be345921
UI: refactor actor link rendering into User.user_link / Object.actor_link
2024-04-29 12:27:00 -07:00
Ryan Barrett
853b4be142
ATroto.send: for flag activities, send createReport to mod service
...
for snarfed/granary#596 . background:
* https://docs.bsky.app/docs/advanced-guides/moderation#reporting
* https://github.com/bluesky-social/atproto/discussions/2350#discussioncomment-8847613
* https://github.com/snarfed/granary/issues/596
2024-04-26 13:59:04 -07:00
Ryan Barrett
0238b46e36
add Protocol.HAS_COPIES, use to generate ids.COPIES_PROTOCOLS
2024-04-23 16:52:53 -07:00
Ryan Barrett
c86c91b25b
User.enable_protocols bug fix: only call create_for for copy protocols
...
also add integration test for following protocol bot user from ATProto
2024-04-23 16:38:08 -07:00
Ryan Barrett
3f1d860bba
AP: add test for following bot user to enable protocol
...
also relax Web.put check on id to allow internal domains for bot users
2024-04-23 10:17:13 -07:00
Ryan Barrett
c87e69d354
bug fix for ids.web_ap_base_domain
...
...and test it properly instead of mocking out the constant
2024-04-22 15:15:27 -07:00
Ryan Barrett
34692abc60
handle protocol bot users in webfinger, ids.translate_handle, Web.owns_handle
...
for #880
2024-04-22 14:01:09 -07:00
Ryan Barrett
18b1a33d22
testutil.setUp() noop tweak for adding Fake classes to common.*_DOMAINS
2024-04-21 16:22:33 -07:00
Ryan Barrett
10023d17fd
Protocol.enable_protocol: create copy user if necessary
2024-04-21 12:18:12 -07:00
Ryan Barrett
6b597c90c3
User.get_or_create: abstract propagate and create_for across protocols
2024-04-21 11:40:13 -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
817ef1d5d6
user pages: only hide indirect AP users, not ATProto
2024-04-11 14:24:18 -07:00
Ryan Barrett
c1acec1a3f
clear did.resolve_* caches in tests
...
for snarfed/arroba@f95365d7c3
2024-04-10 15:20:28 -07:00
Ryan Barrett
d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user
2024-02-28 12:07:06 -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
56a3c0e34b
bluesky: opt out users who have disabled logged out view on bsky.app
...
ie "Discourage apps from showing my account to logged-out users" on https://bsky.app/moderation
fixes #828
https://docs.bsky.app/docs/advanced-guides/resolving-identities#for-backend-services
https://github.com/bluesky-social/atproto/blob/main/packages/api/docs/labels.md#label-behaviors
2024-02-23 10:33:34 -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
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
7941b632ca
Object._pre_put_hook: require that protocol owns id
2024-01-12 19:53:01 -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
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
e9a8d81d43
testutil noop: remove unused import
2023-12-29 21:00:08 -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
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
6091cd4063
drop the rest of g.user!
...
for #690
2023-11-25 20:38:28 -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
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
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