# NOISY-DEBUG: print("DEBUG: Looking up instance by domain:", blocked)
if not fba.is_instance_registered(blocked):
- # NOISY-DEBUG: print("DEBUG: Domain wasn't found, adding:", blocked, blocker)
+ # NOISY-DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
fba.add_instance(blocked, blocker, origin, nodeinfo_url)
fba.cursor.execute(
elif blocked.count("*") > 1:
# same domain guess as above, but for reasons field
fba.cursor.execute(
- "SELECT domain FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [blocked.replace("*", "_")]
+ "SELECT domain, origin, nodeinfo_url FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [blocked.replace("*", "_")]
)
searchres = fba.cursor.fetchone()
if searchres != None:
blocked = searchres[0]
+ origin = searchres[1]
+ nodeinfo_url = searchres[2]
+
+ # NOISY-DEBUG: print("DEBUG: Looking up instance by domain:", blocked)
+ if not fba.is_instance_registered(blocked):
+ # NOISY-DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
+ fba.add_instance(blocked, blocker, origin, nodeinfo_url)
# NOISY-DEBUG: print("DEBUG: Updating block reason:", blocker, blocked, reason["reason"])
fba.update_block_reason(reason["reason"], blocker, blocked, block_level)
if fba.cursor.fetchone() == None:
# NOISY-DEBUG: print("DEBUG: Hash wasn't found, adding:", blocked, blocker)
- fba.add_instance(blocked, blocker, origin)
+ fba.add_instance(blocked, blocker, origin, nodeinfo_url)
else:
# Doing the hash search for instance names as well to tidy up DB
fba.cursor.execute(
- "SELECT domain FROM instances WHERE hash = ? LIMIT 1", [blocked_hash]
+ "SELECT domain, origin, nodeinfo_url FROM instances WHERE hash = ? LIMIT 1", [blocked_hash]
)
searchres = fba.cursor.fetchone()
if searchres != None:
# NOISY-DEBUG: print("DEBUG: Updating domain: ", searchres[0])
blocked = searchres[0]
+ origin = searchres[1]
+ nodeinfo_url = searchres[2]
+
+ # NOISY-DEBUG: print("DEBUG: Looking up instance by domain:", blocked)
+ if not fba.is_instance_registered(blocked):
+ # NOISY-DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
+ fba.add_instance(blocked, blocker, origin, nodeinfo_url)
fba.cursor.execute(
"SELECT * FROM blocks WHERE blocker = ? AND blocked = ? AND block_level = ? LIMIT 1",
if blocked == "":
print("WARNING: blocked is empty:", blocker)
continue
- if blocked.count("*") > 0:
+ elif blocked.count("*") > 0:
# Some friendica servers also obscure domains without hash
fba.cursor.execute(
- "SELECT domain FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [blocked.replace("*", "_")]
+ "SELECT domain, origin, nodeinfo_url FROM instances WHERE domain LIKE ? ORDER BY rowid LIMIT 1", [blocked.replace("*", "_")]
)
+
searchres = fba.cursor.fetchone()
+
if searchres != None:
blocked = searchres[0]
+ origin = searchres[1]
+ nodeinfo_url = searchres[2]
if blocked.count("?") > 0:
# Some obscure them with question marks, not sure if that's dependent on version or not
nodeinfo_url = searchres[2]
if not fba.is_instance_registered(blocked):
- # NOISY-DEBUG: print("DEBUG: Domain wasn't found, adding:", blocked, blocker)
+ # NOISY-DEBUG: print(f"DEBUG: Domain blocked='{blocked}' wasn't found, adding ..., blocker='{blocker}',origin='{origin}',nodeinfo_url='{nodeinfo_url}'")
fba.add_instance(blocked, blocker, origin, nodeinfo_url)
fba.cursor.execute(