Add Teleport servers that connect through tsh - #11
giraypultar wants to merge 3 commits into
Conversation
Headless installs can now register servers with `vibeshell servers add user@host[:port]` and remove them with `vibeshell servers delete`, without opening the desktop UI. Optional flags cover the Add Server dialog fields (jump host, agent forwarding, post-login command, group, tags). Passwords come from SSH_PASSWORD or VIBESHELL_PASSWORD; keys from --identity.
Saved servers can be SSH or Teleport. Teleport sessions spawn `tsh ssh` as the PTY, file/exec operations wrap `tsh scp`/`tsh ssh`, and import reads `tsh status` plus `tsh ls`. CLI add/import and the GUI Add/Edit dialogs accept a required proxy; login/MFA stays with `tsh login`.
Quote remote ls paths and pass tsh argument slices by reference so vibeshell-desktop links.
veithly
left a comment
There was a problem hiding this comment.
Teleport integration is a worthwhile direction. This PR is stacked on #10 and now targets dev, but the current transport implementation changes several safety contracts, so it is not included in 1.1.0 yet. Please resolve #10 first and rebase this work onto the current shared-session architecture.
Blocking items from the current diff:
- Bound tsh process execution, cancellation and captured output. Synchronous Command.output() has no timeout/output cap, and writing all stdin before draining stdout/stderr can deadlock. Use concurrently drained bounded streams and propagate actual process failure.
- Preserve file-operation contracts. The cat-based write/create paths must honor overwrite=false with exclusive creation; they must not overwrite an existing destination silently.
- Preserve binary-read and directory semantics. The binary response needs the expected encoding and real size/truncation fields, not lossy text with binary=true and size=0. The ls fallback trims valid filenames and labels directories as files; either implement a lossless compatible protocol or return an explicit unsupported error.
- Do not implement directory Sync as unconditional recursive scp while ignoring excluded paths, nested gitignore rules and delete_extra. The returned transfer counts/bytes must reflect actual work rather than fixed success placeholders. Unsupported sync modes should fail clearly until implemented.
- Drive session connected/disconnected state from verified connection/process lifecycle rather than spawn success or fixed sleeps. Integrate owner-process routing, quick exec/plugin paths and teardown, with tests for authentication failure, EOF and cancellation.
Please add transport-level regression fixtures for overwrite protection, binary data, Unicode/whitespace paths, ignored-file retention and process I/O limits. Existing tests are valuable, but they do not establish these transport guarantees. I am requesting changes rather than merging or closing the contribution.
|
Re-reviewed on 2026-09-29 at b81e609. There are no new commits since the previous review, the branch still includes #10, and it conflicts with current dev. The earlier process-I/O, lifecycle, binary/file overwrite and sync-contract blockers remain; no merge is being performed. A smaller first revision focused on authenticated session lifecycle, ownership and explicitly reported transport capabilities would be easier to validate. Use concurrent bounded process I/O with timeout/cancellation, and drive connection state from actual authentication/EOF rather than spawn success or sleeps. File/sync operations may return an explicit unsupported error until they satisfy the normal contracts; lossy text, trimmed ls output and recursive scp are not substitutes for those contracts. #17 adds a concrete implementation/test plan in docs/ISSUE_TRIAGE_2026-09.md. Resolve #10 first, then cover GUI/daemon ownership, quick/plugin exec, auth failure, EOF, cancellation, binary bytes, whitespace/Unicode paths, overwrite refusal and ignored-file retention. This remains open with changes requested. |
Depends on #10 (this branch contains the CLI server add/delete commit from #10; once #10 merges this PR will show only the Teleport commits).
Saved servers can now be SSH or Teleport. Teleport sessions spawn
tsh sshas the PTY, file/exec operations wraptsh scp/tsh ssh, and import readstsh statusplustsh ls.tsh loginsrc-tauri/src/teleportmodule wrapping tsh for shell, file and exec operationslspaths and passes tsh argument slices by reference sovibeshell-desktoplinks