Files
DodoSSH/README.md
T
jaap-jan d07b336868 Free the terminal from the Hosts screen, and fill the room it left
The WebView sat inside the Hosts grid, so navigating to Files or the keychain
hid every open terminal and the strip that named them. A connection you had
opened was invisible from four of the five screens. The window now has two
surfaces rather than one: a nav rail that says which page you are on, and a
terminal strip that is always there and switches the whole content area to a
shell. Screen keeps meaning "which page" and never becomes a sixth kind of
page, which is why this is two properties instead of one enum with a terminal
member in it.

Every screen lives inside one wrapper panel that collapses when a terminal is
showing. That is not tidiness — the WebView hosts a Win32 child window that
composites above everything Avalonia draws, so a screen left visible over its
rectangle is a screen sliced in half, and this window has shipped that defect
once already. One decision point, IsTerminalShowing, and a nested panel rather
than five compound bindings nobody would remember to extend.

The focus choreography is the part no test in this repo can see. Every reveal
path now focuses in the same turn the WebView appeared, so all three of them
post at DispatcherPriority.Loaded and let the native control re-push its bounds
first. Going the other way had a real bug: the screen-changed branch called a
bare Focus() where it had to release the keyboard from the native child, so
switching from a terminal to Files silently ate the first keystrokes. Rare
before this commit and the primary gesture after it.

The tab strip grew a cross inside each tab, a plus that opens the quick-connect
palette, and middle-click close. Nested buttons are correct here: Avalonia
handles a left press on the cross and deliberately does not handle other
buttons, which is exactly what lets middle-click bubble up from the cross as
well as the tab. The test is PointerUpdateKind rather than
IsMiddleButtonPressed, because the latter reports button state and is also true
for a left press made while the middle button happens to be held. The handler
is on the tab and not the strip, so the background closes nothing by
construction. Plus opens the palette rather than a flyout, since a menu
dropping into the WebView's rectangle may or may not composite above a child
HWND and this repo does not make rendering claims it has not photographed.

Everything a user reads now says keychain. The wire, the database and the
cryptographic spec still say vault, deliberately: renaming those is a migration
and a protocol change for a word. That split is written down rather than left
to be rediscovered as an inconsistency.

Four things that were squeezed into the keychain's category rail, or into
nothing at all, now have screens. Pinned host keys get one, with fingerprints
never truncated and a filter that matches them, because comparing what you have
against what the operator published is the whole workflow; the approved date is
read out of the item's UUIDv7 rather than added as a column, and says so, since
it means first approval and not last use. Keys can be generated in the client,
which needed the openssh-key-v1 container written by hand — there is no BCL or
NSec helper, and the PKCS#8 route is unverified in the SSH library this uses.
The armour carries no passphrase: encrypting it needs bcrypt_pbkdf, which is
Blowfish with a swizzle, in a project whose crypto is otherwise entirely
libsodium, for a protection the key's own remarks argue is redundant inside a
vault. Generation fills the existing editor and stops, so SAVE stays the one
thing that writes. ~/.ssh/config can be imported behind a preview that is
ticked per row and writes nothing until the button; IdentityFile records the
path and imports the key material only on an explicit opt-in, because reading
somebody's private key into a vault is precisely the act this product exists to
make deliberate. Match blocks and ProxyJump are reported rather than obeyed —
one cannot be evaluated statically and the other has nothing behind it to route
with, and a preview that implied otherwise would be worse than one that admits
it.

Files can be dragged in all four directions that are honestly available. Remote
to Explorer does not ship and is not pretended to: the shell wants the bytes
during the drop, which needs a virtual file and a native COM data object,
outside what Avalonia offers. Note for the next person that Avalonia 12
replaced the drag model outright — DataObject and DataFormats are no-op stubs
and IDataObject is not in the reference assembly, so every tutorial written for
11 does not compile here.

Hosts can be grouped, flat and never nested. A parent id merged as a scalar
lets two offline clients each re-parent A under B and B under A, producing a
cycle inside an encrypted payload that no server can police and every reader
would have to detect for ever. Membership lives in that payload rather than in
the one plaintext concession ADR 0001 allows, whose test is that the relay
cannot function without it — nothing on the server reads a group, so what
plaintext would hand over is a clustering of the estate for nothing. The
plaintext column reserved for it is dropped, provably always null, and the
server now refuses a client that sends one; it was never populated, was copied
on apply, and was not cleared on delete, so a group id would have outlived the
host it described.

Snippets insert through xterm rather than through the pump, because xterm is
the only thing that knows whether the remote has bracketed paste on, and that
is what makes a shell treat embedded newlines as text instead of as execute.
The host process moves opaque bytes and never parses output, so it would have
to guess, and guessing wrong runs every line. Running is off by default and the
copy says the text goes into whatever is there — the terminal has no notion of
being at a prompt, and may be in vi or at a password prompt with echo off, so
the Enter the user presses themselves is the entire safety property.

Connections and keychain changes are recorded as synced encrypted items, which
is what makes them auditable by a team later and costs the server knowledge of
connection rate and timing from row counts alone. ADR 0001 already concedes it
cannot hide that class of metadata; the trade is now written into it rather
than left implicit. A connection entry is written once, at close, which is what
makes a synced log tractable: nothing to merge, one outbox row, no chance of
colliding with itself. Live sessions come from memory, not from the log. The
write is void by contract and posts to a bounded channel, because putting an
encrypt-and-write on the teardown path of every session is how closing the
application comes to take four seconds. A ticket opened before a lock still
closes afterwards, since a shell outlives the vault. The activity log hooks the
one generic repository every kind writes through, so it cannot miss a caller —
which is also why the log kinds themselves declare they are not audited, or the
first entry would write an entry about writing an entry. It records the names
of the fields that changed and never their values; a log with an old password
in it would be a plaintext credential store with no vault around it. Retention
is 90 days or 5,000 entries, whichever bites first, pruned on the sync loop
rather than on a second timer.

That log traffic then broke the status line, which is worth recording because
the fix is a shape and not a patch: background sync counted its own log rows as
pushed items, so the quiet rule stopped being quiet and every action's message
was overwritten a second later by a sync report. The report now separates log
rows from user items and the rule reads the latter.

S3 buckets appear as a remote in the file browser, behind the same interface an
SFTP session implements, so the queue and both panes did not have to learn what
they are talking to. Uploads go through a pipe, because the queue wants to
write and the SDK wants to read; memory is then bounded by the part size
instead of buffering a file to disk twice.

Finally, the Windows device key store moved out of the session project, which
was the one thing keeping it from being portable — everything else in it is
platform-neutral, and a Windows CNG dependency in the middle of the vault code
meant a second head could not reference it without dragging Windows along. The
seam that made the move free was already there. docs/android-port.md is the
audit behind that: what ports, what does not, in order of cost, the four
decisions taken, and an inventory of every screen and state the interface has
to carry, written so a design can be made from it directly.

dotnet build, dotnet test and dotnet format --verify-no-changes are all clean:
1240 tests at zero warnings, including the end-to-end suite against real
containers. The manual checks that headless Avalonia cannot make — the drag
from Explorer, a generated key against a real host, twelve tabs at the minimum
window width — are listed in docs/manual-checks.md and are still outstanding.
2026-07-31 20:30:05 +02:00

22 KiB

DodoSSH

A self-hosted, team-oriented SSH client with an end-to-end encrypted vault.

Manage hosts, credentials and keys in a desktop app; sync them across your devices and share them with teammates through a server you run yourself. The server stores ciphertext and never holds a key — the operator cannot read the credentials it stores.

Status: early development. See the milestone plan for what exists today.

Why

Teams either scatter SSH credentials across individual ~/.ssh directories with no sharing story, or pay per-seat for a hosted product that holds their infrastructure credentials. DodoSSH keeps the convenience of a synced, shareable vault while remaining self-hostable and zero-knowledge.

Architecture

Component Choice
Backend ASP.NET Core on .NET 10, PostgreSQL + EF Core
Client Avalonia (C#) for Windows/Linux/macOS; terminal pane is a WebView running xterm.js
Auth OIDC, provider-agnostic (Entra ID, Keycloak, Auth0, Authentik)
Vault End-to-end encrypted; X25519 + Ed25519 + XChaCha20-Poly1305, Argon2id unlock
Connections Client-direct SSH by default, with an optional raw-TCP server relay

Three consequences worth knowing before you read further:

  • Revocation is not retroactive. A removed member keeps what they already downloaded. The real remediation is rotating the SSH credential, so offboarding is built around a rotation checklist rather than a button that implies more than it delivers.
  • No session recording in relay mode. The relay forwards SSH ciphertext, so it cannot see commands. That is the cost of the relay not being able to read your traffic.
  • Locking the vault does not close your shells. Lock closes the vault and zeroes every key it held; a session that authenticated before it keeps running, because the remote host never consulted the vault and the credential was already spent. That is deliberate — you lock when you walk away from the machine, which is exactly when a long upgrade or transfer is most likely to be in flight, and an idle auto-lock that killed it would be worse than the exposure it removed. The honest reading is that locked describes the vault and not this machine's access to your hosts. The unlock screen therefore shows how many shells are still connected, and quitting DodoSSH is what ends them.

The reasoning behind each major decision is recorded in docs/adr/, starting with the E2EE trust model.

The desktop client's interface was built from a design covering more product than exists yet — file transfer, teams, saved snippets, port forwarding. Everything that design asked for and this build has not got is written down in docs/design-import-gaps.md, with the layer each piece would land in and what the interface shows in its place. Nothing was rendered with invented data to fill a screen.

Repository layout

src/
  DodoSSH.Contracts        DTOs shared with the client — the real API contract
  DodoSSH.Crypto           DSH1 envelope, AAD derivation, the key hierarchy
  DodoSSH.Domain           entities and invariants, no EF
  DodoSSH.Infrastructure   DbContext, configurations, migrations
  DodoSSH.Api              the server
  DodoSSH.Client.Auth      OIDC code+PKCE on a loopback redirect, and the key binding
  DodoSSH.Client.Api       the typed server client, and client-side enrollment
  DodoSSH.Client.Domain    the decrypted item model and the three-way merge — no I/O at all
  DodoSSH.Client.Storage   the local cache: ciphertext mirror, outbox, offline unlock material
  DodoSSH.Client.Sync      the pull/apply/push loop and the conflict policy
  DodoSSH.Client.Session   where a profile lives, unlocking it, and getting one in the first place
  DodoSSH.Client.Ssh       connections, PTY shells, SFTP, host key trust
  DodoSSH.Client.Terminal  the loopback data plane and credit-based flow control
  DodoSSH.Client.Transfer  the transfer queue, part files and resume, and the local file listing
  DodoSSH.Client.ObjectStore  S3-compatible buckets, behind the same interface as SFTP
  DodoSSH.Client.Import    reading ~/.ssh/config, with no I/O of its own
  DodoSSH.Client.App       Avalonia; the only project that knows about a UI toolkit
tests/                     one test project per source project
docs/adr/                  architecture decision records
docs/design-import-gaps.md what the client's design asked for and this build has not got
docs/platform-flags.md     what differs off Windows, and the gotchas that have cost time
docs/manual-checks.md      what no test can reach, and what to look for when checking by hand
docs/android-port.md       what an Android client would take, and what has been decided about it

Everything under src/DodoSSH.Client.* except App is deliberately free of Avalonia. That is the seam that lets the SSH layer, the terminal's flow control and the OIDC flow be tested without a UI toolkit or a browser engine — which is most of why they are testable at all.

Building

Requires the .NET SDK pinned in global.json (10.0.x).

dotnet build DodoSSH.slnx
dotnet test DodoSSH.slnx

The tests need a Docker daemon. Everything that touches the database, the identity provider or an SSH server uses Testcontainers rather than a stub or a shared instance, so there is nothing to start first and nothing to clean up after — but with no daemon those suites fail rather than skip.

Running it

Four commands, in order. The first two are once per machine.

1. The development dependencies — PostgreSQL and Keycloak, with the dodossh realm imported:

docker compose -f deploy/docker-compose.dev.yml up -d

2. The schema. The API never migrates anything: it fails readiness while a migration is pending, and says which one. dotnet-ef is pinned in .config/dotnet-tools.json, so run dotnet tool restore first if you have not:

dotnet ef database update --project src/DodoSSH.Infrastructure

With nothing else configured this targets the compose stack above. Set DODOSSH_DESIGN_CONNECTION to point it at another database.

3. The server:

dotnet run --project src/DodoSSH.Api

It listens on http://localhost:5233, serving /healthz/live, /healthz/ready and — in Development — /openapi/v1.json.

4. The desktop client:

dotnet run --project src/DodoSSH.Client.App

In the app, enter http://localhost:5233 as the server. Your browser opens for sign-in — the realm ships alice / alice — then choose a vault passphrase and write down the recovery code, which cannot be skipped and cannot be recovered from the server. You can then add a host and open a shell on it — double-click it in the sidebar, or select it and press CONNECT, which is the same command with the password box beside it. Keycloak's admin console is at http://localhost:18080 (admin / admin).

You can also add an SSH key, which is stored in the vault like a host and synced the same way: paste the private key, then edit a host and pick that key from its key dropdown. From then on that host authenticates with it — on every machine, since the choice travels inside the host's encrypted payload — and its password box disappears.

The first time you connect to a host you are asked to check its key fingerprint. That decision is stored in the vault, so it is asked once per host rather than once per launch and it reaches your other machines with the next sync. If a server is legitimately rebuilt and offers a new key, the connection is refused outright with no way to continue from the warning — edit the host and choose Forget host key, which is deliberately somewhere you have to go on purpose.

Deleting asks first, and the question is worth reading. DELETE on a host, an SSH key or a stored password puts a question where the buttons were, and what it says is counted rather than generic: how many hosts authenticate with the key about to go — they refuse to connect afterwards rather than falling back to a typed password — whether a terminal is open on the host about to go, and whether this machine can push the deletion yet or is queuing it. There is no undo, which is the other thing it says. Withdrawing host key trust is the deliberate exception: it costs one fingerprint check on the next connection, and the dangerous button there is the one that adds trust.

Signing in once is enough. The refresh token is kept in the local cache, sealed under the vault's own key, so a later launch resumes the session itself and no browser opens — and because it is sealed under that key, resuming can only happen after the vault is unlocked. A machine that unlocks with no network keeps trying: every synchronisation pass asks for a connection, so a laptop opened on a train is online again within a minute of finding a network, with nothing pressed. Unlock takes Enter in the passphrase box, and nothing about unlocking ever waits on the network.

Signing out is under Preferences → Account, and again on the unlock screen, where it is the only answer to a forgotten passphrase — nothing can recover one. It asks first, and says what it costs: it empties this machine's cache (the profile, the cached items, and anything still queued to be sent) and withdraws this machine's device key from the account. The vault itself is on the server and is untouched, so signing in again brings it all back; the count in the confirmation is the one thing that exists nowhere else. Your session at the identity provider is not ended — DodoSSH has no way to end it — so on a machine that is not yours, sign out there too.

Two of M1's known gaps are visible immediately, so they are worth expecting rather than diagnosing: password authentication asks for the password every time, because nothing in the interface can create a vault credential yet (they do sync — there is just no editor for one); and unlock asks for the passphrase on every launch, because no device key is registered.

Moving files

FILES in the nav rail is a two-pane browser: this machine on the left, the host on the right, and a queue underneath. Choose a host, press CONNECT, then select a file in either pane and press the arrow pointing the way you want it to go.

Two things about it are worth expecting rather than discovering.

It is a second connection, not a second channel. SSH itself would allow the SFTP subsystem to open beside a shell on the transport that is already up; SSH.NET does not offer that — its SftpClient owns its own transport — so pressing CONNECT here authenticates again. The host records a second login, and a host whose password you type each time will ask for it again on this screen. Host key trust is shared: a fingerprint approved for a terminal is approved here, and one approved here reaches your other machines with the next sync.

Nothing is written at its final name until it is complete. Every transfer goes to a .dodossh-part file beside its destination and is renamed into place at the end, so an interrupted transfer can never be mistaken for a finished one — which matters most for what people actually use this for, which is copying a build artefact onto a server and then running it. A destination that already exists is refused outright rather than overwritten; the remote pane has DELETE and MKDIR so that refusal is not a dead end. DELETE asks first and names the full path, and it carries the strongest warning in the application on purpose: everything else DodoSSH deletes is a tombstone against a copy the server still holds, and a file on somebody's host is bytes with nothing behind them. RESUME on a stopped transfer carries on from what the part file already holds.

Resume works within a run of the application and not across a restart, and that limit is deliberate: nothing records which source wrote a part file, and resuming one on the strength of its name matching is how a corrupt artefact gets delivered with nothing reporting a failure. A part file found at startup is started over.

What is not here: transferring a directory, dragging between the panes, and routing a transfer through a bastion — the last needs jump hosts the connection layer has not got. All three are in docs/design-import-gaps.md.

End-to-end verification

One suite runs against a real server rather than a stub. It needs a Docker daemon and nothing else, so it is part of the ordinary test run:

dotnet test tests/DodoSSH.SystemTests

It brings up PostgreSQL, Keycloak and an OpenSSH server in containers, applies the committed migrations, starts the API as a child process out of its own build output, and then drives the real client: sign in through Keycloak, enroll, unlock, create an SSH key and a host bound to it, sync them, open a shell on the sshd and approve its host key at the real first-contact refusal, then read all three back on a second simulated machine and unlock again with no network. Roughly 25 seconds once the images are pulled.

What makes it worth its weight is that it consumes the artefacts that ship — the realm file from deploy/keycloak, the EF migrations, the API's own appsettings — rather than a fixture written to match them. On its first run it found a loopback redirect URI the realm registered in a form Keycloak rejects, and a JSON configuration gap that made the whole sync surface unreachable from the real client while every other test passed. Both are the same class of bug: two sides of a stub agreeing with each other about something the specification never said.

The one value it cannot take from a committed file is Oidc:Authority, since the container's port is assigned at start. Everything that authority points at is still the real realm.

Development and testing are currently Windows-only. Anything known or suspected to differ on Linux and macOS is tracked in docs/platform-flags.md, along with the deployment gotchas that have already cost time once. Read it before assuming something works off-Windows.

Android has been audited and scoped, but not started: docs/android-port.md records what ports as it stands (most of the core), what does not (most of the interface), the decisions taken about what an Android client would be — phone-first, keychain plus a terminal — and the spike that gates all of it.

Conventions the build enforces

  • Warnings are errors. dotnet format --verify-no-changes gates CI.
  • Package versions are centralised in Directory.Packages.props; packages.lock.json is committed and CI restores in locked mode.
  • BannedSymbols.txt bans DateTime.UtcNow (use TimeProvider), Guid.NewGuid (use CreateVersion7), sync-over-async, MD5/SHA1 and PBKDF2.
  • Public members of DodoSSH.Contracts must be declared in PublicAPI.Unshipped.txt, so a contract change is a build error rather than a client-side surprise.

Milestones

  • M0 — foundation. Repo structure, build conventions, CI, ADRs. Done.

  • M1 — vertical slice. OIDC login → enroll → create a host → open a shell. Server done: the DSH1 crypto core, the data model, sync push/pull for hosts, /me, and enrollment with the identity-provider key binding. Client done: the key hierarchy, the OIDC flow with the key binding, SSH connections with host key trust, the terminal data plane, the encrypted local cache with the sync client — offline unlock, an outbox and a field-level three-way merge, conflict matrix green — and an Avalonia shell that is vault-backed: server URL → browser sign-in → enroll → unlock → host list → terminal. The shell's state machine is covered by tests against an in-memory server, so the states that matter most (the recovery code that cannot be skipped, the unlock that needs no network) are checked rather than remembered.

    Its layout is not covered by anything, and that gap has already cost a shipped defect: the setup and unlock screens were layered over the terminal's WebView, which on Windows is a native child window that cannot be covered, so they rendered sliced with their buttons unclickable. No test in this repository loads a .axaml file, and a headless one could not have caught this — there is no native window in headless, so it would have rendered perfectly and confirmed the wrong belief. Screens get looked at, or they are unverified. Verified end to end: tests/DodoSSH.SystemTests drives the whole slice against a real Keycloak, a real API, a real PostgreSQL and a real sshd — sign-in, the identity-provider key binding, enrollment, offline unlock, a host and an SSH key through the vault to a second machine, an interactive shell, and the host key approved at that shell's prompt reaching the second machine as well. See End-to-end verification.

    Known gaps in the client, stated rather than implied by the interface: nothing in the interface can create a vault credential yet, so password authentication still asks for the password each time — SSH keys are editable, and binding one to a host is the way to connect without typing anything; and no device key is registered, so the passphrase is needed on every launch until the OS keystore is wired.

    Host key trust is in the vault, which is what makes trust-on-first-use worth having: a fingerprint approved on one machine is approved on all of them and survives a restart, and the server cannot drop a pin to force a fresh first-use decision without the item visibly going missing. A changed host key stays a hard refusal with no way past it; withdrawing a pin is a separate, deliberate act in the host's editor.

    Binding a key introduced the first payload schema version bump, and it is worth knowing how it behaves: a host is written at the lowest schema version that can represent it, so only hosts that actually bind a key are written at version 2 and become read-only on an older build. Hosts that do not are still written at version 1, byte-identically to before the field existed — which is what keeps upgrading one machine from making a team's whole vault uneditable everywhere else.

  • M2 — full personal vault, robust sync, relay. File transfer done: an SFTP session, a two-pane file browser with a real remote listing — names, sizes, modification times and drwxr-xr-x permission bits — and a queue that moves one file at a time with progress, throughput and resume. See Moving files for the two things about it worth knowing before you use it, both of which are consequences rather than choices.

    Organising done: hosts can be filed into groups, and commands can be saved as snippets. Both are ordinary synced items — encrypted, merged and pushed like every other — and both are invisible until used: a keychain with no groups draws the flat host list it always did. Two things about them are deliberate. Group membership is a field on the host rather than a member list on the group, so filing two machines at once on two laptops is two independent writes instead of one contested one; and groups are flat, because a parent pointer merged field by field lets two offline clients build a cycle that nothing can repair.

    Inserting a snippet types it at the prompt and stops. Pressing Enter is a per-snippet decision, off by default, and the reason is worth stating: a terminal is one input stream with no notion of being at a prompt — the remote may be in an editor, or at a password prompt with the echo off — so this client cannot honestly say "run this command", only "type this into whatever is there".

    Logs done: what has been connected to, and what has been changed in the keychain. Both are synced, encrypted items rather than local files, because the point of them is auditing a shared vault — a log only one machine can read is a diagnostic, not an audit trail. Two consequences are stated rather than implied. The connection log records the host's name, the address dialled, when, for how long and by which account on which machine — but not the SSH username, which is a detail of the host and is in the host's own logs. The keychain log records the names of the fields an edit touched and never their contents.

    What that costs is in ADR 0001: the server still cannot read a single field, but one row per connection with a server-side timestamp tells it your connection rate and the hours you work. Retention bounds it — ninety days or five thousand entries per kind, whichever bites first.

    Buckets done: S3-compatible object storage is a second kind of remote on the Files screen, beside a host. Prefixes are directories, objects are files, and transfers go the same way through the same queue. The bucket, its endpoint and its keys are a keychain item like any other, encrypted end to end — which matters more than usual here, because for anybody self-hosting MinIO or Ceph the endpoint is an address on their own network.

    Three things a bucket cannot do are refused with a reason rather than approximated: there are no directories, an interrupted upload starts again rather than resuming (an object cannot be written from the middle), and a rename is a copy and a delete rather than one atomic operation. Downloads do resume — a ranged GET is part of the protocol, which is the one place a bucket beats SFTP.

  • M3 — teams, sharing, ACLs.

  • M4 — hardening and ops, packaging, self-hosting guide.

  • M5 — multi-provider OIDC, key rotation, per-item content keys.

Licence

MIT.