feat: add homelab topology documentation, docker deployments, and authentik sso configuration scripts
This commit is contained in:
21
scripts/check_ha_events.py
Normal file
21
scripts/check_ha_events.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import json
|
||||
import ssl
|
||||
import urllib.request
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
req = urllib.request.Request(
|
||||
'https://authentik.snarfnet.net/api/v3/events/events/?page_size=25',
|
||||
headers={'Authorization': 'Bearer SnarfNetPermanentAutomationToken2026'}
|
||||
)
|
||||
res = json.loads(urllib.request.urlopen(req, context=ctx).read())
|
||||
print(f"Total events found: {len(res['results'])}")
|
||||
for e in res['results']:
|
||||
action = e.get('action')
|
||||
app = e.get('app')
|
||||
user = e.get('user', {}).get('username')
|
||||
created = e.get('created')
|
||||
context = json.dumps(e.get('context', {}))
|
||||
print(f"{created} | {action:25} | app: {app:20} | user: {user} | {context[:120]}")
|
||||
Reference in New Issue
Block a user