devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Allow changing HOST and PORT bindings for openvscode ide

Open gbrayut opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? I am trying to run a workspace on a remote system using the cli on that remote system:

devpod-cli up https://github.com/microsoft/vscode-remote-try-go --id=testing --ide openvscode --provider=docker --ide-option OPEN=false

But then I have to also setup port forwarding from my local machine to the remove system so I can access http://localhost:10800/?folder=/workspaces/testing

ssh -X -A -L 10800:localhost:10800 myuser@myremoteserver

Which solution do you suggest? Allow changing the host:port used for openvscode ide, something like:

--ide-option OPEN=false,HOST=0.0.0.0,PORT=9999

Which alternative solutions exist? Using a proxy server on the remote server to direct requests to the 127.0.0.1:10800 default binding

Additional context My goal is an self-hosted vscode workspace I can access from a chromeos laptop where I can't install anything (even the lightweight devpod client)

gbrayut avatar May 16 '23 23:05 gbrayut

@gbrayut thanks for creating this issue! Just to make sure I understand this correctly, you want to expose vscode on the machine? DevPod automatically does port-forwarding for this given port for you, so you should be able to access it at localhost:10800. Besides that we would also need to publish the port on the remote machine via a -p or you could specify that in the devcontainer.json in appPorts. But we would also require some sort of user / password option to not expose the vscode server unauthenticated. What are your thoughts on this?

FabianKramm avatar May 17 '23 11:05 FabianKramm

@FabianKramm the port forwarding only listens on the localhost address and not on any other network interface. It appears this is hardcoded. What @gbrayut is suggesting is allow passing the network address and port to listen on via the cli.

--ide-option OPEN=false,HOST=0.0.0.0,PORT=9999          # 0.0.0.0 listen on all network addresses.

I have a similar request and am looking at the code to see if we could change the localhost: to a specific network address to listen on.

mavencode01 avatar Jun 26 '23 02:06 mavencode01