]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 13 Jul 2024 09:21:44 +0000 (11:21 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 13 Jul 2024 09:21:44 +0000 (11:21 +0200)
- invalid domains should most be logged as warnings, not debug levels but
  sometimes it is okay
- allow RFC 2782 compliant domains (with underscore)

fba/commands.py
fba/helpers/processing.py
fba/http/federation.py

index 5848fbc20550ac3ee9c04b1dc0c694f43fc58d72..1e0ccb333102cf0f58e3a8fdbcc95613a9ac7554 100644 (file)
@@ -424,7 +424,7 @@ def fetch_blocks(args: argparse.Namespace) -> int:
             if block["blocked"] in [None, ""]:
                 logger.debug("block[blocked]='%s' is empty - SKIPPED!", block["blocked"])
                 continue
-            elif not validators.domain(block["blocked"]):
+            elif not validators.domain(block["blocked"], rfc_2782=True):
                 logger.warning("block[blocked]='%s' is not a valid domain - SKIPPED!", block["blocked"])
                 continue
             elif block["blocked"].endswith(".onion"):
index 01c66d42286b88b9204008ed2472ba771a7aa499..856acf3ca8c72986732e729eb5922f00af670241 100644 (file)
@@ -227,7 +227,7 @@ def csv_block(blocker: str, url: str, command: str):
         domains.append(domain)
 
         if not validators.domain(domain, rfc_2782=True):
-            logger.debug("domain='%s' is not a valid domain - SKIPPED!")
+            logger.warning("domain='%s' is not a valid domain - SKIPPED!")
             continue
         elif blacklist.is_blacklisted(domain):
             logger.debug("domain='%s' is blacklisted - SKIPPED!", domain)
index 53232d2b72f31dd18e09ab93c72a3a3432889fc7..994a32bdca774111d5fb674bd1d9abe9338c591f 100644 (file)
@@ -173,7 +173,7 @@ 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.debug("instance='%s' is not a valid domain - SKIPPED!", instance)
+            logger.warning("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)