From 35a0e79562f51419f4d648649b4f2dcbf6a8226e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 20 Nov 2023 04:47:03 +0100 Subject: [PATCH] Continued: - lemmy may also use obfuscation - also check entries when has_obfuscation is NULL --- daemon.py | 2 +- fba/commands.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index f3f246f..f5bfd7f 100755 --- a/daemon.py +++ b/daemon.py @@ -92,7 +92,7 @@ def api_scoreboard(mode: str, amount: int): elif mode == "obfuscator": database.cursor.execute("SELECT software, COUNT(domain) AS cnt FROM instances WHERE has_obfuscation = 1 GROUP BY software ORDER BY cnt DESC LIMIT ?", [amount]) elif mode == "obfuscation": - database.cursor.execute("SELECT has_obfuscation, COUNT(domain) AS cnt FROM instances WHERE software IN ('pleroma', 'mastodon', 'friendica') GROUP BY has_obfuscation ORDER BY cnt DESC LIMIT ?", [amount]) + database.cursor.execute("SELECT has_obfuscation, COUNT(domain) AS cnt FROM instances WHERE software IN ('pleroma', 'lemmy', 'mastodon', 'friendica') GROUP BY has_obfuscation ORDER BY cnt DESC LIMIT ?", [amount]) elif mode == "block_level": database.cursor.execute("SELECT block_level, COUNT(rowid) AS cnt FROM blocks GROUP BY block_level ORDER BY cnt DESC LIMIT ?", [amount]) else: diff --git a/fba/commands.py b/fba/commands.py index 04a959d..186619a 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1261,11 +1261,11 @@ def recheck_obfuscation(args: argparse.Namespace) -> int: locking.acquire() if isinstance(args.domain, str) and args.domain != "" and domain_helper.is_wanted(args.domain): - database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE has_obfuscation = 1 AND domain = ?", [args.domain]) + database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE (has_obfuscation = 1 OR has_obfuscation IS NULL) AND domain = ?", [args.domain]) elif isinstance(args.software, str) and args.software != "" and validators.domain(args.software) == args.software: - database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE has_obfuscation = 1 AND software = ?", [args.software]) + database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE (has_obfuscation = 1 OR has_obfuscation IS NULL) AND software = ?", [args.software]) else: - database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE has_obfuscation = 1") + database.cursor.execute("SELECT domain, software, nodeinfo_url FROM instances WHERE has_obfuscation = 1 OR has_obfuscation IS NULL") rows = database.cursor.fetchall() logger.info("Checking %d domains ...", len(rows)) -- 2.39.5