mirror of https://github.com/coder/coder.git
docs: update vscode web docs (#10327)
This commit is contained in:
parent
2b5e02f5b2
commit
fe05fd1e6e
|
@ -45,7 +45,7 @@ resource "coder_app" "pubslack" {
|
|||
display_name = "Coder Public Slack"
|
||||
slug = "pubslack"
|
||||
url = "https://coder-com.slack.com/"
|
||||
icon = "https://cdn2.hubspot.net/hubfs/521324/slack-logo.png"
|
||||
icon = "/icon/slack.svg"
|
||||
external = true
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ resource "coder_app" "discord" {
|
|||
display_name = "Coder Discord"
|
||||
slug = "discord"
|
||||
url = "https://discord.com/invite/coder"
|
||||
icon = "https://logodix.com/logo/573024.png"
|
||||
icon = "/icon/discord.svg"
|
||||
external = true
|
||||
}
|
||||
```
|
||||
|
@ -133,43 +133,59 @@ resource "coder_app" "code-server" {
|
|||
|
||||
![code-server in a workspace](../images/code-server-ide.png)
|
||||
|
||||
## VS Code Server
|
||||
## VS Code Web
|
||||
|
||||
VS Code supports launching a local web client using the `code serve-web`
|
||||
command. To add VS Code web as a web IDE, Install and start this in your
|
||||
`startup_script` and create a corresponding `coder_app`
|
||||
command. To add VS Code web as a web IDE, you have two options.
|
||||
|
||||
```hcl
|
||||
resource "coder_agent" "main" {
|
||||
arch = "amd64"
|
||||
os = "linux"
|
||||
startup_script = <<EOF
|
||||
#!/bin/sh
|
||||
# install VS Code
|
||||
curl -L "https://update.code.visualstudio.com/1.82.0/linux-deb-x64/stable" -o /tmp/code.deb
|
||||
sudo dpkg -i /tmp/code.deb && sudo apt-get install -f -y
|
||||
# start the web server on a specific port
|
||||
code serve-web --port 13338 --without-connection-token --accept-server-license-terms >/tmp/vscode-web.log 2>&1 &
|
||||
EOF
|
||||
}
|
||||
```
|
||||
1. Install using the
|
||||
[vscode-web module](https://registry.coder.com/modules/vscode-web) from the
|
||||
coder registry.
|
||||
|
||||
> `code serve-web` was introduced in version 1.82.0 (August 2023).
|
||||
```hcl
|
||||
module "vscode-web" {
|
||||
source = "https://registry.coder.com/modules/vscode-web"
|
||||
agent_id = coder_agent.main.id
|
||||
accept_license = true
|
||||
}
|
||||
```
|
||||
|
||||
You also need to add a `coder_app` resource for this.
|
||||
2. Install and start in your `startup_script` and create a corresponding
|
||||
`coder_app`
|
||||
|
||||
```hcl
|
||||
# VS Code Web
|
||||
resource "coder_app" "vscode-web" {
|
||||
agent_id = coder_agent.coder.id
|
||||
slug = "vscode-web"
|
||||
display_name = "VS Code Web"
|
||||
icon = "/icon/code.svg"
|
||||
url = "http://localhost:13338?folder=/home/coder"
|
||||
subdomain = true # VS Code Web does currently does not work with a subpath https://github.com/microsoft/vscode/issues/192947
|
||||
share = "owner"
|
||||
}
|
||||
```
|
||||
```hcl
|
||||
resource "coder_agent" "main" {
|
||||
arch = "amd64"
|
||||
os = "linux"
|
||||
startup_script = <<EOF
|
||||
#!/bin/sh
|
||||
# install VS Code
|
||||
curl -Lk 'https://code.visualstudio.com/sha/download?build=stable&os=cli-alpine-x64' --output vscode_cli.tar.gz
|
||||
mkdir -p /tmp/vscode-cli
|
||||
tar -xf vscode_cli.tar.gz -C /tmp/vscode-cli
|
||||
rm vscode_cli.tar.gz
|
||||
# start the web server on a specific port
|
||||
/tmp/vscode-cli/code serve-web --port 13338 --without-connection-token --accept-server-license-terms >/tmp/vscode-web.log 2>&1 &
|
||||
EOF
|
||||
}
|
||||
```
|
||||
|
||||
> `code serve-web` was introduced in version 1.82.0 (August 2023).
|
||||
|
||||
You also need to add a `coder_app` resource for this.
|
||||
|
||||
```hcl
|
||||
# VS Code Web
|
||||
resource "coder_app" "vscode-web" {
|
||||
agent_id = coder_agent.coder.id
|
||||
slug = "vscode-web"
|
||||
display_name = "VS Code Web"
|
||||
icon = "/icon/code.svg"
|
||||
url = "http://localhost:13338?folder=/home/coder"
|
||||
subdomain = true # VS Code Web does currently does not work with a subpath https://github.com/microsoft/vscode/issues/192947
|
||||
share = "owner"
|
||||
}
|
||||
```
|
||||
|
||||
## JupyterLab
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"datagrip.svg",
|
||||
"dataspell.svg",
|
||||
"debian.svg",
|
||||
"discord.svg",
|
||||
"do.png",
|
||||
"docker.png",
|
||||
"dotfiles.svg",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36"><defs><style>.cls-1{fill:#5865f2;}</style></defs><g id="图层_2" data-name="图层 2"><g id="Discord_Logos" data-name="Discord Logos"><g id="Discord_Logo_-_Large_-_White" data-name="Discord Logo - Large - White"><path class="cls-1" d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z"/></g></g></g></svg>
|
After Width: | Height: | Size: 988 B |
Loading…
Reference in New Issue