Ryan Barrett
b8be570d66
flask: port activitypub
2021-07-10 08:07:40 -07:00
Ryan Barrett
f26aed5cbb
flask: port salmon
2021-07-08 22:50:33 -07:00
Ryan Barrett
bb5ae9910d
flask: port /wm/
2021-07-08 07:25:44 -07:00
Ryan Barrett
5b8699bec1
flask: port /r/, start to port common
2021-07-07 21:02:13 -07:00
Ryan Barrett
0b7388fed3
flask: move app to app.py, get templates working, port /responses
2021-07-07 08:07:20 -07:00
Ryan Barrett
86a4afdc97
flask: render: get tests working
2021-07-06 20:34:35 -07:00
Ryan Barrett
fa2a970b2c
flask: render: add caching, get_required_param, update tests
2021-07-06 13:45:56 -07:00
Ryan Barrett
a4c5a8e4c5
redirect: handle single /s that got collapsed by the browser (etc)
2021-06-28 22:52:04 -07:00
Ryan Barrett
d4a94ff75a
migrate from webmention-tools to webutil.webmention
2021-04-25 11:40:19 -07:00
Ryan Barrett
064acef4b0
verify SSL certs (more)
...
requires snarfed/webmention-tools@0059627cfd
2021-04-03 21:15:28 -07:00
Ryan Barrett
db732650a4
add https://w3id.org/security/v1 to actors' @context for HTTP sigs
...
fixes #76
2021-03-22 23:55:14 -07:00
Ryan Barrett
17fa355226
webfinger: misc noop comment and test tweaks
2021-03-12 14:35:59 -08:00
Ryan Barrett
f9e8a5abd2
webfinger tests: expect application/jrd+json for JRD, not application/json
...
for snarfed/webutil@4b277abaa4
2021-03-11 14:14:33 -08:00
Ryan Barrett
f74a6d33fa
add synthetic id to outgoing AS2 activities
...
for #12
2021-03-10 20:37:28 -08:00
Ryan Barrett
1f977a7d5c
stop /r/ from being an open redirect by checking that we've seen the domain
2021-03-07 07:36:34 -08:00
Ryan Barrett
6b4089efe4
/r/ redirect endpoint: use HTTP 301, not 302
2021-03-06 21:47:08 -08:00
Ryan Barrett
06cd35abba
upgrade to python 3.9 runtime and feedparser 6.0.2
2021-03-06 08:03:36 -08:00
Ryan Barrett
33436a35a1
webmention: de-dupe inboxes before delivering
2021-02-24 13:41:46 -08:00
Ryan Barrett
c12b675a7a
webfinger: handle acct:[domain]@fed.brid.gy requests
...
fixes #73
2020-12-30 10:26:48 -08:00
Ryan Barrett
eef94eb033
if ActivityPub inbox delivery fails, don't fall back to Salmon
2020-11-13 09:50:14 -08:00
Ryan Barrett
155be76bca
fix outbound AP headers and signature for Mastodon 3.2.1
...
https://github.com/snarfed/bridgy-fed/issues/68#issuecomment-720059695
2020-11-05 12:43:27 -08:00
Ryan Barrett
8af4571648
handle django-salmon port to pycryptodome
...
in snarfed/django-salmon@76f31ed25c
2020-10-31 13:23:36 -07:00
Ryan Barrett
dba533a14b
temporarily disable actually deleting Followers on AP Delete requests
...
mastodon.social sends Deletes for every Bridgy Fed account, all at basically the same time, and we have many Follower objects, so we have to do this table scan for each one, so the requests take a long time and end up spawning extra App Engine instances that we get billed for. and the Delete requests are almost never for followers we have. TODO: revisit this and do it right.
2020-10-11 08:35:14 -07:00
Ryan Barrett
2c15820ef6
webmention => AP: handle multiple in-reply-to links
...
fixes #65 . thanks again for reporting, @nekr0z!
2020-06-06 08:40:07 -07:00
Ryan Barrett
2a91f01393
webmention: handle missing Content-Type header
...
for https://console.cloud.google.com/errors/CNnflKqP5rHWvgE , https://console.cloud.google.com/errors/CPyMpaulkMKWZA
2020-05-20 23:36:11 -07:00
Ryan Barrett
9eae3087fd
404 requests for root paths that aren't user domains
...
lots of these are fediverse tools sniffing for specific implentations, eg mastodon etc. /siteinfo.json, /status.php, etc.
2020-03-02 10:50:43 -08:00
Ryan Barrett
9784686b1c
implement AP Delete of actors when their accounts are deleted
...
fixes #63
2020-02-29 20:28:53 -08: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
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
ab55c9d62c
ujson.dumps/loads() => util.json_dumps/loads()
2019-12-24 23:26:58 -08:00
Ryan Barrett
99a5c35ae3
switch from webutil.util.memcache_response to cache_response
2019-11-12 21:28:44 -08:00
Ryan Barrett
faf676e8bb
switch from json to ultrajson for performance
...
https://github.com/esnme/ultrajson/
2019-10-29 07:06:15 -07:00
Ryan Barrett
7c9a03c827
unify HTTP fetching, HTML and mf2 parsing, and error handling into webutil
...
see:
* snarfed/granary#171
* snarfed/webutil@f994884b2b
* snarfed/oauth-dropins@f5b6e73530
* snarfed/granary@284eb11508
2019-10-03 21:08:26 -07:00
Ryan Barrett
00d0cc5557
fully qualify relative Atom feed URLs before fetching
...
fixes #58 . thanks again for reporting @fluffy-critter!
2019-09-23 11:20:11 -07:00
Ryan Barrett
7617d4893e
update test to match granary new whitespace handling
...
...again. specifically snarfed/granary@0ac54362ae
2019-09-19 11:56:29 -07:00
Ryan Barrett
ef8b9b13cc
bug fix in webmention => activitypub target fetch error handling
...
fixes https://console.cloud.google.com/errors/CPyMpaulkMKWZA
2019-08-13 16:23:47 -07:00
Ryan Barrett
879f6d1752
return 400 on more bad inputs, eg webmention source URLs
2019-08-13 13:29:31 -07:00
Ryan Barrett
65044b081c
accept Undo of Follow even if Follower doesn't exist
2019-08-01 10:39:15 -07:00
Ryan Barrett
f02c212f37
AP delivery: skip inactive followers
2019-08-01 10:36:39 -07: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
6219e2d25e
update test to match granary new whitespace handling
...
specifically snarfed/granary@48b55441c5
2019-06-24 14:48:24 -07:00
Ryan Barrett
7c8a2a4603
fix postprocess_as2() crash on multiply-valued inReplyTo
...
fixes https://console.cloud.google.com/errors/COTu_PXPjJ2ZWw
2019-06-06 06:35:57 -07:00
Ryan Barrett
801bf4075d
detect non-domain requests, eg /nodeinfo.json, and 404
...
these are probably other mastodon instances assuming we're mastodon too.
2019-04-19 08:00:21 -07:00
Ryan Barrett
90f7ac3e5b
add HTML meta redirects to mf2 rendered pages for end users
...
browsers will follow them, and hopefully all webmention receivers should/do ignore them, so we'll get the best progressive enhancement for both worlds.
IRC background:
https://chat.indieweb.org/dev/2019-04-11#t1555004634348000
https://chat.indieweb.org/dev/2019-04-16#t1555440757959400
2019-04-17 08:44:26 -07:00
Ryan Barrett
088e9cfaf7
skip outbound webmentions to same domain as source
2019-04-16 11:42:17 -07:00
Ryan Barrett
aa45f0c526
convert AP mentions to home page webmentions
...
for #46
2019-04-16 10:46:40 -07:00
Ryan Barrett
5bc639216e
more error handling for AS2 objects without id or URL
...
follows b7e44c9295
. fixes https://console.cloud.google.com/errors/CLnu14G46vHLOg
2019-04-15 08:14:37 -07:00
Ryan Barrett
6e7c2008e9
handle SSL failures when fetching arbitrary URLs
...
fixes https://console.cloud.google.com/errors/CJOuzd2b1sehPA
2019-04-10 08:08:02 -07:00
Ryan Barrett
2e33354c27
add following and followers fields to AS2 actors
...
for #40 . they currently both point to endpoint URLs that don't actually work yet, just like the recently added outbox field.
2019-01-14 11:08:08 -08:00
Ryan Barrett
b7e8cd7d42
add conneg + AS2 support to /r/... redirect URLs
...
for pixelfed, #39 . specifically, if the client asks for application/activity+json or application/ld+json (which pixelfed does), fetch and convert to AS2 instead of returning a 302 redirect.
2019-01-04 12:17:50 -08:00
Ryan Barrett
b237e52d6a
add outbox, summary, and publicKey.id properties to actors
...
for #39 , for pixelfed
2019-01-04 08:05:07 -08:00
Ryan Barrett
b7f89dce99
webmention => AP: handle actor/attributedTo id as well as url
...
for #40
2018-12-11 10:59:41 -08:00
Ryan Barrett
0af5c136bb
webmention => AP/Salmon: handle no targets or followers, return 200
...
fixes https://console.cloud.google.com/errors/CIrig_2B6_i87AE
2018-11-27 15:14:56 -08:00
Ryan Barrett
e964190162
webmention => AP: check for link to bridgy fed in source page
...
fixes #42
2018-11-27 10:27:12 -08:00
Ryan Barrett
a9324adceb
webmention => AP: put images into AS2 'attachment' field for Mastodon
...
for https://github.com/snarfed/bridgy-fed/issues/33#issuecomment-440965618
2018-11-23 22:17:37 -08:00
Ryan Barrett
a88165c4e3
webmention => AP: big refactoring to support Create
...
#33 . still in progress!
2018-11-16 07:09:55 -08:00
Ryan Barrett
2bb418dc72
webmention => AP support for u-follow-of => Follow
2018-10-24 21:28:52 -07:00
Ryan Barrett
42ad9d1998
include full AS2 actor object in Response activities
...
for #21
2018-10-23 13:09:49 -07:00
Ryan Barrett
98a19a994d
convert AP Follow to indieweb webmention with u-follow-of
...
#21 , https://indieweb.org/follow
2018-10-23 11:11:50 -07:00
Ryan Barrett
e090c2ba0a
AP Follow bug fix: actors are fed.brid.gy/DOMAIN, not /r/ redirect URLs
2018-10-21 18:54:27 -07:00
Ryan Barrett
abc5ecd919
AP Follow: store users' followers in the datastore
...
#21
2018-10-21 17:37:33 -07:00
Ryan Barrett
a4b309afef
activitypub: refactor Accept response to Follow activity
...
...and get tests working. #21
2018-10-21 15:28:42 -07:00
Ryan Barrett
9fc47c8ba9
AP => wm: switch to proxying reply wm source, unwrap URLs
...
for #35
example: https://webmention.io/realize.be/webmention/hG654HOgobymY54pMaNS
2018-10-17 17:49:56 -07:00
Ryan Barrett
27e56396b8
AP => wm: remove our redirect from target URLs
...
fixes the second half of #35
2018-10-17 12:00:38 -07:00
Ryan Barrett
9fb7f2fe26
AP => wm: prefer object URL for webmention source if available
...
fixes half of #35
2018-10-17 11:52:34 -07:00
Ryan Barrett
25d2724700
add Mention tag for Mastodon replies
...
fixes #34 . thanks @swentel!
2018-10-16 11:38:12 -07:00
Ryan Barrett
2ffd10306f
AP => webmention: handle full AS2 activities
...
mastodon used to send bare objects for lots of things, e.g. replies, but now sends ful AS2 Create activities with embedded objects much more often. handle those too.
thanks for the nudge @swentel!
2018-10-15 11:52:11 -07:00
Ryan Barrett
b25960ca93
wrap activity ids and urls and actor ids in our /r/ endpoint
...
for #16 , #32 . cc @swentel.
2018-10-14 07:58:17 -07:00
Ryan Barrett
e720e543d8
add /r/ redirect endpoint
...
for #16 , #32 . cc @swentel. more to come.
2018-10-14 07:42:28 -07:00
Ryan Barrett
118f8380c7
fix tests for yet another parser change that dropped implied u-url
2018-10-11 17:16:06 -07:00
Ryan Barrett
6681a5f2c7
fix unit test failure triggered by newer versions of mf2py or BS4 or ...
...
problem is that explicit p-name includes `<img>` `src` value, but implicit doesn't. background in https://github.com/microformats/microformats2-parsing/issues/35 etc.
```
======================================================================
FAIL: test_activitypub_create_author_only_url (tests.test_webmention.WebmentionTest)
Mf2 author property is just a URL. We should run full authorship.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ryan/src/bridgy-fed/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "tests/test_webmention.py", line 383, in test_activitypub_create_author_only_url
self.assert_equals(repost_as2, kwargs['json'])
File "/Users/ryan/src/bridgy-fed/local/lib/python2.7/site-packages/oauth_dropins/webutil/testutil.py", line 182, in assert_equals
%s""" % (msg, ''.join(e.args), expected, actual))
AssertionError: None: [actor] [name] u'Ms. \u2615 Baz' != u'Ms. \u2615 Baz http://orig/pic '
- Ms. \u2615 Baz
+ Ms. \u2615 Baz http://orig/pic
Expected value:
{u'@context': u'https://www.w3.org/ns/activitystreams ',
u'actor': {u'icon': ({u'type': u'Image', u'url': u'http://orig/pic '},),
u'id': u'http://localhost/orig ',
u'image': ({u'type': u'Image', u'url': u'http://orig/pic '},),
u'name': u'Ms. \u2615 Baz',
u'preferredUsername': u'orig',
u'type': u'Person',
u'url': u'http://orig '},
u'cc': [u'https://www.w3.org/ns/activitystreams#Public ',
u'http://orig/author ',
u'http://orig/recipient ',
u'http://orig/bystander '],
u'id': u'http://a/repost ',
u'name': u'reposted!',
u'object': u'tag:orig,2017:as2',
u'type': u'Announce',
u'url': u'http://a/repost '}
Actual value:
{u'@context': u'https://www.w3.org/ns/activitystreams ',
u'actor': {u'icon': [{u'type': u'Image', u'url': u'http://orig/pic '}],
u'id': u'http://localhost/orig ',
u'image': [{u'type': u'Image', u'url': u'http://orig/pic '}],
u'name': u'Ms. \u2615 Baz http://orig/pic ',
u'preferredUsername': u'orig',
u'type': u'Person',
u'url': u'http://orig '},
u'cc': [u'https://www.w3.org/ns/activitystreams#Public ',
u'http://orig/author ',
u'http://orig/recipient ',
u'http://orig/bystander '],
u'id': u'http://a/repost ',
u'name': u'reposted!',
u'object': u'tag:orig,2017:as2',
u'type': u'Announce',
u'url': u'http://a/repost '}
```
2018-10-11 16:56:55 -07:00
Ryan Barrett
b8d52b3dac
move test/ => tests/ to avoid shadowing python's built in test module
...
fixes confusing problems with dev_appserver starting in cloud sdk 219 (app-engine-python 1.9.76). background in https://issuetracker.google.com/issues/117145272#comment25 .
2018-10-11 16:07:53 -07:00