Update Code to 1.101.0 (#7376)

This commit is contained in:
Olivier Benz
2025-06-16 23:03:47 +02:00
committed by GitHub
parent 6e26dad1b1
commit 405eb0f511
28 changed files with 65 additions and 81 deletions

View File

@ -1 +1 @@
20.19.0 22.15.1

View File

@ -76,8 +76,8 @@ main() {
echo "USE AT YOUR OWN RISK!" echo "USE AT YOUR OWN RISK!"
fi fi
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-20}" ]; then if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-22}" ]; then
echo "ERROR: code-server currently requires node v20." echo "ERROR: code-server currently requires node v22."
if [ -n "$FORCE_NODE_VERSION" ]; then if [ -n "$FORCE_NODE_VERSION" ]; then
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION." echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
fi fi

View File

@ -32,7 +32,7 @@ The prerequisites for contributing to code-server are almost the same as those
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites). for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
Here is what is needed: Here is what is needed:
- `node` v20.x - `node` v22.x
- `git` v2.x or greater - `git` v2.x or greater
- [`git-lfs`](https://git-lfs.github.com) - [`git-lfs`](https://git-lfs.github.com)
- [`npm`](https://www.npmjs.com/) - [`npm`](https://www.npmjs.com/)

View File

@ -11,7 +11,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
``` ```
6. Exit the terminal using `exit` and then reopen the terminal 6. Exit the terminal using `exit` and then reopen the terminal
7. Install and use Node.js 20: 7. Install and use Node.js 22:
```shell ```shell
nvm install 18 nvm install 18

View File

@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
## Node.js version ## Node.js version
We use the same major version of Node.js shipped with Code's remote, which is We use the same major version of Node.js shipped with Code's remote, which is
currently `20.x`. VS Code also [lists Node.js currently `22.x`. VS Code also [lists Node.js
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites). requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
Using other versions of Node.js [may lead to unexpected Using other versions of Node.js [may lead to unexpected
@ -78,7 +78,7 @@ Proceed to [installing](#installing)
## FreeBSD ## FreeBSD
```sh ```sh
pkg install -y git python npm-node20 pkgconf pkg install -y git python npm-node22 pkgconf
pkg install -y libinotify pkg install -y libinotify
``` ```

View File

@ -57,7 +57,7 @@ npm config set python python3
node -v node -v
``` ```
you will get Node version `v20` you will get Node version `v22`
5. Now install code-server following our guide on [installing with npm](./npm.md) 5. Now install code-server following our guide on [installing with npm](./npm.md)

View File

@ -10,7 +10,7 @@
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: (system:
let pkgs = nixpkgs.legacyPackages.${system}; let pkgs = nixpkgs.legacyPackages.${system};
nodejs = pkgs.nodejs_20; nodejs = pkgs.nodejs_22;
in { in {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [

21
package-lock.json generated
View File

@ -45,7 +45,7 @@
"@types/express": "^5.0.0", "@types/express": "^5.0.0",
"@types/http-proxy": "1.17.7", "@types/http-proxy": "1.17.7",
"@types/js-yaml": "^4.0.6", "@types/js-yaml": "^4.0.6",
"@types/node": "20.x", "@types/node": "22.x",
"@types/pem": "^1.14.1", "@types/pem": "^1.14.1",
"@types/proxy-from-env": "^1.0.1", "@types/proxy-from-env": "^1.0.1",
"@types/safe-compare": "^1.1.0", "@types/safe-compare": "^1.1.0",
@ -66,7 +66,7 @@
"typescript-eslint": "^8.8.0" "typescript-eslint": "^8.8.0"
}, },
"engines": { "engines": {
"node": "20" "node": "22"
} }
}, },
"node_modules/@babel/runtime": { "node_modules/@babel/runtime": {
@ -632,13 +632,13 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.17.17", "version": "22.15.31",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.17.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.31.tgz",
"integrity": "sha512-/WndGO4kIfMicEQLTi/mDANUu/iVUhT7KboZPdEqqHQ4aTS+3qT3U5gIqWDFV+XouorjfgGqvKILJeHhuQgFYg==", "integrity": "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~6.19.2" "undici-types": "~6.21.0"
} }
}, },
"node_modules/@types/pem": { "node_modules/@types/pem": {
@ -6080,10 +6080,11 @@
"dev": true "dev": true
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "6.19.8", "version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true "dev": true,
"license": "MIT"
}, },
"node_modules/unified": { "node_modules/unified": {
"version": "9.2.2", "version": "9.2.2",

View File

@ -47,7 +47,7 @@
"@types/express": "^5.0.0", "@types/express": "^5.0.0",
"@types/http-proxy": "1.17.7", "@types/http-proxy": "1.17.7",
"@types/js-yaml": "^4.0.6", "@types/js-yaml": "^4.0.6",
"@types/node": "20.x", "@types/node": "22.x",
"@types/pem": "^1.14.1", "@types/pem": "^1.14.1",
"@types/proxy-from-env": "^1.0.1", "@types/proxy-from-env": "^1.0.1",
"@types/safe-compare": "^1.1.0", "@types/safe-compare": "^1.1.0",
@ -90,7 +90,7 @@
"xdg-basedir": "^4.0.0" "xdg-basedir": "^4.0.0"
}, },
"resolutions": { "resolutions": {
"@types/node": "20.x" "@types/node": "22.x"
}, },
"bin": { "bin": {
"code-server": "out/node/entry.js" "code-server": "out/node/entry.js"
@ -105,7 +105,7 @@
"remote-development" "remote-development"
], ],
"engines": { "engines": {
"node": "20" "node": "22"
}, },
"jest": { "jest": {
"transform": { "transform": {

View File

@ -111,7 +111,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
@@ -246,7 +246,9 @@ export class WebClientServer { @@ -245,7 +245,9 @@ export class WebClientServer {
}; };
// Prefix routes with basePath for clients // Prefix routes with basePath for clients
@ -122,7 +122,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName]; const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
if (typeof queryConnectionToken === 'string') { if (typeof queryConnectionToken === 'string') {
@@ -285,10 +287,14 @@ export class WebClientServer { @@ -284,10 +286,14 @@ export class WebClientServer {
}; };
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']); const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
@ -138,7 +138,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
); );
if (!remoteAuthority) { if (!remoteAuthority) {
return serveError(req, res, 400, `Bad request.`); return serveError(req, res, 400, `Bad request.`);
@@ -335,6 +341,7 @@ export class WebClientServer { @@ -334,6 +340,7 @@ export class WebClientServer {
const productConfiguration: Partial<Mutable<IProductConfiguration>> = { const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
codeServerVersion: this._productService.codeServerVersion, codeServerVersion: this._productService.codeServerVersion,
@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
embedderIdentifier: 'server-distro', embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? { extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery, ...this._productService.extensionsGallery,
@@ -388,7 +395,9 @@ export class WebClientServer { @@ -387,7 +394,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 ---------------------------------------------------------------------------------------
@@ -425,7 +434,7 @@ export class WebClientServer { @@ -424,7 +433,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:;',
@@ -498,3 +507,70 @@ export class WebClientServer { @@ -497,3 +506,70 @@ export class WebClientServer {
return void res.end(data); return void res.end(data);
} }
} }

View File

@ -85,7 +85,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
+ 'stdin-to-clipboard'?: boolean; + 'stdin-to-clipboard'?: boolean;
'unresponsive-sample-interval'?: string; 'unresponsive-sample-interval'?: string;
'unresponsive-sample-period'?: string; 'unresponsive-sample-period'?: string;
'enable-rdp-display-tracking'?: boolean;
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts --- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts

View File

@ -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
@@ -332,6 +332,10 @@ export class Extension implements IExten @@ -340,6 +340,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;
} }

View File

@ -153,7 +153,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
@@ -26,6 +26,7 @@ import { URI } from '../../base/common/u @@ -25,6 +25,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, Mutable } from '../../base/common/types.js'; import { isString, Mutable } from '../../base/common/types.js';
@ -161,7 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
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';
@@ -386,14 +387,22 @@ export class WebClientServer { @@ -385,14 +386,22 @@ export class WebClientServer {
}; };
const cookies = cookie.parse(req.headers.cookie || ''); const cookies = cookie.parse(req.headers.cookie || '');
@ -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
@@ -474,9 +474,6 @@ export class InstallAction extends Exten @@ -475,9 +475,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;
} }
@@ -781,7 +778,7 @@ export abstract class InstallInOtherServ @@ -782,7 +779,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
@@ -2071,17 +2068,6 @@ export class SetLanguageAction extends E @@ -2073,17 +2070,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> {
@@ -2098,7 +2084,6 @@ export class ClearLanguageAction extends @@ -2100,7 +2086,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);
@@ -2108,17 +2093,6 @@ export class ClearLanguageAction extends @@ -2110,17 +2095,6 @@ export class ClearLanguageAction extends
update(): void { update(): void {
this.enabled = false; this.enabled = false;
this.class = ClearLanguageAction.DisabledClass; this.class = ClearLanguageAction.DisabledClass;

View File

@ -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
@@ -370,6 +370,8 @@ export class WebClientServer { @@ -369,6 +369,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,
@ -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
@@ -40,6 +40,9 @@ export const HasWebFileSystemAccess = ne @@ -36,6 +36,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'));
@ -217,7 +217,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
+ +
//#endregion //#endregion
//#region < --- Window --- >
Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts --- code-server.orig/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts

View File

@ -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';
@@ -874,6 +874,72 @@ export class GettingStartedPage extends @@ -876,6 +876,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', {},);
@@ -909,6 +975,9 @@ export class GettingStartedPage extends @@ -911,6 +977,9 @@ export class GettingStartedPage extends
recentList.setLimit(5); recentList.setLimit(5);
reset(leftColumn, startList.getDomElement(), recentList.getDomElement()); reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
} }
@ -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
@@ -374,6 +374,7 @@ export class WebClientServer { @@ -373,6 +373,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'],
@ -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
@@ -42,6 +42,7 @@ export const EmbedderIdentifierContext = @@ -38,6 +38,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);

View File

@ -269,7 +269,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
@@ -334,6 +334,7 @@ export class WebClientServer { @@ -333,6 +333,7 @@ export class WebClientServer {
} : undefined; } : undefined;
const productConfiguration: Partial<Mutable<IProductConfiguration>> = { const productConfiguration: Partial<Mutable<IProductConfiguration>> = {

View File

@ -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
@@ -365,6 +365,7 @@ export class WebClientServer { @@ -364,6 +364,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',

View File

@ -40,7 +40,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
@@ -342,6 +342,7 @@ export class WebClientServer { @@ -341,6 +341,7 @@ export class WebClientServer {
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,

View File

@ -40,15 +40,15 @@ 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
@@ -327,7 +327,6 @@ export class WebClientServer { @@ -326,7 +326,6 @@ export class WebClientServer {
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH); const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH); const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
- const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH); - const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(path.resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority }); const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
@@ -343,14 +342,7 @@ export class WebClientServer { @@ -342,14 +341,7 @@ export class WebClientServer {
codeServerVersion: this._productService.codeServerVersion, codeServerVersion: this._productService.codeServerVersion,
rootEndpoint: rootBase, rootEndpoint: rootBase,
embedderIdentifier: 'server-distro', embedderIdentifier: 'server-distro',

View File

@ -71,7 +71,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
@@ -343,6 +343,7 @@ export class WebClientServer { @@ -342,6 +342,7 @@ export class WebClientServer {
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,
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,

View File

@ -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
@@ -344,6 +344,10 @@ export class WebClientServer { @@ -343,6 +343,10 @@ export class WebClientServer {
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined, updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
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,
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/', proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',

View File

@ -22,7 +22,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionManagement/node/extension
@IConfigurationService private readonly configurationService: IConfigurationService, @IConfigurationService private readonly configurationService: IConfigurationService,
@IExtensionGalleryManifestService protected readonly extensionGalleryManifestService: IExtensionGalleryManifestService, @IExtensionGalleryManifestService protected readonly extensionGalleryManifestService: IExtensionGalleryManifestService,
@IProductService productService: IProductService, @IProductService productService: IProductService,
@@ -331,8 +333,7 @@ export class ExtensionManagementService @@ -339,8 +341,7 @@ export class ExtensionManagementService
private async downloadExtension(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> { private async downloadExtension(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> {
if (verifySignature) { if (verifySignature) {

View File

@ -96,7 +96,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
import minimist from 'minimist'; import minimist from 'minimist';
import * as nativeWatchdog from 'native-watchdog'; import * as nativeWatchdog from 'native-watchdog';
import * as net from 'net'; import * as net from 'net';
@@ -423,7 +424,28 @@ async function startExtensionHostProcess @@ -437,7 +438,28 @@ async function startExtensionHostProcess
); );
// rewrite onTerminate-function to be a proper shutdown // rewrite onTerminate-function to be a proper shutdown

View File

@ -134,7 +134,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
@@ -348,6 +348,8 @@ export class WebClientServer { @@ -347,6 +347,8 @@ export class WebClientServer {
scope: vscodeBase + '/', scope: vscodeBase + '/',
path: rootBase + '/_static/out/browser/serviceWorker.js', path: rootBase + '/_static/out/browser/serviceWorker.js',
}, },

View File

@ -24,7 +24,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
@@ -339,6 +339,14 @@ export class WebClientServer { @@ -338,6 +338,14 @@ export class WebClientServer {
scopes: [['user:email'], ['repo']] scopes: [['user:email'], ['repo']]
} : undefined; } : undefined;
@ -39,7 +39,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
const productConfiguration: Partial<Mutable<IProductConfiguration>> = { const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
codeServerVersion: this._productService.codeServerVersion, codeServerVersion: this._productService.codeServerVersion,
rootEndpoint: rootBase, rootEndpoint: rootBase,
@@ -353,6 +361,7 @@ export class WebClientServer { @@ -352,6 +360,7 @@ export class WebClientServer {
telemetryEndpoint: this._productService.telemetryEndpoint, telemetryEndpoint: this._productService.telemetryEndpoint,
embedderIdentifier: 'server-distro', embedderIdentifier: 'server-distro',
extensionsGallery: this._productService.extensionsGallery, extensionsGallery: this._productService.extensionsGallery,

View File

@ -105,7 +105,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
@@ -341,6 +341,7 @@ export class WebClientServer { @@ -340,6 +340,7 @@ export class WebClientServer {
const productConfiguration: Partial<Mutable<IProductConfiguration>> = { const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
codeServerVersion: this._productService.codeServerVersion, codeServerVersion: this._productService.codeServerVersion,
rootEndpoint: rootBase, rootEndpoint: rootBase,

View File

@ -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
@@ -361,6 +361,7 @@ export class WebClientServer { @@ -360,6 +360,7 @@ export class WebClientServer {
const workbenchWebConfiguration = { const workbenchWebConfiguration = {
remoteAuthority, remoteAuthority,
serverBasePath: basePath, serverBasePath: basePath,
@ -70,29 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" <meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-nlLyDpnjtftJG2xvXh2vuy77l7xFTjfOz7Jnj1iXNmA=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> - content="default-src 'none'; script-src 'sha256-gEAyFzmkyqMoTTnN+3KReFUYoHsK4RAJEb+6eiul+UY=' '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';"> + content="default-src 'none'; script-src 'sha256-1qYtPnTQa4VwKNJO61EOhs2agF9TvuQSYIJ27OgzZqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming --> <!-- Disable pinch zooming -->
@@ -349,6 +349,12 @@ <meta name="viewport"
@@ -351,6 +351,12 @@
const hostname = location.hostname;
+ // It is safe to run if we are on the same host.
+ const parent = new URL(parentOrigin)
+ if (parent.hostname === hostname) {
+ return start(parentOrigin)
+ }
+
if (!crypto.subtle) {
// cannot validate, not running in a secure context
throw new Error(`'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).`);
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
@@ -343,6 +343,12 @@
const hostname = location.hostname; const hostname = location.hostname;