if block["blocked"] in [None, ""]:
logger.debug("block[blocked]='%s' is empty - SKIPPED!", block["blocked"])
continue
+ elif not validators.domain(block["blocked"]):
+ logger.warning("block[blocked]='%s' is not a valid domain - SKIPPED!", block["blocked"])
+ continue
+ elif block["blocked"].endswith(".onion"):
+ logger.debug("block[blocked]'%s' is a TOR .onion domain - SKIPPED", block["blocked"])
+ continue
+ elif block["blocked"].endswith(".i2p") and not config.get("allow_i2p_domain"):
+ logger.debug("block[blocked]'%s' is an I2P .onion domain - SKIPPED", block["blocked"])
+ continue
+ elif block["blocked"].endswith(".arpa"):
+ logger.debug("block[blocked]'%s' is a reverse IP address - SKIPPED", block["blocked"])
+ continue
+ elif block["blocked"].endswith(".tld"):
+ logger.debug("block[blocked]'%s' is a fake domain - SKIPPED", block["blocked"])
+ continue
logger.debug("block[blocked]='%s' - BEFORE!", block["blocked"])
block["blocked"] = domain_helper.encode_idna(block["blocked"])
logger.debug("block[blocked]='%s' is accepted, not wanted here - SKIPPED!", block["blocked"])
continue
elif not instances.is_registered(block["blocked"]):
- logger.debug("Hash wasn't found, adding: blocked='%s',blocker='%s'", block["blocked"], blocker)
+ logger.debug("Hash wasn't found, adding: block[blocked]'%s',blocker='%s'", block["blocked"], blocker)
federation.fetch_instances(block["blocked"], blocker, None, inspect.currentframe().f_code.co_name)
block["block_level"] = blocks.alias_block_level(block["block_level"])
if processing.block(blocker, block["blocked"], block["reason"], block["block_level"]) and block["block_level"] in ["reject", "suspend"] and config.get("bot_enabled"):
- logger.debug("Appending blocked='%s',reason='%s' for blocker='%s' ...", block["blocked"], block["block_level"], blocker)
+ logger.debug("Appending block[blocked]'%s',reason='%s' for blocker='%s' ...", block["blocked"], block["block_level"], blocker)
blockdict.append({
"blocked": block["blocked"],
"reason" : block["reason"],