From b7733e812fadd6007976d262bd1d793572a36ba7 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 29 Aug 2026 11:15:54 +0200 Subject: feat: node workflow redesign — wizard auto-config, reset, MusicBrainz contact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wizard (Electron): - Auto-provisions node config (hub URL + username) from logged-in user - node:start handles both cold start and restart of misconfigured daemon - Waits for daemon to reach 'running', auto-links node key on hub - probeNode accepts intermediate states for wizard progress feedback Reset (meshbay-node reset): - Unlinks node key from hub (DELETE /me/node_key, best-effort) - Stops and disables daemon (systemctl --user disable --now) - Erases ~/.config/meshbay, ~/.local/share/meshbay, ~/.local/state/meshbay MusicBrainz contact: - Resolved from owner's hub email instead of per-node roster config - Removed musicbrainz_contact UI and WebRTC handshake field - Removed set_musicbrainz_contact/musicbrainz_contact from roster Node pairing: - Added operator pairing banner on NodePage - Added operator_paired flag to list_groups Co-Authored-By: Claude Opus 4.6 --- packages/meshbay-node/src/meshbay_node/ui/app.py | 32 +++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'packages/meshbay-node/src/meshbay_node/ui') diff --git a/packages/meshbay-node/src/meshbay_node/ui/app.py b/packages/meshbay-node/src/meshbay_node/ui/app.py index 3dc320b..dfd9f68 100644 --- a/packages/meshbay-node/src/meshbay_node/ui/app.py +++ b/packages/meshbay-node/src/meshbay_node/ui/app.py @@ -116,9 +116,31 @@ def create_ui_app(state: dict) -> FastAPI: total_files = sum(idx.count for idx in indexes.values()) groups_ctx = state.get("groups_ctx", {}) webrtc = state.get("webrtc") + status = state.get("status", "starting") + + needs = [] + if status == "waiting_for_node_key": + needs.append("node_key_link") + if status == "running" and not groups_ctx: + needs.append("group_add") + if status == "running": + roster = state.get("roster") + if roster: + from meshbay_node.roster import Roster + members = await roster.list_members() + operators = [m for m in members + if m["role"] == "operator" and m["status"] == "active"] + if not operators: + needs.append("operator_pair") + for gid, gctx in groups_ctx.items(): + if not gctx.get("gek"): + name = gctx.get("name", gid[:8]) + needs.append(f"gek_init:{name}") + return { "version": __version__, - "status": state.get("status", "starting"), + "status": status, + "needs": needs, "hub_url": state.get("hub_url", ""), "username": state.get("username", ""), "quic_port": state.get("quic_port", 0), @@ -129,6 +151,14 @@ def create_ui_app(state: dict) -> FastAPI: "pk_node_ed25519": state.get("pk_node_ed25519", ""), } + @app.delete("/api/unlink") + async def api_unlink(): + hub = state.get("hub") + if not hub: + raise HTTPException(status_code=503, detail="Hub not connected") + await hub.unlink_node_key() + return {"status": "unlinked"} + @app.get("/api/groups") async def api_groups(): return await _op(lambda: ops.list_groups(state)) -- cgit v1.2.3