From b4d2f8e728ffb05904a4ab36714d0ef063eb0f31 Mon Sep 17 00:00:00 2001 From: Kierre Date: Sat, 18 Oct 2025 10:23:59 -0400 Subject: [PATCH] Fix federation self test --- vona/__main__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vona/__main__.py b/vona/__main__.py index 82e0f31..77ee8dd 100644 --- a/vona/__main__.py +++ b/vona/__main__.py @@ -74,6 +74,9 @@ async def handle_logging(response): except: pass + if request.path.startswith("/.well-known/matrix/"): + return response + print( f"[{origin}] " + f'[{datetime.now().strftime("%d/%b/%Y:%H:%M:%S")}] ' + @@ -137,7 +140,10 @@ def federation_self_test(): destination=config.server_name, ) - resp.raise_for_status() + if str(resp.status_code).startswith("5") or str(resp.status_code).startswith("4"): + print(f"[FATL] Federation self-test failed: status code is not acceptable ({str(resp.status_code)})") + os._exit(1) + print("[INFO] Federation self-test OK") except Exception as e: print(f"[FATL] Federation self-test failed: {e}")