logger.debug("status=%d - EXIT!", status)
return status
+def check_nodeinfo(args: argparse.Namespace) -> int:
+ logger.debug("args[]='%s' - CALLED!", type(args))
+
+ # Fetch rows
+ database.cursor.execute("SELECT domain, nodeinfo_url FROM instances WHERE nodeinfo_url IS NOT NULL ORDER BY domain ASC")
+
+ cnt = 0
+ for row in database.cursor.fetchall():
+ logger.debug("Checking row[domain]='%s',row[nodeinfo_url]='%s' ...", row["domain"], row["nodeinfo_url"])
+ punycode = row["domain"].encode("idna").decode("utf-8")
+
+ if row["nodeinfo_url"].startswith("/"):
+ logger.debug("row[nodeinfo_url]='%s' is a relative URL and always matches", row["nodeinfo_url"])
+ continue
+ elif row["nodeinfo_url"].find(punycode) == -1 and row["nodeinfo_url"].find(row["domain"]) == -1:
+ logger.warning("punycode='%s' is not found in row[nodeinfo_url]='%s'", punycode, row["nodeinfo_url"])
+ cnt = cnt + 1
+
+ logger.info("Found %d row(s)", cnt)
+
+ logger.debug("EXIT!")
+ return 0
+
def fetch_pixelfed_api(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))