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 --- .../meshbay-node/src/meshbay_node/hub_client.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'packages/meshbay-node/src/meshbay_node/hub_client.py') diff --git a/packages/meshbay-node/src/meshbay_node/hub_client.py b/packages/meshbay-node/src/meshbay_node/hub_client.py index 92c39db..1a746bd 100644 --- a/packages/meshbay-node/src/meshbay_node/hub_client.py +++ b/packages/meshbay-node/src/meshbay_node/hub_client.py @@ -41,6 +41,7 @@ class HubSession: refresh_token: str hub_pk_pem: bytes # cached hub Ed25519 public key node_id: str = "" + email: str = "" _token_exp: int = 0 @property @@ -203,6 +204,27 @@ class HubClient: r.raise_for_status() return r.json().get("groups", []) + # ── Owner profile ──────────────────────────────────────────────────────── + + async def fetch_owner_email(self) -> str: + """Fetch the authenticated user's email from the hub.""" + if self._session is None: + raise RuntimeError("Not logged in") + await self.ensure_fresh_token() + r = await self._http.get("/v1/users/me", + headers=self._session.auth_headers) + r.raise_for_status() + return r.json().get("email", "") + + async def unlink_node_key(self) -> None: + """Clear pk_node_ed25519 on the hub (best-effort before reset).""" + if self._session is None: + return + await self.ensure_fresh_token() + r = await self._http.delete("/v1/users/me/node_key", + headers=self._session.auth_headers) + r.raise_for_status() + # ── User pubkey lookup ──────────────────────────────────────────────────── async def get_user_pubkeys(self, username: str) -> dict: -- cgit v1.2.3