disable /bridge-user until Bluesky launch

pull/923/head
Ryan Barrett 2024-03-13 13:19:34 -07:00
rodzic 7bf29d411f
commit 245ef444f5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
2 zmienionych plików z 26 dodań i 24 usunięć

Wyświetl plik

@ -257,37 +257,38 @@ def serve_feed(*, objects, format, user, title, as_snippets=False, quiet=False):
return body, {'Content-Type': rss.CONTENT_TYPE} return body, {'Content-Type': rss.CONTENT_TYPE}
@app.get('/bridge-user') # TODO: re-enable for launch
@canonicalize_request_domain(common.PROTOCOL_DOMAINS, common.PRIMARY_DOMAIN) # @app.get('/bridge-user')
@flask_util.cached(cache, datetime.timedelta(days=1)) # @canonicalize_request_domain(common.PROTOCOL_DOMAINS, common.PRIMARY_DOMAIN)
def bridge_user_page(): # @flask_util.cached(cache, datetime.timedelta(days=1))
return render_template('bridge_user.html') # def bridge_user_page():
# return render_template('bridge_user.html')
@app.post('/bridge-user') # @app.post('/bridge-user')
def bridge_user(): # def bridge_user():
handle = request.values['handle'] # handle = request.values['handle']
proto, id = Protocol.for_handle(handle) # proto, id = Protocol.for_handle(handle)
if not proto: # if not proto:
flash(f"Couldn't determine protocol for {handle}") # flash(f"Couldn't determine protocol for {handle}")
return render_template('bridge_user.html'), 400 # return render_template('bridge_user.html'), 400
# TODO: put these into a PULL_PROTOCOLS constant? # # TODO: put these into a PULL_PROTOCOLS constant?
if not proto.LABEL in ('activitypub', 'fake', 'web'): # if not proto.LABEL in ('activitypub', 'fake', 'web'):
flash(f"{proto.__name__} isn't supported") # flash(f"{proto.__name__} isn't supported")
return render_template('bridge_user.html'), 400 # return render_template('bridge_user.html'), 400
if not id: # if not id:
id = proto.handle_to_id(handle) # id = proto.handle_to_id(handle)
if not id: # if not id:
flash(f"Couldn't resolve {proto.__name__} handle {handle}") # flash(f"Couldn't resolve {proto.__name__} handle {handle}")
return render_template('bridge_user.html'), 400 # return render_template('bridge_user.html'), 400
user = proto.get_or_create(id=id, propagate=True) # user = proto.get_or_create(id=id, propagate=True)
flash(f'Bridging <a href="{user.web_url()}">{user.handle}</a> into Bluesky. <a href="https://bsky.app/search">Try searching for them</a> in a minute!') # flash(f'Bridging <a href="{user.web_url()}">{user.handle}</a> into Bluesky. <a href="https://bsky.app/search">Try searching for them</a> in a minute!')
return render_template('bridge_user.html') # return render_template('bridge_user.html')
@app.get('/stats') @app.get('/stats')

Wyświetl plik

@ -3,6 +3,7 @@ Disallow: /*?*
Disallow: /ap/ Disallow: /ap/
Disallow: /atp/ Disallow: /atp/
Disallow: /bluesky/ Disallow: /bluesky/
Disallow: /bridge-user
Disallow: /convert/ Disallow: /convert/
Disallow: /nostr/ Disallow: /nostr/
Disallow: /recent Disallow: /recent