From 245ef444f56ae5de7b524715220d20d7a2fe03f6 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Wed, 13 Mar 2024 13:19:34 -0700 Subject: [PATCH] disable /bridge-user until Bluesky launch --- pages.py | 49 ++++++++++++++++++++++++----------------------- static/robots.txt | 1 + 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/pages.py b/pages.py index e9ebd0a..43e23fd 100644 --- a/pages.py +++ b/pages.py @@ -257,37 +257,38 @@ def serve_feed(*, objects, format, user, title, as_snippets=False, quiet=False): return body, {'Content-Type': rss.CONTENT_TYPE} -@app.get('/bridge-user') -@canonicalize_request_domain(common.PROTOCOL_DOMAINS, common.PRIMARY_DOMAIN) -@flask_util.cached(cache, datetime.timedelta(days=1)) -def bridge_user_page(): - return render_template('bridge_user.html') +# TODO: re-enable for launch +# @app.get('/bridge-user') +# @canonicalize_request_domain(common.PROTOCOL_DOMAINS, common.PRIMARY_DOMAIN) +# @flask_util.cached(cache, datetime.timedelta(days=1)) +# def bridge_user_page(): +# return render_template('bridge_user.html') -@app.post('/bridge-user') -def bridge_user(): - handle = request.values['handle'] +# @app.post('/bridge-user') +# def bridge_user(): +# handle = request.values['handle'] - proto, id = Protocol.for_handle(handle) - if not proto: - flash(f"Couldn't determine protocol for {handle}") - return render_template('bridge_user.html'), 400 +# proto, id = Protocol.for_handle(handle) +# if not proto: +# flash(f"Couldn't determine protocol for {handle}") +# return render_template('bridge_user.html'), 400 - # TODO: put these into a PULL_PROTOCOLS constant? - if not proto.LABEL in ('activitypub', 'fake', 'web'): - flash(f"{proto.__name__} isn't supported") - return render_template('bridge_user.html'), 400 +# # TODO: put these into a PULL_PROTOCOLS constant? +# if not proto.LABEL in ('activitypub', 'fake', 'web'): +# flash(f"{proto.__name__} isn't supported") +# return render_template('bridge_user.html'), 400 - if not id: - id = proto.handle_to_id(handle) - if not id: - flash(f"Couldn't resolve {proto.__name__} handle {handle}") - return render_template('bridge_user.html'), 400 +# if not id: +# id = proto.handle_to_id(handle) +# if not id: +# flash(f"Couldn't resolve {proto.__name__} handle {handle}") +# 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 {user.handle} into Bluesky. Try searching for them in a minute!') - return render_template('bridge_user.html') +# flash(f'Bridging {user.handle} into Bluesky. Try searching for them in a minute!') +# return render_template('bridge_user.html') @app.get('/stats') diff --git a/static/robots.txt b/static/robots.txt index 84f5e97..81d4dd7 100644 --- a/static/robots.txt +++ b/static/robots.txt @@ -3,6 +3,7 @@ Disallow: /*?* Disallow: /ap/ Disallow: /atp/ Disallow: /bluesky/ +Disallow: /bridge-user Disallow: /convert/ Disallow: /nostr/ Disallow: /recent