From e7dbafd550c9011fde24e3f390447266e80dd0c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 23 May 2023 08:18:51 +0200 Subject: [PATCH] Continued: - added detection_mode and nodeinfo_url to table 'instances' - described arrays --- blocks_empty.db | Bin 28672 -> 28672 bytes fba.py | 63 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/blocks_empty.db b/blocks_empty.db index 0832008ed05aaa9e89c0d6b540f1e8db3b2bd13c..dea0936df1a595e52b68e81b1a68d3ecb118e8f1 100644 GIT binary patch delta 596 zcmZp8z}WDBae}nq2L=WPb|7X0Vn!g=ny6ze`GG;tdm=Bt4g)LqO$NSZ-gn$L`RDSx za&Fw%XvxXKuft-yu~CIdsYQsFU0hzCvAwt?F)1fCGY?4TC8rj{8SIl8c{J@6{QN@{ z{6c+vbhtQ`G7^h3lsH3NBY;9k!o~S%CFO}lsZc2wS2xE{ABe8WUOZCu3dkZLb8-@k zOX7j{m6R68C+DXCHG2AmxVpOrVON=ylb@WOnu1$ZeorgDL2igcx zkyw&ngi94rQCemZ$X%(aK%?+FsI(v@u>_xkz#dF3D#|a4Pf4vWNzBYC#u7N7ph!tA zNlh-v%+HI@1qVc!W013lV~~cafhI~|aOo)I0TpECrRB$$7Ud|w)EOB76@uaiMYU$5 z5DUAwy(D8}WM!SN=r?0szy& BslosN delta 381 zcmZp8z}WDBae}nqTLuOOb|_{9(#jKcj3wVP=y^}%<=0_g<-X6r*UbBl`#x_suQ5;g zW0@+lUQ65pO>EkG$buwiPO_B#MRw3XmS^iY(1Bb0$4UFCqFqmHAMj` zr=yTxl$oBHrx4=l7YQ<0!O<PKQ}Qm4 list: if res.ok and res.json() is not None: # NOISY-DEBUG: print("DEBUG: Success:", request) json = res.json() + nodeinfos["detection_mode"][domain] = "STATIC_CHECK" + nodeinfos["nodeinfo_url"][domain] = request break elif not res.ok or res.status_code >= 400: print("WARNING: Failed fetching nodeinfo from domain:", domain) @@ -213,13 +262,15 @@ def fetch_wellknown_nodeinfo(domain: str) -> list: # NOISY-DEBUG: print("DEBUG: Found links in nodeinfo():", len(nodeinfo["links"])) for link in nodeinfo["links"]: # NOISY-DEBUG: print("DEBUG: rel,href:", link["rel"], link["href"]) - if link["rel"] in nodeinfos: + if link["rel"] in nodeinfo_identifier: # NOISY-DEBUG: print("DEBUG: Fetching nodeinfo from:", link["href"]) res = reqto.get(link["href"]) # NOISY-DEBUG: print("DEBUG: href,res.ok,res.status_code:", link["href"], res.ok, res.status_code) if res.ok and res.json() is not None: # NOISY-DEBUG: print("DEBUG: Found JSON nodeinfo():", len(res.json())) json = res.json() + nodeinfos["detection_mode"][domain] = "AUTO_DISCOVERY" + nodeinfos["nodeinfo_url"][domain] = link["href"] break else: print("WARNING: Unknown 'rel' value:", domain, link["rel"]) @@ -381,8 +432,12 @@ def add_instance(domain: str, origin: str, originator: str): ), ) + if domain in nodeinfos["nodeinfo_url"]: + # NOISY-DEBUG print("DEBUG: domain has pending nodeinfo being updated:", domain) + update_nodeinfos(domain) + if domain in pending_errors: - # NOISY-DEBUG: print("DEBUG: domain has pending error be updated:", domain) + # NOISY-DEBUG: print("DEBUG: domain has pending error being updated:", domain) update_last_error(domain, pending_errors[domain]) del pending_errors[domain] -- 2.39.5