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}")