Files
SnarfCode/scripts/check_authentik_apps_full.py

32 lines
1.1 KiB
Python

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"
}
req = urllib.request.Request("https://authentik.snarfnet.net/api/v3/core/applications/?page_size=100", headers=headers)
with urllib.request.urlopen(req, context=ctx) as resp:
data = json.loads(resp.read().decode())
print(f"Total Applications: {len(data['results'])}")
for app in sorted(data['results'], key=lambda x: x['name']):
slug = app['slug']
if any(k in slug for k in ['dns', 'pihole', 'technitium', 'syno', 'nas', 'semaphore']):
print(f"- Name: {app['name']}")
print(f" Slug: {app['slug']}")
print(f" Group: {app.get('group')}")
print(f" Launch URL: {app.get('meta_launch_url')}")
print(f" Icon: {app.get('meta_icon')}")
print()