feat: ssh auth, protocol management, and cleanup

This commit is contained in:
infosave2007
2026-01-23 17:55:40 +03:00
parent 4995147bad
commit ea82b78a7d
70 changed files with 16225 additions and 986 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
PANEL_URL="${PANEL_URL:-http://localhost:8082}"
EMAIL="${EMAIL:-admin@amnez.ia}"
PASSWORD="${PASSWORD:-admin123}"
TOKEN_JSON=$(curl -sS -X POST "$PANEL_URL/api/auth/token" -d "email=$EMAIL&password=$PASSWORD")
TOKEN=$(printf '%s' "$TOKEN_JSON" | python3 -c 'import sys,json; print(json.load(sys.stdin).get("token",""))')
if [[ -z "${TOKEN:-}" ]]; then
echo "ERROR: token empty" >&2
printf '%s' "$TOKEN_JSON" | head -c 200 >&2
echo >&2
exit 3
fi
curl -fsS "$PANEL_URL/api/clients" -H "Authorization: Bearer $TOKEN" | \
python3 -c 'import sys,json; j=json.load(sys.stdin); cs=j.get("clients",[]);
print("id\tname\tprotocol\tserver_id")
for c in cs:
print(f"{c.get("id")}\t{c.get("name")}\t{c.get("protocol")}\t{c.get("server_id")}")'