From ec05e15ffd8d63c41c01f3fa342ca71a247f2409 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 22 Jun 2023 06:52:35 +0200 Subject: [PATCH] Continued: - don't check blacklist for (maybe) obsfucated domains, domain.is_domain_wanted() does this --- fba/networks/mastodon.py | 3 --- fba/networks/pleroma.py | 15 --------------- 2 files changed, 18 deletions(-) diff --git a/fba/networks/mastodon.py b/fba/networks/mastodon.py index 686ae9d..ad3e913 100644 --- a/fba/networks/mastodon.py +++ b/fba/networks/mastodon.py @@ -280,9 +280,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): if not utils.is_domain_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif not instances.is_registered(blocked): logger.debug(f"Domain blocked='%s' wasn't found, adding ..., domain='%s',origin='%s',nodeinfo_url='%s'", blocked, domain, origin, nodeinfo_url) instances.add(blocked, domain, inspect.currentframe().f_code.co_name, nodeinfo_url) diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index bfd41f6..390b01e 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -116,9 +116,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): elif blocked.endswith(".tld"): logger.debug("blocked='%s' is a fake domain - SKIPPED!", blocked) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif blocked.count("*") > 0: # Obscured domain name with no hash row = instances.deobscure("*", blocked) @@ -190,9 +187,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): elif blocked.endswith(".tld"): logger.debug("blocked='%s' is a fake domain - SKIPPED!", blocked) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif blocked.count("*") > 0: # Obscured domain name with no hash row = instances.deobscure("*", blocked) @@ -292,9 +286,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): if blocked == "": logger.warning("blocked is empty after tidyup.domain():", domain, block_level) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif blocked.count("*") > 0: # Obscured domain name with no hash row = instances.deobscure("*", blocked) @@ -361,9 +352,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): if blocked == "": logger.warning("blocked is empty after tidyup.domain():", domain, block_level) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif blocked.count("*") > 0: # Obscured domain name with no hash row = instances.deobscure("*", blocked) @@ -431,9 +419,6 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): if blocked == "": logger.warning("blocked is empty after tidyup.domain():", domain, block_level) continue - elif blacklist.is_blacklisted(blocked): - logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked) - continue elif blocked.count("*") > 0: # Obscured domain name with no hash row = instances.deobscure("*", blocked) -- 2.39.5