Wykres commitów

35 Commity (417e3fdb20538362267bf7e903c4ddfb172987a6)

Autor SHA1 Wiadomość Data
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 83893d0ea7
HTTP caching headers: switch to flask_util.headers
for #432, fixes https://console.cloud.google.com/errors/detail/CMK10__x4ZbgbQ;time=P7D;refresh=true?project=bridgy-federated
2024-06-04 14:19:39 -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 d0ca690dc4
HTTP Cache-Control header bug fix, use integer seconds for max-age, not float
for #432
2024-05-30 17:12:45 -07:00
Ryan Barrett 9c4888b02e
switch from flask_util.cached to HTTP caching, suppress some verbose logging 2024-05-30 14:55:35 -07:00
Ryan Barrett f533479e0b
noop: drop unused flask.g imports 2024-05-07 17:14:59 -07: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 1591dfb641
pass user to Protocol.send/convert instead of using g.user
for #690
2023-11-25 20:07:14 -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 acb1c703a3
rename Protocol.serve => .convert, move Content-Type to class constant 2023-10-25 12:31:52 -07:00
Ryan Barrett d12fd99b03
noop: move Protocol.subdomain_url to common.subdomain_wrap 2023-10-23 15:44:32 -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 db29ad7757
docs: fix docstring formatting, other tweaks 2023-10-05 23:32:31 -07:00
Ryan Barrett c10d0c97d7
noop: misc minor doc tweaks 2023-09-26 14:47:26 -07:00
Ryan Barrett 2f308b43e2
/convert: use generic Protocol for fed subdomain
not entirely sure about this one, will see

for #600
2023-07-26 09:02:23 -07:00
Ryan Barrett a1d4806e2a
fix /convert/ redirect on fed.brid.gy to preserve URL-encoding
for #600
2023-07-26 09:02:23 -07:00
Ryan Barrett 850e8a1dc8
switch convert URLs from ^^ back to #
for #581. the ^^s didn't help with WordPress, which was the original motivation, and they're confusing everyone else.
2023-07-24 14:31:07 -07:00
Ryan Barrett e194ccb3ad
Protocol.load/fetch returns True/False (or None) to mean "not this protocol"
ie, nothing failed, but the given id eitehr doesn't below to the given protocol, or fetched successfully but its data belongs to a different protocol.

vs raising exceptions for fetches that fail or error, eg network connection problems, Web got HTML with microformats2 but no h-entry, ActivityPub got non-AS2, etc.

used in Protocol.for_id: when a given Protocol's fetch doesn't work, we move on and try the next protocol _if_ it returned False (ie wasn't fetchable with that protocol, but we fail fast if it raises an exception (ie fetch failed).
2023-07-14 12:58:47 -07:00
Ryan Barrett 40ae3dec8e
start to port test_activitypub tests to test_protocol, using Fake protocol
also minor tweaks to Protocol.deliver
2023-06-27 09:48:47 -07:00
Ryan Barrett ab1c28ee4d
noop, lint fixes from flake8
remaining:

$ flake8 --extend-ignore=E501 *.py tests/*.py
"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'"
Run flake8 with greater verbosity to see more details
activitypub.py:15:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
activitypub.py:36:1: F401 'web' imported but unused
activitypub.py:48:1: E302 expected 2 blank lines, found 1
activitypub.py:51:9: F811 redefinition of unused 'web' from line 36
app.py:6:1: F401 'flask_app.app' imported but unused
app.py:9:1: F401 'activitypub' imported but unused
app.py:9:1: F401 'convert' imported but unused
app.py:9:1: F401 'follow' imported but unused
app.py:9:1: F401 'pages' imported but unused
app.py:9:1: F401 'redirect' imported but unused
app.py:9:1: F401 'superfeedr' imported but unused
app.py:9:1: F401 'ui' imported but unused
app.py:9:1: F401 'webfinger' imported but unused
app.py:9:1: F401 'web' imported but unused
app.py:9:1: F401 'xrpc_actor' imported but unused
app.py:9:1: F401 'xrpc_feed' imported but unused
app.py:9:1: F401 'xrpc_graph' imported but unused
app.py:9:19: E401 multiple imports on one line
models.py:19:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
models.py:364:31: E114 indentation is not a multiple of four (comment)
models.py:364:31: E116 unexpected indentation (comment)
protocol.py:17:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
redirect.py:26:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
web.py:18:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
webfinger.py:13:1: F401 'oauth_dropins.webutil.util.json_loads' imported but unused
webfinger.py:110:13: E122 continuation line missing indentation or outdented
webfinger.py:111:13: E122 continuation line missing indentation or outdented
webfinger.py:131:13: E122 continuation line missing indentation or outdented
webfinger.py:132:13: E122 continuation line missing indentation or outdented
webfinger.py:133:13: E122 continuation line missing indentation or outdented
webfinger.py:134:13: E122 continuation line missing indentation or outdented
tests/__init__.py:2:1: F401 'oauth_dropins.webutil.tests' imported but unused
tests/test_follow.py:11:1: F401 'oauth_dropins.webutil.util.json_dumps' imported but unused
tests/test_follow.py:14:1: F401 '.testutil.Fake' imported but unused
tests/test_models.py:156:15: E122 continuation line missing indentation or outdented
tests/test_models.py:157:15: E122 continuation line missing indentation or outdented
tests/test_models.py:158:11: E122 continuation line missing indentation or outdented
tests/test_web.py:12:1: F401 'oauth_dropins.webutil.util.json_dumps' imported but unused
tests/test_web.py:17:1: F401 '.testutil' imported but unused
tests/test_web.py:1513:13: E128 continuation line under-indented for visual indent
tests/test_web.py:1514:9: E124 closing bracket does not match visual indentation
tests/testutil.py:106:1: E402 module level import not at top of file
tests/testutil.py:107:1: E402 module level import not at top of file
tests/testutil.py:108:1: E402 module level import not at top of file
tests/testutil.py:109:1: E402 module level import not at top of file
tests/testutil.py:110:1: E402 module level import not at top of file
tests/testutil.py:301:24: E203 whitespace before ':'
tests/testutil.py:301:25: E701 multiple statements on one line (colon)
tests/testutil.py:301:25: E231 missing whitespace after ':'
2023-06-20 11:29:31 -07:00
Ryan Barrett 501406ab7a
bring back the /convert/[src]/[dest]/[url] routes, forgot we'd used them in prod
thanks for reporting @gRegorLove!
2023-06-17 13:48:44 -07:00
Ryan Barrett c2f5cbd35e
migrate source Protocol in /convert/ endpoints from path to subdomain
for #512, #548
2023-06-14 15:02:59 -07:00
Ryan Barrett cb1f80832f
AP users: add Protocol.ABBREV, Protocol.OTHER_LABELS
for #512
2023-06-11 08:14:17 -07:00
Ryan Barrett 0f19654eb2
/convert/: require user for converting to AS2
since activitypub.postprocess_as2 currently needs g.user.
2023-06-09 09:39:13 -07:00
Ryan Barrett 7066a935e6
add AP to allowed sources and Web to allowed dests for /convert/ 2023-06-08 21:02:12 -07:00
Ryan Barrett 47b04f5574
rename Web.LABEL from 'webmention' to 'web' 2023-05-30 12:15:36 -07:00
Ryan Barrett c8b2103e13
rename Webmention class => Web, webmention.py => web.py 2023-05-26 17:40:29 -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 a3df7d6d30
make /render redirect to /convert/...
#512
2023-05-24 16:32:00 -07:00
Ryan Barrett 6d976854dc
add /render logic to /convert/... 2023-05-24 16:00:41 -07:00
Ryan Barrett df35ce16cc
AP users: add convert.py and /convert/... endpoint
#512
2023-05-24 15:18:31 -07:00