mirror of
https://github.com/coder/coder.git
synced 2026-09-21 20:51:01 +08:00
@@ -4,9 +4,7 @@ The following desktop IDEs have been tested with Coder, though any IDE with SSH
|
||||
support should work:
|
||||
|
||||
- [VS Code Remote SSH](#vs-code-remote)
|
||||
extension)
|
||||
- [JetBrains with Gateway](./ides/configuring-gateway.md)
|
||||
installed)
|
||||
- IntelliJ IDEA
|
||||
- CLion
|
||||
- GoLand
|
||||
|
||||
@@ -1,57 +1,36 @@
|
||||
# Configuring JetBrains Gateway
|
||||
|
||||
The following screenshots outline in more detail how to create a new Connection
|
||||
for JetBrains Gateway to a Coder workspace.
|
||||
The following walkthrough details how to connect JetBrains Gateway to
|
||||
Coder.
|
||||
|
||||
## Creating a new JetBrains Gateway Connection
|
||||
|
||||
After installing Gateway on your local system, you may connect to a Coder
|
||||
workspace as follows
|
||||
|
||||
1. [Install Gateway](https://www.jetbrains.com/help/idea/jetbrains-gateway.html)
|
||||
1. [Configure the `coder` CLI](../ides.md#ssh-configuration)
|
||||
1. Open Gateway, make sure "SSH" is selected under "Remote Development"
|
||||
2. Click "New Connection"
|
||||
|
||||

|
||||
|
||||
3. In the resulting dialog, click the gear icon to the right of "Connection:"
|
||||
|
||||

|
||||
|
||||
4. Hit the "+" button to add a new SSH connection
|
||||
|
||||

|
||||
|
||||
1. For the Host, enter `coder.<workspace name>`
|
||||
2. For the Port, enter `22` (this is ignored by Coder)
|
||||
3. For the Username, enter `coder`
|
||||
4. For the Authentication Type, select "OpenSSH config and authentication
|
||||
agent"
|
||||
5. Make sure the checkbox for "Parse config file ~/.ssh/config" is checked.
|
||||
6. Click "Test Connection" to ensure you setting are ok.
|
||||
7. Click "OK"
|
||||
|
||||

|
||||
|
||||
5. Select the connection you just added.
|
||||
|
||||

|
||||
|
||||
6. Click "Check Connection and Continue"
|
||||
|
||||

|
||||
|
||||
7. Select the JetBrains IDE for your project and the project directory
|
||||
1. Use an SSH terminal to your workspace to create a directory or check out
|
||||
code if you haven't already.
|
||||
|
||||
> Note the JetBrains IDE is installed in the directory `~/.
|
||||
> cache/JetBrains/RemoteDev/dist`
|
||||
|
||||

|
||||
|
||||
8. Click "Download and Start IDE" to connect.
|
||||
|
||||

|
||||
|
||||
1. Click "New Connection"
|
||||

|
||||
1. In the resulting dialog, click the gear icon to the right of "Connection:"
|
||||

|
||||
1. Hit the "+" button to add a new SSH connection
|
||||

|
||||
|
||||
1. For the Host, enter `coder.<workspace name>`
|
||||
1. For the Port, enter `22` (this is ignored by Coder)
|
||||
1. For the Username, enter `coder`
|
||||
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"
|
||||

|
||||
1. Select the connection you just added
|
||||

|
||||
1. Click "Check Connection and Continue"
|
||||

|
||||
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.
|
||||

|
||||
> Note the JetBrains IDE is remotely installed into `~/. cache/JetBrains/RemoteDev/dist`
|
||||
1. Click "Download and Start IDE" to connect.
|
||||

|
||||
|
||||
+2
-2
@@ -83,8 +83,8 @@
|
||||
"path": "./ides/configuring-web-ides.md"
|
||||
},
|
||||
{
|
||||
"title": "Configuring Jetbrains Gateway",
|
||||
"description": "Learn how to configure Jetbrains Gateway for your workspaces",
|
||||
"title": "Configuring JetBrains Gateway",
|
||||
"description": "Learn how to configure JetBrains Gateway for your workspaces",
|
||||
"path": "./ides/configuring-gateway.md"
|
||||
}
|
||||
]
|
||||
|
||||
+10
-14
@@ -98,11 +98,7 @@ inherited by all child processes of the agent, including SSH sessions.
|
||||
#### startup_script
|
||||
|
||||
Use the Coder agent's `startup_script` to run additional commands like
|
||||
installing IDEs and clone dotfile and project repos. In this example, the
|
||||
project and dotfile repos are specified as Terraform input variables elsewhere
|
||||
in the `main.tf` Note the `&` after the `code-server` start to execute
|
||||
`code-server` process in the background so the `startup_script` can continue
|
||||
with the repo cloning steps.
|
||||
installing IDEs, [cloning dotfile](./dotfiles.md#templates), and cloning project repos.
|
||||
|
||||
```hcl
|
||||
resource "coder_agent" "coder" {
|
||||
@@ -113,9 +109,16 @@ resource "coder_agent" "coder" {
|
||||
#!/bin/bash
|
||||
|
||||
# install code-server
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
|
||||
# The & prevents the startup_script from blocking so the
|
||||
# next commands can run.
|
||||
code-server --auth none --port &
|
||||
|
||||
# var.repo and var.dotfiles_uri is specified
|
||||
# elsewhere in the Terraform code as input
|
||||
# variables.
|
||||
|
||||
# clone repo
|
||||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
||||
git clone --progress git@github.com:${var.repo}
|
||||
@@ -123,17 +126,10 @@ git clone --progress git@github.com:${var.repo}
|
||||
# use coder CLI to clone and install dotfiles
|
||||
coder dotfiles -y ${var.dotfiles_uri}
|
||||
|
||||
EOT
|
||||
EOT
|
||||
}
|
||||
```
|
||||
|
||||
#### Logging
|
||||
|
||||
The output of the `startup_script` are located in
|
||||
`/tmp/coder-startup-script.log` within the workspace.
|
||||
|
||||
The Coder agent log is located in `/tmp/coder-agent.log` within the workspace.
|
||||
|
||||
### Parameters
|
||||
|
||||
Templates often contain _parameters_. These are defined by `variable` blocks in
|
||||
|
||||
@@ -49,6 +49,15 @@ The workspace will be stopped and started:
|
||||
coder update <workspace-name>
|
||||
```
|
||||
|
||||
## Logging
|
||||
|
||||
Coder stores MacOS and Linux logs at the following locations:
|
||||
|
||||
| Service | Location |
|
||||
| ---------------- | ------------------------------- |
|
||||
| `startup_script` | `/tmp/coder-startup-script.log` |
|
||||
| Agent | `/tmp/coder-agent.log` |
|
||||
|
||||
---
|
||||
|
||||
## Up next
|
||||
|
||||
Reference in New Issue
Block a user