refactor: simplify auth and subscription links
This commit is contained in:
@@ -36,24 +36,24 @@ curl -s -H "$H" "$BASE/api/sources" | python3 -c "import sys,json; d=json.load(s
|
||||
|
||||
echo ""
|
||||
echo "=== 6. 下载本地源 — mihomo ==="
|
||||
curl -s "$BASE/download/source/local-vless/mihomo?token=$DL" | head -30
|
||||
curl -s "$BASE/sources/local-vless/$DL?target=mihomo" | head -30
|
||||
|
||||
echo ""
|
||||
echo "=== 7. 下载本地源 — JSON ==="
|
||||
curl -s "$BASE/download/source/local-vless/json?token=$DL" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'proxies={len(d.get(\"proxies\",[]))}'); [print(f' {p.get(\"name\")} ({p.get(\"type\")}) -> {p.get(\"server\")}:{p.get(\"port\")}') for p in d.get('proxies',[])]"
|
||||
curl -s "$BASE/sources/local-vless/$DL?target=json" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'proxies={len(d.get(\"proxies\",[]))}'); [print(f' {p.get(\"name\")} ({p.get(\"type\")}) -> {p.get(\"server\")}:{p.get(\"port\")}') for p in d.get('proxies',[])]"
|
||||
|
||||
echo ""
|
||||
echo "=== 8. 下载本地源 — sing-box ==="
|
||||
curl -s "$BASE/download/source/local-vless/sing-box?token=$DL" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'outbounds={len(d.get(\"outbounds\",[]))}'); [print(f' {o.get(\"tag\",\"?\")} ({o.get(\"type\",\"?\")})') for o in d.get('outbounds',[])]"
|
||||
curl -s "$BASE/sources/local-vless/$DL?target=sing-box" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'outbounds={len(d.get(\"outbounds\",[]))}'); [print(f' {o.get(\"tag\",\"?\")} ({o.get(\"type\",\"?\")})') for o in d.get('outbounds',[])]"
|
||||
|
||||
echo ""
|
||||
echo "=== 9. 下载本地源 — URI ==="
|
||||
curl -s "$BASE/download/source/local-vless/uri?token=$DL"
|
||||
curl -s "$BASE/sources/local-vless/$DL?target=uri"
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "=== 10. 下载本地源 — surge ==="
|
||||
curl -s "$BASE/download/source/local-vless/surge?token=$DL" | head -10
|
||||
curl -s "$BASE/sources/local-vless/$DL?target=surge" | head -10
|
||||
|
||||
echo ""
|
||||
echo "=== 11. 创建集合 (local-vless + remote-sslinks) ==="
|
||||
@@ -63,7 +63,7 @@ curl -s -X POST -H "$H" -H "$CT" \
|
||||
|
||||
echo ""
|
||||
echo "=== 12. 下载集合 — mihomo ==="
|
||||
curl -s "$BASE/download/collection/mixed-collection/mihomo?token=$DL" | head -40
|
||||
curl -s "$BASE/collections/mixed-collection/$DL?target=mihomo" | head -40
|
||||
|
||||
echo ""
|
||||
echo "=== 13. 远程源预览 — remote-sslinks ==="
|
||||
@@ -73,15 +73,15 @@ curl -s -X POST -H "$H" -H "$CT" \
|
||||
|
||||
echo ""
|
||||
echo "=== 14. 远程源下载 — remote-sslinks mihomo ==="
|
||||
curl -s "$BASE/download/source/remote-sslinks/mihomo?token=$DL" 2>&1 | head -30
|
||||
curl -s "$BASE/sources/remote-sslinks/$DL?target=mihomo" 2>&1 | head -30
|
||||
|
||||
echo ""
|
||||
echo "=== 15. 远程源下载 — remote-smallstrawberry mihomo ==="
|
||||
curl -s "$BASE/download/source/remote-smallstrawberry/mihomo?token=$DL" 2>&1 | head -30
|
||||
curl -s "$BASE/sources/remote-smallstrawberry/$DL?target=mihomo" 2>&1 | head -30
|
||||
|
||||
echo ""
|
||||
echo "=== 16. 远程源下载 — remote-aisaka mihomo ==="
|
||||
curl -s "$BASE/download/source/remote-aisaka/mihomo?token=$DL" 2>&1 | head -30
|
||||
curl -s "$BASE/sources/remote-aisaka/$DL?target=mihomo" 2>&1 | head -30
|
||||
|
||||
echo ""
|
||||
echo "=== ALL TESTS DONE ==="
|
||||
|
||||
+6
-16
@@ -38,15 +38,15 @@ curl -s -H "Authorization: Bearer $ADMIN" "$BASE/api/templates" | python3 -c "im
|
||||
|
||||
echo ""
|
||||
echo "=== 8. DOWNLOAD SOURCE (mihomo) ==="
|
||||
curl -s "$BASE/download/source/test-source?token=$DL" | head -20
|
||||
curl -s "$BASE/sources/test-source/$DL" | head -20
|
||||
|
||||
echo ""
|
||||
echo "=== 9. DOWNLOAD SOURCE (json) ==="
|
||||
curl -s "$BASE/download/source/test-source/json?token=$DL" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'proxies count={len(d.get(\"proxies\",[]))}')"
|
||||
curl -s "$BASE/sources/test-source/$DL?target=json" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'proxies count={len(d.get(\"proxies\",[]))}')"
|
||||
|
||||
echo ""
|
||||
echo "=== 10. DOWNLOAD COLLECTION (mihomo) ==="
|
||||
curl -s "$BASE/download/collection/test-collection?token=$DL" | head -20
|
||||
curl -s "$BASE/collections/test-collection/$DL" | head -20
|
||||
|
||||
echo ""
|
||||
echo "=== 11. PREVIEW SOURCE ==="
|
||||
@@ -67,25 +67,15 @@ curl -s -X POST -H "Authorization: Bearer $ADMIN" -H "Content-Type: application/
|
||||
"$BASE/api/rule/parse" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'status={d[\"status\"]}, parsed={d[\"data\"].get(\"parsed\")}, emitted={d[\"data\"].get(\"emitted\")}') if d['status']=='success' else print(f'error: {d}')"
|
||||
|
||||
echo ""
|
||||
echo "=== 14. CREATE SHARE ==="
|
||||
curl -s -X POST -H "Authorization: Bearer $ADMIN" -H "Content-Type: application/json" \
|
||||
-d '{"resourceType":"source","resourceId":"test-source","target":"mihomo"}' \
|
||||
"$BASE/api/shares" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'status={d[\"status\"]}, id={d[\"data\"].get(\"id\")}, url={d[\"data\"].get(\"url\",\"\")[:80]}') if d['status']=='success' else print(f'error: {d}')"
|
||||
|
||||
echo ""
|
||||
echo "=== 15. LIST SHARES ==="
|
||||
curl -s -H "Authorization: Bearer $ADMIN" "$BASE/api/shares" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'count={len(d[\"data\"])}')"
|
||||
|
||||
echo ""
|
||||
echo "=== 16. DELETE SOURCE ==="
|
||||
echo "=== 14. DELETE SOURCE ==="
|
||||
curl -s -X DELETE -H "Authorization: Bearer $ADMIN" "$BASE/api/sources/test-source" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'status={d[\"status\"]}')"
|
||||
|
||||
echo ""
|
||||
echo "=== 17. RECYCLE BIN ==="
|
||||
echo "=== 15. RECYCLE BIN ==="
|
||||
curl -s -H "Authorization: Bearer $ADMIN" "$BASE/api/recycle-bin" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'count={len(d[\"data\"])}'); [print(f' type={e.get(\"resourceType\")}, id={e.get(\"resourceId\")}') for e in d['data']]"
|
||||
|
||||
echo ""
|
||||
echo "=== 18. EXPORT STORAGE ==="
|
||||
echo "=== 16. EXPORT STORAGE ==="
|
||||
curl -s -H "Authorization: Bearer $ADMIN" "$BASE/api/storage" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'sources={len(d.get(\"sources\",[]))}, collections={len(d.get(\"collections\",[]))}, templates={len(d.get(\"templates\",[]))}')"
|
||||
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user