Skip to content

[JB GW]: Support ssh over websocket tunnel #18415

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

Merged
merged 1 commit into from
Aug 4, 2023
Merged

Conversation

akosyakov
Copy link
Member

@akosyakov akosyakov commented Aug 2, 2023

Description

In some networks SSH either blocked or accessible via complicated setup (bastions, proxy jumps). This PR introduces an alternative mode of connectivity via HTTP tunnel directly into Gitpod workspace, i.e. work around SSH Gateway. This mode is either picked is a fallback or a user can force it in settings.

✅ depends on #18411

Summary generated by Copilot

🤖 Generated by Copilot at 936f0a9

This pull request adds support for different SSH connection methods to the JetBrains IDE plugin, and includes the generated Java code for the supervisor API. It modifies the GitpodConnectionProvider.kt file to implement the new features, and adds the GitpodWebSocketTunnelServer.kt file to enable web socket tunneling. It also removes the api folder from the .gitignore file and adds the InfoServiceGrpc.java file to the repository.

Related Issue(s)

Fixes EXP-279

How to test

  • Download a plugin from the dev channel corresponding to this branch: https://plugins.jetbrains.com/plugin/18438-gitpod-gateway/versions/dev (version should start from 0.0.1-ak-jb_gw_web_socket_tunnel)
  • Install it from the disk in your JetBrains Gateway, apply and restart.
  • Check that you have in preferences now Force SSH over HTTP tunnel setting, leave it disabled for now.
  • Start a workspace on Dogfood (or gitpod.io if you are trying after IDE deployment later today) using some JB IDE.
  • Verify that you can connect over HTTP tunnel and features like port forwarding and gp preview still working. You can check that in GW idea.log you don't have yet logs with prefixes like gitpod: tunnel
  • Now close the client, enable HTTP tunnel in settings, and try everything again. Everything should work still, in logs you will see now gitpod: tunnel. When a client is clsoed, you should see a log that the tunnel is stopped.

Documentation

Preview status

gitpod:summary

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@akosyakov akosyakov force-pushed the ak/jb_gw_web_socket_tunnel branch from 936f0a9 to 31136a8 Compare August 2, 2023 14:57
@roboquat roboquat added size/XL and removed size/XXL labels Aug 2, 2023
@akosyakov akosyakov force-pushed the ak/jb_gw_web_socket_tunnel branch 3 times, most recently from 3e1f1b7 to 90ab5a4 Compare August 3, 2023 07:55
@akosyakov akosyakov marked this pull request as ready for review August 3, 2023 08:02
@akosyakov akosyakov requested a review from a team as a code owner August 3, 2023 08:02
@akosyakov akosyakov force-pushed the ak/jb_gw_web_socket_tunnel branch from 90ab5a4 to 4f592db Compare August 3, 2023 08:13
@mustard-mh
Copy link
Contributor

Follow the test steps, everything looks good. But I can't see gitpod: tunnel in idea.log with or without Force SSH over HTTP tunnel enabled. cc @akosyakov

@akosyakov
Copy link
Member Author

Follow the test steps, everything looks good. But I can't see gitpod: tunnel in idea.log with or without Force SSH over HTTP tunnel enabled. cc @akosyakov

Do you check GW logs?

@mustard-mh
Copy link
Contributor

Follow the test steps, everything looks good. But I can't see gitpod: tunnel in idea.log with or without Force SSH over HTTP tunnel enabled. cc @akosyakov

Do you check GW logs?

collect host and client log -> gateway.log has gitpod: tunnel

image

@akosyakov
Copy link
Member Author

it looks good then, no?

Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

LGTM, but didn't try with old installation of Gitpod (self hosted one remove JetBrains IDEs)

@akosyakov
Copy link
Member Author

/unhold

@roboquat roboquat merged commit f062c79 into main Aug 4, 2023
@roboquat roboquat deleted the ak/jb_gw_web_socket_tunnel branch August 4, 2023 14:32
@JennPlothow JennPlothow mentioned this pull request Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants