From 754e44b110b541d7fdf72c37a46c2ee14c9d2ede Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Wed, 18 Dec 2024 21:52:45 +0000 Subject: [PATCH 01/15] copy and md --- docs/user-guides/workspace-access/jetbrains.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains.md b/docs/user-guides/workspace-access/jetbrains.md index 1c3f53830b42a..ef8df9f42c4d9 100644 --- a/docs/user-guides/workspace-access/jetbrains.md +++ b/docs/user-guides/workspace-access/jetbrains.md @@ -194,10 +194,16 @@ keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ ## Using an existing JetBrains installation in the workspace +
+ +This step must be done before configuring Gateway. + +
+ If you would like to use an existing JetBrains IDE in a Coder workspace (or you -are air-gapped, and cannot reach jetbrains.com), run the following script in the +are air-gapped, and cannot reach `jetbrains.com`), run the following script in the JetBrains IDE directory to point the default Gateway directory to the IDE -directory. This step must be done before configuring Gateway. +directory. ```shell cd /opt/idea/bin From 75875f393f33855589d0d41436ab6b60a13928c7 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Thu, 26 Dec 2024 18:45:47 +0000 Subject: [PATCH 02/15] jetbrains initial copy and md edit --- .../user-guides/workspace-access/jetbrains.md | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains.md b/docs/user-guides/workspace-access/jetbrains.md index ef8df9f42c4d9..5c70fd5951e06 100644 --- a/docs/user-guides/workspace-access/jetbrains.md +++ b/docs/user-guides/workspace-access/jetbrains.md @@ -1,6 +1,6 @@ # JetBrains IDEs -We support JetBrains IDEs using +Coder supports JetBrains IDEs using [Gateway](https://www.jetbrains.com/remote-development/gateway/). The following IDEs are supported for remote development: @@ -16,11 +16,11 @@ IDEs are supported for remote development: ## JetBrains Gateway JetBrains Gateway is a compact desktop app that allows you to work remotely with -a JetBrains IDE without even downloading one. Visit the -[JetBrains website](https://www.jetbrains.com/remote-development/gateway/) to +a JetBrains IDE without downloading one. Visit the +[JetBrains Gateway website](https://www.jetbrains.com/remote-development/gateway/) to learn more about Gateway. -Gateway can connect to a Coder workspace by using Coder's Gateway plugin or +Gateway can connect to a Coder workspace using Coder's Gateway plugin or manually setting up an SSH connection. ### How to use the plugin @@ -75,8 +75,8 @@ manually setting up an SSH connection. ### Update a Coder plugin version -1. Click the gear icon at the bottom left of the Gateway home screen and then - "Settings" +1. Click the gear icon at the bottom left of the Gateway home screen, then + **Settings**. 1. In the **Marketplace** tab within Plugins, enter Coder and if a newer plugin release is available, click **Update** then **OK**: @@ -93,31 +93,42 @@ Failed to configure connection to https://coder.internal.enterprise/: PKIX path ``` To resolve this issue, you will need to add Coder's certificate to the Java -trust store present on your local machine. Here is the default location of the -trust store for each OS: +trust store present on your local machine: -```console -# Linux +
+ +#### Linux + +```none /jbr/lib/security/cacerts +``` + +Use the `keytool` utility that ships with Java: + +```shell +keytool -import -alias coder -file -keystore /path/to/trust/store +``` + +#### macOS -# macOS +```none /jbr/lib/security/cacerts /Library/Application Support/JetBrains/Toolbox/apps/JetBrainsGateway/ch-0//JetBrains Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts # Path for Toolbox installation +``` + +Use the `keytool` included in the JetBrains Gateway installation: -# Windows -C:\Program Files (x86)\\jre\lib\security\cacerts -%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts # Path for Toolbox installation +```shell +keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts ``` -To add the certificate to the keystore, you can use the `keytool` utility that -ships with Java: +#### Windows -```console -keytool -import -alias coder -file -keystore /path/to/trust/store +```none +C:\Program Files (x86)\\jre\lib\security\cacerts\%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts # Path for Toolbox installation ``` -You can use `keytool` that ships with the JetBrains Gateway installation. -Windows example: +Use the `keytool` included in the JetBrains Gateway installation: ```powershell & 'C:\Program Files\JetBrains\JetBrains Gateway /jbr/bin/keytool.exe' 'C:\Program Files\JetBrains\JetBrains Gateway /jre/lib/security/cacerts' -import -alias coder -file @@ -126,11 +137,8 @@ Windows example: & '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\apps\Gateway\ch-0\\jbr\bin\keytool.exe' '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts' -import -alias coder -file ``` -macOS example: -```shell -keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts -``` +
## Manually Configuring A JetBrains Gateway Connection From 74a56243bce30a48c509e6102bb9f29aa6a98569 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Thu, 2 Jan 2025 21:06:12 +0000 Subject: [PATCH 03/15] make fmt --- docs/user-guides/workspace-access/jetbrains.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains.md b/docs/user-guides/workspace-access/jetbrains.md index 5c70fd5951e06..8164fb18e53e2 100644 --- a/docs/user-guides/workspace-access/jetbrains.md +++ b/docs/user-guides/workspace-access/jetbrains.md @@ -17,8 +17,8 @@ IDEs are supported for remote development: JetBrains Gateway is a compact desktop app that allows you to work remotely with a JetBrains IDE without downloading one. Visit the -[JetBrains Gateway website](https://www.jetbrains.com/remote-development/gateway/) to -learn more about Gateway. +[JetBrains Gateway website](https://www.jetbrains.com/remote-development/gateway/) +to learn more about Gateway. Gateway can connect to a Coder workspace using Coder's Gateway plugin or manually setting up an SSH connection. @@ -137,7 +137,6 @@ Use the `keytool` included in the JetBrains Gateway installation: & '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\apps\Gateway\ch-0\\jbr\bin\keytool.exe' '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts' -import -alias coder -file ``` - ## Manually Configuring A JetBrains Gateway Connection @@ -209,8 +208,8 @@ This step must be done before configuring Gateway. If you would like to use an existing JetBrains IDE in a Coder workspace (or you -are air-gapped, and cannot reach `jetbrains.com`), run the following script in the -JetBrains IDE directory to point the default Gateway directory to the IDE +are air-gapped, and cannot reach `jetbrains.com`), run the following script in +the JetBrains IDE directory to point the default Gateway directory to the IDE directory. ```shell From b5e80079762dceba61e334173727c72684786d5c Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Fri, 3 Jan 2025 15:14:33 +0000 Subject: [PATCH 04/15] move JetBrains offline steps to separate doc; update links --- docs/changelogs/v2.1.5.md | 2 +- docs/install/offline.md | 2 +- docs/manifest.json | 9 +- docs/user-guides/workspace-access/index.md | 6 +- .../{jetbrains.md => jetbrains/index.md} | 157 ------------------ .../jetbrains/jetbrains-offline.md | 156 +++++++++++++++++ docs/user-guides/workspace-lifecycle.md | 2 +- 7 files changed, 170 insertions(+), 164 deletions(-) rename docs/user-guides/workspace-access/{jetbrains.md => jetbrains/index.md} (63%) create mode 100644 docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md diff --git a/docs/changelogs/v2.1.5.md b/docs/changelogs/v2.1.5.md index f23eff4b67b25..2072386accc8f 100644 --- a/docs/changelogs/v2.1.5.md +++ b/docs/changelogs/v2.1.5.md @@ -54,7 +54,7 @@ - Add -[JetBrains Gateway Offline Mode](https://coder.com/docs/user-guides/workspace-access/jetbrains.md#jetbrains-gateway-in-an-offline-environment) +[JetBrains Gateway Offline Mode](https://coder.com/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md) config steps (#9388) (@ericpaulsen) - Describe diff --git a/docs/install/offline.md b/docs/install/offline.md index 72db203d86dfb..db1d770f34fae 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -249,7 +249,7 @@ Coder is installed. ## JetBrains IDEs Gateway, JetBrains' remote development product that works with Coder, -[has documented offline deployment steps.](../user-guides/workspace-access/jetbrains.md#jetbrains-gateway-in-an-offline-environment) +[has documented offline deployment steps.](../user-guides/workspace-access/jetbrains/jetbrains-offline.md) ## Microsoft VS Code Remote - SSH diff --git a/docs/manifest.json b/docs/manifest.json index fcac552ee0496..19c9a12a1ce24 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -124,7 +124,14 @@ { "title": "JetBrains IDEs", "description": "Use JetBrains IDEs with Gateway", - "path": "./user-guides/workspace-access/jetbrains.md" + "path": "./user-guides/workspace-access/jetbrains/index.md", + "children": [ + { + "title": "JetBrains Gateway in an offline environment", + "description": "Use JetBrains Gateway in an offline environment", + "path": "./user-guides/workspace-access/jetbrains/jetbrains-offline.md" + } + ] }, { "title": "Remote Desktop", diff --git a/docs/user-guides/workspace-access/index.md b/docs/user-guides/workspace-access/index.md index be1ebad3967b3..40d81ca1dfce8 100644 --- a/docs/user-guides/workspace-access/index.md +++ b/docs/user-guides/workspace-access/index.md @@ -86,10 +86,10 @@ IDEs are supported for remote development: - Rider - RubyMine - WebStorm -- [JetBrains Fleet](./jetbrains.md#jetbrains-fleet) +- [JetBrains Fleet](./jetbrains/index.md#jetbrains-fleet) -Read our [docs on JetBrains Gateway](./jetbrains.md) for more information on -connecting your JetBrains IDEs. +Read our [docs on JetBrains Gateway](./jetbrains/index.md) for more information +on connecting your JetBrains IDEs. ## code-server diff --git a/docs/user-guides/workspace-access/jetbrains.md b/docs/user-guides/workspace-access/jetbrains/index.md similarity index 63% rename from docs/user-guides/workspace-access/jetbrains.md rename to docs/user-guides/workspace-access/jetbrains/index.md index 8164fb18e53e2..8b69d2db1ffc6 100644 --- a/docs/user-guides/workspace-access/jetbrains.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -223,163 +223,6 @@ cd /opt/idea/bin [Here is the JetBrains article](https://www.jetbrains.com/help/idea/remote-development-troubleshooting.html#setup:~:text=Can%20I%20point%20Remote%20Development%20to%20an%20existing%20IDE%20on%20my%20remote%20server%3F%20Is%20it%20possible%20to%20install%20IDE%20manually%3F) explaining this IDE specification. -## JetBrains Gateway in an offline environment - -In networks that restrict access to the internet, you will need to leverage the -JetBrains Client Installer to download and save the IDE clients locally. Please -see the -[JetBrains documentation for more information](https://www.jetbrains.com/help/idea/fully-offline-mode.html). - -### Configuration Steps - -The Coder team built a POC of the JetBrains Gateway Offline Mode solution. Here -are the steps we took (and "gotchas"): - -### 1. Deploy the server and install the Client Downloader - -We deployed a simple Ubuntu VM and installed the JetBrains Client Downloader -binary. Note that the server must be a Linux-based distribution. - -```shell -wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ -tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -``` - -### 2. Install backends and clients - -JetBrains Gateway requires both a backend to be installed on the remote host -(your Coder workspace) and a client to be installed on your local machine. You -can host both on the server in this example. - -See here for the full -[JetBrains product list and builds](https://data.services.jetbrains.com/products). -Below is the full list of supported `--platforms-filter` values: - -```console -windows-x64, windows-aarch64, linux-x64, linux-aarch64, osx-x64, osx-aarch64 -``` - -To install both backends and clients, you will need to run two commands. - -**Backends** - -```shell -mkdir ~/backends -./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 --download-backends ~/backends -``` - -**Clients** - -This is the same command as above, with the `--download-backends` flag removed. - -```shell -mkdir ~/clients -./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 ~/clients -``` - -We now have both clients and backends installed. - -### 3. Install a web server - -You will need to run a web server in order to serve requests to the backend and -client files. We installed `nginx` and setup an FQDN and routed all requests to -`/`. See below: - -```console -server { - listen 80 default_server; - listen [::]:80 default_server; - - root /var/www/html; - - index index.html index.htm index.nginx-debian.html; - - server_name _; - - location / { - root /home/ubuntu; - } -} -``` - -Then, configure your DNS entry to point to the IP address of the server. For the -purposes of the POC, we did not configure TLS, although that is a supported -option. - -### 4. Add Client Files - -You will need to add the following files on your local machine in order for -Gateway to pull the backend and client from the server. - -```shell -$ cat productsInfoUrl # a path to products.json that was generated by the backend's downloader (it could be http://, https://, or file://) - -https://internal.site/backends//products.json - -$ cat clientDownloadUrl # a path for clients that you got from the clients' downloader (it could be http://, https://, or file://) - -https://internal.site/clients/ - -$ cat jreDownloadUrl # a path for JBR that you got from the clients' downloader (it could be http://, https://, or file://) - -https://internal.site/jre/ - -$ cat pgpPublicKeyUrl # a URL to the KEYS file that was downloaded with the clients builds. - -https://internal.site/KEYS -``` - -The location of these files will depend upon your local operating system: - -**macOS** - -```console -# User-specific settings -/Users/UserName/Library/Application Support/JetBrains/RemoteDev -# System-wide settings -/Library/Application Support/JetBrains/RemoteDev/ -``` - -**Linux** - -```console -# User-specific settings -$HOME/.config/JetBrains/RemoteDev -# System-wide settings -/etc/xdg/JetBrains/RemoteDev/ -``` - -**Windows** - -```console -# User-specific settings -HKEY_CURRENT_USER registry -# System-wide settings -HKEY_LOCAL_MACHINE registry -``` - -Additionally, create a string for each setting with its appropriate value in -`SOFTWARE\JetBrains\RemoteDev`: - -![Alt text](../../images/gateway/jetbrains-offline-windows.png) - -### 5. Setup SSH connection with JetBrains Gateway - -With the server now configured, you can now configure your local machine to use -Gateway. Here is the documentation to -[setup SSH config via the Coder CLI](../../user-guides/workspace-access/index.md#configure-ssh). -On the Gateway side, follow our guide here until step 16. - -Instead of downloading from jetbrains.com, we will point Gateway to our server -endpoint. Select `Installation options...` and select `Use download link`. Note -that the URL must explicitly reference the archive file: - -![Offline Gateway](../../images/gateway/offline-gateway.png) - -Click `Download IDE and Connect`. Gateway should now download the backend and -clients from the server into your remote workspace and local machine, -respectively. - ## JetBrains Fleet JetBrains Fleet is a code editor and lightweight IDE designed to support various diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md new file mode 100644 index 0000000000000..6e409a167e77f --- /dev/null +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md @@ -0,0 +1,156 @@ +# JetBrains Gateway in an offline environment + +In networks that restrict access to the internet, you will need to leverage the +JetBrains Client Installer to download and save the IDE clients locally. Please +see the +[JetBrains documentation for more information](https://www.jetbrains.com/help/idea/fully-offline-mode.html). + +## Configuration Steps + +The Coder team built a POC of the JetBrains Gateway Offline Mode solution. Here +are the steps we took (and "gotchas"): + +## 1. Deploy the server and install the Client Downloader + +We deployed a simple Ubuntu VM and installed the JetBrains Client Downloader +binary. Note that the server must be a Linux-based distribution. + +```shell +wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ +tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz +``` + +## 2. Install backends and clients + +JetBrains Gateway requires both a backend to be installed on the remote host +(your Coder workspace) and a client to be installed on your local machine. You +can host both on the server in this example. + +See here for the full +[JetBrains product list and builds](https://data.services.jetbrains.com/products). +Below is the full list of supported `--platforms-filter` values: + +```console +windows-x64, windows-aarch64, linux-x64, linux-aarch64, osx-x64, osx-aarch64 +``` + +To install both backends and clients, you will need to run two commands. + +**Backends** + +```shell +mkdir ~/backends +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 --download-backends ~/backends +``` + +**Clients** + +This is the same command as above, with the `--download-backends` flag removed. + +```shell +mkdir ~/clients +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 ~/clients +``` + +We now have both clients and backends installed. + +## 3. Install a web server + +You will need to run a web server in order to serve requests to the backend and +client files. We installed `nginx` and setup an FQDN and routed all requests to +`/`. See below: + +```console +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /var/www/html; + + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + root /home/ubuntu; + } +} +``` + +Then, configure your DNS entry to point to the IP address of the server. For the +purposes of the POC, we did not configure TLS, although that is a supported +option. + +## 4. Add Client Files + +You will need to add the following files on your local machine in order for +Gateway to pull the backend and client from the server. + +```shell +$ cat productsInfoUrl # a path to products.json that was generated by the backend's downloader (it could be http://, https://, or file://) + +https://internal.site/backends//products.json + +$ cat clientDownloadUrl # a path for clients that you got from the clients' downloader (it could be http://, https://, or file://) + +https://internal.site/clients/ + +$ cat jreDownloadUrl # a path for JBR that you got from the clients' downloader (it could be http://, https://, or file://) + +https://internal.site/jre/ + +$ cat pgpPublicKeyUrl # a URL to the KEYS file that was downloaded with the clients builds. + +https://internal.site/KEYS +``` + +The location of these files will depend upon your local operating system: + +**macOS** + +```console +# User-specific settings +/Users/UserName/Library/Application Support/JetBrains/RemoteDev +# System-wide settings +/Library/Application Support/JetBrains/RemoteDev/ +``` + +**Linux** + +```console +# User-specific settings +$HOME/.config/JetBrains/RemoteDev +# System-wide settings +/etc/xdg/JetBrains/RemoteDev/ +``` + +**Windows** + +```console +# User-specific settings +HKEY_CURRENT_USER registry +# System-wide settings +HKEY_LOCAL_MACHINE registry +``` + +Additionally, create a string for each setting with its appropriate value in +`SOFTWARE\JetBrains\RemoteDev`: + +![Alt text](../../images/gateway/jetbrains-offline-windows.png) + +## 5. Setup SSH connection with JetBrains Gateway + +With the server now configured, you can now configure your local machine to use +Gateway. Here is the documentation to +[setup SSH config via the Coder CLI](../../user-guides/workspace-access/index.md#configure-ssh). +On the Gateway side, follow our guide here until step 16. + +Instead of downloading from jetbrains.com, we will point Gateway to our server +endpoint. Select `Installation options...` and select `Use download link`. Note +that the URL must explicitly reference the archive file: + +![Offline Gateway](../../images/gateway/offline-gateway.png) + +Click `Download IDE and Connect`. Gateway should now download the backend and +clients from the server into your remote workspace and local machine, +respectively. diff --git a/docs/user-guides/workspace-lifecycle.md b/docs/user-guides/workspace-lifecycle.md index 56d0c0b5ba7fd..543691d6f48b5 100644 --- a/docs/user-guides/workspace-lifecycle.md +++ b/docs/user-guides/workspace-lifecycle.md @@ -55,7 +55,7 @@ contain some computational resource to run the Coder agent process. The provisioned workspace's computational resources start the agent process, which opens connections to your workspace via SSH, the terminal, and IDES such -as [JetBrains](./workspace-access/jetbrains.md) or +as [JetBrains](./workspace-access/jetbrains/index.md) or [VSCode](./workspace-access/vscode.md). Once started, the Coder agent is responsible for running your workspace startup From 5724624505d33ed642f093884c3f5d5a8737e234 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Fri, 3 Jan 2025 16:04:18 +0000 Subject: [PATCH 05/15] fix relative links --- .../workspace-access/jetbrains/index.md | 34 +++++++++---------- .../jetbrains/jetbrains-offline.md | 6 ++-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index 5c774e630e1c1..544423adc7b7b 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -38,16 +38,16 @@ manually setting up an SSH connection. Click **Connect to Coder** to launch the plugin: - ![Gateway Connect to Coder](../../images/gateway/plugin-connect-to-coder.png) + ![Gateway Connect to Coder](../../../images/gateway/plugin-connect-to-coder.png) 1. Enter your Coder deployment's - [Access Url](../../admin/setup/index.md#access-url) and click **Connect**. + [Access Url](../../../admin/setup/index.md#access-url) and click **Connect**. Gateway opens your Coder deployment's `cli-auth` page with a session token. Click the copy button, paste the session token in the Gateway **Session Token** window, then click **OK**: - ![Gateway Session Token](../../images/gateway/plugin-session-token.png) + ![Gateway Session Token](../../../images/gateway/plugin-session-token.png) 1. To create a new workspace: @@ -59,16 +59,16 @@ manually setting up an SSH connection. 1. When the workspace status is **Running**, click **Select IDE and Project**: - ![Gateway IDE List](../../images/gateway/plugin-select-ide.png) + ![Gateway IDE List](../../../images/gateway/plugin-select-ide.png) 1. Select the JetBrains IDE for your project and the project directory then click **Start IDE and connect**: - ![Gateway Select IDE](../../images/gateway/plugin-ide-list.png) + ![Gateway Select IDE](../../../images/gateway/plugin-ide-list.png) Gateway connects using the IDE you selected: - ![Gateway IDE Opened](../../images/gateway/gateway-intellij-opened.png) + ![Gateway IDE Opened](../../../images/gateway/gateway-intellij-opened.png) > Note the JetBrains IDE is remotely installed into > `~/.cache/JetBrains/RemoteDev/dist` @@ -81,7 +81,7 @@ manually setting up an SSH connection. 1. In the **Marketplace** tab within Plugins, enter Coder and if a newer plugin release is available, click **Update** then **OK**: - ![Gateway Settings and Marketplace](../../images/gateway/plugin-settings-marketplace.png) + ![Gateway Settings and Marketplace](../../../images/gateway/plugin-settings-marketplace.png) ### Configuring the Gateway plugin to use internal certificates @@ -146,21 +146,21 @@ Use the `keytool` included in the JetBrains Gateway installation: 1. [Install Gateway](https://www.jetbrains.com/help/idea/jetbrains-gateway.html). -1. [Configure the `coder` CLI](../../user-guides/workspace-access/index.md#configure-ssh). +1. [Configure the `coder` CLI](../../../user-guides/workspace-access/index.md#configure-ssh). 1. Open Gateway, make sure **SSH** is selected under **Remote Development**. 1. Click **New Connection**: - ![Gateway Home](../../images/gateway/gateway-home.png) + ![Gateway Home](../../../images/gateway/gateway-home.png) 1. In the resulting dialog, click the gear icon to the right of **Connection**: - ![Gateway New Connection](../../images/gateway/gateway-new-connection.png) + ![Gateway New Connection](../../../images/gateway/gateway-new-connection.png) 1. Click + to add a new SSH connection: - ![Gateway Add Connection](../../images/gateway/gateway-add-ssh-configuration.png) + ![Gateway Add Connection](../../../images/gateway/gateway-add-ssh-configuration.png) 1. For the Host, enter `coder.` @@ -177,27 +177,27 @@ Use the `keytool` included in the JetBrains Gateway installation: 1. Click **OK**: - ![Gateway SSH Configuration](../../images/gateway/gateway-create-ssh-configuration.png) + ![Gateway SSH Configuration](../../../images/gateway/gateway-create-ssh-configuration.png) 1. Select the connection you just added: - ![Gateway Welcome](../../images/gateway/gateway-welcome.png) + ![Gateway Welcome](../../../images/gateway/gateway-welcome.png) 1. Click **Check Connection and Continue**: - ![Gateway Continue](../../images/gateway/gateway-continue.png) + ![Gateway Continue](../../../images/gateway/gateway-continue.png) 1. Select the JetBrains IDE for your project and the project directory. SSH into your server to create a directory or check out code if you haven't already. - ![Gateway Choose IDE](../../images/gateway/gateway-choose-ide.png) + ![Gateway Choose IDE](../../../images/gateway/gateway-choose-ide.png) > Note the JetBrains IDE is remotely installed into > `~/. cache/JetBrains/RemoteDev/dist` 1. Click **Download and Start IDE** to connect. - ![Gateway IDE Opened](../../images/gateway/gateway-intellij-opened.png) + ![Gateway IDE Opened](../../../images/gateway/gateway-intellij-opened.png) ## Using an existing JetBrains installation in the workspace @@ -247,7 +247,7 @@ Fleet can connect to a Coder workspace by following these steps. ``` 4. Connect via SSH with the Host set to `coder.workspace-name` - ![Fleet Connect to Coder](../../images/fleet/ssh-connect-to-coder.png) + ![Fleet Connect to Coder](../../../images/fleet/ssh-connect-to-coder.png) > If you experience problems, please > [create a GitHub issue](https://github.com/coder/coder/issues) or share in diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md index 55b14e82f0256..cad207319e2fe 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md @@ -136,20 +136,20 @@ HKEY_LOCAL_MACHINE registry Additionally, create a string for each setting with its appropriate value in `SOFTWARE\JetBrains\RemoteDev`: -![Alt text](../../images/gateway/jetbrains-offline-windows.png) +![JetBrains offline - Windows](../../../images/gateway/jetbrains-offline-windows.png) ## 5. Setup SSH connection with JetBrains Gateway With the server now configured, you can now configure your local machine to use Gateway. Here is the documentation to -[setup SSH config via the Coder CLI](../../user-guides/workspace-access/index.md#configure-ssh). +[setup SSH config via the Coder CLI](../../../user-guides/workspace-access/index.md#configure-ssh). On the Gateway side, follow our guide here until step 16. Instead of downloading from jetbrains.com, we will point Gateway to our server endpoint. Select `Installation options...` and select `Use download link`. Note that the URL must explicitly reference the archive file: -![Offline Gateway](../../images/gateway/offline-gateway.png) +![Offline Gateway](../../../images/gateway/offline-gateway.png) Click `Download IDE and Connect`. Gateway should now download the backend and clients from the server into your remote workspace and local machine, From e9b1e18459090326af8c8e72bf1a2c69f48ac8d7 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Fri, 3 Jan 2025 19:38:45 +0000 Subject: [PATCH 06/15] s/offline/airgapped --- docs/changelogs/v2.1.5.md | 2 +- docs/install/offline.md | 2 +- docs/manifest.json | 6 +++--- .../{jetbrains-offline.md => jetbrains-airgapped.md} | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename docs/user-guides/workspace-access/jetbrains/{jetbrains-offline.md => jetbrains-airgapped.md} (99%) diff --git a/docs/changelogs/v2.1.5.md b/docs/changelogs/v2.1.5.md index 8f62edae401aa..915144319b05c 100644 --- a/docs/changelogs/v2.1.5.md +++ b/docs/changelogs/v2.1.5.md @@ -56,7 +56,7 @@ - Add -[JetBrains Gateway Offline Mode](https://coder.com/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md) +[JetBrains Gateway Offline Mode](https://coder.com/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md) config steps (#9388) (@ericpaulsen) - Describe diff --git a/docs/install/offline.md b/docs/install/offline.md index 747615557fb9d..2e86266deadd7 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -249,7 +249,7 @@ Coder is installed. ## JetBrains IDEs Gateway, JetBrains' remote development product that works with Coder, -[has documented offline deployment steps.](../user-guides/workspace-access/jetbrains/jetbrains-offline.md) +[has documented offline deployment steps.](../user-guides/workspace-access/jetbrains/jetbrains-airgapped.md) ## Microsoft VS Code Remote - SSH diff --git a/docs/manifest.json b/docs/manifest.json index 0e17784b1b0c2..56597b105f100 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -127,9 +127,9 @@ "path": "./user-guides/workspace-access/jetbrains/index.md", "children": [ { - "title": "JetBrains Gateway in an offline environment", - "description": "Use JetBrains Gateway in an offline environment", - "path": "./user-guides/workspace-access/jetbrains/jetbrains-offline.md" + "title": "JetBrains Gateway in an air-gapped environment", + "description": "Use JetBrains Gateway in an air-gapped offline environment", + "path": "./user-guides/workspace-access/jetbrains/jetbrains-airgapped.md" } ] }, diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md similarity index 99% rename from docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md rename to docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md index cad207319e2fe..72f90de394e71 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-offline.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md @@ -1,4 +1,4 @@ -# JetBrains Gateway in an offline environment +# JetBrains Gateway in an air-gapped environment In networks that restrict access to the internet, you will need to leverage the JetBrains Client Installer to download and save the IDE clients locally. Please From 9ead1695d218f76228cc835643fac82fea03a8c5 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Tue, 7 Jan 2025 21:22:26 +0000 Subject: [PATCH 07/15] copy edit --- .../workspace-access/jetbrains/index.md | 2 +- .../jetbrains/jetbrains-airgapped.md | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index 544423adc7b7b..dea8388492500 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -193,7 +193,7 @@ Use the `keytool` included in the JetBrains Gateway installation: ![Gateway Choose IDE](../../../images/gateway/gateway-choose-ide.png) > Note the JetBrains IDE is remotely installed into - > `~/. cache/JetBrains/RemoteDev/dist` + > `~/.cache/JetBrains/RemoteDev/dist` 1. Click **Download and Start IDE** to connect. diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md index 72f90de394e71..c68d0a3b38daa 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md @@ -7,13 +7,15 @@ see the ## Configuration Steps -The Coder team built a POC of the JetBrains Gateway Offline Mode solution. Here -are the steps we took (and "gotchas"): +This page is an example that the Coder team used as a proof-of-concept (POC) of the JetBrains Gateway Offline Mode solution. + +We used Ubuntu on a virtual machine to test the steps. +If you have a suggestion or encounter an issue, please +[file a GitHub issue](https://github.com/coder/coder/issues/new?title=request%28docs%29%3A+jetbrains-airgapped+-+request+title+here%0D%0A&labels=["community","docs"]&body=doc%3A+%5Bjetbrains-airgapped%5D%28https%3A%2F%2Fcoder.com%2Fdocs%2Fuser-guides%2Fworkspace-access%2Fjetbrains%2Fjetbrains-airgapped%29%0D%0A%0D%0Aplease+enter+your+request+here%0D%0A). ## 1. Deploy the server and install the Client Downloader -We deployed a simple Ubuntu VM and installed the JetBrains Client Downloader -binary. Note that the server must be a Linux-based distribution. +Install the JetBrains Client Downloader binary. Note that the server must be a Linux-based distribution: ```shell wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ @@ -106,6 +108,8 @@ https://internal.site/KEYS The location of these files will depend upon your local operating system: +
+ ### macOS ```console @@ -138,6 +142,8 @@ Additionally, create a string for each setting with its appropriate value in ![JetBrains offline - Windows](../../../images/gateway/jetbrains-offline-windows.png) +
+ ## 5. Setup SSH connection with JetBrains Gateway With the server now configured, you can now configure your local machine to use From 302406a6a771da272f816143b4f5d52c11226771 Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Wed, 8 Jan 2025 20:57:48 +0000 Subject: [PATCH 08/15] copy edit --- docs/user-guides/workspace-access/jetbrains/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index c042f0c0f5861..cbecc79503100 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -22,8 +22,8 @@ a JetBrains IDE without downloading one. Visit the [JetBrains Gateway website](https://www.jetbrains.com/remote-development/gateway/) to learn more about Gateway. -Gateway can connect to a Coder workspace using Coder's Gateway plugin or -manually setting up an SSH connection. +Gateway can connect to a Coder workspace using Coder's Gateway plugin or through a +manually configured SSH connection. ### How to use the plugin @@ -87,8 +87,8 @@ manually setting up an SSH connection. ### Configuring the Gateway plugin to use internal certificates -When attempting to connect to a Coder deployment that uses internally signed -certificates, you may receive the following error in Gateway: +When you attempt to connect to a Coder deployment that uses internally signed +certificates, you might receive the following error in Gateway: ```console Failed to configure connection to https://coder.internal.enterprise/: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target From 951efd1bbf2db7ffa3c34f3f85b13cd7a23f348a Mon Sep 17 00:00:00 2001 From: EdwardAngert Date: Wed, 8 Jan 2025 21:15:15 +0000 Subject: [PATCH 09/15] add jetbrains-pre-install --- docs/manifest.json | 5 ++++ .../workspace-access/jetbrains/index.md | 2 ++ .../jetbrains/jetbrains-airgapped.md | 2 -- .../jetbrains/jetbrains-pre-install.md | 29 +++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md diff --git a/docs/manifest.json b/docs/manifest.json index 56597b105f100..0a35eefc1f205 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -126,6 +126,11 @@ "description": "Use JetBrains IDEs with Gateway", "path": "./user-guides/workspace-access/jetbrains/index.md", "children": [ + { + "title": "Pre-install JetBrains Gateway in a template", + "description": "Pre-install JetBrains Gateway in a template", + "path": "./user-guides/workspace-access/jetbrains/jetbrains-pre-install.md" + }, { "title": "JetBrains Gateway in an air-gapped environment", "description": "Use JetBrains Gateway in an air-gapped offline environment", diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index cbecc79503100..cbc7cd7517b4d 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -25,6 +25,8 @@ to learn more about Gateway. Gateway can connect to a Coder workspace using Coder's Gateway plugin or through a manually configured SSH connection. +You can [pre-install the JetBrains Gateway backend](./jetbrains-pre-install.md) in a template to help JetBrains load faster in workspaces. + ### How to use the plugin > If you experience problems, please diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md index c68d0a3b38daa..449fa15980744 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md @@ -5,8 +5,6 @@ JetBrains Client Installer to download and save the IDE clients locally. Please see the [JetBrains documentation for more information](https://www.jetbrains.com/help/idea/fully-offline-mode.html). -## Configuration Steps - This page is an example that the Coder team used as a proof-of-concept (POC) of the JetBrains Gateway Offline Mode solution. We used Ubuntu on a virtual machine to test the steps. diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md new file mode 100644 index 0000000000000..2ce1fc290b298 --- /dev/null +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md @@ -0,0 +1,29 @@ +# Pre-install JetBrains Gateway in a template + +For a faster JetBrains Gateway experience, pre-install the IDE in your template. + +## Deploy the server and install the Client Downloader + +Install the JetBrains Client Downloader binary: + +```shell +wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ +tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz +``` + +## Install Gateway backend + +```shell +mkdir ~/backends +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64 --download-backends ~/backends +``` + +## Register the Gateway backend + +Run the following script in the JetBrains IDE directory to point the default Gateway directory to the IDE +directory: + +```shell +cd /opt/idea/bin +./remote-dev-server.sh registerBackendLocationForGateway +``` From c9c799f11c5a811e855c52d583dc6a73833e1f49 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 19 Mar 2025 22:51:50 +0500 Subject: [PATCH 10/15] Improve JetBrains Gateway installation documentation The subject line alone doesn't sufficiently explain the changes, so here's a body: Enhance setup instructions with specific examples, cleanup commands, and add Terraform configuration for the jetbrains-gateway module. Update directory paths to be more user-friendly and consistent. --- .../jetbrains/jetbrains-pre-install.md | 41 ++++++++++++++++--- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md index 2ce1fc290b298..d8e206dbf75bb 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md @@ -9,21 +9,50 @@ Install the JetBrains Client Downloader binary: ```shell wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz +rm jetbrains-clients-downloader-linux-x86_64-1867.tar.gz ``` ## Install Gateway backend ```shell -mkdir ~/backends -./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64 --download-backends ~/backends +mkdir ~/JetBrains +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64 --download-backends ~/JetBrains +``` + +For example, to install the build `243.26053.27` of IntelliJ IDEA: + +```shell +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter IU --build-filter 243.26053.27 --platforms-filter linux-x64 --download-backends ~/JetBrains +tar -xzvf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz -C ~/JetBrains/backends/IU +rm -rf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz ``` ## Register the Gateway backend -Run the following script in the JetBrains IDE directory to point the default Gateway directory to the IDE -directory: +Run the following script in the downloaded JetBrains IDE backend directory to configure the Gateway backend: ```shell -cd /opt/idea/bin -./remote-dev-server.sh registerBackendLocationForGateway +~/JetBrains/backends/IU/ideaIU-2024.3.5/bin/remote-dev-server.sh registerBackendLocationForGateway ``` + +## Configure JetBrains Gateway Module + +If you are using our [jetbrains-gateway](https://registry.coder.com/modules/jetbrains-gateway) module, you can configure it by adding the following snippet to your template: + +```tf +module "jetbrains_gateway" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/modules/jetbrains-gateway/coder" + version = "1.0.28" + agent_id = coder_agent.example.id + folder = "/home/coder/example" + jetbrains_ides = ["IU"] + default = "IU" + latest = false + jetbrains_ide_versions = { + "IU" = { + build_number = "243.26053.27" + version = "2024.3" + } + } +}``` From 440dbc0845b3e651688637e4c237235f72a36546 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 19 Mar 2025 23:12:53 +0500 Subject: [PATCH 11/15] Update JetBrains Gateway backend setup instructions The command should be in startup_script instead of manual execution --- .../workspace-access/jetbrains/jetbrains-pre-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md index d8e206dbf75bb..4e0432201ae7b 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md @@ -29,7 +29,7 @@ rm -rf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz ## Register the Gateway backend -Run the following script in the downloaded JetBrains IDE backend directory to configure the Gateway backend: +Add the following command to your template's `startup_script`: ```shell ~/JetBrains/backends/IU/ideaIU-2024.3.5/bin/remote-dev-server.sh registerBackendLocationForGateway From fd81c47f392ddfc9ab7dcd0744e3bb04ab81f0b5 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:23:01 +0000 Subject: [PATCH 12/15] align with changes from main --- .../user-guides/workspace-access/jetbrains.md | 411 ------------------ .../workspace-access/jetbrains/index.md | 90 ++-- 2 files changed, 44 insertions(+), 457 deletions(-) delete mode 100644 docs/user-guides/workspace-access/jetbrains.md diff --git a/docs/user-guides/workspace-access/jetbrains.md b/docs/user-guides/workspace-access/jetbrains.md deleted file mode 100644 index 9f78767863590..0000000000000 --- a/docs/user-guides/workspace-access/jetbrains.md +++ /dev/null @@ -1,411 +0,0 @@ -# JetBrains IDEs - -We support JetBrains IDEs using -[Gateway](https://www.jetbrains.com/remote-development/gateway/). The following -IDEs are supported for remote development: - -- IntelliJ IDEA -- CLion -- GoLand -- PyCharm -- Rider -- RubyMine -- WebStorm -- PhpStorm -- RustRover -- [JetBrains Fleet](#jetbrains-fleet) - -## JetBrains Gateway - -JetBrains Gateway is a compact desktop app that allows you to work remotely with -a JetBrains IDE without even downloading one. Visit the -[JetBrains website](https://www.jetbrains.com/remote-development/gateway/) to -learn more about Gateway. - -Gateway can connect to a Coder workspace by using Coder's Gateway plugin or -manually setting up an SSH connection. - -### How to use the plugin - -1. [Install Gateway](https://www.jetbrains.com/help/idea/jetbrains-gateway.html) - and open the application. -1. Under **Install More Providers**, find the Coder icon and click **Install** - to install the Coder plugin. -1. After Gateway installs the plugin, it will appear in the **Run the IDE - Remotely** section. - - Click **Connect to Coder** to launch the plugin: - - ![Gateway Connect to Coder](../../images/gateway/plugin-connect-to-coder.png) - -1. Enter your Coder deployment's - [Access Url](../../admin/setup/index.md#access-url) and click **Connect**. - - Gateway opens your Coder deployment's `cli-auth` page with a session token. - Click the copy button, paste the session token in the Gateway **Session - Token** window, then click **OK**: - - ![Gateway Session Token](../../images/gateway/plugin-session-token.png) - -1. To create a new workspace: - - Click the + icon to open a browser and go to the templates page in - your Coder deployment to create a workspace. - -1. If a workspace already exists but is stopped, select the workspace from the - list, then click the green arrow to start the workspace. - -1. When the workspace status is **Running**, click **Select IDE and Project**: - - ![Gateway IDE List](../../images/gateway/plugin-select-ide.png) - -1. Select the JetBrains IDE for your project and the project directory then - click **Start IDE and connect**: - - ![Gateway Select IDE](../../images/gateway/plugin-ide-list.png) - - Gateway connects using the IDE you selected: - - ![Gateway IDE Opened](../../images/gateway/gateway-intellij-opened.png) - -The JetBrains IDE is remotely installed into `~/.cache/JetBrains/RemoteDev/dist` - -If you experience any issues, please -[create a GitHub issue](https://github.com/coder/coder/issues) or share in -[our Discord channel](https://discord.gg/coder). - -### Update a Coder plugin version - -1. Click the gear icon at the bottom left of the Gateway home screen and then - "Settings" - -1. In the **Marketplace** tab within Plugins, enter Coder and if a newer plugin - release is available, click **Update** then **OK**: - - ![Gateway Settings and Marketplace](../../images/gateway/plugin-settings-marketplace.png) - -### Configuring the Gateway plugin to use internal certificates - -When attempting to connect to a Coder deployment that uses internally signed -certificates, you may receive the following error in Gateway: - -```console -Failed to configure connection to https://coder.internal.enterprise/: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -``` - -To resolve this issue, you will need to add Coder's certificate to the Java -trust store present on your local machine as well as to the Coder plugin settings. - -1. Add the certificate to the Java trust store: - -
- - #### Linux - - ```none - /jbr/lib/security/cacerts - ``` - - Use the `keytool` utility that ships with Java: - - ```shell - keytool -import -alias coder -file -keystore /path/to/trust/store - ``` - - #### macOS - - ```none - /jbr/lib/security/cacerts - /Library/Application Support/JetBrains/Toolbox/apps/JetBrainsGateway/ch-0//JetBrains Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts # Path for Toolbox installation - ``` - - Use the `keytool` included in the JetBrains Gateway installation: - - ```shell - keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts - ``` - - #### Windows - - ```none - C:\Program Files (x86)\\jre\lib\security\cacerts\%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts # Path for Toolbox installation - ``` - - Use the `keytool` included in the JetBrains Gateway installation: - - ```powershell - & 'C:\Program Files\JetBrains\JetBrains Gateway /jbr/bin/keytool.exe' 'C:\Program Files\JetBrains\JetBrains Gateway /jre/lib/security/cacerts' -import -alias coder -file - - # command for Toolbox installation - & '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\apps\Gateway\ch-0\\jbr\bin\keytool.exe' '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts' -import -alias coder -file - ``` - -
- -1. In JetBrains, go to **Settings** > **Tools** > **Coder**. - -1. Paste the path to the certificate in **CA Path**. - -## Manually Configuring A JetBrains Gateway Connection - -This is in lieu of using Coder's Gateway plugin which automatically performs these steps. - -1. [Install Gateway](https://www.jetbrains.com/help/idea/jetbrains-gateway.html). - -1. [Configure the `coder` CLI](../../user-guides/workspace-access/index.md#configure-ssh). - -1. Open Gateway, make sure **SSH** is selected under **Remote Development**. - -1. Click **New Connection**: - - ![Gateway Home](../../images/gateway/gateway-home.png) - -1. In the resulting dialog, click the gear icon to the right of **Connection**: - - ![Gateway New Connection](../../images/gateway/gateway-new-connection.png) - -1. Click + to add a new SSH connection: - - ![Gateway Add Connection](../../images/gateway/gateway-add-ssh-configuration.png) - -1. For the Host, enter `coder.` - -1. For the Port, enter `22` (this is ignored by Coder) - -1. For the Username, enter your workspace username. - -1. For the Authentication Type, select **OpenSSH config and authentication - agent**. - -1. Make sure the checkbox for **Parse config file ~/.ssh/config** is checked. - -1. Click **Test Connection** to validate these settings. - -1. Click **OK**: - - ![Gateway SSH Configuration](../../images/gateway/gateway-create-ssh-configuration.png) - -1. Select the connection you just added: - - ![Gateway Welcome](../../images/gateway/gateway-welcome.png) - -1. Click **Check Connection and Continue**: - - ![Gateway Continue](../../images/gateway/gateway-continue.png) - -1. Select the JetBrains IDE for your project and the project directory. SSH into - your server to create a directory or check out code if you haven't already. - - ![Gateway Choose IDE](../../images/gateway/gateway-choose-ide.png) - - The JetBrains IDE is remotely installed into `~/.cache/JetBrains/RemoteDev/dist` - -1. Click **Download and Start IDE** to connect. - - ![Gateway IDE Opened](../../images/gateway/gateway-intellij-opened.png) - -## Using an existing JetBrains installation in the workspace - -If you would like to use an existing JetBrains IDE in a Coder workspace (or you -are air-gapped, and cannot reach jetbrains.com), run the following script in the -JetBrains IDE directory to point the default Gateway directory to the IDE -directory. This step must be done before configuring Gateway. - -```shell -cd /opt/idea/bin -./remote-dev-server.sh registerBackendLocationForGateway -``` - -> [!NOTE] -> Gateway only works with paid versions of JetBrains IDEs so the script will not -> be located in the `bin` directory of JetBrains Community editions. - -[Here is the JetBrains article](https://www.jetbrains.com/help/idea/remote-development-troubleshooting.html#setup:~:text=Can%20I%20point%20Remote%20Development%20to%20an%20existing%20IDE%20on%20my%20remote%20server%3F%20Is%20it%20possible%20to%20install%20IDE%20manually%3F) -explaining this IDE specification. - -## JetBrains Gateway in an offline environment - -In networks that restrict access to the internet, you will need to leverage the -JetBrains Client Installer to download and save the IDE clients locally. Please -see the -[JetBrains documentation for more information](https://www.jetbrains.com/help/idea/fully-offline-mode.html). - -### Configuration Steps - -The Coder team built a POC of the JetBrains Gateway Offline Mode solution. Here -are the steps we took (and "gotchas"): - -### 1. Deploy the server and install the Client Downloader - -We deployed a simple Ubuntu VM and installed the JetBrains Client Downloader -binary. Note that the server must be a Linux-based distribution. - -```shell -wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ -tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -``` - -### 2. Install backends and clients - -JetBrains Gateway requires both a backend to be installed on the remote host -(your Coder workspace) and a client to be installed on your local machine. You -can host both on the server in this example. - -See here for the full -[JetBrains product list and builds](https://data.services.jetbrains.com/products). -Below is the full list of supported `--platforms-filter` values: - -```console -windows-x64, windows-aarch64, linux-x64, linux-aarch64, osx-x64, osx-aarch64 -``` - -To install both backends and clients, you will need to run two commands. - -#### Backends - -```shell -mkdir ~/backends -./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 --download-backends ~/backends -``` - -#### Clients - -This is the same command as above, with the `--download-backends` flag removed. - -```shell -mkdir ~/clients -./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64,windows-x64,osx-x64 ~/clients -``` - -We now have both clients and backends installed. - -### 3. Install a web server - -You will need to run a web server in order to serve requests to the backend and -client files. We installed `nginx` and setup an FQDN and routed all requests to -`/`. See below: - -```console -server { - listen 80 default_server; - listen [::]:80 default_server; - - root /var/www/html; - - index index.html index.htm index.nginx-debian.html; - - server_name _; - - location / { - root /home/ubuntu; - } -} -``` - -Then, configure your DNS entry to point to the IP address of the server. For the -purposes of the POC, we did not configure TLS, although that is a supported -option. - -### 4. Add Client Files - -You will need to add the following files on your local machine in order for -Gateway to pull the backend and client from the server. - -```shell -$ cat productsInfoUrl # a path to products.json that was generated by the backend's downloader (it could be http://, https://, or file://) - -https://internal.site/backends//products.json - -$ cat clientDownloadUrl # a path for clients that you got from the clients' downloader (it could be http://, https://, or file://) - -https://internal.site/clients/ - -$ cat jreDownloadUrl # a path for JBR that you got from the clients' downloader (it could be http://, https://, or file://) - -https://internal.site/jre/ - -$ cat pgpPublicKeyUrl # a URL to the KEYS file that was downloaded with the clients builds. - -https://internal.site/KEYS -``` - -The location of these files will depend upon your local operating system: - -#### macOS - -```console -# User-specific settings -/Users/UserName/Library/Application Support/JetBrains/RemoteDev -# System-wide settings -/Library/Application Support/JetBrains/RemoteDev/ -``` - -#### Linux - -```console -# User-specific settings -$HOME/.config/JetBrains/RemoteDev -# System-wide settings -/etc/xdg/JetBrains/RemoteDev/ -``` - -#### Windows - -```console -# User-specific settings -HKEY_CURRENT_USER registry -# System-wide settings -HKEY_LOCAL_MACHINE registry -``` - -Additionally, create a string for each setting with its appropriate value in -`SOFTWARE\JetBrains\RemoteDev`: - -![Alt text](../../images/gateway/jetbrains-offline-windows.png) - -### 5. Setup SSH connection with JetBrains Gateway - -With the server now configured, you can now configure your local machine to use -Gateway. Here is the documentation to -[setup SSH config via the Coder CLI](../../user-guides/workspace-access/index.md#configure-ssh). -On the Gateway side, follow our guide here until step 16. - -Instead of downloading from jetbrains.com, we will point Gateway to our server -endpoint. Select `Installation options...` and select `Use download link`. Note -that the URL must explicitly reference the archive file: - -![Offline Gateway](../../images/gateway/offline-gateway.png) - -Click `Download IDE and Connect`. Gateway should now download the backend and -clients from the server into your remote workspace and local machine, -respectively. - -## JetBrains Fleet - -JetBrains Fleet is a code editor and lightweight IDE designed to support various -programming languages and development environments. - -[See JetBrains' website to learn about Fleet](https://www.jetbrains.com/fleet/) - -Fleet can connect to a Coder workspace by following these steps. - -1. [Install Fleet](https://www.jetbrains.com/fleet/download) -2. Install Coder CLI - - ```shell - curl -L https://coder.com/install.sh | sh - ``` - -3. Login and configure Coder SSH. - - ```shell - coder login coder.example.com - coder config-ssh - ``` - -4. Connect via SSH with the Host set to `coder.workspace-name` - ![Fleet Connect to Coder](../../images/fleet/ssh-connect-to-coder.png) - -If you experience any issues, please -[create a GitHub issue](https://github.com/coder/coder/issues) or share in -[our Discord channel](https://discord.gg/coder). diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index cbc7cd7517b4d..ded280c7f85eb 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -74,8 +74,7 @@ You can [pre-install the JetBrains Gateway backend](./jetbrains-pre-install.md) ![Gateway IDE Opened](../../../images/gateway/gateway-intellij-opened.png) - > Note the JetBrains IDE is remotely installed into - > `~/.cache/JetBrains/RemoteDev/dist` + The JetBrains IDE is remotely installed into `~/.cache/JetBrains/RemoteDev/dist`. ### Update a Coder plugin version @@ -97,56 +96,61 @@ Failed to configure connection to https://coder.internal.enterprise/: PKIX path ``` To resolve this issue, you will need to add Coder's certificate to the Java -trust store present on your local machine: +trust store present on your local machine as well as to the Coder plugin settings. -
+1. Add the certificate to the Java trust store: -#### Linux +
-```none -/jbr/lib/security/cacerts -``` + #### Linux -Use the `keytool` utility that ships with Java: + ```none + /jbr/lib/security/cacerts + ``` -```shell -keytool -import -alias coder -file -keystore /path/to/trust/store -``` + Use the `keytool` utility that ships with Java: + + ```shell + keytool -import -alias coder -file -keystore /path/to/trust/store + ``` -#### macOS + #### macOS -```none -/jbr/lib/security/cacerts -/Library/Application Support/JetBrains/Toolbox/apps/JetBrainsGateway/ch-0//JetBrains Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts # Path for Toolbox installation -``` + ```none + /jbr/lib/security/cacerts + /Library/Application Support/JetBrains/Toolbox/apps/JetBrainsGateway/ch-0//JetBrains Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts # Path for Toolbox installation + ``` -Use the `keytool` included in the JetBrains Gateway installation: + Use the `keytool` included in the JetBrains Gateway installation: -```shell -keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts -``` + ```shell + keytool -import -alias coder -file cacert.pem -keystore /Applications/JetBrains\ Gateway.app/Contents/jbr/Contents/Home/lib/security/cacerts + ``` -#### Windows + #### Windows -```none -C:\Program Files (x86)\\jre\lib\security\cacerts\%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts # Path for Toolbox installation -``` + ```none + C:\Program Files (x86)\\jre\lib\security\cacerts\%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts # Path for Toolbox installation + ``` -Use the `keytool` included in the JetBrains Gateway installation: + Use the `keytool` included in the JetBrains Gateway installation: -```powershell -& 'C:\Program Files\JetBrains\JetBrains Gateway /jbr/bin/keytool.exe' 'C:\Program Files\JetBrains\JetBrains Gateway /jre/lib/security/cacerts' -import -alias coder -file + ```powershell + & 'C:\Program Files\JetBrains\JetBrains Gateway /jbr/bin/keytool.exe' 'C:\Program Files\JetBrains\JetBrains Gateway /jre/lib/security/cacerts' -import -alias coder -file -# command for Toolbox installation -& '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\apps\Gateway\ch-0\\jbr\bin\keytool.exe' '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts' -import -alias coder -file -``` + # command for Toolbox installation + & '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\apps\Gateway\ch-0\\jbr\bin\keytool.exe' '%USERPROFILE%\AppData\Local\JetBrains\Toolbox\bin\jre\lib\security\cacerts' -import -alias coder -file + ``` + +
-
+1. In JetBrains, go to **Settings** > **Tools** > **Coder**. + +1. Paste the path to the certificate in **CA Path**. ## Manually Configuring A JetBrains Gateway Connection -> This is in lieu of using Coder's Gateway plugin which automatically performs -> these steps. +This is in lieu of using Coder's Gateway plugin which automatically performs these steps. 1. [Install Gateway](https://www.jetbrains.com/help/idea/jetbrains-gateway.html). @@ -196,8 +200,7 @@ Use the `keytool` included in the JetBrains Gateway installation: ![Gateway Choose IDE](../../../images/gateway/gateway-choose-ide.png) - > Note the JetBrains IDE is remotely installed into - > `~/.cache/JetBrains/RemoteDev/dist` + The JetBrains IDE is remotely installed into `~/.cache/JetBrains/RemoteDev/dist` 1. Click **Download and Start IDE** to connect. @@ -205,22 +208,17 @@ Use the `keytool` included in the JetBrains Gateway installation: ## Using an existing JetBrains installation in the workspace -
- -This step must be done before configuring Gateway. - -
- If you would like to use an existing JetBrains IDE in a Coder workspace (or you are air-gapped, and cannot reach `jetbrains.com`), run the following script in the JetBrains IDE directory to point the default Gateway directory to the IDE -directory. +directory. This step must be done before configuring Gateway. ```shell cd /opt/idea/bin ./remote-dev-server.sh registerBackendLocationForGateway ``` +> [!NOTE] > Gateway only works with paid versions of JetBrains IDEs so the script will not > be located in the `bin` directory of JetBrains Community editions. @@ -254,6 +252,6 @@ To connect Fleet to a Coder workspace: 1. Connect via SSH with the Host set to `coder.workspace-name` ![Fleet Connect to Coder](../../../images/fleet/ssh-connect-to-coder.png) -> If you experience any issues, please -> [create a GitHub issue](https://github.com/coder/coder/issues) or share in -> [our Discord channel](https://discord.gg/coder). +If you experience any issues, please +[create a GitHub issue](https://github.com/coder/coder/issues) or share in +[our Discord channel](https://discord.gg/coder). From 99c1a59166e7bda21c56a9b296c1729b9a700385 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Thu, 27 Mar 2025 01:46:49 +0500 Subject: [PATCH 13/15] Simplify JetBrains pre-installation guide - Remove detailed script instructions - Direct users to admin for backend setup - Add Dockerfile example for pre-installing backend - Organize existing content for clarity --- .../workspace-access/jetbrains/index.md | 10 +-- .../jetbrains/jetbrains-airgapped.md | 4 + .../jetbrains/jetbrains-pre-install.md | 75 +++++++++++++++++-- 3 files changed, 73 insertions(+), 16 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index ded280c7f85eb..3f85a233d54b0 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -208,15 +208,7 @@ This is in lieu of using Coder's Gateway plugin which automatically performs the ## Using an existing JetBrains installation in the workspace -If you would like to use an existing JetBrains IDE in a Coder workspace (or you -are air-gapped, and cannot reach `jetbrains.com`), run the following script in -the JetBrains IDE directory to point the default Gateway directory to the IDE -directory. This step must be done before configuring Gateway. - -```shell -cd /opt/idea/bin -./remote-dev-server.sh registerBackendLocationForGateway -``` +For JetBrains IDEs, you can use an existing installation in the workspace. Please ask you administrator to install the JetBrains Gateway backend in the workspace by following the [pre-install guide](./jetbrains-pre-install.md). > [!NOTE] > Gateway only works with paid versions of JetBrains IDEs so the script will not diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md index 449fa15980744..20198ae004879 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md @@ -158,3 +158,7 @@ that the URL must explicitly reference the archive file: Click `Download IDE and Connect`. Gateway should now download the backend and clients from the server into your remote workspace and local machine, respectively. + +## Next steps + +- [Pre install the JetBrains IDEs backend in your workspace](./jetbrains-pre-install.md) diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md index 4e0432201ae7b..7477d62c8f011 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md @@ -1,8 +1,11 @@ # Pre-install JetBrains Gateway in a template -For a faster JetBrains Gateway experience, pre-install the IDE in your template. +For a faster JetBrains Gateway experience, pre-install the IDEs backend in your template. -## Deploy the server and install the Client Downloader +> [!NOTE] +> This guide only talks about installing the IDEs backend. For a complete guide on setting up JetBrains Gateway with client IDEs, refer to the [JetBrains Gateway air-gapped guide](./jetbrains-airgapped.md). + +## Install the Client Downloader Install the JetBrains Client Downloader binary: @@ -23,8 +26,8 @@ For example, to install the build `243.26053.27` of IntelliJ IDEA: ```shell ./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter IU --build-filter 243.26053.27 --platforms-filter linux-x64 --download-backends ~/JetBrains -tar -xzvf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz -C ~/JetBrains/backends/IU -rm -rf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz +tar -xzvf ~/JetBrains/backends/IU/*.tar.gz -C ~/JetBrains/backends/IU +rm -rf ~/JetBrains/backends/IU/*.tar.gz ``` ## Register the Gateway backend @@ -32,7 +35,7 @@ rm -rf ~/JetBrains/backends/IU/ideaIU-2024.3.5.tar.gz Add the following command to your template's `startup_script`: ```shell -~/JetBrains/backends/IU/ideaIU-2024.3.5/bin/remote-dev-server.sh registerBackendLocationForGateway +~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway ``` ## Configure JetBrains Gateway Module @@ -44,7 +47,7 @@ module "jetbrains_gateway" { count = data.coder_workspace.me.start_count source = "registry.coder.com/modules/jetbrains-gateway/coder" version = "1.0.28" - agent_id = coder_agent.example.id + agent_id = coder_agent.main.id folder = "/home/coder/example" jetbrains_ides = ["IU"] default = "IU" @@ -55,4 +58,62 @@ module "jetbrains_gateway" { version = "2024.3" } } -}``` +} + +resource "coder_agent" "main" { + ... + startup_script = <<-EOF + ~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway + EOF +} +``` + +## Dockerfile example + +If you are using Docker based workspaces, you can add the command to your Dockerfile: + +```dockerfile +FROM ubuntu + +# Combine all apt operations in a single RUN command +# Install only necessary packages +# Clean up apt cache in the same layer +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + git \ + golang \ + sudo \ + vim \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create user in a single layer +ARG USER=coder +RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \ + && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \ + && chmod 0440 /etc/sudoers.d/${USER} + +USER ${USER} +WORKDIR /home/${USER} + +# Install JetBrains Gateway in a single RUN command to reduce layers +# Download, extract, use, and clean up in the same layer +RUN mkdir -p ~/JetBrains \ + && wget -q https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -P /tmp \ + && tar -xzf /tmp/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -C /tmp \ + && /tmp/jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader \ + --products-filter IU \ + --build-filter 243.26053.27 \ + --platforms-filter linux-x64 \ + --download-backends ~/JetBrains \ + && tar -xzf ~/JetBrains/backends/IU/*.tar.gz -C ~/JetBrains/backends/IU \ + && rm -f ~/JetBrains/backends/IU/*.tar.gz \ + && rm -rf /tmp/jetbrains-clients-downloader-linux-x86_64-1867* \ + && rm -rf /tmp/*.tar.gz +``` + +## Next steps + +- [Pre install the Client IDEs](./jetbrains-airgapped.md#1-deploy-the-server-and-install-the-client-downloader) From c7e64e40d2ad6d425b6967911a5a45f3bd20b0c7 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Wed, 26 Mar 2025 20:53:52 +0000 Subject: [PATCH 14/15] Simplify JetBrains pre-installation guide Reduce indentation for the startup script block in the JetBrains guide to improve readability and consistency with other code examples. --- .../workspace-access/jetbrains/jetbrains-pre-install.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md index 7477d62c8f011..862aee9c66fdd 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-pre-install.md @@ -61,10 +61,10 @@ module "jetbrains_gateway" { } resource "coder_agent" "main" { - ... - startup_script = <<-EOF - ~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway - EOF + ... + startup_script = <<-EOF + ~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway + EOF } ``` From 37fdb17a56acf654ba0c91b4ec955c1e617a09c5 Mon Sep 17 00:00:00 2001 From: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com> Date: Fri, 11 Apr 2025 15:42:29 +0000 Subject: [PATCH 15/15] move gateway and update pre-install --- .../extending-templates/jetbrains-gateway.md | 119 ++++++++++++++++++ docs/manifest.json | 10 +- .../workspace-access/jetbrains/index.md | 5 +- .../jetbrains/jetbrains-airgapped.md | 2 +- 4 files changed, 128 insertions(+), 8 deletions(-) create mode 100644 docs/admin/templates/extending-templates/jetbrains-gateway.md diff --git a/docs/admin/templates/extending-templates/jetbrains-gateway.md b/docs/admin/templates/extending-templates/jetbrains-gateway.md new file mode 100644 index 0000000000000..33db219bcac9f --- /dev/null +++ b/docs/admin/templates/extending-templates/jetbrains-gateway.md @@ -0,0 +1,119 @@ +# Pre-install JetBrains Gateway in a template + +For a faster JetBrains Gateway experience, pre-install the IDEs backend in your template. + +> [!NOTE] +> This guide only talks about installing the IDEs backend. For a complete guide on setting up JetBrains Gateway with client IDEs, refer to the [JetBrains Gateway air-gapped guide](../../../user-guides/workspace-access/jetbrains/jetbrains-airgapped.md). + +## Install the Client Downloader + +Install the JetBrains Client Downloader binary: + +```shell +wget https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz && \ +tar -xzvf jetbrains-clients-downloader-linux-x86_64-1867.tar.gz +rm jetbrains-clients-downloader-linux-x86_64-1867.tar.gz +``` + +## Install Gateway backend + +```shell +mkdir ~/JetBrains +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter --build-filter --platforms-filter linux-x64 --download-backends ~/JetBrains +``` + +For example, to install the build `243.26053.27` of IntelliJ IDEA: + +```shell +./jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader --products-filter IU --build-filter 243.26053.27 --platforms-filter linux-x64 --download-backends ~/JetBrains +tar -xzvf ~/JetBrains/backends/IU/*.tar.gz -C ~/JetBrains/backends/IU +rm -rf ~/JetBrains/backends/IU/*.tar.gz +``` + +## Register the Gateway backend + +Add the following command to your template's `startup_script`: + +```shell +~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway +``` + +## Configure JetBrains Gateway Module + +If you are using our [jetbrains-gateway](https://registry.coder.com/modules/jetbrains-gateway) module, you can configure it by adding the following snippet to your template: + +```tf +module "jetbrains_gateway" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/modules/jetbrains-gateway/coder" + version = "1.0.28" + agent_id = coder_agent.main.id + folder = "/home/coder/example" + jetbrains_ides = ["IU"] + default = "IU" + latest = false + jetbrains_ide_versions = { + "IU" = { + build_number = "243.26053.27" + version = "2024.3" + } + } +} + +resource "coder_agent" "main" { + ... + startup_script = <<-EOF + ~/JetBrains/backends/IU/ideaIU-243.26053.27/bin/remote-dev-server.sh registerBackendLocationForGateway + EOF +} +``` + +## Dockerfile example + +If you are using Docker based workspaces, you can add the command to your Dockerfile: + +```dockerfile +FROM ubuntu + +# Combine all apt operations in a single RUN command +# Install only necessary packages +# Clean up apt cache in the same layer +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + curl \ + git \ + golang \ + sudo \ + vim \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Create user in a single layer +ARG USER=coder +RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \ + && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \ + && chmod 0440 /etc/sudoers.d/${USER} + +USER ${USER} +WORKDIR /home/${USER} + +# Install JetBrains Gateway in a single RUN command to reduce layers +# Download, extract, use, and clean up in the same layer +RUN mkdir -p ~/JetBrains \ + && wget -q https://download.jetbrains.com/idea/code-with-me/backend/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -P /tmp \ + && tar -xzf /tmp/jetbrains-clients-downloader-linux-x86_64-1867.tar.gz -C /tmp \ + && /tmp/jetbrains-clients-downloader-linux-x86_64-1867/bin/jetbrains-clients-downloader \ + --products-filter IU \ + --build-filter 243.26053.27 \ + --platforms-filter linux-x64 \ + --download-backends ~/JetBrains \ + && tar -xzf ~/JetBrains/backends/IU/*.tar.gz -C ~/JetBrains/backends/IU \ + && rm -f ~/JetBrains/backends/IU/*.tar.gz \ + && rm -rf /tmp/jetbrains-clients-downloader-linux-x86_64-1867* \ + && rm -rf /tmp/*.tar.gz +``` + +## Next steps + +- [Pre-install the Client IDEs](../../../user-guides/workspace-access/jetbrains/jetbrains-airgapped.md#1-deploy-the-server-and-install-the-client-downloader) diff --git a/docs/manifest.json b/docs/manifest.json index 4abede9b88707..c3858dfd486ea 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -139,11 +139,6 @@ "description": "Use JetBrains IDEs with Gateway", "path": "./user-guides/workspace-access/jetbrains/index.md", "children": [ - { - "title": "Pre-install JetBrains Gateway in a template", - "description": "Pre-install JetBrains Gateway in a template", - "path": "./user-guides/workspace-access/jetbrains/jetbrains-pre-install.md" - }, { "title": "JetBrains Gateway in an air-gapped environment", "description": "Use JetBrains Gateway in an air-gapped offline environment", @@ -461,6 +456,11 @@ "description": "Add and configure Web IDEs in your templates as coder apps", "path": "./admin/templates/extending-templates/web-ides.md" }, + { + "title": "Pre-install JetBrains Gateway", + "description": "Pre-install JetBrains Gateway in a template for faster IDE startup", + "path": "./admin/templates/extending-templates/jetbrains-gateway.md" + }, { "title": "Docker in Workspaces", "description": "Use Docker in your workspaces", diff --git a/docs/user-guides/workspace-access/jetbrains/index.md b/docs/user-guides/workspace-access/jetbrains/index.md index 3f85a233d54b0..66de625866e1b 100644 --- a/docs/user-guides/workspace-access/jetbrains/index.md +++ b/docs/user-guides/workspace-access/jetbrains/index.md @@ -25,7 +25,7 @@ to learn more about Gateway. Gateway can connect to a Coder workspace using Coder's Gateway plugin or through a manually configured SSH connection. -You can [pre-install the JetBrains Gateway backend](./jetbrains-pre-install.md) in a template to help JetBrains load faster in workspaces. +You can [pre-install the JetBrains Gateway backend](../../../admin/templates/extending-templates/jetbrains-gateway.md) in a template to help JetBrains load faster in workspaces. ### How to use the plugin @@ -208,7 +208,8 @@ This is in lieu of using Coder's Gateway plugin which automatically performs the ## Using an existing JetBrains installation in the workspace -For JetBrains IDEs, you can use an existing installation in the workspace. Please ask you administrator to install the JetBrains Gateway backend in the workspace by following the [pre-install guide](./jetbrains-pre-install.md). +For JetBrains IDEs, you can use an existing installation in the workspace. +Please ask your administrator to install the JetBrains Gateway backend in the workspace by following the [pre-install guide](../../../admin/templates/extending-templates/jetbrains-gateway.md). > [!NOTE] > Gateway only works with paid versions of JetBrains IDEs so the script will not diff --git a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md index 20198ae004879..197cce2b5fa33 100644 --- a/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md +++ b/docs/user-guides/workspace-access/jetbrains/jetbrains-airgapped.md @@ -161,4 +161,4 @@ respectively. ## Next steps -- [Pre install the JetBrains IDEs backend in your workspace](./jetbrains-pre-install.md) +- [Pre-install the JetBrains IDEs backend in your workspace](../../../admin/templates/extending-templates/jetbrains-gateway.md) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy