Skip to content

docs: update vscode web docs #10327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 41 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f1e03c4
docs: rework our "templates" section
bpmct Jul 28, 2023
bfee554
wikistuff
bpmct Jul 28, 2023
80215cf
fix formatting
bpmct Jul 28, 2023
7119be1
add diagram
bpmct Jul 30, 2023
2c84f2e
reorganize some things
bpmct Jul 31, 2023
3279747
docs: improve workspaces and templates doc (#9139)
marcpaq Oct 16, 2023
89d07ae
Resolved conflicts from main branch
matifali Oct 16, 2023
9488d6a
Merge branch 'main' into templates-docs
matifali Oct 16, 2023
4447e68
make fmt
matifali Oct 16, 2023
86bff3f
fix merge conflict
matifali Oct 16, 2023
85cf21b
make fmt
matifali Oct 16, 2023
acc2ea6
make gen
matifali Oct 16, 2023
92856a5
update
matifali Oct 16, 2023
21eab5f
Merge branch 'main' into templates-docs
matifali Oct 16, 2023
93b2d38
lint
matifali Oct 17, 2023
ac2e51a
Discard changes to coderd/database/queries.sql.go
matifali Oct 17, 2023
30128dd
Discard changes to cli/templates.go
matifali Oct 17, 2023
5be19b5
Discard changes to cli/templateversionarchive.go
matifali Oct 17, 2023
62b5ef1
Discard changes to cli/templateversions.go
matifali Oct 17, 2023
65d7aed
Update docker-in-workspaces.md
matifali Oct 17, 2023
bc96319
replace ```sh with ```shell
matifali Oct 17, 2023
f86b428
open-in-coder
matifali Oct 17, 2023
77b0ac4
fmt
matifali Oct 17, 2023
5469513
mention coder_metadata in icons.md
matifali Oct 17, 2023
d43e370
resource_metadata
matifali Oct 17, 2023
20bd888
use shell
matifali Oct 17, 2023
b5b74b0
modules.md
matifali Oct 17, 2023
279ebc8
mention coder registry module
matifali Oct 17, 2023
3762b02
workspace.md
matifali Oct 17, 2023
d0c4292
resource_metadata
matifali Oct 17, 2023
c50b95e
remove duplication
matifali Oct 17, 2023
8911200
address comments
matifali Oct 17, 2023
15bf4a0
cleanup
matifali Oct 17, 2023
0e90eda
update vscode web docs
matifali Oct 18, 2023
43479bc
Merge branch 'main' into vscode-web
matifali Oct 18, 2023
7aab775
Discard changes to docs/manifest.json
matifali Oct 18, 2023
6b36a82
Discard changes to site/build/tsconfig.tsbuildinfo
matifali Oct 18, 2023
f358579
remove filebrowser.db
matifali Oct 18, 2023
32bb2e3
fmt
matifali Oct 18, 2023
6859f0b
Add files via upload
matifali Oct 18, 2023
107ec2c
make gen
matifali Oct 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 53 additions & 37 deletions docs/ides/web-ides.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}
```
Expand Down Expand Up @@ -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`

```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
}
```

> `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"
}
```
command. To add VS Code web as a web IDE, you have two options.

1. Install using the
[vscode-web module](https://registry.coder.com/modules/vscode-web) from the
coder registry.

```hcl
module "vscode-web" {
source = "https://registry.coder.com/modules/vscode-web"
agent_id = coder_agent.main.id
accept_license = true
}
```

2. Install and start in your `startup_script` and create a corresponding
`coder_app`

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

Expand Down
1 change: 1 addition & 0 deletions site/src/theme/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"datagrip.svg",
"dataspell.svg",
"debian.svg",
"discord.svg",
"do.png",
"docker.png",
"dotfiles.svg",
Expand Down
1 change: 1 addition & 0 deletions site/static/icon/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.