import argparse
import atoma
import bs4
+import inspect
import itertools
import json
import re
print(f"INFO: Adding {len(domains)} new instances ...")
for domain in domains:
print(f"INFO: Fetching instances from domain='{domain}' ...")
- fba.fetch_instances(domain, None, None, __name__)
+ fba.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name)
# DEBUG: print("DEBUG: EXIT!")
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
if not fba.is_instance_blocked(blocker, blocked, block_level):
# DEBUG: print("DEBUG: Blocking:", blocker, blocked, block_level)
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
# DEBUG: print("DEBUG: Updating block reason:", blocker, blocked, reason["reason"])
fba.update_block_reason(reason["reason"], blocker, blocked, block_level)
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
elif not validators.domain(blocked):
print(f"WARNING: blocked='{blocked}',software='{software}' is not a valid domain name - skipped!")
continue
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print("DEBUG: Hash wasn't found, adding:", blocked, blocker)
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
blocking = blocked if blocked.count("*") <= 1 else blocked_hash
# DEBUG: print(f"DEBUG: blocking='{blocking}',blocked='{blocked}',blocked_hash='{blocked_hash}'")
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print("DEBUG: Hash wasn't found, adding:", blocked, blocker)
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
if not fba.is_instance_blocked(blocker, blocked, block_level):
fba.block_instance(blocker, blocked, reason, block_level)
continue
elif not fba.is_instance_registered(blocked):
# DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
- fba.add_instance(blocked, blocker, __name__, nodeinfo_url)
+ fba.add_instance(blocked, blocker, inspect.currentframe().f_code.co_name, nodeinfo_url)
if not fba.is_instance_blocked(blocker, blocked, "reject"):
# DEBUG: print(f"DEBUG: blocker='{blocker}' is blocking '{blocked}' for unknown reason at this point")
# DEBUG: print(f"DEBUG: row='{row}'")
if not fba.is_instance_registered(row["domain"]):
print(f"INFO: Fetching instances from domain='{row['domain']}' ...")
- fba.fetch_instances(row["domain"], None, None, __name__)
+ fba.fetch_instances(row["domain"], None, None, inspect.currentframe().f_code.co_name)
if not fba.is_instance_blocked('chaos.social', row["domain"], block_level):
# DEBUG: print(f"DEBUG: domain='{row['domain']}',block_level='{block_level}' blocked by chaos.social, adding ...")
print(f"INFO: Adding {len(domains)} new instances ...")
for domain in domains:
print(f"INFO: Fetching instances from domain='{domain}' ...")
- fba.fetch_instances(domain, None, None, __name__)
+ fba.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name)
# DEBUG: print("DEBUG: EXIT!")
print(f"INFO: Adding {len(domains)} new instances ...")
for domain in domains:
print(f"INFO: Fetching instances from domain='{domain}' ...")
- fba.fetch_instances(domain, None, None, __name__)
+ fba.fetch_instances(domain, None, None, inspect.currentframe().f_code.co_name)
# DEBUG: print("DEBUG: EXIT!")
boot.acquire_lock()
# Initial fetch
- fba.fetch_instances(args.domain, None, None, __name__)
+ fba.fetch_instances(args.domain, None, None, inspect.currentframe().f_code.co_name)
if args.single:
# DEBUG: print(f"DEBUG: Not fetching more instances - EXIT!")
continue
print(f"INFO: Fetching instances for instance '{row[0]}' ('{row[2]}') of origin='{row[1]}',nodeinfo_url='{row[3]}'")
- fba.fetch_instances(row[0], row[1], row[2], __name__, row[3])
+ fba.fetch_instances(row[0], row[1], row[2], inspect.currentframe().f_code.co_name, row[3])
# DEBUG: print("DEBUG: EXIT!")