logger = logging.getLogger(__name__)
#logger.setLevel(logging.DEBUG)
-# URLs to fetch
+# Blocklists hosted by oliphant
oliphant_blocklists = (
{
"blocker": "artisan.chat",
},{
"blocker": "oliphant.social",
"csv_url": "mastodon/birdsite.csv",
+ },
+)
+
+# Static URLs
+txt_files = ({
+ "blocker": "seirdy.one",
+ "url" : "https://seirdy.one/pb/bsl.txt",
+},{
+ "blocker": "seirdy.one",
+ "url" : "https://seirdy.one/pb/FediNuke.txt",
+})
+
+# Other CSV files
+csv_files = (
+ {
+ "blocker": "tooters.org",
+ "csv_url": "https://raw.githubusercontent.com/victorwynne/victorwynne/tooters/federation/tooters_defederations.csv",
+ },{
+ "blocker": "pleroma.envs.net",
+ "csv_url": "https://seirdy.one/pb/pleroma.envs.net.csv",
}
)
-def is_excluded(domain: str) -> bool:
+def has(domain: str) -> bool:
logger.debug("domain='%s' - CALLED!")
domain_helper.raise_on(domain)
- # Default is not excluded
- excluded = False
- for row in oliphant_blocklists:
+ # Default is not found
+ found = False
+ for row in oliphant_blocklists + csv_files:
logger.debug("row[blocker]='%s',domain='%s'", row["blocker"], domain)
if row["blocker"] == domain:
- excluded = True
- logger.debug("domain='%s' is excluded from regular fetch_blocks command - BREAK!", domain)
+ found = True
+ logger.debug("domain='%s' is found and excluded from regular fetch_blocks command - BREAK!", domain)
break
- logger.debug("excluded='%s' - EXIT!")
- return excluded
+ logger.debug("found='%s' - EXIT!", found)
+ return found