"rss_limit" : 50,
"api_limit" : 500,
"theme" : "light",
+ "allow_i2p_domain" : "false",
"instances_social_api_key": "",
"max_crawl_depth" : 2000,
"min_peers_length" : 1000
elif block["blocked"].endswith(".onion"):
logger.debug("blocked='%s' is a TOR .onion domain - SKIPPED", block["blocked"])
continue
+ elif block["blocked"].endswith(".i2p") and config.get("allow_i2p_domain"):
+ logger.debug("blocked='%s' is an I2P .onion domain - SKIPPED", block["blocked"])
+ continue
elif block["blocked"].endswith(".arpa"):
logger.debug("blocked='%s' is a reverse IP address - SKIPPED", block["blocked"])
continue
if block["blocked"] == "":
logger.debug("block[blocked] is empty - SKIPPED!")
continue
+ elif block["blocked"].endswith(".onion"):
+ logger.debug("blocked='%s' is a TOR onion domain name - SKIPPED!", block["blocked"])
+ continue
+ elif block["blocked"].endswith(".i2p") and config.get("allow_i2p_domain"):
+ logger.debug("blocked='%s' is an I2P onion domain name - SKIPPED!", block["blocked"])
+ continue
elif block["blocked"].endswith(".arpa"):
logger.debug("blocked='%s' is a reversed IP address - SKIPPED!", block["blocked"])
continue
elif block["blocked"].endswith(".tld"):
logger.debug("blocked='%s' is a fake domain name - SKIPPED!", block["blocked"])
continue
- elif block["blocked"].endswith(".onion"):
- logger.debug("blocked='%s' is a TOR onion domain name - SKIPPED!", block["blocked"])
- continue
elif block["blocked"].find("*") >= 0 or block["blocked"].find("?") >= 0:
logger.debug("block='%s' is obfuscated.", block["blocked"])
obfuscated = obfuscated + 1
import validators
from fba.helpers import blacklist
+from fba.helpers import config
from fba.models import instances
raise ValueError(f"Parameter domain='{domain}' must be all lower-case")
elif not validators.domain(domain.split("/")[0]):
raise ValueError(f"domain='{domain}' is not a valid domain")
- elif domain.endswith(".arpa"):
- raise ValueError(f"domain='{domain}' is a domain for reversed IP addresses, please don't crawl them!")
elif domain.endswith(".onion"):
raise ValueError(f"domain='{domain}' is a TOR, please don't crawl them!")
+ elif domain.endswith(".i2p") and config.get("allow_i2p_domain"):
+ raise ValueError(f"domain='{domain}' is an I2P, please don't crawl them!")
+ elif domain.endswith(".arpa"):
+ raise ValueError(f"domain='{domain}' is a domain for reversed IP addresses, please don't crawl them!")
elif domain.endswith(".tld"):
raise ValueError(f"domain='{domain}' is a fake domain, please don't crawl them!")
wanted = True
if domain.lower() != domain:
+ logger.debug("domain='%s' is not all-lowercase - setting False ...", domain)
wanted = False
elif not validators.domain(domain.split("/")[0]):
logger.debug("domain='%s' is not a valid domain name - setting False ...", domain)
elif domain.endswith(".onion"):
logger.debug("domain='%s' is a TOR .onion domain - setting False ...", domain)
wanted = False
+ elif domain.endswith(".i2p") and config.get("allow_i2p_domain"):
+ logger.debug("domain='%s' is an I2P domain - setting False ...", domain)
+ wanted = False
elif domain.endswith(".tld"):
logger.debug("domain='%s' is a fake domain - setting False ...", domain)
wanted = False
elif domain.endswith(".onion"):
logger.debug("domain='%s' is a TOR .onion domain - SKIPPED", domain)
continue
+ elif domain.endswith(".i2p") and config.get("allow_i2p_domain"):
+ logger.debug("domain='%s' is an I2P .onion domain - SKIPPED", domain)
+ continue
elif domain.endswith(".arpa"):
logger.debug("domain='%s' is a reverse IP address - SKIPPED", domain)
continue