Skip to content

Add server selection and API-key login to the desktop player - #76

Merged
andresbott merged 57 commits into
mainfrom
player/server-selection
Oct 15, 2026
Merged

andresbott merged 57 commits into
mainfrom
player/server-selection

Conversation

@andresbott

Copy link
Copy Markdown
Owner

Summary

The desktop player opened the shared web UI at a tauri:// origin, where it found no server, so the shipped bundles could not play music. The app now asks for an Aether server, signs in as the browser does or with a pasted API key (the only way into a server behind an auth portal), and remembers the server without storing a password.

What

  • Server step (app only): the login view asks for the address first, probes it (only Aether is accepted) and saves it normalised in settings.json. Change server in both account menus goes back to that step, and About gains App and Server rows.
  • Requests leave from Rust: every /api/v0 and /rest call goes through tauri-plugin-http, which keeps an owner-only cookie jar. The webview's origin never sends the server's SameSite=Lax cookie. <audio> and <img> still load straight from the server, so the CSP now allows them.
  • API-key login: a key verified with getUser opens a /rest-only session, also offered on native servers. The key is stored owner-only in credentials.json. Features that need /api/v0 hide behind useAuth().managementApi, and a revoked or expired key brings the key card back.
  • No stored password: the keyring, connection.json and the connect/disconnect commands are gone (no migration). A tested Session owns the settings, the key and the Rust client. The core client gains API-key auth and URL normalisation that refuses embedded credentials.
  • Host layer: webui/src/lib/host/ is the only code that imports @tauri-apps/* or reads location.origin (pinned by originAgnostic.spec.ts), so the browser keeps its own origin and fetch. The tray's Play/Pause and Next now drive the webview player.

Notes

  • Playback still runs in the webview's <audio>. The Rust engine, aether:// covers and the browsing IPC commands stay unused until the playback retrofit.
  • Two things don't work in the app yet, both tracked in TODO.md: administering a portal server and the metadata editor's picture previews.
  • The app flows are unit-tested against a faked host only. Nobody has tested them in the real app window yet.

…an unreachable server, bound and upgrade the probe
…top retrying it in the app and reset the subsonic client whole
…dened gate and track the review's follow-ups
…'s mint flag an expiry after a server switch
…ttings atomically and make the cookie jar owner-only
…e server's question promise only what it does
@andresbott
andresbott merged commit d04eca8 into main Oct 15, 2026
6 checks passed
@andresbott
andresbott deleted the player/server-selection branch October 15, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant