feat(ssh): /sshfilesrelay.ashx SFTP subsystem bridge (VS-2) #23
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/sshfilesrelay-vs-2"
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?
Summary
Adds the
/sshfilesrelay.ashxSFTP bridge as a sibling of the existing terminal bridge. The browser sends{action:"sshauth", username, password, host?, port?}, the server opens an SSHsftpsubsystem channel, and the rest of the session is a transparent WS-binary <-> SFTP byte bridge.Changes
meshcentral-ssh: newopen_sftp_subsystem(session)helper.meshcentral-web::ssh_relay: newfiles()handler,run_files,bridge_raw.lib.rs: top-level + per-domain routes.Test plan
cargo check -p meshcentral-webclean.Closes VS-2.
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