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

[gitpod-desktop] Connect using ssh gateway #346

Merged
merged 1 commit into from
May 24, 2022

Conversation

jeanp413
Copy link
Member

@jeanp413 jeanp413 commented May 3, 2022

Connects to gitpod workspace direclty using ssh gateway, local app is kept for backward compatibility

Related gitpod-io/gitpod#8513

How to test:

  • uninstall remote ssh extension
  • Optional, go to preferences and select vscode desktop
  • Open any workspace in gitpod
  • If in VSCode Browser run command Open in VSCode/VSCode Insiders
  • Workspace should open in desktop local without launching local app, you'll be prompted to install remote-ssh extension

@filiptronicek
Copy link
Member

@jeanp413 are the testing steps just to try to connect to local VS Code using this code of the extension?

@jeanp413
Copy link
Member Author

jeanp413 commented May 3, 2022

Added test steps, I'll generate a vsix file

@jeanp413
Copy link
Member Author

jeanp413 commented May 3, 2022

There's some issue with dependencies, gitpot-protocol is installing a really old version even though it's main on package.json 🤔 I'll look into it later

@jeanp413
Copy link
Member Author

jeanp413 commented May 3, 2022

Added vsix

@jeanp413
Copy link
Member Author

jeanp413 commented May 4, 2022

Updated vsix

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

Generally great work, I'm not sure about session management.

The original idea that we have separate 2 flows:

  • a user uses browser as a primary UI
  • a user uses VS Code

For former settings should not be relevant at all. It used to work even without gitpod.host setting. Latter we will work later, i.e. allow to manage workspaces and start from VS Code when settings are important. We design the same way for other clients like JetBrains.

With that PR it seems that browser flow will swap configurations which is not really great. Maybe we don't need to use VS Code session management API, but use internal? It won't mess with UI and just resolve credentials for one time connection.

@akosyakov
Copy link
Member

For me auth did not work with existing Gitpod account granted for Settings Sync did not work:
Screenshot 2022-05-09 at 13 49 15

I wonder do we need to change something here: https://github.com/gitpod-io/gitpod/blob/63d48ab3a25128e54d23559f07b970d4985ef519/components/server/src/oauth-server/db.ts#L60-L73 ?

@jeanp413
Copy link
Member Author

jeanp413 commented May 9, 2022

yeah I also was wondering that but it seems it's not respected 🤔 the session for ssh has a scope is not listed there but it worked just fine from my tests, does it always fail for you?

@jeanp413
Copy link
Member Author

No it won't fix them, if they use local app for whatever reason (self hosted for example) the bugs will be there

@jeanp413 jeanp413 force-pushed the jp/gitpod-remote-ssh-gateway branch from 774b8df to 2a0b515 Compare May 12, 2022 03:51
@akosyakov
Copy link
Member

akosyakov commented May 12, 2022

Will be closed with this PR?

I think we can close them and say that such self hosted installations should allow SSH direct. We are going to remove local app integration after couple months and should send this signal to our users. There will be in product notification whenever one connects over local app, but also via closed issues.

@jeanp413 jeanp413 force-pushed the jp/gitpod-remote-ssh-gateway branch from 2a0b515 to be36d5b Compare May 12, 2022 04:45
@akosyakov
Copy link
Member

We need to add a smoke test of SSH connection and fallback to the local app for now with proper warning. see internal thread

@akosyakov
Copy link
Member

akosyakov commented May 13, 2022

@jeanp413 just sump up different points done internally:

  • we should never use production untrusted with test vsix files for gitpod desktop [1] (maybe just disable it for test build)
  • we agreed to add a setting to fallback to use local app always if a user for some reason failed to use SSH gateway, but we should still show a notification that local app deprecated on a new attempt
    • the question here where we can tell about such settings, by default we should still try via SSH gateway and only if something goes wrong suggest to use an alternative approach. Most likely only documenting it in docs and changelog will be enough. I don't think we want to highlight much this setting. It means that docs should be prepared before we deploy a new version of extension. I think you can add Configuring SSH connection section in https://github.com/gitpod-io/website/blob/main/gitpod/docs/ides-and-editors/vscode.md. Explain the change there and when to use a fallback.
  • for failed ssh smoke connection, we should guide a user to provide feedback on Workaround for users who cannot use port 22 / SSH (e.g. SSH over HTTPS) gitpod#7452
  • we should add a new analytics event vscode_desktop_ssh with labels:
    • kind is gateway or local-app
    • status is connecting, failed, connected
    • reason when status is failed it can be cancelled, ssh-blocked, other-ssh-error, ws-not-running, other-error (I'm not sure whether we can detect some other common reasons)
  • new analytic event should be tested via [2]
    • it would be good that we don't put in code this segment key but provide as optional parameter during extension build, for production build then we provide key of production untrusted
    • if key is not provided then analytic just should be disabled

@jeanp413
Copy link
Member Author

jeanp413 commented May 13, 2022

  • new analytic event should be tested via [2]
    • it would be good that we don't put in code this segment key but provide as optional parameter during extension build, for production build then we provide key of production untrusted
    • if key is not provided then analytic just should be disabled

Let's do this after we move this to it's own repo, after that you should just checkout this branch and then press f5 to test, I'm tired of creating a vsix manually every time I do some change, I'll just add the new key in the code and comment the production one when building the vsix for now

@jeanp413 jeanp413 force-pushed the jp/gitpod-remote-ssh-gateway branch from 115908c to e29e38c Compare May 14, 2022 04:48
@jeanp413
Copy link
Member Author

for failed ssh smoke connection, we should guide a user to provide feedback on gitpod-io/gitpod#7452

You mean show a warning notification with a link to the issue?

@akosyakov
Copy link
Member

I still see ssh fingerprint check:
Screenshot 2022-05-18 at 14 16 31

We should use a library which after successful SSH smoke test adds this host to known hosts that a user does not need to read through cryptic messages.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

Looks good generally, left comments about docs, analytics and ssh fingerprint.

extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
extensions/gitpod/src/remoteConnector.ts Outdated Show resolved Hide resolved
@iQQBot
Copy link

iQQBot commented May 18, 2022

I only download latest vsix file then install and test, from the user's point of view, this is a really big improvement, both in terms of speed and experience

Thank you @jeanp413

@jeanp413
Copy link
Member Author

@gerardo-junior
Copy link

Please add mosh suport, for roaming/intermittent connectivity

@akosyakov
Copy link
Member

@gerardo-junior Is it related to VS Code Desktop support via SSH? 🤔 If not please file an issue here: https://github.com/gitpod-io/gitpod/issues 🙏

@akosyakov
Copy link
Member

akosyakov commented May 24, 2022

It works super nicely for me and code looks top-notch. Let's finish up docs and ship it 🚀

@jeanp413
Copy link
Member Author

I'm going to merge this, @iQQBot if you have more feedback lets continue in Slack

@jeanp413 jeanp413 force-pushed the jp/gitpod-remote-ssh-gateway branch from fe1f3ee to 612d9b8 Compare May 24, 2022 16:17
@jeanp413 jeanp413 merged commit 746ce41 into gp-code/main May 24, 2022
@jeanp413 jeanp413 deleted the jp/gitpod-remote-ssh-gateway branch May 24, 2022 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants