mirror of
https://github.com/coder/code-server.git
synced 2026-04-16 21:31:43 -05:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0e20d514d | ||
|
|
9bd3b83ef5 | ||
|
|
2c9b4e7fd5 | ||
|
|
7af90ea623 | ||
|
|
8b55b5003d | ||
|
|
e5b8d447e5 | ||
|
|
c8257a3074 | ||
|
|
0c72b20fa7 | ||
|
|
ea2caf00ac | ||
|
|
3f2e3340d8 | ||
|
|
47d6d3ada5 | ||
|
|
dded82bb47 | ||
|
|
5d5b7b1944 |
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
@@ -145,7 +145,7 @@ jobs:
|
|||||||
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
20.18.3
|
20.19.0
|
||||||
|
|||||||
22
CHANGELOG.md
22
CHANGELOG.md
@@ -22,6 +22,28 @@ Code v99.99.999
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## [4.99.4](https://github.com/coder/code-server/releases/tag/v4.99.4) - 2025-05-02
|
||||||
|
|
||||||
|
Code v1.99.3
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Validate that ports in the path proxy are numbers, to prevent proxying to
|
||||||
|
arbitrary domains.
|
||||||
|
|
||||||
|
## [4.99.3](https://github.com/coder/code-server/releases/tag/v4.99.3) - 2025-04-17
|
||||||
|
|
||||||
|
Code v1.99.3
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added `--skip-auth-preflight` flag to let preflight requests through the
|
||||||
|
proxy.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.99.3.
|
||||||
|
|
||||||
## [4.99.2](https://github.com/coder/code-server/releases/tag/v4.99.2) - 2025-04-10
|
## [4.99.2](https://github.com/coder/code-server/releases/tag/v4.99.2) - 2025-04-10
|
||||||
|
|
||||||
Code v1.99.2
|
Code v1.99.2
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 3.26.2
|
version: 3.26.4
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 4.99.2
|
appVersion: 4.99.4
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.99.2'
|
tag: '4.99.4'
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
# Specifies one or more secrets to be used when pulling images from a
|
# Specifies one or more secrets to be used when pulling images from a
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ on how to set up a Google VM on which you can install code-server.
|
|||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
There are four ways to get started:
|
There are five ways to get started:
|
||||||
|
|
||||||
1. Using the [install
|
1. Using the [install
|
||||||
script](https://github.com/coder/code-server/blob/main/install.sh), which
|
script](https://github.com/coder/code-server/blob/main/install.sh), which
|
||||||
@@ -35,6 +35,9 @@ There are four ways to get started:
|
|||||||
3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github)
|
3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github)
|
||||||
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||||
provider](https://github.com/coder/deploy-code-server) ⚡
|
provider](https://github.com/coder/deploy-code-server) ⚡
|
||||||
|
5. Using the [code-server feature for
|
||||||
|
devcontainers](https://github.com/coder/devcontainer-features/blob/main/src/code-server/README.md),
|
||||||
|
if you already use devcontainers in your project.
|
||||||
|
|
||||||
If you use the install script, you can preview what occurs during the install
|
If you use the install script, you can preview what occurs during the install
|
||||||
process:
|
process:
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
||||||
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
||||||
- [Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
|
- [Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
|
||||||
|
- [Preflight requests](#preflight-requests)
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -119,22 +120,22 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
|||||||
|
|
||||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
||||||
|
|
||||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
2. You'll need a domain name (if you don't have one, you can purchase one from
|
||||||
[Google Domains](https://domains.google.com) or the domain service of your
|
[Google Domains](https://domains.google.com) or the domain service of your
|
||||||
choice). Once you have a domain name, add an A record to your domain that contains your
|
choice). Once you have a domain name, add an A record to your domain that contains your
|
||||||
instance's IP address.
|
instance's IP address.
|
||||||
|
|
||||||
1. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
3. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install caddy
|
sudo apt install caddy
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
4. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
mydomain.com {
|
mydomain.com {
|
||||||
@@ -153,7 +154,7 @@ sudo apt install caddy
|
|||||||
|
|
||||||
Remember to replace `mydomain.com` with your domain name!
|
Remember to replace `mydomain.com` with your domain name!
|
||||||
|
|
||||||
1. Reload Caddy:
|
5. Reload Caddy:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo systemctl reload caddy
|
sudo systemctl reload caddy
|
||||||
@@ -164,21 +165,22 @@ At this point, you should be able to access code-server via
|
|||||||
|
|
||||||
### Using Let's Encrypt with NGINX
|
### Using Let's Encrypt with NGINX
|
||||||
|
|
||||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
1. This option requires that the remote machine be exposed to the internet. Make
|
||||||
|
sure that your instance allows HTTP/HTTPS traffic.
|
||||||
|
|
||||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
2. You'll need a domain name (if you don't have one, you can purchase one from
|
||||||
[Google Domains](https://domains.google.com) or the domain service of your
|
[Google Domains](https://domains.google.com) or the domain service of your
|
||||||
choice). Once you have a domain name, add an A record to your domain that contains your
|
choice). Once you have a domain name, add an A record to your domain that contains your
|
||||||
instance's IP address.
|
instance's IP address.
|
||||||
|
|
||||||
1. Install NGINX:
|
3. Install NGINX:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y nginx certbot python3-certbot-nginx
|
sudo apt install -y nginx certbot python3-certbot-nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
4. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||||
configuration:
|
configuration:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@@ -199,13 +201,11 @@ At this point, you should be able to access code-server via
|
|||||||
|
|
||||||
Be sure to replace `mydomain.com` with your domain name!
|
Be sure to replace `mydomain.com` with your domain name!
|
||||||
|
|
||||||
1. Enable the config:
|
5. Enable the config:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
||||||
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Be sure to replace `me@example.com` with your actual email.
|
Be sure to replace `me@example.com` with your actual email.
|
||||||
|
|
||||||
At this point, you should be able to access code-server via
|
At this point, you should be able to access code-server via
|
||||||
@@ -292,7 +292,9 @@ redirect all HTTP requests to HTTPS.
|
|||||||
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
||||||
> for free.
|
> for free.
|
||||||
|
|
||||||
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it will change the address displayed in the green section of code-server in the bottom left to show the correct address.
|
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it
|
||||||
|
will change the address displayed in the green section of code-server in the
|
||||||
|
bottom left to show the correct address.
|
||||||
|
|
||||||
## Accessing web services
|
## Accessing web services
|
||||||
|
|
||||||
@@ -378,14 +380,16 @@ PUBLIC_URL=/absproxy/3000 \
|
|||||||
BROWSER=none yarn start
|
BROWSER=none yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
You should then be able to visit
|
||||||
code-server!
|
`https://my-code-server-address.io/absproxy/3000` to see your app exposed
|
||||||
|
through code-server.
|
||||||
|
|
||||||
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
||||||
|
|
||||||
### Proxying to a Vue app
|
### Proxying to a Vue app
|
||||||
|
|
||||||
Similar to the situation with React apps, you have to make a few modifications to proxy a Vue app.
|
Similar to the situation with React apps, you have to make a few modifications
|
||||||
|
to proxy a Vue app.
|
||||||
|
|
||||||
1. add `vue.config.js`
|
1. add `vue.config.js`
|
||||||
2. update the values to match this (you can use any free port):
|
2. update the values to match this (you can use any free port):
|
||||||
@@ -406,7 +410,8 @@ Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#
|
|||||||
|
|
||||||
### Proxying to an Angular app
|
### Proxying to an Angular app
|
||||||
|
|
||||||
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
|
In order to use code-server's built-in proxy with Angular, you need to make the
|
||||||
|
following changes in your app:
|
||||||
|
|
||||||
1. use `<base href="./.">` in `src/index.html`
|
1. use `<base href="./.">` in `src/index.html`
|
||||||
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
|
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
|
||||||
@@ -415,7 +420,8 @@ For additional context, see [this GitHub Discussion](https://github.com/coder/co
|
|||||||
|
|
||||||
### Proxying to a Svelte app
|
### Proxying to a Svelte app
|
||||||
|
|
||||||
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
|
In order to use code-server's built-in proxy with Svelte, you need to make the
|
||||||
|
following changes in your app:
|
||||||
|
|
||||||
1. Add `svelte.config.js` if you don't already have one
|
1. Add `svelte.config.js` if you don't already have one
|
||||||
2. Update the values to match this (you can use any free port):
|
2. Update the values to match this (you can use any free port):
|
||||||
@@ -436,9 +442,19 @@ For additional context, see [this Github Issue](https://github.com/sveltejs/kit/
|
|||||||
|
|
||||||
### Prefixing `/absproxy/<port>` with a path
|
### Prefixing `/absproxy/<port>` with a path
|
||||||
|
|
||||||
This is a case where you need to serve an application via `absproxy` as explained above while serving `codeserver` itself from a path other than the root in your domain.
|
This is a case where you need to serve an application via `absproxy` as
|
||||||
|
explained above while serving code-server itself from a path other than the root
|
||||||
|
in your domain.
|
||||||
|
|
||||||
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve this result:
|
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve
|
||||||
|
this result:
|
||||||
|
|
||||||
1. Start code server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
1. Start code-server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
||||||
2. Follow one of the instructions above for your framework.
|
2. Follow one of the instructions above for your framework.
|
||||||
|
|
||||||
|
### Preflight requests
|
||||||
|
|
||||||
|
By default, if you have auth enabled, code-server will authenticate all proxied
|
||||||
|
requests including preflight requests. This can cause issues because preflight
|
||||||
|
requests do not typically include credentials. To allow all preflight requests
|
||||||
|
through the proxy without authentication, use `--skip-auth-preflight`.
|
||||||
|
|||||||
Submodule lib/vscode updated: 17baf84113...19e0f9e681
57
package-lock.json
generated
57
package-lock.json
generated
@@ -142,9 +142,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array": {
|
"node_modules/@eslint/config-array": {
|
||||||
"version": "0.19.2",
|
"version": "0.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz",
|
||||||
"integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==",
|
"integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -157,9 +157,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-helpers": {
|
"node_modules/@eslint/config-helpers": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.1.tgz",
|
||||||
"integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==",
|
"integrity": "sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -167,9 +167,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/core": {
|
"node_modules/@eslint/core": {
|
||||||
"version": "0.12.0",
|
"version": "0.13.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz",
|
||||||
"integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==",
|
"integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -217,9 +217,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "9.23.0",
|
"version": "9.25.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.25.1.tgz",
|
||||||
"integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==",
|
"integrity": "sha512-dEIwmjntEx8u3Uvv+kr3PDeeArL8Hw07H9kyYxCjnM9pBjfEhk6uLXSchxxzgiwtRhhzVzqmUSDFBOi1TuZ7qg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -237,13 +237,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/plugin-kit": {
|
"node_modules/@eslint/plugin-kit": {
|
||||||
"version": "0.2.7",
|
"version": "0.2.8",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz",
|
||||||
"integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==",
|
"integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^0.12.0",
|
"@eslint/core": "^0.13.0",
|
||||||
"levn": "^0.4.1"
|
"levn": "^0.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -680,10 +680,11 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/semver": {
|
"node_modules/@types/semver": {
|
||||||
"version": "7.5.8",
|
"version": "7.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz",
|
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz",
|
||||||
"integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==",
|
"integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==",
|
||||||
"dev": true
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/send": {
|
"node_modules/@types/send": {
|
||||||
"version": "0.17.4",
|
"version": "0.17.4",
|
||||||
@@ -2147,20 +2148,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "9.23.0",
|
"version": "9.25.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.25.1.tgz",
|
||||||
"integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==",
|
"integrity": "sha512-E6Mtz9oGQWDCpV12319d59n4tx9zOTXSTmc8BLVxBx+G/0RdM5MvEEJLU9c0+aleoePYYgVTOsRblx433qmhWQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
"@eslint/config-array": "^0.19.2",
|
"@eslint/config-array": "^0.20.0",
|
||||||
"@eslint/config-helpers": "^0.2.0",
|
"@eslint/config-helpers": "^0.2.1",
|
||||||
"@eslint/core": "^0.12.0",
|
"@eslint/core": "^0.13.0",
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@eslint/js": "9.23.0",
|
"@eslint/js": "9.25.1",
|
||||||
"@eslint/plugin-kit": "^0.2.7",
|
"@eslint/plugin-kit": "^0.2.8",
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
|
|||||||
@@ -140,13 +140,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
@@ -335,6 +341,7 @@ export class WebClientServer {
|
@@ -335,6 +341,7 @@ export class WebClientServer {
|
||||||
|
|
||||||
const productConfiguration = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
+ rootEndpoint: rootBase,
|
+ rootEndpoint: rootBase,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -382,7 +389,9 @@ export class WebClientServer {
|
@@ -388,7 +395,9 @@ export class WebClientServer {
|
||||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||||
WORKBENCH_WEB_BASE_URL: staticRoute,
|
WORKBENCH_WEB_BASE_URL: staticRoute,
|
||||||
WORKBENCH_NLS_URL,
|
WORKBENCH_NLS_URL,
|
||||||
@@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
};
|
};
|
||||||
|
|
||||||
// DEV ---------------------------------------------------------------------------------------
|
// DEV ---------------------------------------------------------------------------------------
|
||||||
@@ -419,7 +428,7 @@ export class WebClientServer {
|
@@ -425,7 +434,7 @@ export class WebClientServer {
|
||||||
'default-src \'self\';',
|
'default-src \'self\';',
|
||||||
'img-src \'self\' https: data: blob:;',
|
'img-src \'self\' https: data: blob:;',
|
||||||
'media-src \'self\';',
|
'media-src \'self\';',
|
||||||
@@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
'child-src \'self\';',
|
'child-src \'self\';',
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data: blob:;',
|
'worker-src \'self\' data: blob:;',
|
||||||
@@ -492,3 +501,70 @@ export class WebClientServer {
|
@@ -498,3 +507,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
@@ -326,6 +326,10 @@ export class Extension implements IExten
|
@@ -332,6 +332,10 @@ export class Extension implements IExten
|
||||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,12 +156,12 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
@@ -26,6 +26,7 @@ import { URI } from '../../base/common/u
|
@@ -26,6 +26,7 @@ import { URI } from '../../base/common/u
|
||||||
import { streamToBuffer } from '../../base/common/buffer.js';
|
import { streamToBuffer } from '../../base/common/buffer.js';
|
||||||
import { IProductConfiguration } from '../../base/common/product.js';
|
import { IProductConfiguration } from '../../base/common/product.js';
|
||||||
import { isString } from '../../base/common/types.js';
|
import { isString, Mutable } from '../../base/common/types.js';
|
||||||
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
||||||
import { CharCode } from '../../base/common/charCode.js';
|
import { CharCode } from '../../base/common/charCode.js';
|
||||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||||
@@ -380,14 +381,22 @@ export class WebClientServer {
|
@@ -386,14 +387,22 @@ export class WebClientServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
const cookies = cookie.parse(req.headers.cookie || '');
|
const cookies = cookie.parse(req.headers.cookie || '');
|
||||||
@@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -106,6 +107,7 @@ export interface ServerParsedArgs {
|
@@ -107,6 +108,7 @@ export interface ServerParsedArgs {
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
'disable-getting-started-override'?: boolean,
|
'disable-getting-started-override'?: boolean,
|
||||||
@@ -272,7 +272,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
@@ -445,9 +445,6 @@ export class InstallAction extends Exten
|
@@ -474,9 +474,6 @@ export class InstallAction extends Exten
|
||||||
if (this.extension.isBuiltin) {
|
if (this.extension.isBuiltin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -752,7 +749,7 @@ export abstract class InstallInOtherServ
|
@@ -781,7 +778,7 @@ export abstract class InstallInOtherServ
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
@@ -291,7 +291,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prefers to run on UI
|
// Prefers to run on UI
|
||||||
@@ -2039,17 +2036,6 @@ export class SetLanguageAction extends E
|
@@ -2071,17 +2068,6 @@ export class SetLanguageAction extends E
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = SetLanguageAction.DisabledClass;
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
@@ -309,7 +309,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
@@ -2066,7 +2052,6 @@ export class ClearLanguageAction extends
|
@@ -2098,7 +2084,6 @@ export class ClearLanguageAction extends
|
||||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -317,7 +317,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
@ILocaleService private readonly localeService: ILocaleService,
|
@ILocaleService private readonly localeService: ILocaleService,
|
||||||
) {
|
) {
|
||||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||||
@@ -2076,17 +2061,6 @@ export class ClearLanguageAction extends
|
@@ -2108,17 +2093,6 @@ export class ClearLanguageAction extends
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = ClearLanguageAction.DisabledClass;
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -100,6 +102,8 @@ export interface ServerParsedArgs {
|
@@ -101,6 +103,8 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string;
|
'auth'?: string;
|
||||||
@@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -364,6 +364,8 @@ export class WebClientServer {
|
@@ -370,6 +370,8 @@ export class WebClientServer {
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
@@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,11 +7,11 @@ import { Event } from '../../base/common
|
@@ -7,11 +7,11 @@ import { Event } from '../../base/common
|
||||||
import { Disposable } from '../../base/common/lifecycle.js';
|
import { Disposable, DisposableStore } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from '../common/contextkeys.js';
|
||||||
@@ -208,7 +208,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -39,6 +39,9 @@ export const HasWebFileSystemAccess = ne
|
@@ -40,6 +40,9 @@ export const HasWebFileSystemAccess = ne
|
||||||
|
|
||||||
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||||
import './gettingStartedColors.js';
|
import './gettingStartedColors.js';
|
||||||
@@ -872,6 +872,72 @@ export class GettingStartedPage extends
|
@@ -874,6 +874,72 @@ export class GettingStartedPage extends
|
||||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||||
|
|
||||||
@@ -907,6 +973,9 @@ export class GettingStartedPage extends
|
@@ -909,6 +975,9 @@ export class GettingStartedPage extends
|
||||||
recentList.setLimit(5);
|
recentList.setLimit(5);
|
||||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
|
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||||
'auth'?: string;
|
'auth'?: string;
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -368,6 +368,7 @@ export class WebClientServer {
|
@@ -374,6 +374,7 @@ export class WebClientServer {
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||||
@@ -214,7 +214,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,7 +7,7 @@ import { Event } from '../../base/common
|
@@ -7,7 +7,7 @@ import { Event } from '../../base/common
|
||||||
import { Disposable } from '../../base/common/lifecycle.js';
|
import { Disposable, DisposableStore } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||||
@@ -234,7 +234,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -41,6 +41,7 @@ export const EmbedderIdentifierContext =
|
@@ -42,6 +42,7 @@ export const EmbedderIdentifierContext =
|
||||||
|
|
||||||
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
@@ -334,6 +334,7 @@ export class WebClientServer {
|
@@ -334,6 +334,7 @@ export class WebClientServer {
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
+ codeServerVersion: this._productService.codeServerVersion,
|
+ codeServerVersion: this._productService.codeServerVersion,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -359,6 +359,7 @@ export class WebClientServer {
|
@@ -365,6 +365,7 @@ export class WebClientServer {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ export const serverOptions: OptionDescri
|
@@ -99,6 +100,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
@@ -47,7 +47,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
- }).toString(true)
|
- }).toString(true)
|
||||||
- } : undefined
|
- } : undefined
|
||||||
+ extensionsGallery: this._productService.extensionsGallery,
|
+ extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
|
|
||||||
if (!this._environmentService.isBuilt) {
|
const proposedApi = this._environmentService.args['enable-proposed-api'];
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
|
|||||||
@@ -20,3 +20,5 @@ getting-started.diff
|
|||||||
keepalive.diff
|
keepalive.diff
|
||||||
clipboard.diff
|
clipboard.diff
|
||||||
display-language.diff
|
display-language.diff
|
||||||
|
trusted-domains.diff
|
||||||
|
signature-verification.diff
|
||||||
|
|||||||
@@ -64,4 +64,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ },
|
+ },
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
|
|||||||
34
patches/signature-verification.diff
Normal file
34
patches/signature-verification.diff
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
Disable signature verification.
|
||||||
|
|
||||||
|
Extension signature verification is now mandatory for all platforms and needs to be disabled.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
@@ -34,6 +34,7 @@ import {
|
||||||
|
ExtensionSignatureVerificationCode,
|
||||||
|
computeSize,
|
||||||
|
IAllowedExtensionsService,
|
||||||
|
+ // @ts-expect-error no-unused-variable
|
||||||
|
VerifyExtensionSignatureConfigKey,
|
||||||
|
shouldRequireRepositorySignatureFor,
|
||||||
|
} from '../common/extensionManagement.js';
|
||||||
|
@@ -87,6 +88,7 @@ export class ExtensionManagementService
|
||||||
|
@IDownloadService private downloadService: IDownloadService,
|
||||||
|
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||||
|
@IFileService private readonly fileService: IFileService,
|
||||||
|
+ // @ts-expect-error no-unused-variable
|
||||||
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
|
@IExtensionGalleryManifestService protected readonly extensionGalleryManifestService: IExtensionGalleryManifestService,
|
||||||
|
@IProductService productService: IProductService,
|
||||||
|
@@ -331,8 +333,7 @@ export class ExtensionManagementService
|
||||||
|
|
||||||
|
private async downloadExtension(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> {
|
||||||
|
if (verifySignature) {
|
||||||
|
- const value = this.configurationService.getValue(VerifyExtensionSignatureConfigKey);
|
||||||
|
- verifySignature = isBoolean(value) ? value : true;
|
||||||
|
+ verifySignature = false;
|
||||||
|
}
|
||||||
|
const { location, verificationStatus } = await this.extensionsDownloader.download(extension, operation, verifySignature, clientTargetPlatform);
|
||||||
|
const shouldRequireSignature = shouldRequireRepositorySignatureFor(extension.private, await this.extensionGalleryManifestService.getExtensionGalleryManifest());
|
||||||
@@ -21,18 +21,18 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
|||||||
|
|
||||||
+import * as _http from 'http';
|
+import * as _http from 'http';
|
||||||
import * as performance from '../../../base/common/performance.js';
|
import * as performance from '../../../base/common/performance.js';
|
||||||
|
import type * as vscode from 'vscode';
|
||||||
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
||||||
import { RequireInterceptor } from '../common/extHostRequireInterceptor.js';
|
@@ -18,6 +19,7 @@ import { ExtensionRuntime } from '../com
|
||||||
@@ -17,6 +18,7 @@ import { ExtensionRuntime } from '../com
|
|
||||||
import { CLIServer } from './extHostCLIServer.js';
|
import { CLIServer } from './extHostCLIServer.js';
|
||||||
import { realpathSync } from '../../../base/node/extpath.js';
|
import { realpathSync } from '../../../base/node/extpath.js';
|
||||||
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
||||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
||||||
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
||||||
import { createRequire } from 'node:module';
|
import nodeModule from 'node:module';
|
||||||
const require = createRequire(import.meta.url);
|
import { assertType } from '../../../base/common/types.js';
|
||||||
@@ -97,6 +99,52 @@ export class ExtHostExtensionService ext
|
@@ -226,6 +228,52 @@ export class ExtHostExtensionService ext
|
||||||
await interceptor.install();
|
|
||||||
performance.mark('code/extHost/didInitAPI');
|
performance.mark('code/extHost/didInitAPI');
|
||||||
|
|
||||||
+ (async () => {
|
+ (async () => {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
|
|||||||
49
patches/trusted-domains.diff
Normal file
49
patches/trusted-domains.diff
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
Allow configuring trusted domains via product.json or flag.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
@@ -20,6 +20,7 @@ export const serverOptions: OptionDescri
|
||||||
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
|
'disable-getting-started-override': { type: 'boolean' },
|
||||||
|
'locale': { type: 'string' },
|
||||||
|
+ 'link-protection-trusted-domains': { type: 'string[]' },
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
@@ -109,6 +110,7 @@ export interface ServerParsedArgs {
|
||||||
|
'disable-file-uploads'?: boolean;
|
||||||
|
'disable-getting-started-override'?: boolean,
|
||||||
|
'locale'?: string
|
||||||
|
+ 'link-protection-trusted-domains'?: string[],
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
@@ -339,6 +339,14 @@ export class WebClientServer {
|
||||||
|
scopes: [['user:email'], ['repo']]
|
||||||
|
} : undefined;
|
||||||
|
|
||||||
|
+ const linkProtectionTrustedDomains: string[] = [];
|
||||||
|
+ if (this._environmentService.args['link-protection-trusted-domains']) {
|
||||||
|
+ linkProtectionTrustedDomains.push(...this._environmentService.args['link-protection-trusted-domains']);
|
||||||
|
+ }
|
||||||
|
+ if (this._productService.linkProtectionTrustedDomains) {
|
||||||
|
+ linkProtectionTrustedDomains.push(...this._productService.linkProtectionTrustedDomains);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
|
rootEndpoint: rootBase,
|
||||||
|
@@ -353,6 +361,7 @@ export class WebClientServer {
|
||||||
|
telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||||
|
embedderIdentifier: 'server-distro',
|
||||||
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
|
+ linkProtectionTrustedDomains,
|
||||||
|
};
|
||||||
|
|
||||||
|
const proposedApi = this._environmentService.args['enable-proposed-api'];
|
||||||
@@ -106,13 +106,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -341,6 +341,7 @@ export class WebClientServer {
|
@@ -341,6 +341,7 @@ export class WebClientServer {
|
||||||
const productConfiguration = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -94,6 +96,8 @@ export const serverOptions: OptionDescri
|
@@ -95,6 +97,8 @@ export const serverOptions: OptionDescri
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -355,6 +355,7 @@ export class WebClientServer {
|
@@ -361,6 +361,7 @@ export class WebClientServer {
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export enum LogLevel {
|
|||||||
export class OptionalString extends Optional<string> {}
|
export class OptionalString extends Optional<string> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Code flags provided by the user.
|
* (VS) Code flags provided by the user.
|
||||||
*/
|
*/
|
||||||
export interface UserProvidedCodeArgs {
|
export interface UserProvidedCodeArgs {
|
||||||
"disable-telemetry"?: boolean
|
"disable-telemetry"?: boolean
|
||||||
@@ -53,7 +53,9 @@ export interface UserProvidedCodeArgs {
|
|||||||
"disable-getting-started-override"?: boolean
|
"disable-getting-started-override"?: boolean
|
||||||
"disable-proxy"?: boolean
|
"disable-proxy"?: boolean
|
||||||
"session-socket"?: string
|
"session-socket"?: string
|
||||||
"abs-proxy-base-path"?: string
|
"link-protection-trusted-domains"?: string[]
|
||||||
|
// locale is used by both VS Code and code-server.
|
||||||
|
locale?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +75,6 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
enable?: string[]
|
enable?: string[]
|
||||||
help?: boolean
|
help?: boolean
|
||||||
host?: string
|
host?: string
|
||||||
locale?: string
|
|
||||||
port?: number
|
port?: number
|
||||||
json?: boolean
|
json?: boolean
|
||||||
log?: LogLevel
|
log?: LogLevel
|
||||||
@@ -91,6 +92,7 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
verbose?: boolean
|
verbose?: boolean
|
||||||
"app-name"?: string
|
"app-name"?: string
|
||||||
"welcome-text"?: string
|
"welcome-text"?: string
|
||||||
|
"abs-proxy-base-path"?: string
|
||||||
/* Positional arguments. */
|
/* Positional arguments. */
|
||||||
_?: string[]
|
_?: string[]
|
||||||
}
|
}
|
||||||
@@ -194,6 +196,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
enable: { type: "string[]" },
|
enable: { type: "string[]" },
|
||||||
help: { type: "boolean", short: "h", description: "Show this output." },
|
help: { type: "boolean", short: "h", description: "Show this output." },
|
||||||
json: { type: "boolean" },
|
json: { type: "boolean" },
|
||||||
|
"link-protection-trusted-domains": {
|
||||||
|
type: "string[]",
|
||||||
|
description: "Links matching a trusted domain can be opened without link protection.",
|
||||||
|
},
|
||||||
locale: {
|
locale: {
|
||||||
// The preferred way to set the locale is via the UI.
|
// The preferred way to set the locale is via the UI.
|
||||||
type: "string",
|
type: "string",
|
||||||
@@ -707,12 +713,16 @@ export function parseConfigFile(configFile: string, configPath: string): ConfigA
|
|||||||
|
|
||||||
// We convert the config file into a set of flags.
|
// We convert the config file into a set of flags.
|
||||||
// This is a temporary measure until we add a proper CLI library.
|
// This is a temporary measure until we add a proper CLI library.
|
||||||
const configFileArgv = Object.entries(config).map(([optName, opt]) => {
|
const configFileArgv = Object.entries(config)
|
||||||
if (opt === true) {
|
.map(([optName, opt]) => {
|
||||||
return `--${optName}`
|
if (opt === true) {
|
||||||
}
|
return `--${optName}`
|
||||||
return `--${optName}=${opt}`
|
} else if (Array.isArray(opt)) {
|
||||||
})
|
return opt.map((o) => `--${optName}=${o}`)
|
||||||
|
}
|
||||||
|
return `--${optName}=${opt}`
|
||||||
|
})
|
||||||
|
.flat()
|
||||||
const args = parse(configFileArgv, {
|
const args = parse(configFileArgv, {
|
||||||
configFile: configPath,
|
configFile: configPath,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ const getProxyTarget = (
|
|||||||
): string => {
|
): string => {
|
||||||
// If there is a base path, strip it out.
|
// If there is a base path, strip it out.
|
||||||
const base = (req as any).base || ""
|
const base = (req as any).base || ""
|
||||||
return `http://0.0.0.0:${req.params.port}${opts?.proxyBasePath || ""}/${req.originalUrl.slice(base.length)}`
|
const port = parseInt(req.params.port, 10)
|
||||||
|
if (isNaN(port)) {
|
||||||
|
throw new HttpError("Invalid port", HttpCode.BadRequest)
|
||||||
|
}
|
||||||
|
return `http://0.0.0.0:${port}${opts?.proxyBasePath || ""}/${req.originalUrl.slice(base.length)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function proxy(
|
export async function proxy(
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
bindAddrFromArgs,
|
bindAddrFromArgs,
|
||||||
defaultConfigFile,
|
defaultConfigFile,
|
||||||
parse,
|
parse,
|
||||||
|
parseConfigFile,
|
||||||
setDefaults,
|
setDefaults,
|
||||||
shouldOpenInExistingInstance,
|
shouldOpenInExistingInstance,
|
||||||
toCodeArgs,
|
toCodeArgs,
|
||||||
@@ -287,12 +288,17 @@ describe("parser", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("should support repeatable flags", async () => {
|
it("should support repeatable flags", async () => {
|
||||||
|
expect(() => parse(["--proxy-domain", ""])).toThrowError(/--proxy-domain requires a value/)
|
||||||
expect(parse(["--proxy-domain", "*.coder.com"])).toEqual({
|
expect(parse(["--proxy-domain", "*.coder.com"])).toEqual({
|
||||||
"proxy-domain": ["*.coder.com"],
|
"proxy-domain": ["*.coder.com"],
|
||||||
})
|
})
|
||||||
expect(parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "test.com"])).toEqual({
|
expect(parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "test.com"])).toEqual({
|
||||||
"proxy-domain": ["*.coder.com", "test.com"],
|
"proxy-domain": ["*.coder.com", "test.com"],
|
||||||
})
|
})
|
||||||
|
// Commas are literal, at the moment.
|
||||||
|
expect(parse(["--proxy-domain", "*.coder.com,test.com"])).toEqual({
|
||||||
|
"proxy-domain": ["*.coder.com,test.com"],
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should enforce cert-key with cert value or otherwise generate one", async () => {
|
it("should enforce cert-key with cert value or otherwise generate one", async () => {
|
||||||
@@ -490,6 +496,20 @@ describe("parser", () => {
|
|||||||
}),
|
}),
|
||||||
).toThrowError(expectedErrMsg)
|
).toThrowError(expectedErrMsg)
|
||||||
})
|
})
|
||||||
|
it("should fail to parse invalid config", () => {
|
||||||
|
expect(() => parseConfigFile("test", "/fake-config-path")).toThrowError("invalid config: test")
|
||||||
|
})
|
||||||
|
it("should parse repeatable options", () => {
|
||||||
|
const configContents = `
|
||||||
|
install-extension:
|
||||||
|
- extension.number1
|
||||||
|
- extension.number2
|
||||||
|
`
|
||||||
|
expect(parseConfigFile(configContents, "/fake-config-path")).toEqual({
|
||||||
|
config: "/fake-config-path",
|
||||||
|
"install-extension": ["extension.number1", "extension.number2"],
|
||||||
|
})
|
||||||
|
})
|
||||||
it("should ignore optional strings set to false", async () => {
|
it("should ignore optional strings set to false", async () => {
|
||||||
expect(parse(["--cert=false"])).toEqual({})
|
expect(parse(["--cert=false"])).toEqual({})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user