From 42bb9c8efd46c4fb2184a137bed0f0d488ec0a5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 11 Dec 2023 07:57:39 +0100 Subject: [PATCH] Continued: - also check blacklist first, before invoking instances.is_recent() --- fba/commands.py | 8 ++++---- fba/helpers/processing.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index 8ae5722..2d26357 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1272,11 +1272,11 @@ def recheck_obfuscation(args: argparse.Namespace) -> int: logger.info("Checking %d domains ...", len(rows)) for row in rows: logger.debug("Fetching peers from domain='%s',software='%s',nodeinfo_url='%s' ...", row["domain"], row["software"], row["nodeinfo_url"]) - if (args.force is None or not args.force) and args.domain is None and args.software is None and instances.is_recent(row["domain"], "last_blocked"): - logger.debug("row[domain]='%s' has been recently checked, args.force[]='%s' - SKIPPED!", row["domain"], type(args.force)) + if blacklist.is_blacklisted(row["domain"]): + logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"]) continue - elif blacklist.is_blacklisted(row["domain"]): - logger.warning("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"]) + elif (args.force is None or not args.force) and args.domain is None and args.software is None and instances.is_recent(row["domain"], "last_blocked"): + logger.debug("row[domain]='%s' has been recently checked, args.force[]='%s' - SKIPPED!", row["domain"], type(args.force)) continue logger.debug("Invoking federation.fetch_blocks(%s) ...", row["domain"]) diff --git a/fba/helpers/processing.py b/fba/helpers/processing.py index d0df8aa..07e9371 100644 --- a/fba/helpers/processing.py +++ b/fba/helpers/processing.py @@ -226,7 +226,7 @@ def csv_block(blocker: str, url: str, command: str): logger.debug("domain='%s' is not a valid domain - SKIPPED!") continue elif blacklist.is_blacklisted(domain): - logger.warning("domain='%s' is blacklisted - SKIPPED!", domain) + logger.debug("domain='%s' is blacklisted - SKIPPED!", domain) continue elif blocks.is_instance_blocked(blocker, domain, severity): logger.debug("blocker='%s' has already blocked domain='%s' with severity='%s' - SKIPPED!", blocker, domain, severity) -- 2.39.5