From b4f7746d79385b110329ed6578bdefaab5a945da Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 1 Oct 2024 19:00:37 +0200 Subject: [PATCH] Continued: - now also command recheck_obfuscation() is updating/adding 'obfucated' a record --- fba/commands.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fba/commands.py b/fba/commands.py index d862ce1..5efea1b 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1440,11 +1440,19 @@ def recheck_obfuscation(args: argparse.Namespace) -> int: logger.debug("block[block_level]='%s' - AFTER!", block["block_level"]) if processing.block(row["domain"], blocked, block["reason"], block["block_level"]) and block["block_level"] in ["suspended", "rejected"] and config.get("bot_enabled"): - logger.debug("Appending blocked='%s',reason='%s' for blocker='%s' ...", block["blocked"], block["block_level"], row["domain"]) + logger.debug("Appending blocked='%s',reason='%s' for blocker='%s' ...", blocked, block["block_level"], row["domain"]) blockdict.append({ "blocked": blocked, "reason" : block["reason"], }) + elif blocked is not None: + logger.debug("blocked='%s' is maybe added and needs update.", blocked) + if not obfuscation.is_added(block["blocked"]): + logger.debug("Invoking obfuscation.add(%s) ...", block["blocked"]) + obfuscation.add(block["blocked"]) + else: + logger.debug("Invoking obfuscation.update(%s) ...", block["blocked"]) + obfuscation.update(block["blocked"]) logger.debug("Setting obfuscated=%d for row[domain]='%s' ...", obfuscated, row["domain"]) instances.set_obfuscated_blocks(row["domain"], obfuscated) -- 2.39.5