Skip to content

feat: reuse SSH connections for multi-profile deployments#358

Closed
XYenon wants to merge 2 commits intoserokell:masterfrom
XYenon:feature/ssh-connection-multiplexing
Closed

feat: reuse SSH connections for multi-profile deployments#358
XYenon wants to merge 2 commits intoserokell:masterfrom
XYenon:feature/ssh-connection-multiplexing

Conversation

@XYenon
Copy link
Copy Markdown
Contributor

@XYenon XYenon commented Jan 3, 2026

SSH Connection Multiplexing (fixes #225)

  • Introduce SshControlMaster and SshMultiplexer in new src/ssh.rs module
  • Leverage OpenSSH's ControlMaster functionality to maintain persistent connections
  • Socket files stored securely in XDG_RUNTIME_DIR, TMPDIR, or ~/.cache
  • Add --no-ssh-multiplexing flag to disable this feature

Rollback Check Safety (fixes #106)

  • Add --no-rollback-fresh-connection flag to control rollback check behavior
  • By default, rollback checks use fresh SSH connections to avoid false positives when sshd is broken
  • Filter out ControlPath/ControlMaster options and add -o ControlPath=none for rollback checks

XYenon added 2 commits March 2, 2026 17:07
Use OpenSSH ControlMaster to multiplex SSH connections when deploying
multiple profiles to the same node. This avoids establishing a new SSH
connection for each profile, significantly improving deployment speed.

- Add ssh module with SshControlMaster and SshMultiplexer
- Establish control master after build, before push/deploy
- Inject ControlPath option into ssh_opts for all SSH commands
- Use XDG_RUNTIME_DIR/TMPDIR for socket files (secure, user-private)
- Add --no-ssh-multiplexing flag to disable (enabled by default)
- Clean up control masters when deployment completes
…issue

By default, rollback check now uses a fresh SSH connection instead of
reusing multiplexed connections. This prevents false-positive success
when SSH is broken but an existing connection is still open.

Fixes: #106
@XYenon XYenon force-pushed the feature/ssh-connection-multiplexing branch from 95d6407 to 4bd4cab Compare March 2, 2026 09:08
@XYenon XYenon closed this by deleting the head repository Mar 28, 2026
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.

Use less SSH connections / UX improvements for interactive SSH login flows Magic rollback gets confused with multiplexed SSH connections

1 participant