Skip to content

Commit

Permalink
Update Code to 1.95.1 (#7059)
Browse files Browse the repository at this point in the history
* Update Code to 1.95.1
* Update Node to 20.18.0
* Update build.yaml to use Ubuntu 22.04
  This is to resolve a gcc error.  Might have to address
  the release step later as well.
* Fix --stdin-to-clipboard
  With the switch to esm, the fs require is failing.  fs is already
  imported, so we can just use it anyway.
* Fix mangled exports
* Update CSP hashes
  • Loading branch information
code-asher committed Nov 1, 2024
1 parent dd2e9fc commit 494a3e0
Show file tree
Hide file tree
Showing 22 changed files with 147 additions and 180 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
jobs:
prettier:
name: Format with Prettier
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repo
Expand All @@ -37,7 +37,7 @@ jobs:

doctoc:
name: Doctoc markdown files
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repo
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

lint-helm:
name: Lint Helm chart
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repo
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

lint-ts:
name: Lint TypeScript files
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repo
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:

test-unit:
name: Run unit tests
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Checkout repo
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:

build:
name: Build code-server
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
test-e2e:
name: Run e2e tests
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 25
steps:
- name: Checkout repo
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
test-e2e-proxy:
name: Run e2e tests behind proxy
needs: build
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 25
steps:
- name: Checkout repo
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.16.0
20.18.0
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Code v99.99.999

## Unreleased

Code v1.95.0

### Changed

- Update to Code 1.95.0.

## [4.93.1](https://github.com/coder/code-server/releases/tag/v4.93.1) - 2024-09-23

Code v1.93.1
Expand Down
17 changes: 10 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
description = "code-server";

inputs.flake-utils.url = "github:numtide/flake-utils";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem
Expand Down
2 changes: 1 addition & 1 deletion lib/vscode
Submodule vscode updated 1144 files
126 changes: 27 additions & 99 deletions patches/base-path.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
+++ code-server/lib/vscode/src/vs/base/common/network.ts
@@ -215,7 +215,9 @@ class RemoteAuthoritiesImpl {
@@ -220,7 +220,9 @@ class RemoteAuthoritiesImpl {
return URI.from({
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
authority: `${host}:${port}`,
Expand Down Expand Up @@ -46,18 +46,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
</head>
<style id="vscode-css-modules" type="text/css" media="screen"></style>

<body aria-label="">
</head>
@@ -39,7 +39,7 @@
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>

<!-- Startup (do not modify order of script tags!) -->
<script>
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
Object.keys(self.webPackagePaths).map(function (key, index) {
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
});
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
</script>
<script>
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
Expand All @@ -83,18 +83,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">

</head>
@@ -40,7 +40,7 @@
<script>
@@ -36,7 +36,7 @@

// Packages
<!-- Startup (do not modify order of script tags!) -->
<script>
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
Object.keys(self.webPackagePaths).map(function (key, index) {
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
});
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
</script>
<script>
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
Expand All @@ -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/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -272,16 +272,15 @@ export class WebClientServer {
@@ -271,16 +271,15 @@ export class WebClientServer {
return void res.end();
}

Expand All @@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
);
if (!remoteAuthority) {
return serveError(req, res, 400, `Bad request.`);
@@ -308,8 +307,12 @@ export class WebClientServer {
@@ -307,8 +306,12 @@ export class WebClientServer {
scopes: [['user:email'], ['repo']]
} : undefined;

Expand All @@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery,
@@ -338,7 +341,7 @@ export class WebClientServer {
@@ -337,7 +340,7 @@ export class WebClientServer {
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
productConfiguration,
Expand All @@ -155,7 +155,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
};

const cookies = cookie.parse(req.headers.cookie || '');
@@ -355,9 +358,11 @@ export class WebClientServer {
@@ -354,9 +357,11 @@ export class WebClientServer {
const values: { [key: string]: string } = {
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
Expand All @@ -169,18 +169,16 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
};

// DEV ---------------------------------------------------------------------------------------
@@ -395,8 +400,8 @@ export class WebClientServer {
@@ -393,7 +398,7 @@ export class WebClientServer {
'default-src \'self\';',
'img-src \'self\' https: data: blob:;',
'media-src \'self\';',
isESM ?
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};` : // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : ``};` : // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
'child-src \'self\';',
`frame-src 'self' https://*.vscode-cdn.net data:;`,
'worker-src \'self\' data: blob:;',
@@ -469,3 +474,70 @@ export class WebClientServer {
@@ -466,3 +471,70 @@ export class WebClientServer {
return void res.end(data);
}
}
Expand Down Expand Up @@ -267,7 +265,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
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
@@ -317,7 +317,8 @@ class LocalStorageURLCallbackProvider ex
this.startListening();
}

Expand All @@ -277,7 +275,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
}

private startListening(): void {
@@ -550,17 +551,6 @@ class WorkspaceProvider implements IWork
@@ -563,17 +564,6 @@ class WorkspaceProvider implements IWork
}
}

Expand All @@ -295,7 +293,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
(function () {

// Find config by checking for DOM
@@ -569,8 +559,8 @@ function readCookie(name: string): strin
@@ -582,8 +572,8 @@ function readCookie(name: string): strin
if (!configElement || !configElementAttribute) {
throw new Error('Missing web configuration element');
}
Expand All @@ -319,73 +317,3 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
}
return undefined;
}
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.esm.html
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench-dev.esm.html
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.esm.html
@@ -11,7 +11,8 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Code">
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
+ <link rel="apple-touch-icon" sizes="192x192" href="{{BASE}}/_static/src/browser/media/pwa-icon-192.png" />
+ <link rel="apple-touch-icon" sizes="512x512" href="{{BASE}}/_static/src/browser/media/pwa-icon-512.png" />

<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
@@ -26,8 +27,9 @@
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">

<!-- Workbench Icon/Manifest/CSS -->
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
<style id="vscode-css-modules" type="text/css" media="screen"></style>

</head>
@@ -37,7 +39,7 @@

<!-- Startup (do not modify order of script tags!) -->
<script>
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
</script>
<script>
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.esm.html
===================================================================
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.esm.html
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.esm.html
@@ -11,7 +11,8 @@
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Code">
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
+ <link rel="apple-touch-icon" sizes="192x192" href="{{BASE}}/_static/src/browser/media/pwa-icon-192.png" />
+ <link rel="apple-touch-icon" sizes="512x512" href="{{BASE}}/_static/src/browser/media/pwa-icon-512.png" />

<!-- Disable pinch zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
@@ -23,8 +24,9 @@
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">

<!-- Workbench Icon/Manifest/CSS -->
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">

</head>
@@ -34,7 +36,7 @@

<!-- Startup (do not modify order of script tags!) -->
<script>
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
</script>
<script>
9 changes: 4 additions & 5 deletions patches/clipboard.diff
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
@@ -89,6 +90,11 @@ CommandsRegistry.registerCommand('_remot
return lines.join('\n');
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot

});

+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
Expand Down Expand Up @@ -102,15 +102,15 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
@@ -75,6 +75,7 @@ const isSupportedForPipe = (optionId: ke
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
case 'verbose':
case 'remote':
case 'locate-shell-integration-path':
+ case 'stdin-to-clipboard':
return true;
default:
return false;
@@ -292,6 +293,23 @@ export async function main(desc: Product
@@ -293,6 +294,22 @@ export async function main(desc: Product
}
}
} else {
Expand All @@ -119,7 +119,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
+ console.error("stdin has a tty.");
+ return;
+ }
+ const fs = require("fs");
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
+ const clipboardContent = stdinBuffer.toString();
+ sendToPipe({
Expand Down
Loading

0 comments on commit 494a3e0

Please sign in to comment.