Skip to content

Sign in to a shellwing server on the phones - #375

Merged
tiendc merged 1 commit into
mainfrom
sync/server-on-phones
Dec 5, 2026
Merged

tiendc merged 1 commit into
mainfrom
sync/server-on-phones

Conversation

@tiendc

@tiendc tiendc commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

The phones can now sync with a shellwing server, as the desktop does. They sign in the same way as for OneDrive: iOS uses its browser sheet and Android a Custom Tab, and both come back to the app's own scheme, com.hivepaas.shellwing://server.

Needs hivepaas/shellwing-server#49, which makes the server accept that redirect besides a loopback port. Until it is deployed, a server answers ERR_DEVICE_REDIRECT_INVALID when the person clicks Allow.

Rust

  • server::AppSignIn (crates/remote) starts the sign-in and exchanges the code when the browser comes back with it.
    • The PKCE verifier stays on the phone, so another app that claimed the scheme could catch a code but not use it.
    • An address that comes back from another sign-in, or to another host, is refused.
    • The code exchange is shared with the desktop's SignIn.
  • ServerSignIn in crates/mobile exposes url, scheme and finish.
    • The platform is sent as ios or android.
    • An empty address, or one that is not https://, is refused with the desktop's (translated) messages.
  • Stop syncing on a phone signs it out of the server, as on the desktop.

iOS

  • Settings › Sync › shellwing server: an address field and Sign in.
  • The place picker is now a menu: eight segments did not fit, and the names were cut ("iClo…", "Ser…").
  • The places are named as on the desktop: Google Drive, shellwing server, S3-compatible, A folder.

Android

  • A shellwing server chip.
  • It shares SignInTab with OneDrive and Dropbox: the tab now also takes com.hivepaas.shellwing://server, and the sync screen finishes whichever sign-in is under way.
  • An intent filter for com.hivepaas.shellwing://server.
  • Place names as on the desktop.

Start over on a server. When the server already holds another device's vault, joining now offers Start over here, on the desktop as well as the phones. A person cannot delete a server's files themselves: they are reached only through the app.

Docs. docs/design/sync.md says the phones sign in to a server. It also fixes two lines that still said OneDrive was not on iOS.

Tests

  • server::tests::a_phone_signs_in_through_the_apps_scheme runs against the fake server. It refuses a wrong host, another sign-in's state, a missing code and a missing state. It also checks that the verifier never goes to the browser.
  • a_phone_signs_in_to_a_server_through_the_apps_scheme in crates/mobile.
  • crates/core/tests/shellwing_server.rs::a_phone_signs_in_through_the_apps_scheme ran against a real server built from Keys: the agent, saved passphrases, and a key made for a host #49:
    • the phone signs in through the scheme;
    • it writes and reads;
    • the server lists it with platform ios;
    • signing out stops its token;
    • a web redirect is refused.
  • Tried by hand against a local server: sign-in from the iOS Simulator and an Android emulator (with adb reverse).
  • Checks: cargo test -p shellwing-remote -p shellwing-mobile, clippy and fmt, i18n.py check (2018/2018, no new strings), the iOS Simulator build, and the Android debug APK.

🤖 Generated with Claude Code

The phones sign in to a server as they do to OneDrive: iOS's browser
sheet and Android's Custom Tab, coming back to the app's own scheme,
com.hivepaas.shellwing://server, which the server now takes besides a
loopback port (shellwing-server #49).

- remote: server::AppSignIn, the code exchanged with the verifier that
  stays on the phone; the exchange is shared with the desktop's SignIn.
- mobile: ServerSignIn (url, scheme, finish); an address that is not
  https:// is refused with the desktop's words. Stopping sync signs the
  phone out of the server, as on the desktop.
- iOS: Settings > Sync > shellwing server. The place picker is a menu now:
  eight places did not fit side by side. The places are named as on the
  desktop.
- Android: the shellwing server chip; SignInTab takes its redirect too, with
  an intent filter of its own.
- Joining a vault on a server offers Start over here, on the desktop too:
  a server's files are reached only through the app.
- An e2e test of a phone signing in against a real server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tiendc
tiendc force-pushed the sync/server-on-phones branch from b25fea1 to 9e4d677 Compare December 5, 2026 08:06
@tiendc
tiendc merged commit 04b8d6e into main Dec 5, 2026
5 checks passed
@tiendc
tiendc deleted the sync/server-on-phones branch December 5, 2026 08:10
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