Ryan Barrett
47b04f5574
rename Web.LABEL from 'webmention' to 'web'
2023-05-30 12:15:36 -07:00
Ryan Barrett
93f621aaf5
AP users: start to replace external with indirect, starting with webfinger
...
#512
2023-05-29 20:16:15 -07:00
Ryan Barrett
624355d85a
AP users: add new User.direct property
...
direct users signed up or otherwise interacted with BF explicitly, indirect users didn't
2023-05-29 19:37:41 -07:00
Ryan Barrett
b7bebb4075
move base64_to_long, long_to_base64 to common
2023-05-27 14:58:22 -07:00
Ryan Barrett
c8b2103e13
rename Webmention class => Web, webmention.py => web.py
2023-05-26 17:40:29 -07:00
Ryan Barrett
51fd119c02
fix bug in models.reset_protocol_properties
...
added in eaa4e5333a
2023-05-26 16:36:45 -07:00
Ryan Barrett
eaa4e5333a
start to make User subclasses for each protocol
...
#512
2023-05-26 16:07:36 -07:00
Ryan Barrett
15e3daff5e
switch outbound webmention source URLs from /render?id=... to /convert/...
...
#512
2023-05-24 16:32:00 -07:00
Ryan Barrett
af95521759
user page bug fix, add missing import
...
fixes https://console.cloud.google.com/errors/detail/COHl8dmZ9-i4Lw;time=P30D?project=bridgy-federated
2023-05-24 06:57:34 -07:00
Ryan Barrett
cf86f4d808
AP users: extract out Protocol.serve() method
...
#512
2023-05-23 21:30:57 -07:00
Ryan Barrett
0ab3698db7
Bluesky: move most ATProto code to separate arroba library
...
https://github.com/snarfed/arroba
2023-05-06 14:41:06 -07:00
Ryan Barrett
64f4f62ae9
bluesky: add models.AtpNode for storing repo blocks
2023-04-28 12:02:26 -07:00
Ryan Barrett
e303f55fdf
models.User: generate and store an ECC P-256 keypair
...
for AT Proto
2023-04-25 14:04:29 -07:00
Ryan Barrett
d2ab48b23e
switch circular imports to runtime imports; split out flask_app.py from app.py
...
runtime imports are just as bad, but...meh. eventually I'll untangle them for real. #486
2023-04-18 17:18:17 -07:00
Ryan Barrett
b39d673f12
add Object.expire property for datastore TTL to garbage collect old Objects
...
right now, auto-delete some ephemeral activities after 90d. for #456 . https://cloud.google.com/datastore/docs/ttl
2023-04-18 09:16:16 -07:00
Ryan Barrett
212f2b11ec
wm => AP: add delete support
...
fixes #30
2023-04-17 15:36:29 -07:00
Ryan Barrett
01125d38d8
/render : escape #s in object id URLs to ^^
...
fixes #469
2023-04-05 16:23:49 -07:00
Ryan Barrett
22ca59749e
stop using common.actor() in User.verify()
2023-04-04 22:06:13 -07:00
Ryan Barrett
1f40aedf27
webmention.py: unify homepage update logic, move fetching into fetch()
2023-04-04 18:02:41 -07:00
Ryan Barrett
629c1a2bd4
unify Object.new/changed generation into Protocol.load
...
also:
* switch back to preserving fragments in URL ids
* webmention.fetch: if URL id redirects, preserve original id in Object
2023-04-03 07:53:15 -07:00
Ryan Barrett
3a97ba587d
noop: Protocol.load: switch from @cached decorator to manual cache
...
...so that I can add a refresh kwarg that bypasses the cache
2023-04-02 20:36:23 -07:00
Ryan Barrett
f836762b0f
big webmention.py refactoring
...
* use Objects properly
* use Object's mf2/AS2/AS1 conversion
* drop resuming partially completed deliveries
* use load, fetch, send
* get closer to unifying all activity handling into Protocol.receive
2023-04-01 19:13:51 -07:00
Ryan Barrett
e41ce9216c
noop, rename Protocol.get_object => Protocol.load
2023-03-29 13:13:32 -07:00
Ryan Barrett
5493e2f297
add 'activity' to Object.labels automatically in new _pre_put_hook
2023-03-28 11:14:08 -07:00
Ryan Barrett
20f86c7de3
handle wm => AP with targets that we've already federated wm => AP
...
fixes https://console.cloud.google.com/errors/detail/CMHpr9L3ooGKeQ;time=P30D?project=bridgy-federated
2023-03-22 12:30:55 -07:00
Ryan Barrett
3538940e4f
add new Object.our_as1 property for activities we create or modify ourselves
2023-03-21 09:10:14 -07:00
Ryan Barrett
fb5f7b3fb0
move current user into Flask g request-global
2023-03-20 14:28:14 -07:00
Ryan Barrett
5e3c623552
add User.actor_id()
2023-03-19 09:34:42 -07:00
Ryan Barrett
d8932d4e76
add mf2 to user page dashboard to make a notifications feed
...
for #442
2023-03-14 11:27:10 -07:00
Ryan Barrett
ffd8810b44
start to separate logic from protocols with new Protocol/ActivityPub classes
...
for #388
2023-03-10 07:36:50 -08:00
Ryan Barrett
aa483ded0b
Object.type and object_ids fixes to handle missing as1
...
fixes https://console.cloud.google.com/errors/detail/CJ-U7Zq_s4bxgwE;time=P30D?project=bridgy-federated
2023-02-24 21:59:12 -06:00
Ryan Barrett
7bb9785327
fix log message for Object.as2 vs mf2 vs bluesky
2023-02-24 11:48:48 -06:00
Ryan Barrett
76927ee487
Object.as1: temporarily demote assert to warning log
2023-02-24 10:02:06 -06:00
Ryan Barrett
5463a74e7e
switch Object.as1 to custom ComputedJsonProperty
2023-02-24 08:25:18 -06:00
Ryan Barrett
fd27dabe61
switch JSON properties to custom JSONProperty that works in web console UI
...
https://github.com/googleapis/python-ndb/issues/874#issuecomment-1442753255
2023-02-24 07:25:29 -06:00
Ryan Barrett
91a60c7e67
switch Object.as1 to be a ComputedProperty
2023-02-23 21:17:26 -06:00
Ryan Barrett
d1691b65c5
Object post put hook: don't add fragment ids to the common.get_object cache
2023-02-16 12:21:27 -08:00
Ryan Barrett
e423bde6d0
unify logging for writing datastore entities into post put hook
...
and other logging tweaks
2023-02-14 15:38:42 -08:00
Ryan Barrett
588598c5ff
switch most uses of common.get_as2 to common.get_object
2023-02-14 14:56:27 -08:00
Ryan Barrett
c2e6174330
add common.get_object()
2023-02-14 14:30:00 -08:00
Ryan Barrett
6446c8c421
convert Object.type and .object_ids to ComputedPropertys
...
https://googleapis.dev/python/python-ndb/latest/model.html#google.cloud.ndb.model.ComputedProperty
2023-02-13 21:43:49 -08:00
Ryan Barrett
f39c532ad3
add User.homepage, is_homepage()
2023-02-12 12:03:27 -08:00
Ryan Barrett
d72540fde7
move Activity model to scripts/activity_model.py
2023-02-11 18:11:30 -08:00
Ryan Barrett
b739bd4cee
return 404 on requests for unknown users instead of automatically creating them
2023-02-07 18:28:52 -08:00
Ryan Barrett
c143192aa4
user page activities UI: if actor has no displayName, default to username
...
#286
2023-02-07 08:24:24 -08:00
Ryan Barrett
cb605e96c6
user page activities: if object is user, render as pretty user link
...
for #406
2023-02-06 21:28:40 -08:00
Ryan Barrett
f922ce89bb
user page: activities: render fediverse actor links as @-@
...
for #406
2023-02-06 21:08:52 -08:00
Ryan Barrett
db4d765cf8
user page: activities: fix user actor rendering for UI follows
...
fixes #406
2023-02-06 20:30:08 -08:00
Ryan Barrett
18404f70e7
speed up tests by only using 1024 bit keys
...
fixes #398
2023-02-05 22:22:22 -08:00
Ryan Barrett
2a1b199558
Activity => Object: user dashboard UI bug fixes, add missing Object index
2023-02-04 20:46:28 -08:00
Ryan Barrett
9680f6f83e
Activity => Object: drop /recent, tweak feed queries, update datastore indices
2023-02-04 20:46:28 -08:00
Ryan Barrett
2c3a693b4d
Activity => Object: add script to migrate existing Activitys to Objects
...
#286
temporarily adds back Activity model definition, will remove again later.
2023-02-04 20:46:28 -08:00
Ryan Barrett
532ccb8ac1
Activity => Object: use StructuredProperty for Object.delivered etc, add protocol
...
#286
ndb implements StructuredProperty by hoisting each nested property into a
corresponding property on the parent entity, prefixed by the StructuredProperty's
name, eg delivered.uri, delivered.protocol, etc.
For repeated StructuredPropertys, the hoisted properties are all repeated on the
parent entity, and reconstructed into StructuredPropertys based on their order.
https://googleapis.dev/python/python-ndb/latest/model.html#google.cloud.ndb.model.StructuredProperty
2023-02-04 20:46:27 -08:00
Ryan Barrett
f9891b6ef7
Activity => Object: add activity label, unify Objects for AP => wm
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
4d2fcdd76f
Activity => Object: fully populate labels, source_protocol webmention
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
eafba6d7cd
Activity => Object: populate Object.type
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
58e836b380
Activity => Object: update webmention.py
...
#286
2023-02-04 20:46:27 -08:00
Ryan Barrett
23aff3b176
Activity => Object: update follow.py
2023-02-04 20:46:27 -08:00
Ryan Barrett
cc453035c8
initial design of new Object model, implement it in render.py
2023-02-04 20:46:27 -08:00
Ryan Barrett
82547c9557
override User.get_by_id() to handle use_instead
...
fixes #403
2023-02-04 19:53:30 -08:00
Ryan Barrett
4a621eed65
bump RSA key length up from 1024 to 2048 bits
...
https://www.pycryptodome.org/src/public_key/rsa#Crypto.PublicKey.RSA.generate
fixes https://github.com/snarfed/bridgy-fed/security/code-scanning/10
2023-01-30 15:49:11 -08:00
Ryan Barrett
bb2d3e03de
noop: convert a few %s'es to f-strings
...
thanks flynt! https://github.com/ikamensh/flynt
2023-01-24 12:17:24 -08:00
Ryan Barrett
378bb5dbf4
activities UI: handle empty Activity, source_mf2 without `items`
...
for #376
2023-01-23 19:20:31 -08:00
Ryan Barrett
1627ff667a
translate webmention from home page into profile (actor) Update
...
for #376 , #331
2023-01-23 16:09:25 -08:00
Ryan Barrett
36349a5db9
add Follower.to_as2()
2023-01-19 06:49:39 -08:00
Ryan Barrett
c3edf3a68e
make Follower.to_as1() handle both inbound and outbound last_follow
...
...and use it in followers and following UI pages
2023-01-18 22:31:13 -08:00
Ryan Barrett
37e389447a
always store Follower.last_follow as AP/AS2 Follow activity
...
specifically, this switches storing outbound follows from inbound webmentions from AS1 to AS2.
2023-01-18 21:09:43 -08:00
Ryan Barrett
898b8545ac
bluesky: implement app.bsky.graph.getFollowers
2023-01-13 11:40:52 -08:00
Ryan Barrett
6520331627
incoming Follows: synthesize url into follow object stored in Activity
...
rendered mf2 HTML proxy pages (in render.py) fall back to redirecting to the follow's AS2 id field, but Mastodon's ids are URLs that don't load in browsers, eg https://jawns.club/ac33c547-ca6b-4351-80d5-d11a6879a7b0 . so, set a synthetic URL based on the follower's profile. fixes #336
2023-01-12 12:28:34 -08:00
Ryan Barrett
91c4200bb3
follow UI: synthesize Follow activity id, store an Activity, link address, form bug fix
2023-01-08 07:11:22 -08:00
Ryan Barrett
7ac1006021
background task bug fix: override task runner host
...
we were using request.host_url blindly, which was fed.brid.gy for user-facing requests, but bridgy-federated.uc.r.appspot.com for tasks. #335
2023-01-05 15:05:35 -08:00
Ryan Barrett
fe5c3947a8
drop OStatus! it's been unused for years
...
fixes #282
2023-01-04 19:22:11 -08:00
Ryan Barrett
72b8dea8a0
Model.verify: minor redirect error message tweak
2022-12-06 22:41:55 -08:00
Ryan Barrett
f72b3abfa0
Model.verify: add error message for non-2xx redirects
...
for #337
2022-12-06 22:37:56 -08:00
Ryan Barrett
a95c2c4b55
incoming follow bug fix, handle www and use_instead
...
fixes #314
2022-12-06 14:09:44 -08:00
Ryan Barrett
71d4c260b3
add User.created and updated properties
2022-12-02 14:46:09 -08:00
Ryan Barrett
01c89fae2d
special case opt www.jvt.me out of new www redirect handling
...
for #314
2022-12-02 11:07:58 -08:00
Ryan Barrett
5249bb5a4f
special-case www subdomains, use root domain if it redirects to www
...
for #314
2022-12-02 10:48:16 -08:00
Ryan Barrett
0363db65fa
handle new multi-valued url field in AS2 objects
...
snarfed/granary@79c512402b
2022-11-30 21:04:41 -08:00
Ryan Barrett
d4af114247
user verification: follow multiple redirects
2022-11-28 13:10:51 -08:00
Ryan Barrett
ee2c6c2f79
activities rendering bug fix when name is missing
...
fixes https://console.cloud.google.com/errors/detail/CPHdyJL08PvEKg;time=P30D?project=bridgy-federated
2022-11-28 08:02:28 -08:00
Ryan Barrett
c343164f5b
user page UI redirects warning: show diff of current vs expected
...
for #305
2022-11-27 17:45:23 -08:00
Ryan Barrett
85b1a400ff
user page UI: first pass at details for redirect check
...
for #305
2022-11-27 17:33:53 -08:00
Ryan Barrett
3a4e8c4872
user and activities UIs: default to username if we don't have name
...
for #281
2022-11-26 16:29:48 -08:00
Ryan Barrett
776f60b416
activities UI: default actor to user's domain if no name
...
for #281
2022-11-26 16:29:36 -08:00
Ryan Barrett
7d902ec616
bug fix for custom username in fediverse address on user page UI
...
should come from acct: actor URL, not preferredUsername field, which always has to be user's domain for AP interop.
in the process, refactored common.get_username() into User.username().
for #281
2022-11-26 16:05:02 -08:00
Ryan Barrett
d2d0932893
refactor user name and profile picture links, add to user page and activities
2022-11-25 22:21:50 -08:00
Ryan Barrett
2fdc6f29a9
sign HTTP GET requests for AS2 objects
...
to support Mastodon's AUTHORIZED_FETCH aka secure mode: https://docs.joinmastodon.org/admin/config/#authorized_fetch
fixes #291
2022-11-24 09:41:14 -08:00
Ryan Barrett
34593e2a1b
render human-friendly summaries of activities on /recent and user pages
...
for #261
2022-11-20 20:52:44 -08:00
Ryan Barrett
30d9f7c9a5
make verification accept fed.brid.gy redirects when running locally
2022-11-20 11:56:32 -08:00
Ryan Barrett
65f3ef3cc7
show fediverse address on user page UI, including custom username
...
for #281
2022-11-20 11:46:05 -08:00
Ryan Barrett
b854981497
UI edits: enter web site page, /docs, flashed messages, copy Bridgy's CSS
2022-11-18 22:30:07 -08:00
Ryan Barrett
f384bf5529
add User.verify(), checks redirects and home page representative h-card
...
for #276
2022-11-18 18:49:41 -08:00
Ryan Barrett
eaa6e1f9e5
always write Follower.dest and src
...
for #279
2022-11-16 16:38:08 -08:00
Ryan Barrett
2bb76a90e7
store Activity entities for AP activities delivered to followers
...
for #265
2022-11-16 15:54:02 -08:00
Ryan Barrett
320b117470
add AP sharedInbox
...
#285 , https://www.w3.org/TR/activitypub/#sharedInbox
2022-11-16 10:09:24 -08:00
Ryan Barrett
870ffbbbd2
when writing Follower, always set dest and src
...
for #279
2022-11-16 06:49:29 -08:00
Ryan Barrett
50956c02b0
noop, rename Domain => User
2022-11-15 22:00:28 -08:00
Ryan Barrett
e3f1431018
noop identifier renames, key => domain or entity
2022-11-15 19:12:20 -08:00
Ryan Barrett
4f3dc03a3e
rename MagicKey => Domain, Response => Activity
...
the Python classes, but not (yet) the kinds in the datastore. maybe eventually.
2022-11-12 15:27:59 -08:00
Ryan Barrett
e767cf5d1f
refactor /responses and user pages, add follower counts to user pages
...
for #274
more to come
2022-11-11 21:13:51 -08:00
Ryan Barrett
b24a22e817
add /responses/[DOMAIN] user pages and Response.domain property
2022-11-08 06:56:19 -08:00
Ryan Barrett
96dba41c9b
logging: use separate loggers for each module with their names
2022-02-11 22:38:56 -08:00
Ryan Barrett
4eaf70aa51
add 'ignored' status for AP requests where the target has no webmention endpoint
2022-01-11 22:40:44 -08:00
Ryan Barrett
2f28be09be
convert %-formatted strings with args in logging.* calls to f-strings
2021-12-27 22:45:57 -08:00
Ryan Barrett
40ad6a4afa
move handle_exception and default_modern_headers to webutil
...
corresponds to snarfed/webutil@cdcaa3e897
2021-07-27 21:58:05 -07:00
Ryan Barrett
f26aed5cbb
flask: port salmon
2021-07-08 22:50:33 -07:00
Ryan Barrett
df6b0b58ba
unify request handler classes and handle_exception; move away from HOST[_URL]
...
fixes:
* https://console.cloud.google.com/errors/CN68rO-5sOK9cQ
* https://console.cloud.google.com/errors/CJWCu8b5_ureAg
* https://console.cloud.google.com/errors/CN6W4Zy7irzgOA
* https://console.cloud.google.com/errors/CN278MyjhZbtOQ
2020-01-31 14:40:11 -08:00
Ryan Barrett
ee7b324525
bring back HOST_URL override to fed.brid.gy, for URLs emitted into AP
2019-12-26 18:18:44 -08:00
Ryan Barrett
02d36b3b1f
migrate to the app engine standard python 3 runtime!
...
https://cloud.google.com/appengine/docs/standard/python3/python-differences
https://cloud.google.com/appengine/docs/standard/python/migrate-to-python3/
2019-12-25 22:26:26 -08:00
Ryan Barrett
4b70a89046
handle AP Undo of Follow
...
needed for eg mastodon when you unfollow and then try to refollow someone. on unfollow, mastodon sends an Undo, and waits for a 200 before it shows success and will let you refollow.
2019-08-01 10:32:50 -07:00
Ryan Barrett
7c10585ad3
/response logs, once more with feeling
2019-04-18 11:18:14 -07:00
Ryan Barrett
7a94537721
/responses: link logs for all requests, not just webmention => fed
2019-04-16 14:19:16 -07:00
Ryan Barrett
2cb0dda2d1
webmention => AP: Create: handle Follower with actor URL instead of object
...
we don't create these any more, we always fetch and store full actor objects, but we have a few old ones lying around in the prod datastore.
for #33
2018-11-20 08:37:57 -08:00
Ryan Barrett
11c66cfd3e
webmention => AP: fix AP replies etc after big Create refactoring
...
for #33
2018-11-20 08:24:29 -08:00
Ryan Barrett
2bb418dc72
webmention => AP support for u-follow-of => Follow
2018-10-24 21:28:52 -07:00
Ryan Barrett
abc5ecd919
AP Follow: store users' followers in the datastore
...
#21
2018-10-21 17:37:33 -07:00
Ryan Barrett
dcc6b9d23b
minor tweak to fix /log
2017-10-26 17:31:40 -07:00
Ryan Barrett
92798bc434
webmention: refactor storing Responses so we can do it earlier
2017-10-26 12:31:04 -07:00
Ryan Barrett
f940718790
salmon: support incoming likes and shares (reposts)
2017-10-15 16:57:05 -07:00
Ryan Barrett
a11d6745a9
switch incoming salmon/activitypub to overwrite Response
2017-10-12 23:13:54 -07:00
Ryan Barrett
d74e6f02dd
convert # to __ in source, target URLs in Response key ids
...
...since some fedsocnet like ids (eg Mastodon) include fragments, which webmention receivers (eg wordpress) strip from source before fetching, even when they're URL-encoded in bridgy fed proxy URLs.
also add Response.get_or_create() that handles concatenating source and target.
2017-10-11 18:08:52 -07:00
Ryan Barrett
9a7975bf5d
activitypub: use proxy mf2 URLs for likes and reposts/boosts
...
for #4
2017-10-10 22:42:19 -07:00
Ryan Barrett
6a65e2e74a
store source post in Response
...
...so we can use it to render proxy ActivityPub mf2 pages for webmentions
2017-10-09 21:11:40 -05:00
Ryan Barrett
19a686edc3
store responses in new Response datastore model
2017-10-09 19:29:50 -05:00
Ryan Barrett
71f0a4c8d4
AP: add publicKey to actor object
...
needed for mastodon interop
2017-10-01 07:01:35 -07:00
Ryan Barrett
2699de6903
add MagicKey.private_pem() and public_pem()
2017-09-19 09:15:34 -07:00
Ryan Barrett
5bb62f4021
use future unicode string literals, drop u qualifier
2017-09-12 07:31:18 -07:00
Ryan Barrett
5499e06a6b
MagicKey: generate data: URI for href value
...
also fix indentation
2017-08-19 09:15:29 -07:00
Ryan Barrett
ba1d49ffa3
add MagicKey datastore model
2017-08-19 08:36:55 -07:00