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
bf70ddd348
user pages UI: don't show user in every activity on profile and feed pages
...
it's redundant
2024-04-29 11:26:28 -07:00
Ryan Barrett
9617d8ab71
move Protocol.is_enabled to User.is_enabled
2024-04-27 20:34:37 -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
4012b13a5a
User: add delete as a type that expires
2024-04-26 09:59:08 -07:00
Ryan Barrett
3c62f7cfcc
give up on email for now, still can't get SMTP to work
...
Gmail SMTP is unhappy with auth, even though I got it to work on https://shell-py3.appspot.com/ , and Gandi SMTP seems to block Google Cloud IPs. sigh.
2024-04-24 15:30:20 -07:00
Ryan Barrett
55ae9fd2bb
User.enable/disable_protocol: move email out of datastore tx
2024-04-24 14:34:52 -07:00
Ryan Barrett
b543fdb1d5
switch to Gmail SMTP, other minor tweaks
2024-04-24 14:26:20 -07:00
Ryan Barrett
ece168fac1
email me when someone enables or disables a protocol
2024-04-24 11:15:28 -07:00
Ryan Barrett
506de7fd1d
User.get_or_create: if the id is a copy, return the original
...
...which will be in a different protocol! worried this will break something. hrm.
2024-04-23 17:56:59 -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
11eb082190
tighten common.unwrap so it doesn't remove protocol bot user URLs
...
...like https://bsky.brid.gy/ . this hopefully fixes following bot users in eg AP to enable protocols.
2024-04-23 12:00:39 -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
0c37d94191
ids.translate_* noop refactoring: from_proto => from_, to_proto => to
2024-04-20 21:03:06 -07:00
Ryan Barrett
7c34689c9f
index.yaml: remove obsolete datastore indices
2024-04-20 21:02:14 -07:00
Ryan Barrett
1981c8eba8
User.get_or_create: propagate obj into existing user
2024-04-19 12:53:44 -07:00
Ryan Barrett
3c55d7c145
protocol: extract out enable/disable_protocol methods
...
for #880
2024-04-19 12:53:44 -07:00
Ryan Barrett
917732ad4b
demote models import in ids.py to top-level to avoid circular import
2024-04-18 07:09:52 -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
f02ba80304
switch from gcloud datastore emulator to firestore emulator
...
...since the datastore emulator evidently doesn't support != query filters: https://github.com/googleapis/python-ndb/issues/962
2024-04-17 11:36:28 -07:00
Ryan Barrett
393605bde9
change ATProto.ABBREV to bsky
...
🤞 , for #961
2024-04-17 06:54:16 -07:00
Ryan Barrett
bf52d80e0f
add protocol logo to user page activities and followers
...
fixes #939
also drop page size from 30 to 20
2024-04-15 19:41:22 -07:00
Ryan Barrett
86ad33b896
user page tweak for follow accepts
...
for #825
2024-04-15 14:45:02 -07:00
Ryan Barrett
2ec22de09f
abstract redirect.py to be multi-protocol
...
...mostly. creating the underlying user opportunistically is still Web-only.
2024-04-14 18:26:34 -07:00
Ryan Barrett
2085b131a1
atproto user pages: render DIDs as handles with profile links
...
for #825
2024-04-12 12:34:49 -07:00
Ryan Barrett
ea1f3dce49
user page bug fix for 133d640f1d
2024-04-12 07:16:06 -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
7009267bb0
use new handle_or_id kwarg in common.is_enabled calls
2024-04-10 11:49:53 -07:00
Ryan Barrett
5767ffabb5
add new Object.normalize_ids method, use in Protocol.receive
...
eg https://bsky.app/ ... URLs to DIDs for actors or at:// URIs for objects
this hopefully fixes web => ATProto follows of https://bsky.app/ ... profile URLs.
2024-04-09 13:07:57 -07:00
Ryan Barrett
5a1dda151c
ATProto.create_for: better support for local testing
2024-03-24 08:59:54 -04:00
Ryan Barrett
e86763f654
Object.as1 from bsky: bug fix for PDS in getBlob image URLs
2024-03-14 20:26:46 -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
7edb5a5da9
noop, prune more Object properties from write logging
2024-03-12 11:12:34 -07:00
Ryan Barrett
11a480f1c2
web UI sugar: parse bsky.app URLs into "x's post"
2024-03-06 14:04:44 -08:00
Ryan Barrett
311ba3ae0a
User.get_or_create: don't overwrite existing fediverse keypair
2024-02-28 16:22:29 -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
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
d461397ce8
tone down Object write logging: omit delivered, failed, undelivered
2024-02-15 13:28:09 -08:00
Ryan Barrett
675e39809e
web UI: tweak user links in user page header
2024-02-11 14:39:09 -08:00
Ryan Barrett
4529f30dce
switch from opt_outs.txt to new User.manual_opt_out property
...
opt_outs.txt wasn't included in continuous deploy from Circle, so those deploys were ignoring ids in that file :/
2024-01-14 21:02:39 -08:00
Ryan Barrett
7941b632ca
Object._pre_put_hook: require that protocol owns id
2024-01-12 19:53:01 -08:00
Ryan Barrett
a2ed71b3ec
util.parse_mf2: use metaformats photo if h-card doesn't have one
2024-01-09 13:07:03 -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
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
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
73dc42fa59
UI: notifications page: use "undid" phrase for undos
...
thanks for reporting @jamietanna!
2023-12-23 07:54: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
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
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
c816be48ba
ids.translate_handle: add enhanced kwarg
...
for #551
2023-11-29 16:41:09 -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
fe8b710cce
User.get_by_id: handle opt-out
2023-11-27 11:28:05 -08:00
Ryan Barrett
dd62f472da
User.get_or_create: return None if opted out
2023-11-27 06:53:22 -08:00
Ryan Barrett
6091cd4063
drop the rest of g.user!
...
for #690
2023-11-25 20:38:28 -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
f8b7d0c283
move pages.fetch_objects to models
2023-11-22 20:39:21 -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
a1a7ceef51
stop using g.user in Follower.fetch_page
...
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
85ae5bc675
ignore inReplyTo when checking if an object has changed
...
snarfed/granary@3c782f9dac , snarfed/granary@308a2d56f9 , snarfed/granary@95fae94bf8 , snarfed/bridgy#933 , snarfed/bridgy#941
2023-11-14 06:49:57 -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
91a0a43665
noop docstring comment in User.status
2023-11-12 07:49:13 -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
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
98bb29b333
drop Object.proxy_url, switch callers to ids.translate_object_id
2023-11-06 12:18:11 -08: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
4d44363693
fold Object.as_bsky into ATProto.convert, translate ids
2023-11-02 17:41:31 -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
9358bf2fd2
Protocol.translate_ids: minor tweaks, bug fixes, comments
2023-11-01 12:33:38 -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
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
611bc94fc2
Object.as1 from bluesky: granary now sets actor/author
...
in snarfed/granary@eceb700c6c
2023-10-24 12:36:13 -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
158200d9fd
bug fix for opt out, handle HTML
2023-10-21 20:51: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
d31f470178
Web.is_web_url: ignore www subdomain
...
for 3b88b0f
2023-10-19 16:25:04 -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
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
efdf84a023
Protocol.receive: replace copy ids with originals, related bug fixes
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
fc96959383
tone down logging, especially for polling ATProto notifs
2023-10-18 11:03:21 -07:00
Ryan Barrett
f292a7d957
authorization: allow actor to update/delete itself
...
for #566
2023-10-16 12:25:29 -07:00
Ryan Barrett
66cf3bfd42
bug fix for 55c8d9b
2023-10-16 06:54:06 -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
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
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
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
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
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
f1bb2df2ce
Object: don't log "wiping out existing [data field]
2023-10-09 16:41:05 -07:00
Ryan Barrett
5efd97d867
add Object.lock and new add, remove, and put methods
2023-10-07 13:51:59 -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
62302b9105
more docstring formatting tweaks
2023-10-06 08:22:50 -07:00
Ryan Barrett
db29ad7757
docs: fix docstring formatting, other tweaks
2023-10-05 23:32:31 -07:00
Ryan Barrett
7d8b1ba2e8
add fetch_blobs kwarg to Object.as_bsky
2023-10-05 15:47:04 -07:00
Ryan Barrett
e96ab4654f
move creating ATProto users from User.get_or_create to new ATProto.create_for
2023-10-04 12:44:14 -07:00
Ryan Barrett
ae25baba8c
drop obsolete User.href, it was only for OStatus
...
🫗
2023-10-04 12:30:20 -07:00
Ryan Barrett
f85ab9ef41
noop: add a couple minor tests and comments
2023-09-29 11:32:29 -07:00
Ryan Barrett
4b94b4397c
User.get_or_create: fetch and propagate user profile object
2023-09-29 11:32:28 -07:00
Ryan Barrett
bfabfabea7
move creating a new ATProto user from ATProto.send to User.get_or_create
...
in progress, still need to load user profile object and write it to ATProto repo
2023-09-29 11:32:28 -07:00
Ryan Barrett
ad0a942034
switch webfinger and AP actors to mostly protocol subdomains
...
except Web, it still mostly serves on fed.brid.gy for backcompat, don't want to change existing Web users' AP actor ids.
2023-09-26 16:43:48 -07:00
Ryan Barrett
a9fcc167f6
replace User.readable_id computed property with handle
2023-09-25 15:08:14 -07:00
Ryan Barrett
1a003c8c5b
refactor User.ap_address implementations to highlight similarities
2023-09-25 14:16:14 -07:00
Ryan Barrett
9b8b02e99f
consolidate ap_address in ATProto, Fake, Web (partially) into User
2023-09-25 12:45:47 -07:00
Ryan Barrett
e9e8827ef9
standardize more on 'handle' and 'id' terms
...
* User.readable_id => handle
* User.readable_or_key_id => handle_or_id
2023-09-25 12:33:24 -07:00
Ryan Barrett
6cdb04b53f
replace User.atproto_handle with handle_as('atproto')
2023-09-25 10:58:05 -07:00
Ryan Barrett
40ba007e9e
add User.handle()
2023-09-25 10:58:05 -07:00
Ryan Barrett
021df15f7e
Object.as1 from bsky: pass repo DID, handle, PDS to granary
2023-09-24 20:02:09 -07:00
Ryan Barrett
452e49134d
add User.profile_id, implement in ATProto
2023-09-22 15:40:22 -07:00
Ryan Barrett
0d2ec18edd
add ids.convert_handle
2023-09-22 11:42:08 -07:00
Ryan Barrett
e967bb4ada
start centralizing id conversion into new ids.py file
2023-09-22 11:42:08 -07:00
Ryan Barrett
c1880569b8
User.get_by_copy => get_by_copies
2023-09-19 21:12:53 -07:00
Ryan Barrett
5107d003fe
Object.as1: genericize converting actor/author id from copy to original
2023-09-19 19:59:28 -07:00
Ryan Barrett
134416cd7b
genericize User.get_by_atproto_did to get_for_copy
2023-09-19 16:48:16 -07:00
Ryan Barrett
bb18b5ee0d
add new User.copies property
2023-09-19 16:07:11 -07:00
Ryan Barrett
dcbf16db6e
Object.as1 conversion from bsky, injecting actor/author
...
prefer user id to profile object id, default to AT URI repo DID
2023-09-18 11:52:17 -07:00
Ryan Barrett
5b16386fbc
User.get_by_atproto_did and Object.as1 from bsky: support native ATProto users
2023-09-18 11:41:01 -07:00
Ryan Barrett
a723be660e
Object.as1: inject actor/author when converting from bsky objects
...
...since they imply actor/author in the AT URI's repo DID.
2023-09-18 11:23:11 -07:00
Ryan Barrett
48e47f5f7d
add User.get_by_atproto_did
2023-09-17 22:38:33 -07:00
Ryan Barrett
b45635b125
noop: move canonicalizing AT URIs TODO from ATProto to Object
2023-09-14 16:52:22 -07:00
Ryan Barrett
077b5a97bc
ATProto.send: populate Object.copies with local record's AT URI
2023-09-14 10:20:04 -07:00
Ryan Barrett
d3b3ff47f5
atproto: start on polling notifications
...
lots more to do here, 8 new TODOs in this commit 😆
2023-09-14 09:42:11 -07:00
Ryan Barrett
61b585e715
for Objects for ATProto records, require at:// URIs to have DID repos
...
don't allow handles. https://atproto.com/specs/at-uri-scheme
2023-09-13 12:51:34 -07:00
Ryan Barrett
165a403353
drop User.k256_pem, use arroba's AtpRepo.signing_key/rotation_key instead
2023-09-08 21:52:46 -07:00
Ryan Barrett
6ea7813242
start on new hub service for ATProto and eventually Nostr websockets
2023-09-05 12:06:07 -07:00
Ryan Barrett
abf583952c
first pass at ATProto.send
2023-09-01 12:07:21 -07:00
Ryan Barrett
3ff42f0cd4
User.p256_key = k256_key, for ATProto
2023-09-01 07:51:23 -07:00
Ryan Barrett
fd4b40fe7c
implement default User.ap_actor()
2023-08-31 11:49:10 -07:00