1 # Fedi API Block - An aggregator for fetching blocking data from fediverse nodes
2 # Copyright (C) 2023 Free Software Foundation
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published
6 # by the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 from fba.helpers import domain as domain_helper
21 logging.basicConfig(level=logging.INFO)
22 logger = logging.getLogger(__name__)
23 #logger.setLevel(logging.DEBUG)
25 # Blocklists hosted by oliphant
26 oliphant_blocklists = (
28 "blocker": "artisan.chat",
29 "csv_url": "mastodon/artisan.chat.csv",
31 "blocker": "colorid.es",
32 "csv_url": "mastodon/colorid.es.csv",
34 "blocker": "indiepocalypse.social",
35 "csv_url": "mastodon/indiepocalypse.social.csv",
37 "blocker": "mastodon.art",
38 "csv_url": "mastodon/mastodon.art.csv",
40 "blocker": "pleroma.envs.net",
41 "csv_url": "mastodon/pleroma.envs.net.csv",
43 "blocker": "oliphant.social",
44 "csv_url": "mastodon/_unified_tier3_blocklist.csv",
46 "blocker": "mastodon.online",
47 "csv_url": "mastodon/mastodon.online.csv",
49 "blocker": "mastodon.social",
50 "csv_url": "mastodon/mastodon.social.csv",
52 "blocker": "mastodon.social",
53 "csv_url": "other/missing-tier0-mastodon.social.csv",
55 "blocker": "rage.love",
56 "csv_url": "mastodon/rage.love.csv",
58 "blocker": "sunny.garden",
59 "csv_url": "mastodon/sunny.garden.csv",
61 "blocker": "sunny.garden",
62 "csv_url": "mastodon/gardenfence.csv",
64 "blocker": "solarpunk.moe",
65 "csv_url": "mastodon/solarpunk.moe.csv",
67 "blocker": "toot.wales",
68 "csv_url": "mastodon/toot.wales.csv",
70 "blocker": "union.place",
71 "csv_url": "mastodon/union.place.csv",
73 "blocker": "oliphant.social",
74 "csv_url": "mastodon/birdsite.csv",
81 "blocker": "seirdy.one",
82 "url" : "https://seirdy.one/pb/bsl.txt",
84 "blocker": "seirdy.one",
85 "url" : "https://seirdy.one/pb/FediNuke.txt",
87 "blocker": "seirdy.one",
88 "url" : "https://seirdy.one/pb/spammy-subdomains.txt",
95 "blocker": "tooters.org",
96 "csv_url": "https://raw.githubusercontent.com/victorwynne/victorwynne/tooters/federation/tooters_defederations.csv",
98 "blocker": "pleroma.envs.net",
99 "csv_url": "https://seirdy.one/pb/pleroma.envs.net.csv",
103 def has(domain: str) -> bool:
104 logger.debug("domain='%s' - CALLED!")
105 domain_helper.raise_on(domain)
107 # Default is not found
109 for row in oliphant_blocklists + csv_files:
110 logger.debug("row[blocker]='%s',domain='%s'", row["blocker"], domain)
111 if row["blocker"] == domain:
113 logger.debug("domain='%s' is found and excluded from regular fetch_blocks command - BREAK!", domain)
116 logger.debug("found='%s' - EXIT!", found)