Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Question] Coder v2 OSS behind Cloudflare#9130

Unanswered
YueMiyuki asked this question inGeneral
Discussion options

Hi. I have recently deployed Coder v2 OSS on my server and I use cloudflare tunnels to provide secure access to the server.
The question is that if I try to open a worksapce in VS Code Desktop, it fails to load the workspace.
Here is VSCOUTPUT tab:

[19:35:28.450] Log Level: 2[19:35:28.463] VS Code version: 1.81.1[19:35:28.463] Remote-SSH version: remote-ssh@0.102.0[19:35:28.464] win32 x64[19:35:34.363] SSH Resolver called for "ssh-remote+coder-vscode--yue--main", attempt 1[19:35:34.364] "remote.SSH.useLocalServer": false[19:35:34.365] "remote.SSH.showLoginTerminal": false[19:35:34.365] "remote.SSH.remotePlatform": {}[19:35:34.366] "remote.SSH.path": undefined[19:35:34.366] "remote.SSH.configFile": undefined[19:35:34.366] "remote.SSH.useFlock": true[19:35:34.367] "remote.SSH.lockfilesInTmp": false[19:35:34.367] "remote.SSH.localServerDownload": auto[19:35:34.367] "remote.SSH.remoteServerListenOnSocket": false[19:35:34.367] "remote.SSH.showLoginTerminal": false[19:35:34.368] "remote.SSH.defaultExtensions": [][19:35:34.368] "remote.SSH.loglevel": 2[19:35:34.368] "remote.SSH.enableDynamicForwarding": true[19:35:34.369] "remote.SSH.enableRemoteCommand": false[19:35:34.369] "remote.SSH.serverPickPortsFromRange": {}[19:35:34.369] "remote.SSH.serverInstallPath": {}[19:35:34.399] SSH Resolver called for host: coder-vscode--yue--main[19:35:34.399] Setting up SSH remote "coder-vscode--yue--main"[19:35:34.403] Using commit id "6c3e3dba23e8fadc360aed75ce363ba185c49794" and quality "stable" for server[19:35:34.408] Install and start server if needed[19:35:35.522] Checking ssh with "C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\ssh.exe -V"[19:35:35.526] Got error from ssh: spawn C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\ssh.exe ENOENT[19:35:35.526] Checking ssh with "C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot\bin\ssh.exe -V"[19:35:35.527] Got error from ssh: spawn C:\Program Files\Eclipse Adoptium\jdk-17.0.6.10-hotspot\bin\ssh.exe ENOENT[19:35:35.527] Checking ssh with "C:\Program Files (x86)\Intel\iCLS Client\ssh.exe -V"[19:35:35.529] Got error from ssh: spawn C:\Program Files (x86)\Intel\iCLS Client\ssh.exe ENOENT[19:35:35.529] Checking ssh with "C:\Program Files\Intel\iCLS Client\ssh.exe -V"[19:35:35.530] Got error from ssh: spawn C:\Program Files\Intel\iCLS Client\ssh.exe ENOENT[19:35:35.530] Checking ssh with "C:\Windows\system32\ssh.exe -V"[19:35:35.532] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT[19:35:35.532] Checking ssh with "C:\Windows\ssh.exe -V"[19:35:35.534] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT[19:35:35.534] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"[19:35:35.535] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT[19:35:35.536] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"[19:35:35.537] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT[19:35:35.537] Checking ssh with "C:\Program Files\Intel\WiFi\bin\ssh.exe -V"[19:35:35.539] Got error from ssh: spawn C:\Program Files\Intel\WiFi\bin\ssh.exe ENOENT[19:35:35.539] Checking ssh with "C:\Program Files\Common Files\Intel\WirelessCommon\ssh.exe -V"[19:35:35.541] Got error from ssh: spawn C:\Program Files\Common Files\Intel\WirelessCommon\ssh.exe ENOENT[19:35:35.541] Checking ssh with "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\ssh.exe -V"[19:35:35.542] Got error from ssh: spawn C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\ssh.exe ENOENT[19:35:35.542] Checking ssh with "C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\ssh.exe -V"[19:35:35.543] Got error from ssh: spawn C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\ssh.exe ENOENT[19:35:35.544] Checking ssh with "C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\ssh.exe -V"[19:35:35.545] Got error from ssh: spawn C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\ssh.exe ENOENT[19:35:35.545] Checking ssh with "C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\ssh.exe -V"[19:35:35.547] Got error from ssh: spawn C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\ssh.exe ENOENT[19:35:35.547] Checking ssh with "C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\ssh.exe -V"[19:35:35.548] Got error from ssh: spawn C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\ssh.exe ENOENT[19:35:35.549] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"[19:35:35.550] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT[19:35:35.551] Checking ssh with "C:\WINDOWS\ssh.exe -V"[19:35:35.552] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT[19:35:35.552] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"[19:35:35.554] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT[19:35:35.554] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"[19:35:35.555] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT[19:35:35.555] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"[19:35:35.607] > OpenSSH_for_Windows_9.2p1, LibreSSL 3.6.2[19:35:35.611] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 51128 "coder-vscode--yue--main" bash[19:35:35.615] Terminal shell path: C:\WINDOWS\System32\cmd.exe[19:35:37.175] > ssh: Could not resolve hostname coder-vscode--yue--main: \237o\267\250\327R\204e\337@\314\250\326\367\231C\241\243> The process tried to write to a nonexistent pipe.> �]0;C:\WINDOWS\System32\cmd.exe�[19:35:37.176] Got some output, clearing connection timeout[19:35:38.459] "install" terminal command done[19:35:38.459] Install terminal quit with output: �]0;C:\WINDOWS\System32\cmd.exe�[19:35:38.460] Received install output: �]0;C:\WINDOWS\System32\cmd.exe�[19:35:38.461] Failed to parse remote port from server output[19:35:38.464] Resolver error: Error: at m.Create (c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:584145)at t.handleInstallOutput (c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:582705)at t.tryInstall (c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:681881)at async c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:644110at async t.withShowDetailsEvent (c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:647428)at async t.resolve (c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:645160)at async c:\Users\YueYue\.vscode\extensions\ms-vscode-remote.remote-ssh-0.102.0\out\extension.js:1:720916[19:35:38.474] ------
You must be logged in to vote

Replies: 3 comments 11 replies

Comment options

This might be related to your question.
https://discord.com/channels/747933592273027093/1059038889878241310

You must be logged in to vote
10 replies
@phorcys420
Comment options

to use CloudFlare Tunnels with the CLI on the client, you will probably need to do something like this:

export TOKEN=$(cloudflared access token -app=http://coder.example.com)coderexport CODER_HEADER=cf-access-token=$TOKENcoder login https://coder.example.com

or

export TOKEN=$(cloudflared access token -app=http://coder.example.com)coder coder login https://coder.example.com --header cf-access-token=$TOKEN

(https://developers.cloudflare.com/cloudflare-one/tutorials/cli/#using-the-token-as-an-environment-variable)

@phorcys420
Comment options

support for--header was added in#3527
on a side note, since quite a bit of people are using CF Access -- it could be worthy to add a section to our docs. (cc:@matifali, thoughts?)

@matifali
Comment options

Yes. I would personally opt for a guide on how to host Coder behind a cloud flare tunnel.

@alphamichael
Comment options

Thank you so much@phorcys420 and@matifali!! I really appreciate it!

Also, I tried the original discord link again and this time it loaded - I think I hadn't completed onboarding in Discord so it look like the messages were no longer available.

@YueMiyuki
Comment options

Hi- Sorry for the late reply.
I gave up coder behind cloudflare tunnel years ago and switched to cloudflare dns + nginx. It's happy to see that code sever is now supporting cloudflare tunnel. I will definitely try that out later :)

Comment options

Once running the commands@phorcys420 listed, I also needed to run:

coder config-ssh

To get the cloudflared token added to the SSH config. Then I needed to connect to a remote via VSCode and specify the SSH path in the SSH config for the workspace (ssh coder.workspace-name.main). I am unable to use the VSCode button on the workspace or open a previous project in VSCode to connect when I am offsite.

Not an issue really since I can use the SSH path and remote connections, just something to note for future people looking to connect via this method.

You must be logged in to vote
1 reply
@matifali
Comment options

When you connect via the VSCode button it uses thecoder-remote extension that writes it own ssh-config.

To set a header for the extension you need to set it in the extension settings in VSCode.
image

Comment options

you need to enable websockets on cloudflare, and either disable bot fight mode, or add a custom rule to prevent the cloudflare anti-bot measures from stopping coder

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
6 participants
@YueMiyuki@neilmcguigan@chrisbalmer@matifali@alphamichael@phorcys420
Converted from issue

This discussion was converted from issue #9124 on August 16, 2023 15:48.


[8]ページ先頭

©2009-2025 Movatter.jp