coder/coder-jetbrains-toolbox

Coder Desktop Integration

Closed this issue ยท 10 comments

Implement an enhancement making this extension aware of Coder Desktop. With Coder Desktop running, there is already an established tunnel to a workspace; thus, the extension does not need to create another tunnel.

The extension should prioritize the existing tunnel rather than creating a new one and should be able to display tunnel statistics related to the VPN within the editor.

Hi @fioan89. Can you start looking into this? I think the initial launch should contain this functionality.

@ThomasK33 and I can help with how Coder Desktop works here.

Sure. Right now I was working on integrating uri handling. It's slowly progressing as Toolbox API is not as flexilblle as Gateway's API. Should I put it on hold?

No that's a higher priorty. This is something we can look into after that.

OK, so I'll continue with uri handling if my understanding is correct.

This depends on coder/coder#16828 otherwise it would be too complex to handle different URIs for Coder desktop and existing Coder CLI.

We have a reference VS Code implementation at coder/vscode-coder#482

I'm not too familiar with the Jetbrains plugins, but I'd recommend actually not using the VSCode implementation as a reference, since it looks like you don't use wildcard SSH configs, you can probably just config something like (not exact, haven't tested):

Match host coder-jetbrains-toolbox-foo--test.coder.bar exec "/path/to/coder connect exists agent1.foo.owner.coder"
  HostName agent1.foo.owner.coder
Host coder-jetbrains-toolbox-foo--test.coder.bar
  ProxyCommand /path/to/coder ssh owner/foo.agent1
  ConnectTimeout 0
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null
  LogLevel ERROR
  SetEnv CODER_SSH_SESSION_TYPE=JetBrains

Where the ProxyCommand is only used if the agent wasn't available at agent1.foo.owner.coder (also keeping in mind that the .coder suffix is configurable deployment-wide)

For that reason, a better reference implementation would be coder/coder#17419

Thank you for the feedback @ethanndickson. Wildcard config support was added no too long ago.

since it looks like you don't use wildcard SSH configs

@ethanndickson, we do have wildcard configs on by default with the option to opt out.