atproto: only enable indieweb.org and snarfed.org, for now

pull/923/head
Ryan Barrett 2024-03-13 13:07:30 -07:00
rodzic 663063e06c
commit 7bf29d411f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
4 zmienionych plików z 17 dodań i 4 usunięć

Wyświetl plik

@ -401,7 +401,7 @@ class ActivityPub(User, Protocol):
sig = headers.get('Signature')
if not sig:
if appengine_info.DEBUG:
logging.info('No HTTP Signature, allowing due to DEBUG=true')
logger.info('No HTTP Signature, allowing due to DEBUG=true')
return
error('No HTTP Signature', status=401)

Wyświetl plik

@ -485,7 +485,12 @@ def poll_notifications():
headers={'User-Agent': USER_AGENT})
for user in users:
logging.debug(f'Fetching notifs for {user.key.id()}')
# TODO: remove for launch
if not DEBUG and user.key.id() not in ['indieweb.org', 'snarfed.org']:
logger.info(f'Skipping {user.key.id()}')
continue
logger.debug(f'Fetching notifs for {user.key.id()}')
# TODO: store and use cursor
# seenAt would be easier, but they don't support it yet
@ -536,7 +541,12 @@ def poll_posts():
headers={'User-Agent': USER_AGENT})
for user in users:
logging.debug(f'Fetching posts for {user.key.id()}')
# TODO: remove for launch
if not DEBUG and user.key.id() not in ['indieweb.org', 'snarfed.org']:
logger.info(f'Skipping {user.key.id()}')
continue
logger.debug(f'Fetching posts for {user.key.id()}')
# TODO: store and use cursor
# seenAt would be easier, but they don't support it yet

Wyświetl plik

@ -868,6 +868,9 @@ class Object(StringIdModel):
# TODO: optimize! this is called serially in loops, eg in home.html
if set(actor.keys()) == {'id'} and self.source_protocol:
proto = PROTOCOLS[self.source_protocol]
# STATE: this load gets the DID doc, not the profile object
# should we start using at://[did] as actor/author? or special case
# atproto here?
actor_obj = proto.load(actor['id'], remote=False)
if actor_obj and actor_obj.as1:
actor = actor_obj.as1

Wyświetl plik

@ -1245,7 +1245,7 @@ def send_task():
target = Target(uri=url, protocol=protocol)
obj = ndb.Key(urlsafe=form['obj']).get()
logging.info(f'Sending {obj.key.id()} AS1: {json_dumps(obj.as1, indent=2)}')
logger.info(f'Sending {obj.key.id()} AS1: {json_dumps(obj.as1, indent=2)}')
if (target not in obj.undelivered and target not in obj.failed
and 'force' not in request.values):