feat: add infrastructure diagnostic and monitoring scripts

This commit is contained in:
2026-11-06 23:12:35 -05:00
parent d5c2f6eae5
commit 0ed293b6ea
22 changed files with 320 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
import urllib.request
import ssl
import json
import sys
sys.stdout.reconfigure(encoding='utf-8')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
AK_BASE = "https://authentik.snarfnet.net"
AK_TOKEN = "SnarfNetPermanentAutomationToken2026"
headers = {
"Authorization": f"Bearer {AK_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json"
}
req = urllib.request.Request(f"{AK_BASE}/api/v3/providers/oauth2/", headers=headers)
with urllib.request.urlopen(req, timeout=10, context=ctx) as r:
data = json.loads(r.read().decode())
for p in data.get("results", []):
if "home" in p.get("name", "").lower() or "assistant" in p.get("name", "").lower():
print("Home Assistant Provider:")
print(json.dumps(p, indent=2))
req2 = urllib.request.Request(f"{AK_BASE}/api/v3/providers/proxy/", headers=headers)
with urllib.request.urlopen(req2, timeout=10, context=ctx) as r:
data = json.loads(r.read().decode())
for p in data.get("results", []):
if "home" in p.get("name", "").lower() or "snarfhome" in str(p).lower():
print("Proxy Provider:")
print(json.dumps(p, indent=2))