]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 10 Jul 2024 20:54:21 +0000 (22:54 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Jul 2024 20:54:21 +0000 (22:54 +0200)
- 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

index 8b22ccf6e6e53cc3a4537f244e06f4edf0f1d996..cdffdf50545ae5fdc08b75530d749588781c7dd7 100644 (file)
@@ -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)