diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-29 11:15:54 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-29 11:15:54 +0200 |
| commit | b7733e812fadd6007976d262bd1d793572a36ba7 (patch) | |
| tree | 52e2ac07c9ba4929fa50b6ba8d19f94f86e8b304 /packages/meshbay-hub | |
| parent | 09a007937f03fad04a390323f3817f1ae7d7c2a9 (diff) | |
| download | meshbay-b7733e812fadd6007976d262bd1d793572a36ba7.tar.gz | |
feat: node workflow redesign — wizard auto-config, reset, MusicBrainz contact
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub')
15 files changed, 132 insertions, 147 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/api/users.py b/packages/meshbay-hub/src/meshbay_hub/api/users.py index b1489ec..7db3fc9 100644 --- a/packages/meshbay-hub/src/meshbay_hub/api/users.py +++ b/packages/meshbay-hub/src/meshbay_hub/api/users.py @@ -625,6 +625,17 @@ async def register_node_key( return {"status": "stored", "pk_node_ed25519": body.pk_node_ed25519} +@router.delete("/me/node_key") +async def unlink_node_key( + current_user: User = Depends(get_current_user), + db: AsyncSession = Depends(get_db), +): + """Remove the linked node key from the operator's account.""" + current_user.pk_node_ed25519 = None + await db.commit() + return {"status": "unlinked"} + + # Key rotation used to live here (`PUT /me/keys`). Identity keys are per node # now, so rotating means `meshbay-node member unpin <user>` and pairing again with # a fresh code — an operator decision on the machine that pinned it, not a hub diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js index 50a972b..4aab150 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js @@ -1130,7 +1130,31 @@ function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = tru } } - // Step 1: Group details + directories + // Node detected but not fully ready — provision config and/or link key, + // then wait for 'running' before showing the group form. + const provisionAttempted = useRef(false); + useEffect(() => { + if (step === 1 && nodeStatus && !nodeStarting + && !provisionAttempted.current + && (nodeStatus.status === 'waiting_for_account' + || nodeStatus.status === 'waiting_for_node_key' + || nodeStatus.status === 'starting')) { + provisionAttempted.current = true; + startNode(); + } + }, [step, nodeStatus, nodeStarting, startNode]); + + if (step === 1 && nodeStatus + && nodeStatus.status !== 'running' && nodeStatus.status !== undefined) { + return html`<div class="page-content"> + <h2>${t('wizard.title')}</h2> + <p class="page-message">${error + ? t('wizard.wrong_account') + : t('wizard.detecting')}</p> + ${error && html`<button class="btn btn-secondary" onClick=${detectNode}> + ${t('wizard.retry')}</button>`} + </div>`; + } if (step === 1) { const canProceed = name.trim() && roots.length > 0 && enabledApps.length > 0; return html`<div class="page-content"> @@ -2352,6 +2376,10 @@ function NodePage({ token, username, userId, groups }) { const [attachGroup_, setAttachGroup_] = useState(''); const [attachDir, setAttachDir] = useState(''); const [attachUpload, setAttachUpload] = useState(''); + const [operatorPaired, setOperatorPaired] = useState(false); + const [pairCode, setPairCode] = useState(''); + const [pairStatus, setPairStatus] = useState(''); + const [pairing, setPairing] = useState(false); const transportRef = useRef(null); const connectAndFetch = useCallback(async () => { @@ -2405,6 +2433,7 @@ function NodePage({ token, username, userId, groups }) { console.log('[NodePage] got status:', result.groups?.length, 'groups'); transportRef.current = transport; setNodeGroups(result.groups || []); + setOperatorPaired(!!result.operator_paired); setStatus('connected'); return; } catch (err) { @@ -2437,6 +2466,7 @@ function NodePage({ token, username, userId, groups }) { try { const result = await transport.fetchNodeStatus(); setNodeGroups(result.groups || []); + setOperatorPaired(!!result.operator_paired); } catch {} }, []); @@ -2606,6 +2636,27 @@ function NodePage({ token, username, userId, groups }) { } }, [attachGroup_, attachDir, attachUpload, signFn]); + const doPairOperator = useCallback(async (e) => { + e.preventDefault(); + const code = pairCode.trim(); + if (!code) return; + setPairing(true); + setPairStatus(''); + try { + const transport = transportRef.current; + if (!transport || !transport.connected) throw new Error('Not connected'); + await transport.pairOperator(userId, code); + setPairCode(''); + setPairStatus('paired'); + setOperatorPaired(true); + await refresh(); + } catch (err) { + setPairStatus(err.message); + } finally { + setPairing(false); + } + }, [pairCode, userId, refresh]); + const reloadConfig = useCallback(async () => { const transport = transportRef.current; if (!transport || !transport.connected) return; @@ -2656,6 +2707,22 @@ function NodePage({ token, username, userId, groups }) { </div> <${NodeServicePanel} onChanged=${connectAndFetch} /> ${actionMsg && html`<div class="node-message">${actionMsg}</div>`} + ${!operatorPaired && html` + <div class="node-pair-banner"> + <p>${t('node.pair_needed')}</p> + <form onSubmit=${doPairOperator} class="node-pair-form"> + <input type="text" placeholder=${t('node.pair_code_placeholder')} + value=${pairCode} onInput=${e => setPairCode(e.target.value)} + disabled=${pairing} /> + <button class="btn btn-primary btn-small" type="submit" + disabled=${pairing || !pairCode.trim()}> + ${t('node.pair_button')}</button> + </form> + ${pairStatus === 'paired' + ? html`<p class="success-msg">${t('node.pair_success')}</p>` + : pairStatus ? html`<p class="error-msg">${pairStatus}</p>` : null} + </div> + `} ${(() => { const hubIds = new Set((groups || []).map(g => g.id)); return nodeGroups.map(g => { diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js index 5a2a79b..dac0f45 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js @@ -94,8 +94,7 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, // above (docs/photos.md §2.1: a photo library is routinely scattered // across several folders). Empty means nothing configured yet. const [photoRoots, setPhotoRoots] = useState([]); - // MusicBrainz on/off (per-group) + whether a contact string is configured - // (node-wide) — docs/musicbay.md §3.2, same shape as tmdbConfig above. + // MusicBrainz on/off (per-group) — docs/musicbay.md §3.2. const [musicbrainzConfig, setMusicbrainzConfig] = useState(null); const onPlayQueue = useCallback((tracks, startIndex) => { setVideoEntry(null); @@ -245,7 +244,6 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, setPhotoRoots(ack.photo_roots || []); setMusicbrainzConfig({ enabled: ack.musicbrainz_enabled !== false, - contactConfigured: !!ack.musicbrainz_contact_configured, }); // Changed while we are connected, by an operator who may be someone // else entirely. Without this the button stays until a reconnection, @@ -262,8 +260,6 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, transport.onVideoRoot = (path) => setVideoRoot(path); transport.onAudioRoot = (path) => setAudioRoot(path); transport.onPhotoRoots = (roots) => setPhotoRoots(roots); - transport.onMusicbrainzConfig = (cfg) => - setMusicbrainzConfig((prev) => ({ ...(prev || {}), ...cfg })); transport.onMusicbrainzEnabled = (enabled) => setMusicbrainzConfig((prev) => ({ ...(prev || {}), enabled })); // The node's own scan (a root added while we were already connected, @@ -599,7 +595,6 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, onTmdbConfig=${(cfg) => setTmdbConfig((prev) => ({ ...(prev || {}), ...cfg }))} onTmdbEnabled=${(enabled) => setTmdbConfig((prev) => ({ ...(prev || {}), enabled }))} musicbrainzConfig=${musicbrainzConfig} - onMusicbrainzConfig=${(cfg) => setMusicbrainzConfig((prev) => ({ ...(prev || {}), ...cfg }))} onMusicbrainzEnabled=${(enabled) => setMusicbrainzConfig((prev) => ({ ...(prev || {}), enabled }))} entries=${entries} nodeDirs=${nodeDirs} videoRoot=${videoRoot} diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js index 59d1456..4f55dfb 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js @@ -191,7 +191,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, enabledApps, onEnabledApps, scanSettings, onScanSettings, tmdbConfig, onTmdbConfig, onTmdbEnabled, - musicbrainzConfig, onMusicbrainzConfig, onMusicbrainzEnabled, + musicbrainzConfig, onMusicbrainzEnabled, entries, nodeDirs, videoRoot, onVideoRoot, audioRoot, onAudioRoot, photoRoots, onPhotoRoots, onRefreshIndex, @@ -548,9 +548,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, saveTmdbConfig(); }, [isNodeAdmin, connected, tmdbConfig, saveTmdbConfig]); - const [mbBusy, setMbBusy] = useState(false); const [mbMsg, setMbMsg] = useState(''); - const [mbContactDraft, setMbContactDraft] = useState(''); const [mbEnabledBusy, setMbEnabledBusy] = useState(false); const mbEnabled = musicbrainzConfig ? musicbrainzConfig.enabled : true; @@ -579,43 +577,6 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, } }, [transportRef, onMusicbrainzEnabled]); - /** - * The node-wide MusicBrainz contact string (docs/musicbay.md §3.2) — not - * a secret, unlike TMDB's token, but still cleared from the draft field - * after a save: the node never echoes it back - * (musicbrainz_config_ack carries only whether one is set), so there is - * nothing to keep showing. - */ - const saveMusicbrainzConfig = useCallback(async () => { - const transport = transportRef && transportRef.current; - setMbMsg(''); - setMbBusy(true); - try { - if (!transport || !transport.connected) { - throw new Error('Not connected to the node'); - } - const sk = transport.sessionKeys && transport.sessionKeys.skEdB64; - const signFn = (sk && window.MeshBayKeys) - ? (transcript) => window.MeshBayKeys.signBytes(sk, transcript) - : null; - const contact = mbContactDraft.trim(); - await transport.setMusicbrainzConfig(contact || undefined, signFn); - setMbContactDraft(''); - if (onMusicbrainzConfig) { - onMusicbrainzConfig({ - contactConfigured: contact - ? true - : (musicbrainzConfig ? musicbrainzConfig.contactConfigured : false), - }); - } - setMbMsg(t('settings_node.scan_saved')); - } catch (err) { - setMbMsg(err.message); - } finally { - setMbBusy(false); - } - }, [transportRef, onMusicbrainzConfig, mbContactDraft, musicbrainzConfig]); - // Every folder anywhere in the group's shared index, deepest included — // `entries[].path` is each file's containing directory (files-app.js's own // convention), so every ancestor prefix of it is a real folder, and @@ -1033,23 +994,6 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef, onChange=${(v) => saveMusicbrainzEnabled(v)} label=${mbEnabled ? t('settings_node.musicbrainz_enabled') : t('settings_node.musicbrainz_disabled')} /> </div> - <div class="settings-row"> - <label class="settings-label"> - ${t('settings_node.musicbrainz_contact_label')} - <input type="text" placeholder=${t('settings_node.musicbrainz_contact_placeholder')} - value=${mbContactDraft} disabled=${mbBusy} - onInput=${e => setMbContactDraft(e.target.value)} /> - </label> - <p class="settings-hint"> - ${musicbrainzConfig && musicbrainzConfig.contactConfigured - ? t('settings_node.musicbrainz_contact_set') - : t('settings_node.musicbrainz_contact_unset')} - </p> - </div> - <button class="btn btn-small btn-secondary" style="margin-top:8px" - disabled=${mbBusy} onClick=${() => saveMusicbrainzConfig()}> - ${mbBusy ? t('settings_node.scan_saving') : t('settings_node.musicbrainz_save')} - </button> ${mbMsg && html`<p class="settings-hint">${mbMsg}</p>`} </${CollapsibleSection}> `} diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js index e3d9ee2..525f70c 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/de.js @@ -594,6 +594,10 @@ export default { 'node.not_operator': 'Ihr Node konnte nicht erreicht werden. Stellen Sie sicher, dass er läuft.', 'node.offline': 'Node ist offline', 'node.retry': 'Erneut versuchen', + 'node.pair_needed': 'Kein Operator gekoppelt. Geben Sie einen Kopplungscode ein, um Administratoraktionen (Einladungen, Dateilöschung) zu aktivieren.', + 'node.pair_code_placeholder': 'Kopplungscode', + 'node.pair_button': 'Diesen Browser koppeln', + 'node.pair_success': 'Erfolgreich gekoppelt.', 'node.reload': 'Konfiguration neu laden', 'node.reloaded': 'Konfiguration neu geladen. Verzeichnisänderungen an bestehenden Gruppen sind jetzt aktiv.', 'node.restart_needed': 'Nach dem Hinzufügen: Gruppenschlüssel initialisieren (meshbay-node gek-init --group <name>).', @@ -673,11 +677,6 @@ export default { 'settings_node.musicbrainz_hint': 'Ermöglicht der Musik-App, Cover und kanonische Benennungen von MusicBrainz anzuzeigen, wenn ein Titel kein brauchbares eingebettetes Cover hat. Aus bedeutet nur Tag-/Dateiname-basiertes Durchsuchen, ohne Anfrage an Dritte.', 'settings_node.musicbrainz_enabled': 'Aktiviert', 'settings_node.musicbrainz_disabled': 'Deaktiviert', - 'settings_node.musicbrainz_contact_label': 'Kontakt (erforderlich, damit MusicBrainz antwortet)', - 'settings_node.musicbrainz_contact_placeholder': 'du@beispiel.de oder eine Projekt-URL', - 'settings_node.musicbrainz_contact_set': 'Ein Kontakt ist konfiguriert.', - 'settings_node.musicbrainz_contact_unset': 'Kein Kontakt konfiguriert — MusicBrainz-Abfragen bleiben deaktiviert, bis einer festgelegt ist.', - 'settings_node.musicbrainz_save': 'Speichern', 'settings_node.video_root_save': 'Speichern', 'settings_node.video_root_change_confirm': 'Das Ändern des Videos-Stammordners ersetzt, was jedes Mitglied im Videos-Tab sieht. Fortfahren?', @@ -702,6 +701,7 @@ export default { 'wizard.node_not_found': 'Kein lokaler Node erkannt. Stellen Sie sicher, dass meshbay-node läuft.', 'wizard.node_offline_warning': 'Node läuft nicht. Die Gruppe wird nur auf dem Hub erstellt. Sie können den Node später über die Node-Seite verbinden.', 'wizard.retry': 'Erneut versuchen', + 'wizard.wrong_account': 'Der Node läuft, aber der konfigurierte Benutzername stimmt nicht mit Ihrem Konto überein. Überprüfen Sie hub.username in node.toml.', 'wizard.skip_node': 'Ohne Node fortfahren', 'wizard.directories': 'Freigegebene Verzeichnisse', 'wizard.directories_hint': 'Wählen Sie die Verzeichnisse, die diese Gruppe teilen soll. Mindestens eines ist erforderlich.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js index e8bfca3..a35eaf5 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/en.js @@ -428,6 +428,7 @@ export default { 'wizard.detecting': 'Detecting local node...', 'wizard.node_not_found': 'No local node detected. Make sure meshbay-node is running.', 'wizard.retry': 'Retry', + 'wizard.wrong_account': 'The node is running but its configured username does not match your account. Check hub.username in node.toml.', 'wizard.skip_node': 'Continue without node', 'wizard.node_offline_warning': 'Node is not running. The group will be created on the hub only. You can connect the node later from the Node page.', 'wizard.directories': 'Shared directories', @@ -495,11 +496,6 @@ export default { 'settings_node.musicbrainz_hint': 'Lets the Music app show cover art and canonical naming from MusicBrainz when a track has no usable embedded cover. Off means tag/filename-only browsing, with no request to a third party.', 'settings_node.musicbrainz_enabled': 'Enabled', 'settings_node.musicbrainz_disabled': 'Disabled', - 'settings_node.musicbrainz_contact_label': 'Contact (required for MusicBrainz to answer requests)', - 'settings_node.musicbrainz_contact_placeholder': 'you@example.com or a project URL', - 'settings_node.musicbrainz_contact_set': 'A contact is configured.', - 'settings_node.musicbrainz_contact_unset': 'No contact configured — MusicBrainz lookups stay off until one is set.', - 'settings_node.musicbrainz_save': 'Save', 'settings_node.video_root_save': 'Save', 'settings_node.video_root_change_confirm': 'Changing the Videos root replaces what every member sees in the Videos tab. Continue?', @@ -691,6 +687,10 @@ export default { 'node.denylist_clear_all': 'Clear all', 'node.denylist_clear_confirm': 'Remove "{subject}" from the denylist?', 'node.denylist_cleared': 'Denylist entry removed.', + 'node.pair_needed': 'No operator paired. Enter a pairing code to enable admin operations (invites, file deletion).', + 'node.pair_code_placeholder': 'Pairing code', + 'node.pair_button': 'Pair this browser', + 'node.pair_success': 'Paired successfully.', 'node.reload': 'Reload config', 'node.reloaded': 'Config reloaded. Root changes on existing groups are now active.', 'node.attach_group': 'Add group', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js index 0847d79..7400fc3 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/es.js @@ -590,6 +590,10 @@ export default { 'node.not_operator': 'No se pudo contactar con su node. Asegúrese de que esté en ejecución.', 'node.offline': 'Node sin conexión', 'node.retry': 'Reintentar', + 'node.pair_needed': 'Ningún operador emparejado. Introduzca un código de emparejamiento para habilitar las operaciones de administración (invitaciones, eliminación de archivos).', + 'node.pair_code_placeholder': 'Código de emparejamiento', + 'node.pair_button': 'Emparejar este navegador', + 'node.pair_success': 'Emparejamiento exitoso.', 'node.reload': 'Recargar configuración', 'node.reloaded': 'Configuración recargada. Los cambios de directorios en los grupos existentes ya están activos.', 'node.restart_needed': 'Después de añadir: inicialice la clave de grupo (meshbay-node gek-init --group <nombre>).', @@ -669,11 +673,6 @@ export default { 'settings_node.musicbrainz_hint': 'Permite que la app de Música muestre carátulas y nombres canónicos de MusicBrainz cuando una pista no tiene una carátula incrustada utilizable. Desactivado significa navegación solo por etiquetas/nombre de archivo, sin solicitudes a terceros.', 'settings_node.musicbrainz_enabled': 'Activado', 'settings_node.musicbrainz_disabled': 'Desactivado', - 'settings_node.musicbrainz_contact_label': 'Contacto (necesario para que MusicBrainz responda)', - 'settings_node.musicbrainz_contact_placeholder': 'tu@ejemplo.com o una URL de proyecto', - 'settings_node.musicbrainz_contact_set': 'Hay un contacto configurado.', - 'settings_node.musicbrainz_contact_unset': 'Sin contacto configurado — las búsquedas de MusicBrainz permanecen desactivadas hasta que se configure uno.', - 'settings_node.musicbrainz_save': 'Guardar', 'settings_node.video_root_save': 'Guardar', 'settings_node.video_root_change_confirm': 'Cambiar la raíz de Vídeos reemplaza lo que ve cada miembro en la pestaña Vídeos. ¿Continuar?', @@ -698,6 +697,7 @@ export default { 'wizard.node_not_found': 'No se detectó un node local. Asegúrese de que meshbay-node esté en ejecución.', 'wizard.node_offline_warning': 'El node no está en ejecución. El grupo se creará solo en el hub. Podrá conectar el node más tarde desde la página Node.', 'wizard.retry': 'Reintentar', + 'wizard.wrong_account': 'El node está en ejecución, pero el nombre de usuario configurado no coincide con su cuenta. Compruebe hub.username en node.toml.', 'wizard.skip_node': 'Continuar sin node', 'wizard.directories': 'Directorios compartidos', 'wizard.directories_hint': 'Elija los directorios que este grupo compartirá. Se requiere al menos uno.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js index bcc82d1..98b155a 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/fr.js @@ -594,6 +594,10 @@ export default { 'node.not_operator': 'Impossible de joindre votre node. Vérifiez qu\'il est en cours d\'exécution.', 'node.offline': 'Node hors ligne', 'node.retry': 'Réessayer', + 'node.pair_needed': "Aucun opérateur appairé. Entrez un code d'appairage pour activer les opérations d'administration (invitations, suppression de fichiers).", + 'node.pair_code_placeholder': "Code d'appairage", + 'node.pair_button': 'Appairer ce navigateur', + 'node.pair_success': 'Appairage réussi.', 'node.reload': 'Recharger la configuration', 'node.reloaded': 'Configuration rechargée. Les modifications de répertoires sur les groupes existants sont maintenant actives.', 'node.restart_needed': 'Après l\'ajout : initialisez la clé de groupe (meshbay-node gek-init --group <name>).', @@ -685,11 +689,6 @@ export default { 'settings_node.musicbrainz_hint': "Permet à l'app Musique d'afficher les pochettes et les noms canoniques depuis MusicBrainz quand un morceau n'a pas de pochette intégrée utilisable. Désactivé signifie une navigation par tags/nom de fichier uniquement, sans requête vers un tiers.", 'settings_node.musicbrainz_enabled': 'Activé', 'settings_node.musicbrainz_disabled': 'Désactivé', - 'settings_node.musicbrainz_contact_label': 'Contact (requis pour que MusicBrainz réponde)', - 'settings_node.musicbrainz_contact_placeholder': 'vous@exemple.com ou une URL de projet', - 'settings_node.musicbrainz_contact_set': 'Un contact est configuré.', - 'settings_node.musicbrainz_contact_unset': "Aucun contact configuré — les recherches MusicBrainz restent désactivées tant que rien n'est renseigné.", - 'settings_node.musicbrainz_save': 'Enregistrer', 'settings_node.video_root_save': 'Enregistrer', 'settings_node.video_root_change_confirm': "Changer la racine des Vidéos remplace ce que chaque membre voit dans l'onglet Vidéos. Continuer ?", @@ -714,6 +713,7 @@ export default { 'wizard.node_not_found': 'Aucun node local détecté. Vérifiez que meshbay-node est en cours d\'exécution.', 'wizard.node_offline_warning': 'Le node ne tourne pas. Le groupe sera créé sur le hub uniquement. Vous pourrez connecter le node plus tard depuis la page Node.', 'wizard.retry': 'Réessayer', + 'wizard.wrong_account': "Le node tourne mais le nom d'utilisateur configuré ne correspond pas à votre compte. Vérifiez hub.username dans node.toml.", 'wizard.skip_node': 'Continuer sans node', 'wizard.directories': 'Répertoires partagés', 'wizard.directories_hint': 'Choisissez les répertoires que ce groupe partagera. Au moins un est requis.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js index bfdd964..9843e7c 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/it.js @@ -592,6 +592,10 @@ export default { 'node.not_operator': 'Impossibile raggiungere il suo node. Si assicuri che sia in esecuzione.', 'node.offline': 'Node non in linea', 'node.retry': 'Riprova', + 'node.pair_needed': "Nessun operatore associato. Inserisci un codice di associazione per abilitare le operazioni di amministrazione (inviti, eliminazione file).", + 'node.pair_code_placeholder': 'Codice di associazione', + 'node.pair_button': 'Associa questo browser', + 'node.pair_success': 'Associazione riuscita.', 'node.reload': 'Ricarica configurazione', 'node.reloaded': 'Configurazione ricaricata. Le modifiche alle directory dei gruppi esistenti sono ora attive.', 'node.restart_needed': "Dopo l'aggiunta: inizializzi la chiave di gruppo (meshbay-node gek-init --group <nome>).", @@ -683,11 +687,6 @@ export default { 'settings_node.musicbrainz_hint': "Permette all'app Musica di mostrare copertine e nomi canonici da MusicBrainz quando una traccia non ha una copertina incorporata utilizzabile. Disattivato significa navigazione basata solo su tag/nome file, senza richieste a terzi.", 'settings_node.musicbrainz_enabled': 'Attivato', 'settings_node.musicbrainz_disabled': 'Disattivato', - 'settings_node.musicbrainz_contact_label': 'Contatto (necessario perché MusicBrainz risponda)', - 'settings_node.musicbrainz_contact_placeholder': 'tu@esempio.com o un URL di progetto', - 'settings_node.musicbrainz_contact_set': 'È configurato un contatto.', - 'settings_node.musicbrainz_contact_unset': 'Nessun contatto configurato — le ricerche MusicBrainz restano disattivate finché non ne viene impostato uno.', - 'settings_node.musicbrainz_save': 'Salva', 'settings_node.video_root_save': 'Salva', 'settings_node.video_root_change_confirm': 'Cambiare la radice di Video sostituisce ciò che ogni membro vede nella scheda Video. Continuare?', @@ -712,6 +711,7 @@ export default { 'wizard.node_not_found': 'Nessun node locale rilevato. Si assicuri che meshbay-node sia in esecuzione.', 'wizard.node_offline_warning': 'Il node non è in esecuzione. Il gruppo sarà creato solo sul hub. Potrà collegare il node in seguito dalla pagina Node.', 'wizard.retry': 'Riprova', + 'wizard.wrong_account': 'Il node è in esecuzione, ma il nome utente configurato non corrisponde al suo account. Verifichi hub.username in node.toml.', 'wizard.skip_node': 'Continua senza node', 'wizard.directories': 'Directory condivise', 'wizard.directories_hint': 'Scelga le directory che questo gruppo condividerà. Ne serve almeno una.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js index 5d86e32..41635d4 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/ja.js @@ -580,6 +580,10 @@ export default { 'node.not_operator': 'node に接続できませんでした。node が実行中であることをご確認ください。', 'node.offline': 'Node はオフラインです', 'node.retry': '再試行', + 'node.pair_needed': 'オペレーターがペアリングされていません。管理操作(招待、ファイル削除)を有効にするにはペアリングコードを入力してください。', + 'node.pair_code_placeholder': 'ペアリングコード', + 'node.pair_button': 'このブラウザをペアリング', + 'node.pair_success': 'ペアリングに成功しました。', 'node.reload': '設定を再読み込み', 'node.reloaded': '設定を再読み込みしました。既存グループのルート変更が反映されました。', 'node.restart_needed': '追加後、グループ鍵を初期化してください(meshbay-node gek-init --group <name>)。', @@ -667,11 +671,6 @@ export default { 'settings_node.musicbrainz_hint': 'トラックに使用可能な埋め込みカバーがない場合、MusicBrainzのカバーアートと正式名称をMusicアプリで表示できるようにします。オフにするとタグ・ファイル名のみでの閲覧になり、第三者へのリクエストは発生しません。', 'settings_node.musicbrainz_enabled': '有効', 'settings_node.musicbrainz_disabled': '無効', - 'settings_node.musicbrainz_contact_label': '連絡先(MusicBrainzが応答するために必要)', - 'settings_node.musicbrainz_contact_placeholder': 'you@example.com またはプロジェクトのURL', - 'settings_node.musicbrainz_contact_set': '連絡先が設定されています。', - 'settings_node.musicbrainz_contact_unset': '連絡先が設定されていません — 設定されるまでMusicBrainzの検索は無効のままです。', - 'settings_node.musicbrainz_save': '保存', 'settings_node.video_root_save': '保存', 'settings_node.video_root_change_confirm': '動画のルートフォルダを変更すると、全メンバーの動画タブの表示内容が変わります。続行しますか?', @@ -696,6 +695,7 @@ export default { 'wizard.node_not_found': 'ローカル node が検出できませんでした。meshbay-node が実行中であることをご確認ください。', 'wizard.node_offline_warning': 'Node が実行されていません。グループは hub 上のみに作成されます。後から Node ページで node を接続できます。', 'wizard.retry': '再試行', + 'wizard.wrong_account': 'node は実行中ですが、設定されたユーザー名がお使いのアカウントと一致しません。node.toml の hub.username をご確認ください。', 'wizard.skip_node': 'node なしで続行', 'wizard.directories': '共有ディレクトリ', 'wizard.directories_hint': 'このグループで共有するディレクトリを選択してください。少なくとも 1 つ必要です。', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js index 77ba822..38f9845 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/nl.js @@ -594,6 +594,10 @@ export default { 'node.not_operator': 'Uw node is niet bereikbaar. Controleer of hij draait.', 'node.offline': 'Node is offline', 'node.retry': 'Opnieuw proberen', + 'node.pair_needed': 'Geen operator gekoppeld. Voer een koppelingscode in om beheeracties (uitnodigingen, bestandsverwijdering) in te schakelen.', + 'node.pair_code_placeholder': 'Koppelingscode', + 'node.pair_button': 'Deze browser koppelen', + 'node.pair_success': 'Succesvol gekoppeld.', 'node.reload': 'Configuratie herladen', 'node.reloaded': 'Configuratie herladen. Mapwijzigingen op bestaande groepen zijn nu actief.', 'node.restart_needed': 'Na het toevoegen: initialiseer de groepssleutel (meshbay-node gek-init --group <naam>).', @@ -685,11 +689,6 @@ export default { 'settings_node.musicbrainz_hint': "Laat de Muziek-app hoesfoto's en canonieke namen van MusicBrainz tonen wanneer een nummer geen bruikbare ingesloten hoes heeft. Uit betekent alleen bladeren op tag/bestandsnaam, zonder verzoek aan derden.", 'settings_node.musicbrainz_enabled': 'Ingeschakeld', 'settings_node.musicbrainz_disabled': 'Uitgeschakeld', - 'settings_node.musicbrainz_contact_label': 'Contact (vereist zodat MusicBrainz kan antwoorden)', - 'settings_node.musicbrainz_contact_placeholder': 'jij@voorbeeld.com of een project-URL', - 'settings_node.musicbrainz_contact_set': 'Er is een contact ingesteld.', - 'settings_node.musicbrainz_contact_unset': 'Geen contact ingesteld — MusicBrainz-opzoekingen blijven uit totdat er een is ingesteld.', - 'settings_node.musicbrainz_save': 'Opslaan', 'settings_node.video_root_save': 'Opslaan', 'settings_node.video_root_change_confirm': "Het wijzigen van de hoofdmap voor Video's vervangt wat elk lid ziet in het tabblad Video's. Doorgaan?", @@ -714,6 +713,7 @@ export default { 'wizard.node_not_found': 'Geen lokale node gedetecteerd. Controleer of meshbay-node draait.', 'wizard.node_offline_warning': 'Node draait niet. De groep wordt alleen op de hub aangemaakt. U kunt de node later verbinden via de Node-pagina.', 'wizard.retry': 'Opnieuw proberen', + 'wizard.wrong_account': 'De node draait, maar de geconfigureerde gebruikersnaam komt niet overeen met uw account. Controleer hub.username in node.toml.', 'wizard.skip_node': 'Doorgaan zonder node', 'wizard.directories': 'Gedeelde mappen', 'wizard.directories_hint': 'Kies de mappen die deze groep deelt. Minimaal één is vereist.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js index 23fc4d9..bfad68b 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pl.js @@ -613,6 +613,10 @@ export default { 'node.not_operator': 'Nie udało się połączyć z Pana/Pani node. Upewnij się, że działa.', 'node.offline': 'Node jest niedostępny', 'node.retry': 'Ponów', + 'node.pair_needed': 'Brak sparowanego operatora. Wprowadź kod parowania, aby włączyć operacje administracyjne (zaproszenia, usuwanie plików).', + 'node.pair_code_placeholder': 'Kod parowania', + 'node.pair_button': 'Sparuj tę przeglądarkę', + 'node.pair_success': 'Parowanie zakończone sukcesem.', 'node.reload': 'Przeładuj konfigurację', 'node.reloaded': 'Konfiguracja przeładowana. Zmiany katalogów w istniejących grupach są teraz aktywne.', 'node.restart_needed': 'Po dodaniu: zainicjalizuj klucz grupy (meshbay-node gek-init --group <nazwa>).', @@ -712,11 +716,6 @@ export default { 'settings_node.musicbrainz_hint': 'Pozwala aplikacji Muzyka pokazywać okładki i kanoniczne nazwy z MusicBrainz, gdy utwór nie ma użytecznej wbudowanej okładki. Wyłączone oznacza przeglądanie tylko na podstawie tagów/nazwy pliku, bez żądań do strony trzeciej.', 'settings_node.musicbrainz_enabled': 'Włączone', 'settings_node.musicbrainz_disabled': 'Wyłączone', - 'settings_node.musicbrainz_contact_label': 'Kontakt (wymagany, aby MusicBrainz odpowiadał)', - 'settings_node.musicbrainz_contact_placeholder': 'ty@przyklad.com lub URL projektu', - 'settings_node.musicbrainz_contact_set': 'Kontakt jest skonfigurowany.', - 'settings_node.musicbrainz_contact_unset': 'Brak skonfigurowanego kontaktu — wyszukiwania MusicBrainz pozostają wyłączone, dopóki nie zostanie ustawiony.', - 'settings_node.musicbrainz_save': 'Zapisz', 'settings_node.video_root_save': 'Zapisz', 'settings_node.video_root_change_confirm': 'Zmiana katalogu głównego Wideo zastępuje to, co widzi każdy członek w karcie Wideo. Kontynuować?', @@ -741,6 +740,7 @@ export default { 'wizard.node_not_found': 'Nie wykryto lokalnego node. Upewnij się, że meshbay-node działa.', 'wizard.node_offline_warning': 'Node nie działa. Grupa zostanie utworzona wyłącznie na hub. Node można podłączyć później na stronie Node.', 'wizard.retry': 'Ponów', + 'wizard.wrong_account': 'Node działa, ale skonfigurowana nazwa użytkownika nie odpowiada Pana/Pani kontu. Proszę sprawdzić hub.username w pliku node.toml.', 'wizard.skip_node': 'Kontynuuj bez node', 'wizard.directories': 'Katalogi współdzielone', 'wizard.directories_hint': 'Wybierz katalogi, które ta grupa będzie współdzielić. Wymagany jest co najmniej jeden.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js index 5c217f0..a6ddadd 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/pt-BR.js @@ -591,6 +591,10 @@ export default { 'node.not_operator': 'Não foi possível alcançar seu node. Verifique se ele está em execução.', 'node.offline': 'Node está off-line', 'node.retry': 'Tentar novamente', + 'node.pair_needed': 'Nenhum operador pareado. Insira um código de pareamento para habilitar operações administrativas (convites, exclusão de arquivos).', + 'node.pair_code_placeholder': 'Código de pareamento', + 'node.pair_button': 'Parear este navegador', + 'node.pair_success': 'Pareamento realizado com sucesso.', 'node.reload': 'Recarregar configuração', 'node.reloaded': 'Configuração recarregada. Alterações de diretórios em grupos existentes estão ativas.', 'node.restart_needed': 'Após adicionar: inicialize a chave do grupo (meshbay-node gek-init --group <nome>).', @@ -670,11 +674,6 @@ export default { 'settings_node.musicbrainz_hint': 'Permite que o app Música mostre capas e nomes canônicos do MusicBrainz quando uma faixa não tem uma capa incorporada utilizável. Desativado significa navegação apenas por tags/nome de arquivo, sem solicitação a terceiros.', 'settings_node.musicbrainz_enabled': 'Ativado', 'settings_node.musicbrainz_disabled': 'Desativado', - 'settings_node.musicbrainz_contact_label': 'Contato (necessário para o MusicBrainz responder)', - 'settings_node.musicbrainz_contact_placeholder': 'voce@exemplo.com ou uma URL de projeto', - 'settings_node.musicbrainz_contact_set': 'Um contato está configurado.', - 'settings_node.musicbrainz_contact_unset': 'Nenhum contato configurado — as buscas no MusicBrainz permanecem desativadas até que um seja definido.', - 'settings_node.musicbrainz_save': 'Salvar', 'settings_node.video_root_save': 'Salvar', 'settings_node.video_root_change_confirm': 'Alterar a raiz de Vídeos substitui o que cada membro vê na aba Vídeos. Continuar?', @@ -699,6 +698,7 @@ export default { 'wizard.node_not_found': 'Nenhum node local detectado. Verifique se o meshbay-node está em execução.', 'wizard.node_offline_warning': 'O node não está em execução. O grupo será criado apenas no hub. Você pode conectar o node posteriormente pela página Node.', 'wizard.retry': 'Tentar novamente', + 'wizard.wrong_account': 'O node está em execução, mas o nome de usuário configurado não corresponde à sua conta. Verifique hub.username em node.toml.', 'wizard.skip_node': 'Continuar sem node', 'wizard.directories': 'Diretórios compartilhados', 'wizard.directories_hint': 'Escolha os diretórios que este grupo compartilhará. Pelo menos um é obrigatório.', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js index b00779d..5fb2a0b 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/locales/zh-CN.js @@ -566,6 +566,10 @@ export default { 'node.not_operator': '无法连接到您的 node。请确保它正在运行。', 'node.offline': 'Node 已离线', 'node.retry': '重试', + 'node.pair_needed': '尚未配对操作员。请输入配对码以启用管理操作(邀请、文件删除)。', + 'node.pair_code_placeholder': '配对码', + 'node.pair_button': '配对此浏览器', + 'node.pair_success': '配对成功。', 'node.reload': '重新加载配置', 'node.reloaded': '配置已重新加载。对现有群组的目录更改现已生效。', 'node.restart_needed': '添加后请初始化群组密钥(meshbay-node gek-init --group <名称>)。', @@ -653,11 +657,6 @@ export default { 'settings_node.musicbrainz_hint': '当曲目没有可用的内嵌封面时,允许音乐应用显示来自 MusicBrainz 的封面和规范名称。关闭表示仅按标签/文件名浏览,不向第三方发送请求。', 'settings_node.musicbrainz_enabled': '已启用', 'settings_node.musicbrainz_disabled': '已禁用', - 'settings_node.musicbrainz_contact_label': '联系方式(MusicBrainz 需要它才能响应请求)', - 'settings_node.musicbrainz_contact_placeholder': 'you@example.com 或项目 URL', - 'settings_node.musicbrainz_contact_set': '已配置联系方式。', - 'settings_node.musicbrainz_contact_unset': '未配置联系方式 — 在设置之前,MusicBrainz 查询将保持关闭。', - 'settings_node.musicbrainz_save': '保存', 'settings_node.video_root_save': '保存', 'settings_node.video_root_change_confirm': '更改视频根目录会替换每位成员在"视频"标签页中看到的内容。是否继续?', @@ -683,6 +682,7 @@ export default { 'wizard.node_offline_warning': 'Node 未在运行。群组将仅在 hub 上创建。' + '您可以之后在 Node 页面连接 node。', 'wizard.retry': '重试', + 'wizard.wrong_account': 'node 正在运行,但配置的用户名与您的账户不匹配。请检查 node.toml 中的 hub.username。', 'wizard.skip_node': '不使用 node 继续', 'wizard.directories': '共享目录', 'wizard.directories_hint': '选择此群组要共享的目录。至少需要一个。', diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport.js b/packages/meshbay-hub/src/meshbay_hub/static/transport.js index 120c7d7..d6a28d9 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/transport.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/transport.js @@ -75,7 +75,7 @@ function _aborted() { const ADMIN_OP_TYPES = new Set([ 'tmdb_override', 'tmdb_config', 'tmdb_enabled', 'video_root', 'audio_root', 'photo_roots', - 'musicbrainz_config', 'musicbrainz_enabled', 'file_delete', 'dir_delete', + 'musicbrainz_enabled', 'file_delete', 'dir_delete', 'member_upload', 'apps_enabled', 'set_scan_settings', 'member_revoke', 'root_add', 'root_remove', 'member_unpin', 'gek_rotate', 'group_attach', 'group_detach', 'invite_create', @@ -276,7 +276,6 @@ class MeshBayTransport { set onVideoRoot(fn) { this._onVideoRoot = fn; } set onAudioRoot(fn) { this._onAudioRoot = fn; } set onPhotoRoots(fn) { this._onPhotoRoots = fn; } - set onMusicbrainzConfig(fn) { this._onMusicbrainzConfig = fn; } set onMusicbrainzEnabled(fn) { this._onMusicbrainzEnabled = fn; } set onIndexProgress(fn) { this._onIndexProgress = fn; } // Fired once an automatic reconnect (see _reconnectLoop) lands a fresh @@ -1055,31 +1054,6 @@ class MeshBayTransport { } /** - * Set/clear the node-wide MusicBrainz contact string — the User-Agent - * identity MusicBrainz's usage policy asks for, not a credential (there - * is none, docs/musicbay.md §3.1). Signed like setTmdbConfig: this turns - * on outbound third-party network traffic the operator has to agree to. - * `contact: ''` explicitly clears it (reverting to "no calls at all"); - * omit it (undefined/null) to leave whatever is stored unchanged. - */ - async setMusicbrainzConfig(contact, signFn) { - const msg = await this._sendAndWait({ - type: 'musicbrainz_config', v: '0.8', - contact: contact === undefined ? null : contact, - }); - if (msg.type === 'error') throw new Error(msg.detail); - if (msg.type === 'admin_challenge') { - // Must match the node's subject byte-for-byte (webrtc_server.py - // _do_musicbrainz_config) — not a secret like tmdb_config's token, - // but still kept out of the audit log as free text: only whether one - // was supplied travels in the subject. - const subject = `contact_configured=${contact ? 'yes' : 'no'}`; - return this._authorizeAdminOp(msg, 'musicbrainz_config', subject, signFn); - } - return msg; - } - - /** * Whether MusicBrainz lookups run for this group at all — per-group from * the start (docs/musicbay.md §3.2/§6). Signed like setTmdbEnabled. */ @@ -2077,12 +2051,6 @@ class MeshBayTransport { this._onPhotoRoots(msg.roots || []); } - // Node-wide, like tmdb_config_ack above — no token equivalent to hide, - // only whether a contact string is configured (docs/musicbay.md §3.2). - if (msg.type === 'musicbrainz_config_ack' && this._onMusicbrainzConfig) { - this._onMusicbrainzConfig({ contactConfigured: Boolean(msg.contact_configured) }); - } - // Per-group, like tmdb_enabled_ack above. if (msg.type === 'musicbrainz_enabled_ack' && this._onMusicbrainzEnabled) { this._onMusicbrainzEnabled(Boolean(msg.enabled)); |