Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
continue-on-error: true
strategy:
matrix:
# vscode-web is intentionally absent: it requires acceptLicenseTerms=true
# and autogenerated tests cannot set options, so it is covered by
# scenario tests only (including non-default base images).
features:
- code-server
baseImage:
Expand All @@ -49,6 +52,7 @@ jobs:
matrix:
features:
- code-server
- vscode-web
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This guide contains information about how to contribute to this collection of de
This repository currently contains the following features:

- `code-server` - Adds VS Code in the browser functionality to your dev container
- `vscode-web` - Adds VS Code in the browser via Microsoft's official VS Code web server

## Adding a New Feature

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ test:
devcontainer features test --filter "$$DEVCONTAINER_FEATURE_TEST_FILTER"

.PHONY: docs
docs: src/code-server/README.md
docs: src/code-server/README.md src/vscode-web/README.md
cd src && devcontainer features generate-docs -n coder/devcontainer-features
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This repository contains a collection of [dev container Features](https://contai
## Available Features

- [code-server](./src/code-server/README.md) - VS Code in the browser
- [vscode-web](./src/vscode-web/README.md) - VS Code in the browser (Microsoft's official VS Code web server)

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion src/code-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ VS Code in the browser ([code-server](https://github.com/coder/code-server))

---

_Note: This file was auto-generated from the [devcontainer-feature.json](https://github.com/coder/devcontainer-features/blob/main/src/code-server/devcontainer-feature.json). Add additional notes to a `NOTES.md`._
_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._
53 changes: 53 additions & 0 deletions src/vscode-web/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
## vscode-web vs code-server

This feature installs Microsoft's official VS Code web server (the same
`vscode-server-linux-*-web` build used by `code serve-web`), not
[coder/code-server](https://github.com/coder/code-server). The main practical
difference is the extension marketplace: the official server uses the
Microsoft Marketplace, so Microsoft-exclusive extensions such as Pylance and
GitHub Copilot can be installed. If you do not need those, consider the
[code-server feature](../code-server) instead.

## License

Installing this feature requires explicitly accepting the
[Microsoft VS Code Server license](https://aka.ms/vscode-server-license),
which limits usage to your own development purposes. Set the
`acceptLicenseTerms` option to `true`; installation fails otherwise:

```json
"features": {
"ghcr.io/coder/devcontainer-features/vscode-web:1": {
"acceptLicenseTerms": true
}
}
```

The server is then started with `--accept-server-license-terms`.

## Extensions

Extensions must be listed in this feature's `extensions` option. The
`customizations.vscode.extensions` property of `devcontainer.json` is consumed
by VS Code clients (e.g. the Dev Containers extension), not by the standalone
web server, so extensions listed only there will not show up in VS Code Web.

## Authentication

By default the server binds to `127.0.0.1` and starts without a connection
token. This assumes an authenticating reverse proxy (such as Coder) in front
of it. If you expose the port directly, set `connectionTokenFile` to require a
token.

## Opening a folder

Use the `defaultFolder` option to control which folder opens by default, or
append `?folder=/path/to/folder` to the URL.

## Coder integration

When used inside a [Coder workspace with dev container support](https://coder.com/docs/admin/templates/extending-templates/devcontainers),
the feature registers a `vscode-web` app on the workspace dashboard via
`customizations.coder.apps`. Its health check probes the `/version` endpoint
(the standalone web server exposes no `/healthz`). The `app*` options
only affect this Coder app metadata, not the server itself.
95 changes: 95 additions & 0 deletions src/vscode-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

# vscode-web (vscode-web)

VS Code in the browser (Microsoft's official [VS Code web server](https://code.visualstudio.com/docs/remote/vscode-server), with access to the Microsoft Marketplace)

## Example Usage

```json
"features": {
"ghcr.io/coder/devcontainer-features/vscode-web:1": {}
}
```

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| acceptLicenseTerms | REQUIRED: set to true to accept the Microsoft VS Code Server license terms (https://aka.ms/vscode-server-license). The feature fails to install when the terms are not accepted. | boolean | false |
| connectionTokenFile | Path to a file containing the connection token used for authentication. When empty, the server starts without a connection token (intended to be used behind an authenticating reverse proxy such as Coder). | string | - |
| defaultFolder | The folder to open by default when no folder is specified in the URL. Can also be passed per-request via the '?folder=' query parameter. | string | - |
| disableWorkspaceTrust | Disable Workspace Trust feature. This only affects the current session. | boolean | false |
| extensions | Comma-separated list of VS Code extensions to install from the Microsoft Marketplace. Format: 'publisher.extension[@version]' (e.g., 'ms-python.python,ms-python.vscode-pylance'). | string | - |
| extensionsDir | Path where extensions are installed. Defaults to a directory under the server data dir. | string | - |
| host | The address to bind to for the VS Code web server. Use '0.0.0.0' to listen on all interfaces. | string | 127.0.0.1 |
| logFile | Path to a file to send stdout and stderr logs to from the VS Code web server. | string | /tmp/vscode-web.log |
| logLevel | Log level of the VS Code web server. One of 'trace', 'debug', 'info', 'warn', 'error', 'critical', 'off'. Defaults to the server's built-in default ('info'). | string | - |
| port | The port to bind to for the VS Code web server. | string | 13338 |
| serverBasePath | Path under which the server is served (e.g. when running behind a path-routing reverse proxy). | string | - |
| serverDataDir | Directory where the server stores its data. Defaults to '~/.vscode-server'. | string | - |
| socketPath | Path to a socket to listen on instead of host:port. | string | - |
| telemetryLevel | Telemetry level of the VS Code web server. | string | off |
| userDataDir | Directory where user data (settings, state) is kept. Defaults to a directory under the server data dir. | string | - |
| version | The version of VS Code to install (e.g. '1.101.0'). If empty, installs the latest stable version. | string | - |
| appOpenIn | The way to open the app in Coder. Defaults to 'slim-window'. | string | slim-window |
| appShare | The sharing level to use for the app in Coder. Defaults to 'owner'. | string | owner |
| appGroup | The group to use for the app in Coder. Defaults to 'Web Editors'. | string | Web Editors |

## vscode-web vs code-server

This feature installs Microsoft's official VS Code web server (the same
`vscode-server-linux-*-web` build used by `code serve-web`), not
[coder/code-server](https://github.com/coder/code-server). The main practical
difference is the extension marketplace: the official server uses the
Microsoft Marketplace, so Microsoft-exclusive extensions such as Pylance and
GitHub Copilot can be installed. If you do not need those, consider the
[code-server feature](../code-server) instead.

## License

Installing this feature requires explicitly accepting the
[Microsoft VS Code Server license](https://aka.ms/vscode-server-license),
which limits usage to your own development purposes. Set the
`acceptLicenseTerms` option to `true`; installation fails otherwise:

```json
"features": {
"ghcr.io/coder/devcontainer-features/vscode-web:1": {
"acceptLicenseTerms": true
}
}
```

The server is then started with `--accept-server-license-terms`.

## Extensions

Extensions must be listed in this feature's `extensions` option. The
`customizations.vscode.extensions` property of `devcontainer.json` is consumed
by VS Code clients (e.g. the Dev Containers extension), not by the standalone
web server, so extensions listed only there will not show up in VS Code Web.

## Authentication

By default the server binds to `127.0.0.1` and starts without a connection
token. This assumes an authenticating reverse proxy (such as Coder) in front
of it. If you expose the port directly, set `connectionTokenFile` to require a
token.

## Opening a folder

Use the `defaultFolder` option to control which folder opens by default, or
append `?folder=/path/to/folder` to the URL.

## Coder integration

When used inside a [Coder workspace with dev container support](https://coder.com/docs/admin/templates/extending-templates/devcontainers),
the feature registers a `vscode-web` app on the workspace dashboard via
`customizations.coder.apps`. Its health check probes the `/version` endpoint
(the standalone web server exposes no `/healthz`). The `app*` options
only affect this Coder app metadata, not the server itself.


---

_Note: This file was auto-generated from the [devcontainer-feature.json](devcontainer-feature.json). Add additional notes to a `NOTES.md`._
128 changes: 128 additions & 0 deletions src/vscode-web/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"name": "vscode-web",
"id": "vscode-web",
"version": "1.0.0",
"description": "VS Code in the browser (Microsoft's official [VS Code web server](https://code.visualstudio.com/docs/remote/vscode-server), with access to the Microsoft Marketplace)",
"options": {
"acceptLicenseTerms": {
"type": "boolean",
"default": false,
"description": "REQUIRED: set to true to accept the Microsoft VS Code Server license terms (https://aka.ms/vscode-server-license). The feature fails to install when the terms are not accepted."
},
"connectionTokenFile": {
"type": "string",
"default": "",
"description": "Path to a file containing the connection token used for authentication. When empty, the server starts without a connection token (intended to be used behind an authenticating reverse proxy such as Coder)."
},
"defaultFolder": {
"type": "string",
"default": "",
"description": "The folder to open by default when no folder is specified in the URL. Can also be passed per-request via the '?folder=' query parameter."
},
"disableWorkspaceTrust": {
"type": "boolean",
"default": false,
"description": "Disable Workspace Trust feature. This only affects the current session."
},
"extensions": {
"type": "string",
"default": "",
"description": "Comma-separated list of VS Code extensions to install from the Microsoft Marketplace. Format: 'publisher.extension[@version]' (e.g., 'ms-python.python,ms-python.vscode-pylance')."
},
"extensionsDir": {
"type": "string",
"default": "",
"description": "Path where extensions are installed. Defaults to a directory under the server data dir."
},
"host": {
"type": "string",
"default": "127.0.0.1",
"description": "The address to bind to for the VS Code web server. Use '0.0.0.0' to listen on all interfaces."
},
"logFile": {
"type": "string",
"default": "/tmp/vscode-web.log",
"description": "Path to a file to send stdout and stderr logs to from the VS Code web server."
},
"logLevel": {
"type": "string",
"default": "",
"description": "Log level of the VS Code web server. One of 'trace', 'debug', 'info', 'warn', 'error', 'critical', 'off'. Defaults to the server's built-in default ('info')."
},
"port": {
"type": "string",
"default": "13338",
"description": "The port to bind to for the VS Code web server."
},
"serverBasePath": {
"type": "string",
"default": "",
"description": "Path under which the server is served (e.g. when running behind a path-routing reverse proxy)."
},
"serverDataDir": {
"type": "string",
"default": "",
"description": "Directory where the server stores its data. Defaults to '~/.vscode-server'."
},
"socketPath": {
"type": "string",
"default": "",
"description": "Path to a socket to listen on instead of host:port."
},
"telemetryLevel": {
"type": "string",
"enum": ["off", "crash", "error", "all"],
"default": "off",
"description": "Telemetry level of the VS Code web server."
},
"userDataDir": {
"type": "string",
"default": "",
"description": "Directory where user data (settings, state) is kept. Defaults to a directory under the server data dir."
},
"version": {
"type": "string",
"default": "",
"description": "The version of VS Code to install (e.g. '1.101.0'). If empty, installs the latest stable version."
},
"appOpenIn": {
"type": "string",
"default": "slim-window",
"description": "The way to open the app in Coder. Defaults to 'slim-window'."
},
"appShare": {
"type": "string",
"default": "owner",
"description": "The sharing level to use for the app in Coder. Defaults to 'owner'."
},
"appGroup": {
"type": "string",
"default": "Web Editors",
"description": "The group to use for the app in Coder. Defaults to 'Web Editors'."
}
},
"customizations": {
"coder": {
"apps": [
{
"slug": "vscode-web",
"displayName": "VS Code Web",
"url": "http://${localEnv:FEATURE_VSCODE_WEB_OPTION_HOST:127.0.0.1}:${localEnv:FEATURE_VSCODE_WEB_OPTION_PORT:13338}/",
"openIn": "${localEnv:FEATURE_VSCODE_WEB_OPTION_APPOPENIN:slim-window}",
"share": "${localEnv:FEATURE_VSCODE_WEB_OPTION_APPSHARE:owner}",
"icon": "/icon/code.svg",
"group": "${localEnv:FEATURE_VSCODE_WEB_OPTION_APPGROUP:Web Editors}",
"healthCheck": {
"url": "http://127.0.0.1:${localEnv:FEATURE_VSCODE_WEB_OPTION_PORT:13338}/version",
"interval": 3,
"threshold": 10
}
}
]
}
},
"entrypoint": "/usr/local/bin/vscode-web-entrypoint",
"dependsOn": {
"ghcr.io/devcontainers/features/common-utils:2": {}
}
}
Loading
Loading