logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
+#logger.setLevel(logging.DEBUG)
# Don't check these, known trolls/flooders/testing/developing
-blacklist = [
- # Floods federation with fake nodes as "research" project
- "activitypub-troll.cf",
- "activitypub-proxy.cf",
- # Similar troll
- "gab.best",
- # Similar troll
- "4chan.icu",
- # Flooder (?)
- "social.shrimpcam.pw",
- "mastotroll.netz.org",
- "lhr.life",
- "localhost.run",
- # Testing/developing installations
- "ngrok.io",
- "ngrok-free.app",
- "misskeytest.chn.moe",
- "netlify.app",
- # block flooder
- "everyoneattack.com",
-]
+_blacklist = {
+ "activitypub-troll.cf": "Floods federation with fake nodes as \"research\" project",
+ "activitypub-proxy.cf": "Floods federation with fake nodes as \"research\" project",
+ "misskey-forkbomb.cf" : "Floods federation tables with fake nodes",
+ "gab.best" : "Floods federation tables with fake nodes",
+ "4chan.icu" : "Floods federation tables with fake nodes",
+ "social.shrimpcam.pw" : "Floods federation tables with fake nodes",
+ "mastotroll.netz.org" : "Floods federation tables with fake nodes",
+ "lhr.life" : "Floods federation tables with fake nodes",
+ "localhost.run" : "Floods federation tables with fake nodes",
+ "loca.lt" : "Floods federation tables with fake nodes",
+ "grid.tf" : "Floods federation tables with fake nodes",
+ "gitpod.io" : "Floods federation tables with fake nodes",
+ "everyoneattack.com" : "Floods federation tables with fake nodes",
+ "vercel.app" : "Floods federation tables with fake nodes",
+ "run.app" : "Floods federation tables with fake nodes",
+ "sutty.nl" : "Floods federation tables with fake nodes",
+ "mdrqnxtagon.pw" : "Floods federation tables with fake nodes",
+ "denden.world" : "Looks like a valid Mastodon instance, but return exactly (!) 5k instances with trash domains",
+ "fnaf.stream" : "Trolls with over-long sub-domain name(s)",
+ "ngrok.io" : "Testing/developing instances shouldn't be part of public instances",
+ "ngrok.app" : "Testing/developing instances shouldn't be part of public instances",
+ "ngrok-free.app" : "Testing/developing instances shouldn't be part of public instances",
+ "misskeytest.chn.moe" : "Testing/developing instances shouldn't be part of public instances",
+ "netlify.app" : "Testing/developing instances shouldn't be part of public instances",
+ "ignorelist.com" : "Testing/developing instances shouldn't be part of public instances",
+ "app.github.dev" : "Testing/developing instances shouldn't be part of public instances",
+ "tunnel.silicon.moe" : "Testing/developing instances shouldn't be part of public instances",
+ "7988276.xyz" : "Testing/developing instances shouldn't be part of public instances",
+ "hexbear.net" : "Is a Lemmy instance with malicious JavaScript code (shell commands)",
+ "mastodon.n41.lat" : "Somehow this instance repeatedly causes an OOM here",
+ "fb.me" : "Facebook websites are never Fediverse instances",
+ "osl.academy" : "Parked domain, no fediverse instance",
+ "icolectiva.org" : "Parked domain, no fediverse instance",
+ "blombus.com" : "Parked domain, no fediverse instance",
+ "eliotberriot.com" : "Parked domain, no fediverse instance",
+ "fsam.one" : "Parked domain, no fediverse instance",
+ "doot.tv" : "Parked domain, no fediverse instance",
+ "snet.blog" : "Parked domain, no fediverse instance",
+ "horserock.xyz" : "Parked domain, no fediverse instance",
+ "free-pic.org" : "Parked domain, no fediverse instance",
+ "co-mastdn.ga" : "Parked domain, no fediverse instance",
+ "chocoflan.net" : "Parked domain, no fediverse instance",
+ "singleuser.club" : "Parked domain, no fediverse instance",
+ "qwest.net" : "Dynamic IP address hosts should not be used for fediverse instances",
+ "github.io" : "GITHub's 'pages' service won't contain any fediverse instance",
+ "github.com" : "GIT repository hosting service",
+}
def is_blacklisted(domain: str) -> bool:
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
blacklisted = False
- logger.debug("Checking %d blacklist entries ...", len(blacklist))
- for peer in blacklist:
- logger.debug("Checking peer='%s' ...", peer)
- if peer in domain:
+ logger.debug("Checking %d blacklist entries ...", len(_blacklist))
+ for blocked in _blacklist:
+ logger.debug("Checking blocked='%s' ...", blocked)
+ if blocked in domain:
logger.debug("domain='%s' is blacklisted.", domain)
blacklisted = True
+ break
logger.debug("blacklisted='%s' - EXIT!", blacklisted)
return blacklisted
+
+def get_all() -> dict:
+ logger.debug("_blacklist()=%d - CALLED!", len(_blacklist))
+ return _blacklist