return 0
else:
logger.debug("source_domain='%s' has not been recently used, marking ...", source_domain)
- #sources.update(source_domain)
+ sources.update(source_domain)
logger.info("Fetching instances from source_domain='%s' ...", source_domain)
raw = utils.fetch_url(
logger.debug("block[blocked]='%s' has been recently checked - SKIPPED!", block["blocked"])
continue
- logger.info("Proccessing blocked='%s' ...", block["blocked"])
+ logger.debug("Proccessing blocked='%s' ...", block["blocked"])
processing.domain(block["blocked"], "climatejustice.social", inspect.currentframe().f_code.co_name)
blockdict = list()
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
+#logger.setLevel(logging.DEBUG)
# Don't check these, known trolls/flooders/testing/developing
_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",
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
+#logger.setLevel(logging.DEBUG)
# Found info from node, such as nodeinfo URL, detection mode that needs to be
# written to database. Both arrays must be filled at the same time or else
database.cursor.execute(f"SELECT {column} FROM instances WHERE domain = ? LIMIT 1", [domain])
# Fetch row
- fetched = database.cursor.fetchone()[column]
+ fetched = float(database.cursor.fetchone()[column])
+ diff = (time.time() - fetched)
- logger.debug("fetched[%s]='%s',key='%s'", type(fetched), fetched, key)
- recently = isinstance(fetched, float) and (time.time() - fetched) >= config.get(key)
+ logger.debug("fetched[%s]='%s',key='%s',diff=%f", type(fetched), fetched, key, diff)
+ recently = bool(diff < config.get(key))
logger.debug("recently='%s' - EXIT!", recently)
return recently
elif domain.lower() != domain:
wanted = False
elif not validators.domain(domain.split("/")[0]):
- logger.debug("domain='%s' is not a valid domain name - settings False ...", domain)
+ logger.debug("domain='%s' is not a valid domain name - setting False ...", domain)
wanted = False
elif domain.endswith(".arpa"):
- logger.debug("domain='%s' is a domain for reversed IP addresses - settings False ...", domain)
+ logger.debug("domain='%s' is a domain for reversed IP addresses - setting False ...", domain)
wanted = False
elif domain.endswith(".onion"):
- logger.debug("domain='%s' is a TOR .onion domain - settings False ...", domain)
+ logger.debug("domain='%s' is a TOR .onion domain - setting False ...", domain)
wanted = False
elif domain.endswith(".tld"):
- logger.debug("domain='%s' is a fake domain - settings False ...", domain)
+ logger.debug("domain='%s' is a fake domain - setting False ...", domain)
wanted = False
elif blacklist.is_blacklisted(domain):
- logger.debug("domain='%s' is blacklisted - settings False ...", domain)
+ logger.debug("domain='%s' is blacklisted - setting False ...", domain)
wanted = False
elif domain.find("/profile/") > 0 or domain.find("/users/") > 0 or (instances.is_registered(domain.split("/")[0]) and domain.find("/c/") > 0):
logger.debug("domain='%s' is a single user", domain)