feat: add diagnostic and management scripts for DNS, NPM, and cluster infrastructure

This commit is contained in:
2026-11-06 19:08:19 -05:00
parent 8e1c5f1e66
commit d5c2f6eae5
19 changed files with 559 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
import urllib.request
import urllib.parse
import ssl
import json
import http.client
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
def do_req(ip, host_header, path):
conn = http.client.HTTPSConnection(ip, 443, context=ctx, timeout=8)
conn.request("GET", path, headers={"Host": host_header})
resp = conn.getresponse()
data = resp.read().decode('utf-8')
conn.close()
return json.loads(data)
token = do_req("140.44.4.62", "dns2.snarfnet.net", "/api/user/login?user=admin&pass=snarfnetadmin&includeInfo=true")['token']
zone_data = do_req("140.44.4.62", "dns2.snarfnet.net", f"/api/zones/records/get?token={token}&zone=snarfnet.net&domain=pihole1.snarfnet.net")
print("pihole1 records on dns2:\n", zone_data)