feat: add infrastructure audit and diagnostic helper scripts
This commit is contained in:
34
scripts/inspect_proxy_providers.py
Normal file
34
scripts/inspect_proxy_providers.py
Normal file
@@ -0,0 +1,34 @@
|
||||
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
|
||||
|
||||
token = "SnarfNetPermanentAutomationToken2026"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
def api_call(url):
|
||||
req = urllib.request.Request(url, headers=headers)
|
||||
with urllib.request.urlopen(req, context=ctx, timeout=8) as resp:
|
||||
return json.loads(resp.read().decode('utf-8'))
|
||||
|
||||
print("=== Provider 24 (pihole1) ===")
|
||||
p24 = api_call("https://authentik.snarfnet.net/api/v3/providers/proxy/24/")
|
||||
print(json.dumps(p24, indent=2))
|
||||
|
||||
print("\n=== Provider 12 (pihole2) ===")
|
||||
p12 = api_call("https://authentik.snarfnet.net/api/v3/providers/proxy/12/")
|
||||
print(json.dumps(p12, indent=2))
|
||||
|
||||
print("\n=== Outposts ===")
|
||||
outposts = api_call("https://authentik.snarfnet.net/api/v3/outposts/instances/")
|
||||
print(json.dumps(outposts, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user