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

JetBrains Fleet: Add a 1-click button for launching Fleet #246

Open
matifali opened this issue May 6, 2024 · 15 comments
Open

JetBrains Fleet: Add a 1-click button for launching Fleet #246

matifali opened this issue May 6, 2024 · 15 comments
Labels
good first issue Good for newcomers module-idea A new module idea or suggestion

Comments

@matifali
Copy link
Member

matifali commented May 6, 2024

As per this Fleet issue, it will soon support launching remote environments via a URI scheme.

With Fleet 1.36 (the version after the upcoming version 1.35), Fleet URI handler will support connecting to SSH directly using URIs of this format:

fleet://fleet.ssh/<hostname>?<query_params>

with possible params being

  • username
  • port
  • pwd (the working directory to open)
  • forceNewHost (possible values are true and false, default is false - Setting to true will let Fleet ignore previous known hosts and always create a new connection)

username and port can also be specified alongside the hostname in common SSH URI syntax, i.e., <username>@<hostname>:<port>. To avoid ambiguities, pwd can only be specified explicitly.

Only the hostname is required. If some parameters are not specified, Fleet will try to use the closest known match in previous connections or fall back to default values. .ssh/config is considered as usual. Not specifying pwd will open an empty workspace on the host.

Examples:

fleet://fleet.ssh/example.org?username=foo&pwd=/home/foo/my_test_project

fleet://fleet.ssh/foo@example.org?pwd=/home/foo/my_test_project

The current process to connect to a Coder workspace is documented here: https://coder.com/docs/ides/fleet

@kylecarbs @code-asher, what are your thoughts on how we can dynamically populate the URI? We have our plugins for VSCode Desktop and JetBrains gateway, which populates the .ssh/config.


Update: Fleet 1.36, which supports the SSH connection URI, has been released.

@matifali matifali added the module-idea A new module idea or suggestion label May 6, 2024
@kylecarbs
Copy link
Member

Is it possible to have a Fleet extension?

@matifali
Copy link
Member Author

matifali commented May 6, 2024

@kylecarbs not yet. But it's on their long-term roadmap. No developers docs ATM.

@code-asher
Copy link
Member

code-asher commented May 7, 2024

Yeah without an extension the best we can do is document that coder config-ssh has to be ran manually and then use the coder.workspacename hostname in the URI, I think.

@kylecarbs
Copy link
Member

This is insane, but I'm pretty sure Chrome handles ssh://.

In some magically insane world, we could add a small sniffer to the initial HTTPS packet for the SSH prefix (e.g. SSH-), and then authenticate using a secret username. Then we could one-click open anything, even without an extension!

ssh mymagicstring--dev--kylecarbs@dev.coder.com

@code-asher
Copy link
Member

Woaaaah that is actually dope.

@michaelbrewer
Copy link
Contributor

nice, what awesome about fleet is that it's free, for now.

@michaelbrewer
Copy link
Contributor

Maybe in preparation the fleet icon can be added to the coder server ;)

Also you do need have your ssh config updated ahead of time.

@michaelbrewer
Copy link
Contributor

michaelbrewer commented May 23, 2024

Screenshot 2024-05-23 at 3 36 54 PM

For sure you can access the server via chrome: ssh://coder.platform-onbarding.main and with fleet it would be fleet://fleet.ssh/foo@example.org?pwd=/workspace/platform-onboarding. The template would have to get the remote name ie: coder.platform-onbarding.main, for which i assume it coder.<workspace_id>.<agent_id> ?

@matifali
Copy link
Member Author

or which i assume it coder.<workspace_id>.<agent_id>

It should be coder.<workspace_id>.<agent_name> given that coder config-ssh is already run.

@michaelbrewer
Copy link
Contributor

i see that fleet 1.37 now out and this url schema works well :)

@matifali matifali added the good first issue Good for newcomers label Jul 25, 2024
@michaelbrewer
Copy link
Contributor

@matifali i added the fleet icon to coder so long coder/coder#14021

@michaelbrewer
Copy link
Contributor

or which i assume it coder.<workspace_id>.<agent_id>

It should be coder.<workspace_id>.<agent_name> given that coder config-ssh is already run.

And there is no way to know that the coder cli was installed locally or that coder config-ssh was run

@matifali
Copy link
Member Author

And there is no way to know that the coder cli was installed locally or that coder config-ssh was run

Sadly yes for now. It might change in future when Fleet support extensions or We find another way probably through Coder chrome extension.

@michaelbrewer
Copy link
Contributor

The same problem exists for people using JetBrains IDE (you need to pre-install Jetbrain Gateway).

@matifali
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers module-idea A new module idea or suggestion
Projects
None yet
Development

No branches or pull requests

4 participants