feat(ssh): /sshfilesrelay.ashx SFTP subsystem bridge (VS-2) #23

Merged
David merged 2 commits from feat/sshfilesrelay-vs-2 into main 2026-05-17 14:33:56 +02:00
Owner

Summary

Adds the /sshfilesrelay.ashx SFTP bridge as a sibling of the existing terminal bridge. The browser sends {action:"sshauth", username, password, host?, port?}, the server opens an SSH sftp subsystem channel, and the rest of the session is a transparent WS-binary <-> SFTP byte bridge.

Changes

  • meshcentral-ssh: new open_sftp_subsystem(session) helper.
  • meshcentral-web::ssh_relay: new files() handler, run_files, bridge_raw.
  • lib.rs: top-level + per-domain routes.

Test plan

  • cargo check -p meshcentral-web clean.
  • Reviewer: open the SPA's file-manager panel for an SSH host, verify the SFTP listing populates.

Closes VS-2.

## Summary Adds the `/sshfilesrelay.ashx` SFTP bridge as a sibling of the existing terminal bridge. The browser sends `{action:"sshauth", username, password, host?, port?}`, the server opens an SSH `sftp` subsystem channel, and the rest of the session is a transparent WS-binary <-> SFTP byte bridge. ## Changes - `meshcentral-ssh`: new `open_sftp_subsystem(session)` helper. - `meshcentral-web::ssh_relay`: new `files()` handler, `run_files`, `bridge_raw`. - `lib.rs`: top-level + per-domain routes. ## Test plan - [x] `cargo check -p meshcentral-web` clean. - [ ] Reviewer: open the SPA's file-manager panel for an SSH host, verify the SFTP listing populates. Closes VS-2.
feat(ssh): /sshfilesrelay.ashx SFTP subsystem bridge (VS-2)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 4m42s
fd8ca19bf6
Mirrors the existing `/sshterminalrelay.ashx` (terminal) flow: first WS text frame is `{action:"sshauth", username, password, host?, port?}`. Instead of opening an interactive PTY shell, the relay opens an SSH `sftp` subsystem channel and bridges raw bytes between WS Binary frames and the SFTP channel in both directions. The browser owns the SFTP framing (the SPA's sftp client reads/writes the binary stream directly), so the relay stays format-agnostic.

Changes:

- `meshcentral-ssh`: new `open_sftp_subsystem(session)` helper (parallel to `open_shell`).
- `meshcentral-web::ssh_relay`: new `files()` handler + `run_files` + `bridge_raw` helpers. Auth + connect failure modes match `terminal` (`autherror` / `connectionerror` / `sessionerror`).
- `lib.rs`: routes `/sshfilesrelay.ashx` and `/:domain/sshfilesrelay.ashx` to the new handler.

#VS-2 State Done
Merge branch 'main' into feat/sshfilesrelay-vs-2
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Failing after 4s
Create release / Create release from merged PR (pull_request) Has been skipped
99e4e356e8
David merged commit 47f0ad90c6 into main 2026-05-17 14:33:56 +02:00
David deleted branch feat/sshfilesrelay-vs-2 2026-05-17 14:33:56 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!23
No description provided.