Wykres commitów

185 Commity (main)

Autor SHA1 Wiadomość Data
Ryan Barrett f668a53f74
User.is_enabled: if a user explicitly opts in, override profile opt outs
fixes #974
2024-04-30 12:38:43 -07:00
Ryan Barrett 5071685c1b
noop: move is_enabled tests from test_protocol to test_models 2024-04-30 12:31:48 -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 e5c12c4595
update protocol bot user data to match snarfed/granary@ac14727 2024-04-28 12:09:39 -07:00
Ryan Barrett b6845246e9
fix protocol bot users' image URLs
re: #967
2024-04-28 08:14:55 -07:00
Ryan Barrett 506de7fd1d
User.get_or_create: if the id is a copy, return the original
...which will be in a different protocol! worried this will break something. hrm.
2024-04-23 17:56:59 -07:00
Ryan Barrett 10023d17fd
Protocol.enable_protocol: create copy user if necessary 2024-04-21 12:18:12 -07:00
Ryan Barrett 6b597c90c3
User.get_or_create: abstract propagate and create_for across protocols 2024-04-21 11:40:13 -07:00
Ryan Barrett 393605bde9
change ATProto.ABBREV to bsky
🤞, for #961
2024-04-17 06:54:16 -07:00
Ryan Barrett 5767ffabb5
add new Object.normalize_ids method, use in Protocol.receive
eg https://bsky.app/... URLs to DIDs for actors or at:// URIs for objects

this hopefully fixes web => ATProto follows of https://bsky.app/... profile URLs.
2024-04-09 13:07:57 -07:00
Ryan Barrett e86763f654
Object.as1 from bsky: bug fix for PDS in getBlob image URLs 2024-03-14 20:26:46 -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 7c5496113f
fix a few tests that were using the network 2024-03-04 16:35:38 -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 d2865fdb86
add common.ENABLED_BRIDGES, check before conversion and /bridge-user 2024-02-28 12:07:06 -08:00
Ryan Barrett 56a3c0e34b
bluesky: opt out users who have disabled logged out view on bsky.app
ie "Discourage apps from showing my account to logged-out users" on https://bsky.app/moderation

fixes #828

https://docs.bsky.app/docs/advanced-guides/resolving-identities#for-backend-services
https://github.com/bluesky-social/atproto/blob/main/packages/api/docs/labels.md#label-behaviors
2024-02-23 10:33:34 -08:00
Ryan Barrett 675e39809e
web UI: tweak user links in user page header 2024-02-11 14:39:09 -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 c966090912
Protocol.load: reload objects if our copy is over 30d old
fixes #628

no clue how much this will impact our outbound request load. we'll see!
2024-02-08 11:23:09 -08:00
Ryan Barrett 4529f30dce
switch from opt_outs.txt to new User.manual_opt_out property
opt_outs.txt wasn't included in continuous deploy from Circle, so those deploys were ignoring ids in that file :/
2024-01-14 21:02:39 -08:00
Ryan Barrett 7941b632ca
Object._pre_put_hook: require that protocol owns id 2024-01-12 19:53:01 -08:00
Ryan Barrett 28fa7eba8c
User.get_or_create: set transient User.existing attribute
would have used new, but it's already a method
2024-01-06 13:19:43 -10:00
Ryan Barrett 7e702305bf
Web: add poll_feed_task for ingesting Atom/RSS feeds
also demotes Web.atom to informational only, we're switching to populate feed entries into our_as1 because we can't easily extract individual items from feedparser.

for #550
2024-01-01 20:12:33 -10:00
Ryan Barrett b0f278e033
Web: when subscribing to superfeedr, handle returned posts
for #550
2023-12-05 06:52:33 -08:00
Ryan Barrett 5485cbeece
Object.as1 from atom: extract object, override id with url 2023-12-02 20:56:07 -08:00
Ryan Barrett e217419747
add Object.atom property
for #550
2023-12-02 14:30:14 -08:00
Ryan Barrett 2f4bae8dc9
change Web.ap_subdomain default to 'web' 2023-11-30 20:08:41 -08:00
Ryan Barrett 6e236e2d70
switch User.ap_actor to id_as, use Web.ap_subdomain property 2023-11-30 17:10:18 -08:00
Ryan Barrett aaf115347e
add manual opt-out list 2023-11-29 10:25:45 -08:00
Ryan Barrett 62ca4022fb
stop clearing Object data properties
...so that we have original data preserved when we override it in our_as1. fixes #721
2023-11-28 06:39:34 -08:00
Ryan Barrett fe8b710cce
User.get_by_id: handle opt-out 2023-11-27 11:28:05 -08:00
Ryan Barrett dd62f472da
User.get_or_create: return None if opted out 2023-11-27 06:53:22 -08:00
Ryan Barrett 6091cd4063
drop the rest of g.user!
for #690
2023-11-25 20:38:28 -08:00
Ryan Barrett f27e914a89
User.handle_as: handle when handle isn't set
for https://console.cloud.google.com/errors/detail/CIT9-r3d-MKW5AE;time=P30D?project=bridgy-federated
2023-11-23 22:09:05 -08:00
Ryan Barrett 48f89cebc0
User.handle_as: handle web users with custom usernames
bug fix for b255962, fixes https://console.cloud.google.com/errors/detail/CPiAj72alvDYNQ;time=P30D?project=bridgy-federated
2023-11-22 19:00:02 -08:00
Ryan Barrett 2c6a470058
drop g.user in lots of tests
for #690
2023-11-19 21:53:39 -08:00
Ryan Barrett bee313fb67
drop User.atproto_did, switch to using copies 2023-11-15 19:08:06 -08:00
Ryan Barrett 3d0c5ecea5
Object.resolve_ids: handle multiple inReplyTo 2023-11-12 13:15:08 -08:00
Ryan Barrett a08a76c672
Object.resolve_ids bug fix: handle both protocol LABEL and ABBREV 2023-11-12 10:33:08 -08:00
Ryan Barrett 535494f21b
Object.to_as1 from bsky: pass at:// uri so we get id/url more often
for #715
2023-11-09 20:50:48 -08:00
Ryan Barrett f97b837960
cache follower/following counts for 2h 2023-11-08 12:03:56 -08:00
Ryan Barrett d576d2b2e4
move pages.count_followers to User, use it in activitypub.actor 2023-11-08 11:56:01 -08:00
Ryan Barrett 98bb29b333
drop Object.proxy_url, switch callers to ids.translate_object_id 2023-11-06 12:18:11 -08:00
Ryan Barrett 1f6a227aee
Object.actor_link bug fix: handle composite url field
fixes https://console.cloud.google.com/errors/detail/CJTXq6ri48XtKQ;time=P30D?project=bridgy-federated
2023-11-03 06:53:33 -07:00
Ryan Barrett 4d44363693
fold Object.as_bsky into ATProto.convert, translate ids 2023-11-02 17:41:31 -07:00
Ryan Barrett 72e180f854
User/Object.get_copy: return key id if proto is the source protocol 2023-11-02 13:08:23 -07:00
Ryan Barrett 0ca49e837a
add Object.get_copy, User.get_copy 2023-11-02 13:08:23 -07:00
Ryan Barrett 9aff3122c0
noop: rename get_for_copy[ies] => get_for_original[s] 2023-11-02 13:08:23 -07:00