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)
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",
78 def is_excluded(domain: str) -> bool:
79 logger.debug("domain='%s' - CALLED!")
80 domain_helper.raise_on(domain)
82 # Default is not excluded
84 for row in oliphant_blocklists:
85 logger.debug("row[blocker]='%s',domain='%s'", row["blocker"], domain)
86 if row["blocker"] == domain:
88 logger.debug("domain='%s' is excluded from regular fetch_blocks command - BREAK!", domain)
91 logger.debug("excluded='%s' - EXIT!")