Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --reuse-sock flag so browser IDEs can reuse another SSH connections SSH_AUTH_SOCK #1471

Merged
merged 17 commits into from
Jan 8, 2025

Conversation

bkneis
Copy link
Contributor

@bkneis bkneis commented Dec 12, 2024

This PR introduces the hidden flag --reuse-sock to the SSH and helper ssh-server commands so that browser IDE's can first set up a SSH connection and allow the browser tunnel to reuse this.

Fixes #1307, #1456 and #1464

Why do we need this? "normal" IDE's like vscode use an SSH connection to connect to the remote, this connection requersts agent forwarding so the user's SSH_AUTH_SOCK is available in the workspace.

For browser IDEs this SSH connection is not made, the only long lived connection we have is used for the credential server and runs as root, which it must.

Therefore this fix is to emulate the behaviour of the normal IDE and allow the vscode session to highjack the SSH_AUTH_SOCK of the unused "backhaul" connection.

This PR was tested using local docker provider and kubernetes with openvscode and vscode. I tried pro with vscode and it works but using openvscode does not because the devpod CLI on the platform does not have the build changes.

Additionally we perform the clean up of the tmp dir if used

@bkneis bkneis requested review from pascalbreuninger and a team December 12, 2024 15:56
cmd/ssh.go Outdated Show resolved Hide resolved
cmd/ssh.go Show resolved Hide resolved
cmd/up.go Outdated Show resolved Hide resolved
cmd/up.go Outdated Show resolved Hide resolved
pkg/tunnel/container.go Show resolved Hide resolved
@bkneis bkneis force-pushed the feature/fix-auth-agent-sock branch from 786be1f to 9695082 Compare January 6, 2025 10:06
Copy link
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙌

@pascalbreuninger pascalbreuninger merged commit a4e5a36 into loft-sh:main Jan 8, 2025
18 of 24 checks passed
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.

SSH ForwardAgent does not work for openvscode
2 participants