mirror of
https://github.com/coder/code-server.git
synced 2026-04-13 21:32:52 -05:00
Compare commits
34 Commits
v4.98.0-rc
...
v4.100.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dd999ba78 | ||
|
|
1aca01f8d8 | ||
|
|
e05219d9c0 | ||
|
|
d0e20d514d | ||
|
|
9bd3b83ef5 | ||
|
|
2c9b4e7fd5 | ||
|
|
7af90ea623 | ||
|
|
8b55b5003d | ||
|
|
e5b8d447e5 | ||
|
|
c8257a3074 | ||
|
|
0c72b20fa7 | ||
|
|
ea2caf00ac | ||
|
|
3f2e3340d8 | ||
|
|
47d6d3ada5 | ||
|
|
dded82bb47 | ||
|
|
5d5b7b1944 | ||
|
|
c36b2d3edd | ||
|
|
3b7634c578 | ||
|
|
ec0899a81b | ||
|
|
bbf2e24648 | ||
|
|
9045919d2b | ||
|
|
cb29e65982 | ||
|
|
7eb8f4be87 | ||
|
|
cd4d1b614d | ||
|
|
5051c0f9e4 | ||
|
|
b07335a0f1 | ||
|
|
e3c09efcbc | ||
|
|
e0c960b30e | ||
|
|
55b311a954 | ||
|
|
0a92b76304 | ||
|
|
400ac7b8d0 | ||
|
|
53722c5361 | ||
|
|
e2c489dd00 | ||
|
|
e1c84998d7 |
8
.github/workflows/publish.yaml
vendored
8
.github/workflows/publish.yaml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
node-version-file: .node-version
|
||||
|
||||
- name: Download npm package from release artifacts
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
||||
@@ -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
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v4
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download deb artifacts
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
@@ -184,7 +184,7 @@ jobs:
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Download rpm artifacts
|
||||
uses: robinraju/release-downloader@v1.11
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
|
||||
2
.github/workflows/security.yaml
vendored
2
.github/workflows/security.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
|
||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
20.18.2
|
||||
20.19.0
|
||||
|
||||
76
CHANGELOG.md
76
CHANGELOG.md
@@ -22,6 +22,82 @@ Code v99.99.999
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [4.100.0](https://github.com/coder/code-server/releases/tag/v4.100.0) - 2025-05-12
|
||||
|
||||
Code v1.100.0
|
||||
|
||||
### Added
|
||||
|
||||
- Trusted domains for links can now be set at run-time by configuring
|
||||
`linkProtectionTrustedDomains` in the `lib/vscode/product.json` file or via
|
||||
the `--link-protection-trusted-domains` flag.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.100.0.
|
||||
- Disable extension signature verification, which previously was skipped by
|
||||
default (the package used for verification is not available to OSS builds of
|
||||
VS Code) but now reportedly throws hard errors making it impossible to install
|
||||
extensions.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Flags with repeatable options now work via the config file.
|
||||
|
||||
## [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
|
||||
|
||||
Code v1.99.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.2.
|
||||
|
||||
## [4.99.1](https://github.com/coder/code-server/releases/tag/v4.99.1) - 2025-04-08
|
||||
|
||||
Code v1.99.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.1.
|
||||
|
||||
## [4.99.0](https://github.com/coder/code-server/releases/tag/v4.99.0) - 2025-04-07
|
||||
|
||||
Code v1.99.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.0.
|
||||
|
||||
## [4.98.0](https://github.com/coder/code-server/releases/tag/v4.98.0) - 2025-03-07
|
||||
|
||||
Code v1.98.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.98.0.
|
||||
|
||||
## [4.97.2](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-02-18
|
||||
|
||||
Code v1.97.2
|
||||
|
||||
@@ -15,9 +15,9 @@ type: application
|
||||
# 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.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 3.25.3
|
||||
version: 3.27.0
|
||||
|
||||
# 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
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 4.96.4
|
||||
appVersion: 4.100.0
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.96.4'
|
||||
tag: '4.100.0'
|
||||
pullPolicy: Always
|
||||
|
||||
# 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
|
||||
|
||||
There are four ways to get started:
|
||||
There are five ways to get started:
|
||||
|
||||
1. Using the [install
|
||||
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)
|
||||
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||
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
|
||||
process:
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
||||
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
||||
- [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 -->
|
||||
<!-- 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. 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
|
||||
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.
|
||||
|
||||
1. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||
3. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||
|
||||
```console
|
||||
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/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||
sudo apt update
|
||||
sudo apt install caddy
|
||||
```
|
||||
```console
|
||||
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/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||
sudo apt update
|
||||
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
|
||||
mydomain.com {
|
||||
@@ -153,7 +154,7 @@ sudo apt install caddy
|
||||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
|
||||
1. Reload Caddy:
|
||||
5. Reload Caddy:
|
||||
|
||||
```console
|
||||
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
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
1. Install NGINX:
|
||||
3. Install NGINX:
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
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:
|
||||
|
||||
```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!
|
||||
|
||||
1. Enable the config:
|
||||
|
||||
5. Enable the config:
|
||||
```console
|
||||
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
|
||||
```
|
||||
|
||||
Be sure to replace `me@example.com` with your actual email.
|
||||
|
||||
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
|
||||
> 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
|
||||
|
||||
@@ -378,14 +380,16 @@ PUBLIC_URL=/absproxy/3000 \
|
||||
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
|
||||
code-server!
|
||||
You should then be able to visit
|
||||
`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.
|
||||
|
||||
### 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`
|
||||
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
|
||||
|
||||
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`
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
### 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: 6609ac3d66...848b80aeb5
591
package-lock.json
generated
591
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -140,13 +140,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
return serveError(req, res, 400, `Bad request.`);
|
||||
@@ -335,6 +341,7 @@ export class WebClientServer {
|
||||
|
||||
const productConfiguration = {
|
||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: rootBase,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && 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_WEB_BASE_URL: staticRoute,
|
||||
WORKBENCH_NLS_URL,
|
||||
@@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
};
|
||||
|
||||
// DEV ---------------------------------------------------------------------------------------
|
||||
@@ -419,7 +428,7 @@ export class WebClientServer {
|
||||
@@ -425,7 +434,7 @@ export class WebClientServer {
|
||||
'default-src \'self\';',
|
||||
'img-src \'self\' https: data: blob:;',
|
||||
'media-src \'self\';',
|
||||
@@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
'child-src \'self\';',
|
||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||
'worker-src \'self\' data: blob:;',
|
||||
@@ -492,3 +501,70 @@ export class WebClientServer {
|
||||
@@ -498,3 +507,70 @@ export class WebClientServer {
|
||||
return void res.end(data);
|
||||
}
|
||||
}
|
||||
@@ -241,7 +241,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -56,6 +56,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
|
||||
export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
@@ -253,7 +253,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -317,7 +317,8 @@ class LocalStorageURLCallbackProvider ex
|
||||
@@ -332,7 +332,8 @@ class LocalStorageURLCallbackProvider ex
|
||||
this.startListening();
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
}
|
||||
|
||||
private startListening(): void {
|
||||
@@ -563,17 +564,6 @@ class WorkspaceProvider implements IWork
|
||||
@@ -579,17 +580,6 @@ class WorkspaceProvider implements IWork
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
(function () {
|
||||
|
||||
// Find config by checking for DOM
|
||||
@@ -582,8 +572,8 @@ function readCookie(name: string): strin
|
||||
@@ -598,8 +588,8 @@ function readCookie(name: string): strin
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
@@ -296,7 +296,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -98,7 +98,7 @@ export abstract class AbstractExtensionR
|
||||
@@ -120,7 +120,7 @@ export abstract class AbstractExtensionR
|
||||
: version,
|
||||
path: 'extension'
|
||||
}));
|
||||
|
||||
@@ -79,13 +79,13 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
@@ -122,6 +122,7 @@ export interface NativeParsedArgs {
|
||||
'disable-chromium-sandbox'?: boolean;
|
||||
sandbox?: boolean;
|
||||
|
||||
'enable-coi'?: boolean;
|
||||
+ 'stdin-to-clipboard'?: boolean;
|
||||
'unresponsive-sample-interval'?: string;
|
||||
'unresponsive-sample-period'?: string;
|
||||
|
||||
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
|
||||
'no-proxy-server'?: boolean;
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
|
||||
@@ -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/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
@@ -319,6 +319,10 @@ export class Extension implements IExten
|
||||
@@ -332,6 +332,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
||||
@@ -246,6 +246,9 @@ export async function setupServerService
|
||||
@@ -255,6 +255,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
|
||||
@@ -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
|
||||
import { streamToBuffer } from '../../base/common/buffer.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 { CharCode } from '../../base/common/charCode.js';
|
||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.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 || '');
|
||||
@@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -106,6 +107,7 @@ export interface ServerParsedArgs {
|
||||
@@ -107,6 +108,7 @@ export interface ServerParsedArgs {
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: 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/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
@@ -435,9 +435,6 @@ export class InstallAction extends Exten
|
||||
@@ -474,9 +474,6 @@ export class InstallAction extends Exten
|
||||
if (this.extension.isBuiltin) {
|
||||
return;
|
||||
}
|
||||
@@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||
return;
|
||||
}
|
||||
@@ -742,7 +739,7 @@ export abstract class InstallInOtherServ
|
||||
@@ -781,7 +778,7 @@ export abstract class InstallInOtherServ
|
||||
}
|
||||
|
||||
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
|
||||
@@ -2028,17 +2025,6 @@ export class SetLanguageAction extends E
|
||||
@@ -2071,17 +2068,6 @@ export class SetLanguageAction extends E
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
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> {
|
||||
@@ -2055,7 +2041,6 @@ export class ClearLanguageAction extends
|
||||
@@ -2098,7 +2084,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
@@ -317,7 +317,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
@ILocaleService private readonly localeService: ILocaleService,
|
||||
) {
|
||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||
@@ -2065,17 +2050,6 @@ export class ClearLanguageAction extends
|
||||
@@ -2108,17 +2093,6 @@ export class ClearLanguageAction extends
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = ClearLanguageAction.DisabledClass;
|
||||
@@ -351,7 +351,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
@@ -52,7 +52,7 @@ import './services/dialogs/browser/fileD
|
||||
@@ -53,7 +53,7 @@ import './services/dialogs/browser/fileD
|
||||
import './services/host/browser/browserHostService.js';
|
||||
import './services/lifecycle/browser/lifecycleService.js';
|
||||
import './services/clipboard/browser/clipboardService.js';
|
||||
|
||||
@@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -100,6 +102,8 @@ export interface ServerParsedArgs {
|
||||
@@ -101,6 +103,8 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
'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/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -364,6 +364,8 @@ export class WebClientServer {
|
||||
@@ -370,6 +370,8 @@ export class WebClientServer {
|
||||
serverBasePath: basePath,
|
||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
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/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -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 { 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';
|
||||
@@ -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/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'));
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||
import './gettingStartedColors.js';
|
||||
@@ -870,6 +870,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"))
|
||||
);
|
||||
|
||||
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||
|
||||
@@ -905,6 +971,9 @@ export class GettingStartedPage extends
|
||||
@@ -909,6 +975,9 @@ export class GettingStartedPage extends
|
||||
recentList.setLimit(5);
|
||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||
}
|
||||
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
|
||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string;
|
||||
'disable-file-downloads'?: 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/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,
|
||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
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/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -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 { 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';
|
||||
@@ -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/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 IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
||||
|
||||
@@ -113,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
@@ -79,8 +79,11 @@ export class BrowserDialogHandler extend
|
||||
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
|
||||
|
||||
async about(): Promise<void> {
|
||||
const detailString = (useAgo: boolean): string => {
|
||||
@@ -204,7 +204,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -55,6 +55,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||
@@ -56,6 +56,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||
};
|
||||
|
||||
export interface IProductConfiguration {
|
||||
@@ -272,7 +272,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -334,6 +334,7 @@ export class WebClientServer {
|
||||
} : undefined;
|
||||
|
||||
const productConfiguration = {
|
||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
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/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -359,6 +359,7 @@ export class WebClientServer {
|
||||
@@ -365,6 +365,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
serverBasePath: basePath,
|
||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
|
||||
@@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -58,6 +58,7 @@ export interface IProductConfiguration {
|
||||
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
readonly rootEndpoint?: string
|
||||
readonly updateEndpoint?: string
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -98,6 +99,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -99,6 +100,7 @@ export const serverOptions: OptionDescri
|
||||
export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'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,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
};
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
|
||||
@@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
@@ -47,6 +47,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||
@@ -49,6 +49,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||
version: pkg.version
|
||||
});
|
||||
}
|
||||
@@ -61,9 +61,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ 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
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -74,9 +74,9 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
||||
import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js';
|
||||
-import { RemoteAuthorities } from '../../../base/common/network.js';
|
||||
import { TargetPlatform } from '../../extensions/common/extensions.js';
|
||||
|
||||
const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
|
||||
@@ -140,9 +139,9 @@ export abstract class AbstractExtensionR
|
||||
import { ExtensionGalleryResourceType, getExtensionGalleryManifestResourceUri, IExtensionGalleryManifest, IExtensionGalleryManifestService } from '../../extensionManagement/common/extensionGalleryManifest.js';
|
||||
import { ILogService } from '../../log/common/log.js';
|
||||
@@ -163,9 +162,9 @@ export abstract class AbstractExtensionR
|
||||
}
|
||||
|
||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
||||
|
||||
@@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
||||
@@ -60,6 +60,7 @@ export interface IProductConfiguration {
|
||||
readonly rootEndpoint?: string
|
||||
readonly updateEndpoint?: string
|
||||
readonly logoutEndpoint?: string
|
||||
@@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
};
|
||||
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
|
||||
@@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||
|
||||
@@ -584,6 +585,39 @@ class WorkspaceProvider implements IWork
|
||||
@@ -600,6 +601,39 @@ class WorkspaceProvider implements IWork
|
||||
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
||||
workspaceProvider: WorkspaceProvider.create(config),
|
||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
||||
|
||||
@@ -20,3 +20,5 @@ getting-started.diff
|
||||
keepalive.diff
|
||||
clipboard.diff
|
||||
display-language.diff
|
||||
trusted-domains.diff
|
||||
signature-verification.diff
|
||||
|
||||
@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -60,6 +60,10 @@ export interface IProductConfiguration {
|
||||
@@ -61,6 +61,10 @@ export interface IProductConfiguration {
|
||||
readonly updateEndpoint?: string
|
||||
readonly logoutEndpoint?: string
|
||||
readonly proxyEndpointTemplate?: string
|
||||
@@ -64,4 +64,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ },
|
||||
embedderIdentifier: 'server-distro',
|
||||
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());
|
||||
@@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -457,7 +456,7 @@ function tweakProductForServerWeb(produc
|
||||
@@ -451,7 +450,7 @@ function tweakProductForServerWeb(produc
|
||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||
bundleTask,
|
||||
util.rimraf(`out-vscode-${type}-min`),
|
||||
|
||||
@@ -21,18 +21,18 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
||||
|
||||
+import * as _http from 'http';
|
||||
import * as performance from '../../../base/common/performance.js';
|
||||
import type * as vscode from 'vscode';
|
||||
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
||||
import { RequireInterceptor } from '../common/extHostRequireInterceptor.js';
|
||||
@@ -17,6 +18,7 @@ import { ExtensionRuntime } from '../com
|
||||
@@ -18,6 +19,7 @@ import { ExtensionRuntime } from '../com
|
||||
import { CLIServer } from './extHostCLIServer.js';
|
||||
import { realpathSync } from '../../../base/node/extpath.js';
|
||||
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
||||
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
||||
import { createRequire } from 'node:module';
|
||||
const require = createRequire(import.meta.url);
|
||||
@@ -97,6 +99,52 @@ export class ExtHostExtensionService ext
|
||||
await interceptor.install();
|
||||
import nodeModule from 'node:module';
|
||||
import { assertType } from '../../../base/common/types.js';
|
||||
@@ -226,6 +228,52 @@ export class ExtHostExtensionService ext
|
||||
|
||||
performance.mark('code/extHost/didInitAPI');
|
||||
|
||||
+ (async () => {
|
||||
@@ -96,7 +96,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||
import minimist from 'minimist';
|
||||
import * as nativeWatchdog from 'native-watchdog';
|
||||
import * as net from 'net';
|
||||
@@ -422,7 +423,28 @@ async function startExtensionHostProcess
|
||||
@@ -423,7 +424,28 @@ async function startExtensionHostProcess
|
||||
);
|
||||
|
||||
// rewrite onTerminate-function to be a proper shutdown
|
||||
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||
@@ -153,11 +155,23 @@ export async function setupServerService
|
||||
@@ -158,11 +160,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||
services.set(IRequestService, requestService);
|
||||
|
||||
@@ -142,12 +142,12 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
};
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -64,6 +64,7 @@ export interface IProductConfiguration {
|
||||
@@ -65,6 +65,7 @@ export interface IProductConfiguration {
|
||||
readonly path: string;
|
||||
readonly scope: string;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
@@ -55,7 +55,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||
@@ -57,7 +57,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||
controlUrl: "",
|
||||
recommendationsUrl: "",
|
||||
|
||||
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'];
|
||||
@@ -21,7 +21,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS
|
||||
|
||||
export class BrowserStorageService extends AbstractStorageService {
|
||||
|
||||
@@ -298,7 +299,11 @@ export class IndexedDBStorageDatabase ex
|
||||
@@ -300,7 +301,11 @@ export class IndexedDBStorageDatabase ex
|
||||
}
|
||||
|
||||
static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
||||
|
||||
@@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
@@ -58,6 +58,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
readonly rootEndpoint?: string
|
||||
@@ -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/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -341,6 +341,7 @@ export class WebClientServer {
|
||||
const productConfiguration = {
|
||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: rootBase,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
};
|
||||
Index: code-server/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 ----- */
|
||||
|
||||
@@ -94,6 +96,8 @@ export const serverOptions: OptionDescri
|
||||
@@ -95,6 +97,8 @@ export const serverOptions: OptionDescri
|
||||
};
|
||||
|
||||
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/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -355,6 +355,7 @@ export class WebClientServer {
|
||||
@@ -361,6 +361,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
serverBasePath: basePath,
|
||||
@@ -70,8 +70,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
- content="default-src 'none'; script-src 'sha256-DXeP32g8BdMsVuVabYTmznoTH59F7M7UtV0vXemEFqc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-z5v/0xE4zQPgV1fazhHB/UlsTzdm39hRMk3V8Av0HI4=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
- content="default-src 'none'; script-src 'sha256-nlLyDpnjtftJG2xvXh2vuy77l7xFTjfOz7Jnj1iXNmA=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-ap/AtocvSWp0rrxaO19DJy/nOpazT6M5Cv9utUWe7MA=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
|
||||
@@ -30,7 +30,7 @@ export enum LogLevel {
|
||||
export class OptionalString extends Optional<string> {}
|
||||
|
||||
/**
|
||||
* Code flags provided by the user.
|
||||
* (VS) Code flags provided by the user.
|
||||
*/
|
||||
export interface UserProvidedCodeArgs {
|
||||
"disable-telemetry"?: boolean
|
||||
@@ -53,7 +53,9 @@ export interface UserProvidedCodeArgs {
|
||||
"disable-getting-started-override"?: boolean
|
||||
"disable-proxy"?: boolean
|
||||
"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[]
|
||||
help?: boolean
|
||||
host?: string
|
||||
locale?: string
|
||||
port?: number
|
||||
json?: boolean
|
||||
log?: LogLevel
|
||||
@@ -84,12 +85,14 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
||||
"trusted-origins"?: string[]
|
||||
version?: boolean
|
||||
"proxy-domain"?: string[]
|
||||
"skip-auth-preflight"?: boolean
|
||||
"reuse-window"?: boolean
|
||||
"new-window"?: boolean
|
||||
"ignore-last-opened"?: boolean
|
||||
verbose?: boolean
|
||||
"app-name"?: string
|
||||
"welcome-text"?: string
|
||||
"abs-proxy-base-path"?: string
|
||||
/* Positional arguments. */
|
||||
_?: string[]
|
||||
}
|
||||
@@ -193,6 +196,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
||||
enable: { type: "string[]" },
|
||||
help: { type: "boolean", short: "h", description: "Show this output." },
|
||||
json: { type: "boolean" },
|
||||
"link-protection-trusted-domains": {
|
||||
type: "string[]",
|
||||
description: "Links matching a trusted domain can be opened without link protection.",
|
||||
},
|
||||
locale: {
|
||||
// The preferred way to set the locale is via the UI.
|
||||
type: "string",
|
||||
@@ -252,6 +259,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
||||
description: "GitHub authentication token (can only be passed in via $GITHUB_TOKEN or the config file).",
|
||||
},
|
||||
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
|
||||
"skip-auth-preflight": {
|
||||
type: "boolean",
|
||||
description: "Allows preflight requests through proxy without authentication.",
|
||||
},
|
||||
"ignore-last-opened": {
|
||||
type: "boolean",
|
||||
short: "e",
|
||||
@@ -702,12 +713,16 @@ export function parseConfigFile(configFile: string, configPath: string): ConfigA
|
||||
|
||||
// We convert the config file into a set of flags.
|
||||
// This is a temporary measure until we add a proper CLI library.
|
||||
const configFileArgv = Object.entries(config).map(([optName, opt]) => {
|
||||
if (opt === true) {
|
||||
return `--${optName}`
|
||||
}
|
||||
return `--${optName}=${opt}`
|
||||
})
|
||||
const configFileArgv = Object.entries(config)
|
||||
.map(([optName, opt]) => {
|
||||
if (opt === true) {
|
||||
return `--${optName}`
|
||||
} else if (Array.isArray(opt)) {
|
||||
return opt.map((o) => `--${optName}=${o}`)
|
||||
}
|
||||
return `--${optName}=${opt}`
|
||||
})
|
||||
.flat()
|
||||
const args = parse(configFileArgv, {
|
||||
configFile: configPath,
|
||||
})
|
||||
|
||||
@@ -163,6 +163,9 @@ export const runCodeServer = async (
|
||||
logger.info(` - ${plural(args["proxy-domain"].length, "Proxying the following domain")}:`)
|
||||
args["proxy-domain"].forEach((domain) => logger.info(` - ${domain}`))
|
||||
}
|
||||
if (args["skip-auth-preflight"]) {
|
||||
logger.info(" - Skipping authentication for preflight requests")
|
||||
}
|
||||
if (process.env.VSCODE_PROXY_URI) {
|
||||
logger.info(`Using proxy URI in PORTS tab: ${process.env.VSCODE_PROXY_URI}`)
|
||||
}
|
||||
|
||||
@@ -61,6 +61,11 @@ router.all(/.*/, async (req, res, next) => {
|
||||
|
||||
ensureProxyEnabled(req)
|
||||
|
||||
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||
// Allow preflight requests with `skip-auth-preflight` flag
|
||||
return next()
|
||||
}
|
||||
|
||||
// Must be authenticated to use the proxy.
|
||||
const isAuthenticated = await authenticated(req)
|
||||
if (!isAuthenticated) {
|
||||
|
||||
@@ -13,7 +13,11 @@ const getProxyTarget = (
|
||||
): string => {
|
||||
// If there is a base path, strip it out.
|
||||
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(
|
||||
@@ -26,7 +30,9 @@ export async function proxy(
|
||||
): Promise<void> {
|
||||
ensureProxyEnabled(req)
|
||||
|
||||
if (!(await authenticated(req))) {
|
||||
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||
// Allow preflight requests with `skip-auth-preflight` flag
|
||||
} else if (!(await authenticated(req))) {
|
||||
// If visiting the root (/:port only) redirect to the login page.
|
||||
if (!req.params.path || req.params.path === "/") {
|
||||
const to = self(req)
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
bindAddrFromArgs,
|
||||
defaultConfigFile,
|
||||
parse,
|
||||
parseConfigFile,
|
||||
setDefaults,
|
||||
shouldOpenInExistingInstance,
|
||||
toCodeArgs,
|
||||
@@ -108,6 +109,8 @@ describe("parser", () => {
|
||||
|
||||
["--abs-proxy-base-path", "/codeserver/app1"],
|
||||
|
||||
"--skip-auth-preflight",
|
||||
|
||||
["--session-socket", "/tmp/override-code-server-ipc-socket"],
|
||||
|
||||
["--host", "0.0.0.0"],
|
||||
@@ -146,6 +149,7 @@ describe("parser", () => {
|
||||
"bind-addr": "192.169.0.1:8080",
|
||||
"session-socket": "/tmp/override-code-server-ipc-socket",
|
||||
"abs-proxy-base-path": "/codeserver/app1",
|
||||
"skip-auth-preflight": true,
|
||||
})
|
||||
})
|
||||
|
||||
@@ -284,12 +288,17 @@ describe("parser", () => {
|
||||
})
|
||||
|
||||
it("should support repeatable flags", async () => {
|
||||
expect(() => parse(["--proxy-domain", ""])).toThrowError(/--proxy-domain requires a value/)
|
||||
expect(parse(["--proxy-domain", "*.coder.com"])).toEqual({
|
||||
"proxy-domain": ["*.coder.com"],
|
||||
})
|
||||
expect(parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "test.com"])).toEqual({
|
||||
"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 () => {
|
||||
@@ -487,6 +496,20 @@ describe("parser", () => {
|
||||
}),
|
||||
).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 () => {
|
||||
expect(parse(["--cert=false"])).toEqual({})
|
||||
})
|
||||
|
||||
@@ -268,6 +268,21 @@ describe("proxy", () => {
|
||||
const text = await resp.text()
|
||||
expect(text).toBe("app being served behind a prefixed path")
|
||||
})
|
||||
|
||||
it("should not allow OPTIONS without authentication by default", async () => {
|
||||
process.env.PASSWORD = "test"
|
||||
codeServer = await integration.setup(["--auth=password"])
|
||||
const resp = await codeServer.fetch(proxyPath, { method: "OPTIONS" })
|
||||
expect(resp.status).toBe(401)
|
||||
})
|
||||
|
||||
it("should allow OPTIONS with `skip-auth-preflight` flag", async () => {
|
||||
process.env.PASSWORD = "test"
|
||||
codeServer = await integration.setup(["--auth=password", "--skip-auth-preflight"])
|
||||
e.post("/wsup", (req, res) => {})
|
||||
const resp = await codeServer.fetch(proxyPath, { method: "OPTIONS" })
|
||||
expect(resp.status).toBe(200)
|
||||
})
|
||||
})
|
||||
|
||||
// NOTE@jsjoeio
|
||||
|
||||
Reference in New Issue
Block a user