feat: add automation scripts for NAS fixes, Authentik monitoring, and Technitium DNS management

This commit is contained in:
2026-11-06 18:49:24 -05:00
parent 1965d37687
commit 8e1c5f1e66
22 changed files with 675 additions and 17 deletions

View File

@@ -0,0 +1,35 @@
import urllib.request
import ssl
import json
import urllib.parse
import sys
sys.stdout.reconfigure(encoding='utf-8')
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
def get_token(host):
url = f"https://{host}/api/user/login?user=admin&pass=snarfnetadmin&includeInfo=true"
with urllib.request.urlopen(urllib.request.Request(url), context=ctx, timeout=8) as resp:
return json.loads(resp.read().decode())['token']
token = get_token("dns1.snarfnet.net")
# Test adding an A record
params = {
"token": token,
"domain": "test.snarfnet.net",
"zone": "snarfnet.net",
"type": "A",
"ipAddress": "140.44.4.11",
"ptr": "true",
"createPtrZone": "true"
}
url = f"https://dns1.snarfnet.net/api/zones/records/add?{urllib.parse.urlencode(params)}"
try:
with urllib.request.urlopen(urllib.request.Request(url), context=ctx, timeout=8) as resp:
print("Add record response:", json.loads(resp.read().decode()))
except urllib.error.HTTPError as e:
print("HTTPError:", e.code, e.read().decode())