Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Warn if coder-cli is not in PATH on Windows #357

Merged
merged 5 commits into from
Jul 26, 2021
Merged

Conversation

deansheather
Copy link
Member

@deansheather deansheather commented May 21, 2021

In Powershell and VS Code, the OpenSSH for Windows ProxyCommand is expected to be a binary name like coder or a Windows-like path such as C:\path\to\coder.exe.

In Msys2 and Git Bash, the Linux-y OpenSSH expects the ProxyCommand to be a binary name or a Unix-like path such as /c/path/to/coder.

To support both environments simultaneously, the ProxyCommand must be set to coder (or whatever binary name coder-cli has), and we must warn the user if the binary is not in $PATH.

[CH-15394]

@deansheather deansheather changed the title Enforce coder-cli in PATH on Windows Warn if coder-cli is not in PATH on Windows May 21, 2021
@kylecarbs
Copy link
Member

What's blocking this? Seems like it could be important for the coder tunnel

@deansheather
Copy link
Member Author

@kylecarbs The package I'm using to check if the binary is in path seems to fail when cross-compiled for Windows from within my workspace, but works when I build on my Windows machine. I may just write my own function that does the same thing.

@deansheather deansheather marked this pull request as ready for review July 24, 2021 07:21
@deansheather deansheather requested a review from kylecarbs July 24, 2021 07:21
@deansheather
Copy link
Member Author

It works when I remove GOARCH=386 from the windows builds.

@deansheather deansheather requested review from kylecarbs and removed request for kylecarbs July 26, 2021 16:55
@@ -212,7 +259,7 @@ func makeSSHConfig(binPath, host, userName, workspaceName, privateKeyFilepath st
host := fmt.Sprintf(
`Host coder.%s
HostName coder.%s
ProxyCommand %s tunnel %s 12213 stdio
ProxyCommand "%s" tunnel %s 12213 stdio
Copy link
Member

Choose a reason for hiding this comment

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

Do the quotes work on Linux too? I thought I tried it before...

Copy link
Member Author

Choose a reason for hiding this comment

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

Works on windows, mac and linux from my testing.

@shortcut-integration
Copy link

This pull request has been linked to Clubhouse Story #15394: bug: escape path to coder-cli in .ssh/config.

@deansheather deansheather enabled auto-merge (squash) July 26, 2021 18:59
@deansheather deansheather merged commit 961f7dd into master Jul 26, 2021
@deansheather deansheather deleted the tunnel-msys2 branch July 26, 2021 19:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants