Wykres commitów

192 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett f6798f2725
abstract "bridged from Bridgy Fed" profile label across protocols
for #976
2024-05-14 16:03:42 -07:00
Ryan Barrett f533479e0b
noop: drop unused flask.g imports 2024-05-07 17:14:59 -07:00
Ryan Barrett c608ecaa36
noop: misc constants cleanup 2024-05-05 16:35:23 -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 4b95d49ccc
ids.translate_handle: convert _ and ~ chars to - for Bluesky
hopefully fixes #982
2024-05-02 15:41:41 -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 0e8b9ece7e
set up ap.brid.gy protocol bot user 2024-04-23 13:54:29 -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 d4a56127d9
incoming webmentions: stop converting home pages to update activities
pass Protocol.receive the bare actor object, let it convert to update activity, like with posts etc
2024-04-23 06:50:55 -07:00
Ryan Barrett 0c41f0e081
remove /webmention-interactive (for old Web-specific update profile button) 2024-04-22 20:25:48 -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 b9551c4de7
adjust Web.owns_id to say it owns protocol bot user domains but not their pages
eg bsky.brid.gy True, https://bsky.brid.gy/ True, https://bsky.brid.gy/foo False.

also move our internal synthetic UI-initiated follow ids from https://fed.brid.gy/web/... to under the user's own domain. hopefully this won't break anything 🤞
2024-04-22 11:58:01 -07:00
Ryan Barrett ed78090d2c
expand User.ap_subdomain to allow protocol subdomains like bsky
part of setting up per-protocol bot users for #880
2024-04-22 11:12:03 -07:00
Ryan Barrett e1f9021696
AP instance actor: move AS2 JSON files, start adding per-protocol bot users 2024-04-21 16:35:17 -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 2886ae180d
remove common.ENABLED_PROTOCOLS, use Protocol.DEFAULT_ENABLED_PROTOCOLS instead
also use is_enabled_to in user page template
2024-04-18 16:39:15 -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 7009267bb0
use new handle_or_id kwarg in common.is_enabled calls 2024-04-10 11:49:53 -07:00
Ryan Barrett 663063e06c
test_integrations: add ATProto => Web follow 2024-03-12 21:41:05 -07:00
Ryan Barrett 7e7556bb02
Web.load: support domain ids, convert to homepage URLs 2024-03-12 21:09:34 -07:00
Ryan Barrett 95e46c5ebb
Revert "cache outbound HTTP request responses, locally to each inbound request"
This reverts commit 30debfc8fa.

seemed promising, but broke in production. Saw a lot of `IncompleteRead`s on both GETs and POSTs. Rolled back for now.

```
('Connection broken: IncompleteRead(9172 bytes read, -4586 more expected)', IncompleteRead(9172 bytes read, -4586 more expected))
...
File "oauth_dropins/webutil/util.py", line 1673, in call
  resp = getattr((session or requests), fn)(url, *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 102, in get
  return self.request('GET', url, params=params, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 158, in request
  return super().request(method, url, *args, headers=headers, **kwargs)  # type: ignore
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/sessions.py", line 589, in request
  resp = self.send(prep, **send_kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 205, in send
  response = self._send_and_cache(request, actions, cached_response, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/session.py", line 233, in _send_and_cache
  self.cache.save_response(response, actions.cache_key, actions.expires)
File "requests_cache/backends/base.py", line 89, in save_response
  cached_response = CachedResponse.from_response(response, expires=expires)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/response.py", line 102, in from_response
  obj.raw = CachedHTTPResponse.from_response(response)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests_cache/models/raw_response.py", line 69, in from_response
  _ = response.content  # This property reads, decodes, and stores response content
      ^^^^^^^^^^^^^^^^
File "requests/models.py", line 899, in content
  self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "requests/models.py", line 818, in generate
  raise ChunkedEncodingError(e)
```
2024-03-11 15:31:30 -07:00
Ryan Barrett 30debfc8fa
cache outbound HTTP request responses, locally to each inbound request
using requests-cache. pretty straightforward! for #588
2024-03-08 12:34:49 -08:00
Ryan Barrett 01e5ac51ab
fix crash in Web.owns_id
fixes https://console.cloud.google.com/errors/detail/CPOsl7usgr3VUQ;time=P30D?project=bridgy-federated
2024-03-06 14:04:44 -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 3ef64948e5
web: log when we can't fetch an apex domain and fall back to www 2024-02-28 12:07:05 -08:00
Ryan Barrett fce24c0645
/web-site: don't allow URLs with paths
for #882
2024-02-27 11:19:14 -08:00
Ryan Barrett dc5d7c132a
Web feed polling: limit Object.atom/rss properties to 500K
...since the overall entity size imit is 1M: https://cloud.google.com/datastore/docs/concepts/limits

fixes https://console.cloud.google.com/errors/detail/CO-fpZfMq_6ktgE;time=P30D?project=bridgy-federated
2024-02-27 07:00:45 -08:00
Ryan Barrett 42b4541c8d
Web.get_or_create: bug fix for normalizing domain case
fixes https://console.cloud.google.com/errors/detail/CKOs59zx0rSXQg;time=P30D?project=bridgy-federated
2024-02-26 19:26:47 -08:00
Ryan Barrett ac4b7fb4e5
web.poll_feed_task: handle more HTTP and parse errors
fixes https://console.cloud.google.com/errors/detail/CNj81tKbzNSzwAE;time=P30D?project=bridgy-federated
2024-02-20 12:23:20 -08:00
Ryan Barrett 6a63820cd8
tighten Object.owns_id to reject blocklisted domains
fixes https://console.cloud.google.com/errors/detail/CLSnttKfy4v90wE;time=P30D?project=bridgy-federated
2024-02-08 14:41:15 -08:00
Ryan Barrett 9818b39b16
Web.owns_id bug fix: return None for opted out domain, not False 2024-01-27 13:45:02 -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 86079c3684
Web.convert: for meta refresh redirect, if object has no url, fall back to id 2024-01-22 13:04:16 -08:00
Ryan Barrett 4e5021e2b0
/web-site bug fix, handle opted out users
fixes https://console.cloud.google.com/errors/detail/CN7a9KGAicelyAE;time=P30D?project=bridgy-federated
2024-01-22 08:43:33 -08:00
Ryan Barrett f3ccee40de
noop: refactor web feed polling 2024-01-22 08:43:33 -08:00
Ryan Barrett 3a8d33ee52
web feed polling: start using ETag/If-None-Match and Last-Modified/If-Modified-Since
for #791
2024-01-19 21:07:48 -08:00
Ryan Barrett 09dcabc708
feed polling: bug fix, calculate posting frequency independent of order 2024-01-19 11:33:58 -08:00
Ryan Barrett 7fcbf89d97
feed polling: add Web.feed_last_item, skip parts of feeds we've already seen
for #791
2024-01-19 11:33:58 -08:00
Ryan Barrett bfbcc34f55
suppress a couple log messages around inferring ids 2024-01-14 13:48:18 -08:00
Ryan Barrett c8e2fafba4
web.poll_feed_task: use URL as id since some feeds use non-URL (eg tag URI) ids
example: https://www.producthunt.com/feed, Atom. excerpt:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:www.producthunt.com,2005:/feed</id>
  <link rel="alternate" type="text/html" href="https://www.producthunt.com"/>
  <link rel="self" type="application/atom+xml" href="https://www.producthunt.com/feed"/>
  <title>Product Hunt — The best new products, every day</title>
  <updated>2024-01-10T02:57:06-08:00</updated>
  <entry>
    <id>tag:www.producthunt.com,2005:Post/432225</id>
    <published>2023-12-31T18:15:55-08:00</published>
    <updated>2024-01-10T12:54:42-08:00</updated>
    <link rel="alternate" type="text/html" href="https://www.producthunt.com/posts/seemless"/>
    <title>Seemless</title>
    ...
```

fixes https://console.cloud.google.com/errors/detail/CKLuk-v4x8X0NQ;time=P30D?project=bridgy-federated
2024-01-11 13:01:45 -08:00
Ryan Barrett 91876a7d22
web.poll_feed_task: handle when feed content and Content-Type don't match
fixes https://console.cloud.google.com/errors/detail/CIX--Oz-w4D_Xg;time=P30D?project=bridgy-federated
2024-01-11 13:01:45 -08:00
Ryan Barrett ab4427c182
web.poll_feed_task: handle missing Content-Type header
fixes https://console.cloud.google.com/errors/detail/CKiskJSXi5z9gwE;time=P30D?project=bridgy-federated
2024-01-11 13:01:45 -08:00
Ryan Barrett 81e675f79b
web.poll_feed_task: default actor/author to user 2024-01-09 16:02:41 -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 aac85cedca
web feed polling: if we get Content-Type application/xml, use the link's type
fixes eg https://simonwillison.net/atom/everything/
2024-01-09 12:00: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 1db5358688
Web: test a couple poll feed errors 2024-01-06 13:04:22 -10:00
Ryan Barrett 5f1c521500
Web: add last_polled_feed property 2024-01-06 12:56:37 -10: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 6025925c26
web: start removing superfeedr code 2024-01-04 16:32:39 -10:00