From 7dd844225fd03f9228d76950165ffae212ab5084 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 10 Jul 2024 22:54:21 +0200 Subject: [PATCH] Continued: - a warning was to much here - also need to check on other invalid TLDs, like .arpa, .tld and (if disabled) .onion/.i2p TLDs --- fba/http/federation.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fba/http/federation.py b/fba/http/federation.py index 8b22ccf..cdffdf5 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -173,7 +173,19 @@ def fetch_instances(domain: str, origin: str, software: str, command: str, path: logger.debug("instance='%s'", instance) if not validators.domain(instance, rfc_2782=True): - logger.warning("instance='%s' is not a valid domain - SKIPPED!", instance) + logger.debug("instance='%s' is not a valid domain - SKIPPED!", instance) + continue + elif instance.endswith(".onion"): + logger.debug("instance='%s' is a TOR .onion instance - SKIPPED", instance) + continue + elif instance.endswith(".i2p") and not config.get("allow_i2p_instance"): + logger.debug("instance='%s' is an I2P .onion instance - SKIPPED", instance) + continue + elif instance.endswith(".arpa"): + logger.debug("instance='%s' is a reverse IP address - SKIPPED", instance) + continue + elif instance.endswith(".tld"): + logger.debug("instance='%s' is a fake instance - SKIPPED", instance) continue logger.debug("instance='%s' - BEFORE!", instance) -- 2.39.5