]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/blocklists.py
Continued:
[fba.git] / fba / helpers / blocklists.py
index 309f8a68ea5be4057c12ea9a063ba544d77d4aed..795fb252118325a962167ac81ba5248430de17d1 100644 (file)
@@ -22,7 +22,7 @@ logging.basicConfig(level=logging.INFO)
 logger = logging.getLogger(__name__)
 #logger.setLevel(logging.DEBUG)
 
-# URLs to fetch
+# Blocklists hosted by oliphant
 oliphant_blocklists = (
     {
         "blocker": "artisan.chat",
@@ -72,21 +72,41 @@ oliphant_blocklists = (
     },{
         "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