Wykres commitów

87 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett c943e6fd87
/update-profile: bug fix for when user profile fetch fails
fixes https://console.cloud.google.com/errors/detail/CLzStOz_oPfYxwE;time=P30D?project=bridgy-federated
2024-05-05 19:22:11 -07:00
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 2a4146fe74
update profile UI: link handle in flashed message 2024-04-28 06:50:46 -07:00
Ryan Barrett 71cb803840
user page bug fix for direct vs enabledd
need to drop direct!
2024-04-27 09:54:13 -07:00
Ryan Barrett 1d20befe7e
Protocol.receive: always wrap actor objects in update, not post/create 2024-04-25 13:45:27 -07:00
Ryan Barrett d6a10b4be0
update profile button: make receive task instead of running it inline 2024-04-24 17:06:25 -07:00
Ryan Barrett 115d85909a
abstract "update profile" button across protocols
adds new /[protocol]/[id]/update-profile endpoint
2024-04-22 20:21:56 -07:00
Ryan Barrett 817ef1d5d6
user pages: only hide indirect AP users, not ATProto 2024-04-11 14:24:18 -07:00
Ryan Barrett 6325f0e94c
temporarily disable /bridge-user tests, for 245ef44 2024-03-13 13:53:30 -07:00
Ryan Barrett 51254f67de
atproto: tweak profile label, add bridgy-fed- 2024-03-11 15:31:31 -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 c2b8db8687
atproto: self label profiles with 'bridged-from-[protocol]'
fixes #827
2024-03-01 13:31:59 -08:00
Ryan Barrett 675e39809e
web UI: tweak user links in user page header 2024-02-11 14:39:09 -08:00
Ryan Barrett 907e6e7aeb
show Web user page even when direct is False
not other protocols though
2024-01-22 13:12:20 -08:00
Ryan Barrett 7941b632ca
Object._pre_put_hook: require that protocol owns id 2024-01-12 19:53:01 -08:00
Ryan Barrett 49eb9b8541
add Mastodon instance info at /api/v1/instance
https://docs.joinmastodon.org/methods/instance/#v1

right now just for FediSeer: https://fediseer.com/faq/eng#how-can-i-claim-my-instance
2023-12-31 08:42:26 -08:00
Ryan Barrett 520b2fd3b0
User.ap_address() => handle_as(ActivityPub) 2023-11-29 21:06:55 -08:00
Ryan Barrett 1ec1fc2482
genericize user handles on UI follower/following pages 2023-11-27 21:40:01 -08:00
Ryan Barrett 004726d397
fix followers/ing UI page for AP users
fixes #718
2023-11-27 21:01:02 -08:00
Ryan Barrett dcd7081d48
activitypub.actor: remove redundant preferredUsername
no clue why this triggered these flaky test failures, they happened when I ran all tests, but not test_pages on its own. grr.
2023-11-23 22:09:11 -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 db646909e2
delivery: switch from threads to tasks, one per send
for #652
2023-10-31 12:49:27 -07:00
Ryan Barrett 9a87d7261f
fix crash on RSS/Atom feeds for users without obj or obj.as1
fixes https://console.cloud.google.com/errors/detail/CKSZq8OU-tCRXA;time=P30D?project=bridgy-federated
2023-10-23 13:11:40 -07:00
Ryan Barrett 4a3607325f
canonicalize domain: redirect UI requests on other domains to fed.brid.gy 2023-10-16 14:02:17 -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 215578f33f
render notifications feeds as snippets, not whole activities 2023-10-12 10:40:55 -07:00
Ryan Barrett b1b2478b66
user page redesign: add notifications feeds, other minor tweaks
for #442
2023-10-11 12:25:39 -07:00
Ryan Barrett cc62d4cdb1
user page redesign: feeds bug fix, fix tests 2023-10-11 12:25:38 -07:00
Ryan Barrett c1e0a08f72
user page redesign: add home, notifications pages
for #442
2023-10-11 12:25:38 -07:00
Ryan Barrett 6442acb244
/bridge-user flashed message, link user handle 2023-10-05 22:28:36 -07:00
Ryan Barrett e00a4b52ba
ATProto: don't create DNS records if DEBUG is on 2023-10-05 15:55:31 -07:00
Ryan Barrett 7d8b1ba2e8
add fetch_blobs kwarg to Object.as_bsky 2023-10-05 15:47:04 -07:00
Ryan Barrett 000b08f9b2
when creating a new ATProto user, add a DNS _atproto TXT record for their handle 2023-10-04 13:54:20 -07:00
Ryan Barrett b4d5ab15ef
ATProto: assert that we only store record type objects in the repo 2023-10-03 16:56:06 -07:00
Ryan Barrett b70ef87236
hub: add dispatch.yaml for URL-based routing, update network ingress 2023-09-29 14:28:36 -07:00
Ryan Barrett 56c5909b84
add /bridge-user page to propagate a new user into ATProto
for #647
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 f16011211e
update tests for granary atom change snarfed/granary@a82ecfd7d9 2023-08-29 11:39:48 -07:00
Ryan Barrett b2b5383271
fix authors in RSS and Atom feeds 2023-07-28 15:53:56 -07:00
Ryan Barrett ca1d0dcc01
feeds: also load repost objects from separate Objects
for #419, follows 47b90c8
2023-07-20 07:26:16 -10:00
Ryan Barrett 47b90c890e
/feed: load author/actor if it's in a separate Object
fixes #419. thanks again @gRegorLove!
2023-07-19 19:39:29 -10:00
Ryan Barrett 9140318f4a
generalize Protocol.accept_follow, other bug fixes in Protocol.receive
for #529, fixes https://console.cloud.google.com/errors/detail/CMbJ6a6j56LErwE;time=P30D?project=bridgy-federated
2023-06-26 20:22:55 -07:00
Ryan Barrett cae406e6c4
don't allow BF domains in ActivityPub or Web ids
also other ActivityPub id validation. #558
2023-06-23 12:22:37 -07:00
Ryan Barrett cba4845394
disable ndb in-memory cache
it has a bug/weird behavior that we want to avoid, at least for now.

https://github.com/googleapis/python-ndb/issues/888
https://github.com/snarfed/bridgy-fed/issues/558
2023-06-22 14:27:02 -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 d3c4415cd3
migrate User.actor_as2 to obj key pointing to Object
for #547
2023-06-15 21:23:31 -07:00
Ryan Barrett bbcb8de44a
noop test refactoring: finally unify request context push/pop into testutil 2023-06-15 15:09:03 -07:00