feat(desktop): let the user set and persist the server URL #65
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VAPP-54-desktop-server-url-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The desktop (wry) build had no way to point the embedded server fns at a vervain-server: both base URLs came only from the VERVAIN_SERVER_INTERNAL_URL / VERVAIN_SERVER_PUBLIC_URL env vars, which a desktop user has no container to set, so every server fn returned "server URL not configured" and login was impossible.
Add a desktop-only persisted "Server URL".
internal_base_url()andpublic_base_url()now fall back to it when their env var is unset (env var still wins, so the web/container deployment is unchanged), gated on#[cfg(feature = "desktop")]. One stored value feeds both roles since the desktop user dials the public origin directly. The value persists to the OS config dir (directories) as JSON.UI: the Settings Connection card becomes an editable "Server URL" field on desktop (the web build keeps the read-only, env-var-driven display and the admin-only internal row). A first-run prompt above the sign-in form lets a fresh install set the URL and log in without restarting, since a logged-out user cannot reach Settings. Entries are validated to
http(s)://host[:port]server-side, with the rejection reason surfaced inline.#VAPP-54
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com