mirror of
https://github.com/prdlk/vortex.git
synced 2026-08-02 17:31:41 +00:00
feat: guided bridge login wizard in TUI via bridgev2 provisioning API
Bootstrap now enables each bridge's provisioning API (persisted shared secret, matrix-token auth) and publishes /shared/bridges.json. The TUI bridge screen shows per-bridge login state and launches a step-driven wizard: flow picker, sequential input prompts (phone/cookies/password), in-terminal QR rendering with long-poll wait, cancel support. Discord (legacy bridge, no v3 API) keeps the bot-DM path via 'm'. verify.sh gains a provisioning API smoke check. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d57086cd00
commit
760d9db800
+18
-4
@@ -8,7 +8,7 @@ HS=http://localhost:8008
|
||||
pass() { echo "PASS: $*"; }
|
||||
fail() { echo "FAIL: $*"; exit 1; }
|
||||
|
||||
echo "== 1/4 containers"
|
||||
echo "== 1/5 containers"
|
||||
docker compose ps --format '{{.Service}} {{.State}} {{.Health}}' | tee /tmp/vortex-ps.txt
|
||||
for svc in postgres synapse mcp; do
|
||||
grep -q "^$svc running" /tmp/vortex-ps.txt || fail "$svc not running"
|
||||
@@ -23,7 +23,7 @@ for oneshot in bootstrap provision; do
|
||||
done
|
||||
pass "all services up, one-shots exited 0"
|
||||
|
||||
echo "== 2/4 synapse health + login"
|
||||
echo "== 2/5 synapse health + login"
|
||||
curl -sf $HS/health >/dev/null || fail "synapse /health"
|
||||
TOKEN=$(curl -sf -X POST $HS/_matrix/client/v3/login -d "{
|
||||
\"type\":\"m.login.password\",
|
||||
@@ -33,7 +33,7 @@ TOKEN=$(curl -sf -X POST $HS/_matrix/client/v3/login -d "{
|
||||
[ -n "$TOKEN" ] || fail "login"
|
||||
pass "synapse healthy, admin login works"
|
||||
|
||||
echo "== 3/4 bridge bot round-trip"
|
||||
echo "== 3/5 bridge bot round-trip"
|
||||
FIRST_BRIDGE=$(echo "${BRIDGES_ENABLED}" | cut -d, -f1)
|
||||
BOT="@${FIRST_BRIDGE}bot:${MATRIX_SERVER_NAME}"
|
||||
python3 - "$HS" "$TOKEN" "$BOT" <<'EOF' || fail "bridge bot did not respond"
|
||||
@@ -65,7 +65,21 @@ sys.exit(1)
|
||||
EOF
|
||||
pass "appservice round-trip via $BOT"
|
||||
|
||||
echo "== 4/4 MCP tools + draft gating"
|
||||
echo "== 4/5 bridge provisioning API (guided TUI login)"
|
||||
docker compose exec -T mcp python - "$TOKEN" <<'EOF' || fail "provisioning API"
|
||||
import json, sys, urllib.request, urllib.parse
|
||||
tok = sys.argv[1]
|
||||
bridges = json.load(open("/shared/bridges.json"))
|
||||
net, info = next((n, i) for n, i in bridges.items() if i["kind"] == "v2")
|
||||
url = f"{info['base_url']}/_matrix/provision/v3/login/flows?user_id=%40admin%3Alocalhost"
|
||||
req = urllib.request.Request(url, headers={"Authorization": "Bearer " + tok})
|
||||
flows = json.load(urllib.request.urlopen(req))["flows"]
|
||||
assert flows, "no login flows"
|
||||
print(f"{net} login flows: {[f['id'] for f in flows]}")
|
||||
EOF
|
||||
pass "provisioning API reachable with matrix-token auth"
|
||||
|
||||
echo "== 5/5 MCP tools + draft gating"
|
||||
docker compose exec -T mcp python - <<'EOF' || fail "mcp checks"
|
||||
import asyncio, json, os
|
||||
from fastmcp import Client
|
||||
|
||||
Reference in New Issue
Block a user