This commit is contained in:
2026-03-29 00:04:02 +09:00
parent d8cce8499f
commit 8116f562f6

View File

@@ -21,18 +21,6 @@ templates.env.globals["get_access_count"] = accesscounter.get
templates.env.globals["server_version"] = server_version
templates.env.globals["onion_site_url"] = f"http://{onion_hostname}/"
poste_http_proxy = make_http_proxy("http://localhost:8081", remove_prefix_path=True)
poste_websocket_proxy = make_websocket_proxy("ws://localhost:8081", remove_prefix_path=True)
app.add_api_route("/mail/{path:path}", poste_http_proxy, methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
app.add_api_websocket_route("/mail/{path:path}", poste_websocket_proxy)
bluesky_http_proxy = make_http_proxy("http://localhost:3000")
bluesky_websocket_proxy = make_websocket_proxy("ws://localhost:3000")
bluesky_routes = ["/xrpc/{path:path}", "/oauth/{path:path}", "/.well-known/atproto-did", "/.well-known/oauth-authorization-server", "/.well-known/oauth-protected-resource"]
for route in bluesky_routes:
app.add_api_route(route, bluesky_http_proxy, methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
app.add_api_websocket_route(route, bluesky_websocket_proxy)
def get_current_year() -> str:
return str(datetime.now(ZoneInfo("Asia/Tokyo")).year)
templates.env.globals["get_current_year"] = get_current_year