From 7ea6c5bb3137d9f91230fd7465a3333ba3d2efda Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 10:15:47 -0700 Subject: [PATCH 01/25] chore: update Code to 1.72.2 --- lib/vscode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vscode b/lib/vscode index 74b1f979648c..129500ee4c8a 160000 --- a/lib/vscode +++ b/lib/vscode @@ -1 +1 @@ -Subproject commit 74b1f979648cc44d385a2286793c226e611f59e7 +Subproject commit 129500ee4c8ab7263461ffe327268ba56b9f210d From ce18a0ee295bda3c2c9fe5b91eeb0b34b84cc9e3 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 11:24:09 -0700 Subject: [PATCH 02/25] chore: refresh integration patch --- patches/integration.diff | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/patches/integration.diff b/patches/integration.diff index fd1fb03f04d4..8ef4d247c574 100644 --- a/patches/integration.diff +++ b/patches/integration.diff @@ -221,15 +221,16 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -@@ -26,8 +27,9 @@ +@@ -26,9 +27,9 @@ - - -+ -+ -+ +- ++ ++ ++ From 5fdfd195de300f0a00f017a602136e8364f27193 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:03:36 -0700 Subject: [PATCH 03/25] chore: refresh base-path --- patches/base-path.diff | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/patches/base-path.diff b/patches/base-path.diff index 867d43ab4bf1..d18a5c50c78a 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -40,12 +40,12 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -- -- -- -+ -+ -+ +- +- +- ++ ++ ++ @@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactor connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void { const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws'); + path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/") - const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); + const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel); const errorListener = socket.onError((err) => callback(err, undefined)); socket.onOpen(() => { @@ -282,6 +283,3 @@ export class BrowserSocketFactory implem @@ -262,7 +262,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 -@@ -485,6 +485,7 @@ function doCreateUri(path: string, query +@@ -489,6 +489,7 @@ function doCreateUri(path: string, query }); } @@ -270,7 +270,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts return URI.parse(window.location.href).with({ path, query }); } -@@ -496,7 +497,7 @@ function doCreateUri(path: string, query +@@ -500,7 +501,7 @@ function doCreateUri(path: string, query if (!configElement || !configElementAttribute) { throw new Error('Missing web configuration element'); } From d6734ab7a94e1f7e256bd4558b05604a05ef1d09 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:04:28 -0700 Subject: [PATCH 04/25] chore: refresh proposed-api patch --- patches/proposed-api.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/proposed-api.diff b/patches/proposed-api.diff index 09333557b0b6..ca6282313c95 100644 --- a/patches/proposed-api.diff +++ b/patches/proposed-api.diff @@ -9,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts -@@ -1458,7 +1458,7 @@ class ProposedApiController { +@@ -1462,7 +1462,7 @@ class ProposedApiController { this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id))); From c8e638a741b9a88dbcf84227e3aa0ca1ad983252 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:25:06 -0700 Subject: [PATCH 05/25] chore: refresh marketplace patch --- patches/marketplace.diff | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/patches/marketplace.diff b/patches/marketplace.diff index d079d2b0efec..8ea1c762f808 100644 --- a/patches/marketplace.diff +++ b/patches/marketplace.diff @@ -19,22 +19,22 @@ 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 -@@ -45,7 +45,14 @@ else if (typeof require?.__$__nodeRequir - } +@@ -50,7 +50,14 @@ else if (typeof require?.__$__nodeRequir + const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string }; - Object.assign(product, { -- version: pkg.version -+ version: pkg.version, -+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || { -+ serviceUrl: "https://open-vsx.org/vscode/gallery", -+ itemUrl: "https://open-vsx.org/vscode/item", -+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", -+ controlUrl: "", -+ recommendationsUrl: "", -+ }), - }); + Object.assign(product, { +- version: pkg.version ++ version: pkg.version, ++ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || { ++ serviceUrl: "https://open-vsx.org/vscode/gallery", ++ itemUrl: "https://open-vsx.org/vscode/item", ++ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", ++ controlUrl: "", ++ recommendationsUrl: "", ++ }), + }); + } } - Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts From d4d62997a4da8bfe38df3e875b22511e4e9b3e52 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:30:03 -0700 Subject: [PATCH 06/25] chore: refresh webview patch --- patches/webview.diff | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/patches/webview.diff b/patches/webview.diff index 2c2c69250875..a06ef39852ca 100644 --- a/patches/webview.diff +++ b/patches/webview.diff @@ -43,21 +43,12 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts remoteAuthority, + webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', _wrapWebWorkerExtHostInIframe, - developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined }, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html +++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html -@@ -5,7 +5,7 @@ - - - -+ content="default-src 'none'; script-src 'sha256-BRi/ZOLWtsisl3jAheglVzKmoA1T6n2Mmf2NM4UnIXE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> - - - Date: Fri, 14 Oct 2022 13:30:38 -0700 Subject: [PATCH 07/25] chore: refresh disable-builtin patch --- patches/disable-builtin-ext-update.diff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/disable-builtin-ext-update.diff b/patches/disable-builtin-ext-update.diff index adf6ca304e2c..070b374439b8 100644 --- a/patches/disable-builtin-ext-update.diff +++ b/patches/disable-builtin-ext-update.diff @@ -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 -@@ -236,6 +236,10 @@ export class Extension implements IExten +@@ -237,6 +237,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/workbench/contrib/extensions/browser/extens if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) { return false; } -@@ -1121,6 +1125,10 @@ export class ExtensionsWorkbenchService +@@ -1234,6 +1238,10 @@ export class ExtensionsWorkbenchService // Skip if check updates only for builtin extensions and current extension is not builtin. continue; } From e95210362304d256a0baba007483734cb4b08a1a Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:35:03 -0700 Subject: [PATCH 08/25] chore: refresh logout, update-check patches --- patches/logout.diff | 2 +- patches/update-check.diff | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/logout.diff b/patches/logout.diff index 40070888582c..01eddce29937 100644 --- a/patches/logout.diff +++ b/patches/logout.diff @@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -93,6 +94,7 @@ export const serverOptions: OptionDescri +@@ -92,6 +93,7 @@ export const serverOptions: OptionDescri export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; diff --git a/patches/update-check.diff b/patches/update-check.diff index ba81a4b4c65b..86edbce37cab 100644 --- a/patches/update-check.diff +++ b/patches/update-check.diff @@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -89,6 +91,8 @@ export const serverOptions: OptionDescri +@@ -88,6 +90,8 @@ export const serverOptions: OptionDescri }; export interface ServerParsedArgs { From 616a8a8c9c9801f25ab351ca7b643ed4d0a51cb5 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:36:19 -0700 Subject: [PATCH 09/25] chor: refresh proxy-uri patch --- patches/proxy-uri.diff | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/proxy-uri.diff b/patches/proxy-uri.diff index 4065d48744e1..95933402e092 100644 --- a/patches/proxy-uri.diff +++ b/patches/proxy-uri.diff @@ -98,7 +98,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts -@@ -388,7 +388,7 @@ export async function createTerminalEnvi +@@ -392,7 +392,7 @@ export async function createTerminalEnvi // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables @@ -111,15 +111,15 @@ 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 -@@ -17,6 +17,7 @@ import { isFolderToOpen, isWorkspaceToOp - import { create, ICredentialsProvider, IURLCallbackProvider, IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/workbench.web.main'; - import { posix } from 'vs/base/common/path'; - import { ltrim } from 'vs/base/common/strings'; +@@ -21,6 +21,7 @@ import type { ICredentialsProvider } fro + import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService'; + import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api'; + import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService'; +import { extractLocalHostUriMetaDataForPortMapping } from 'vs/platform/tunnel/common/tunnel'; interface ICredential { service: string; -@@ -507,6 +508,21 @@ function doCreateUri(path: string, query +@@ -511,6 +512,21 @@ function doCreateUri(path: string, query } : undefined, workspaceProvider: WorkspaceProvider.create(config), urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute), From ca0506c5f6b49da5644697bb2f5b29d135a8d201 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:41:56 -0700 Subject: [PATCH 10/25] fix: delete unique-db patch This was supposed to be removed in https://github.com/coder/code-server/pull/5519 Looks like I didn't update the series or actually delete the patch. --- patches/series | 1 - patches/unique-db.diff | 36 ------------------------------------ 2 files changed, 37 deletions(-) delete mode 100644 patches/unique-db.diff diff --git a/patches/series b/patches/series index e5289b4bd9b0..f6fd05b66ab8 100644 --- a/patches/series +++ b/patches/series @@ -10,7 +10,6 @@ logout.diff store-socket.diff proxy-uri.diff github-auth.diff -unique-db.diff log-level.diff local-storage.diff service-worker.diff diff --git a/patches/unique-db.diff b/patches/unique-db.diff deleted file mode 100644 index f03a3a933bcf..000000000000 --- a/patches/unique-db.diff +++ /dev/null @@ -1,36 +0,0 @@ -Prevent state collisions - -Previously if you opened different workspaces that had the same filesystem path -(for example if you have /home/coder on two different machines that are both -accessed through the same host) they would conflict with each other. This -ensures that different browser paths will be unique (for example /workspace1 and -/workspace2). - -The easiest way to test is to open files in the same workspace using both / and -/vscode and make sure they are not interacting with each other. - -Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -=================================================================== ---- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -+++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts -@@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi - import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; - import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; - import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; -+import { hash } from 'vs/base/common/hash'; - - export class BrowserStorageService extends AbstractStorageService { - -@@ -67,7 +68,11 @@ export class BrowserStorageService exten - return `global-${this.profileStorageProfile.id}`; - } - case StorageScope.WORKSPACE: -- return this.payload.id; -+ // Add a unique ID based on the current path for per-workspace databases. -+ // This prevents workspaces on different machines that share the same domain -+ // and file path from colliding (since it does not appear IndexedDB can be -+ // scoped to a path) as long as they are hosted on different paths. -+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16); - } - } - From 71b581c3c941408e5d250baf34bf018dce204f74 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:43:47 -0700 Subject: [PATCH 11/25] fix: drop log-level patch This was merged upstream! --- patches/log-level.diff | 21 --------------------- patches/series | 1 - 2 files changed, 22 deletions(-) delete mode 100644 patches/log-level.diff diff --git a/patches/log-level.diff b/patches/log-level.diff deleted file mode 100644 index 5961f989a8aa..000000000000 --- a/patches/log-level.diff +++ /dev/null @@ -1,21 +0,0 @@ -Propagate the log level to the client - -This can be tested by using `--log trace`. You should see plenty of debug and -trace logs in the console. - -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 -@@ -304,7 +304,10 @@ export class WebClientServer { - remoteAuthority, - webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', - _wrapWebWorkerExtHostInIframe, -- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined }, -+ developmentOptions: { -+ enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, -+ logLevel: this._logService.getLevel(), -+ }, - settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, - enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'], - folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']), diff --git a/patches/series b/patches/series index f6fd05b66ab8..08423359075a 100644 --- a/patches/series +++ b/patches/series @@ -10,7 +10,6 @@ logout.diff store-socket.diff proxy-uri.diff github-auth.diff -log-level.diff local-storage.diff service-worker.diff sourcemaps.diff From 2d9cf0cc10768506671b35c7eb421464293b07ca Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:44:51 -0700 Subject: [PATCH 12/25] chore: refresh local-storage patch --- patches/local-storage.diff | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/local-storage.diff b/patches/local-storage.diff index fe0b59c0baa3..f9aca09e5ca3 100644 --- a/patches/local-storage.diff +++ b/patches/local-storage.diff @@ -26,13 +26,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', + userDataPath: this._environmentService.userDataPath, _wrapWebWorkerExtHostInIframe, - developmentOptions: { - enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, + settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts -@@ -262,6 +262,11 @@ export interface IWorkbenchConstructionO +@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO */ readonly configurationDefaults?: Record; From 266875cf2ac054801abe20fe603c006406957bce Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:45:13 -0700 Subject: [PATCH 13/25] chore: refresh service-worker patch --- patches/service-worker.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/service-worker.diff b/patches/service-worker.diff index ce902f64c2f1..dec1ffe8cd45 100644 --- a/patches/service-worker.diff +++ b/patches/service-worker.diff @@ -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 -@@ -319,6 +319,10 @@ export class WebClientServer { +@@ -316,6 +316,10 @@ export class WebClientServer { updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined, logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined, proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}', From cd09ea9a1a9931baa95c06303b0cae99cd3751ee Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:47:46 -0700 Subject: [PATCH 14/25] chore: refresh sourcemaps patch --- patches/sourcemaps.diff | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/patches/sourcemaps.diff b/patches/sourcemaps.diff index 22c593a3ed66..ddd227d3a0c2 100644 --- a/patches/sourcemaps.diff +++ b/patches/sourcemaps.diff @@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js =================================================================== --- code-server.orig/lib/vscode/build/gulpfile.reh.js +++ code-server/lib/vscode/build/gulpfile.reh.js -@@ -196,8 +196,7 @@ function packageTask(type, platform, arc +@@ -191,8 +191,7 @@ function packageTask(type, platform, arc const src = gulp.src(sourceFolderName + '/**', { base: '.' }) .pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); })) @@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js const workspaceExtensionPoints = ['debuggers', 'jsonValidation']; const isUIExtension = (manifest) => { -@@ -236,9 +235,9 @@ function packageTask(type, platform, arc +@@ -231,9 +230,9 @@ function packageTask(type, platform, arc .map(name => `.build/extensions/${name}/**`); const extensions = gulp.src(extensionPaths, { base: '.build', dot: true }); @@ -32,12 +32,12 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js let version = packageJson.version; const quality = product.quality; -@@ -373,7 +372,7 @@ function tweakProductForServerWeb(produc +@@ -387,7 +386,7 @@ function tweakProductForServerWeb(produc const minifyTask = task.define(`minify-vscode-${type}`, task.series( optimizeTask, util.rimraf(`out-vscode-${type}-min`), -- common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`) -+ common.minifyTask(`out-vscode-${type}`, '') +- optimize.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`) ++ optimize.minifyTask(`out-vscode-${type}`, ``) )); gulp.task(minifyTask); From 2ad8914c134c76331a40663d74b217e14fad2588 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:52:48 -0700 Subject: [PATCH 15/25] chore: refresh disable-downloads patch --- patches/disable-downloads.diff | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/patches/disable-downloads.diff b/patches/disable-downloads.diff index 3ed71ac83009..5969911b90a0 100644 --- a/patches/disable-downloads.diff +++ b/patches/disable-downloads.diff @@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts -@@ -267,6 +267,11 @@ export interface IWorkbenchConstructionO +@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO */ readonly userDataPath?: string @@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -95,6 +96,7 @@ export interface ServerParsedArgs { +@@ -94,6 +95,7 @@ export interface ServerParsedArgs { /* ----- code-server ----- */ 'disable-update-check'?: boolean; 'auth'?: string @@ -84,8 +84,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts userDataPath: this._environmentService.userDataPath, + isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], _wrapWebWorkerExtHostInIframe, - developmentOptions: { - enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, + developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, + settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined, Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts @@ -93,16 +93,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts @@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev import { Disposable } from 'vs/base/common/lifecycle'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; - import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext } from 'vs/platform/contextkey/common/contextkeys'; --import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext } from 'vs/workbench/common/contextkeys'; -+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys'; + import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys'; +-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys'; ++import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys'; import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor'; import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; - import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; + import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace'; import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; @@ -25,6 +24,7 @@ import { IPaneCompositePartService } fro import { Schemas } from 'vs/base/common/network'; @@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts export class WorkbenchContextKeysHandler extends Disposable { private inputFocusedContext: IContextKey; -@@ -76,7 +76,7 @@ export class WorkbenchContextKeysHandler +@@ -77,7 +77,7 @@ export class WorkbenchContextKeysHandler @IContextKeyService private readonly contextKeyService: IContextKeyService, @IWorkspaceContextService private readonly contextService: IWorkspaceContextService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -121,7 +121,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts @IProductService private readonly productService: IProductService, @IEditorService private readonly editorService: IEditorService, @IEditorResolverService private readonly editorResolverService: IEditorResolverService, -@@ -199,6 +199,9 @@ export class WorkbenchContextKeysHandler +@@ -202,6 +202,9 @@ export class WorkbenchContextKeysHandler this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService); this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART)); @@ -172,7 +172,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 -@@ -30,6 +30,8 @@ export const IsFullscreenContext = new R +@@ -32,6 +32,8 @@ export const IsFullscreenContext = new R export const HasWebFileSystemAccess = new RawContextKey('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access) From bb6f3ee9ca9a789304f9891f97a48c9ae520a25e Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 13:53:13 -0700 Subject: [PATCH 16/25] chore: refresh telemetry patch --- patches/telemetry.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/telemetry.diff b/patches/telemetry.diff index 7245d2d58260..a57f2736d960 100644 --- a/patches/telemetry.diff +++ b/patches/telemetry.diff @@ -93,7 +93,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 -@@ -324,6 +324,7 @@ export class WebClientServer { +@@ -321,6 +321,7 @@ export class WebClientServer { scope: vscodeBase + '/', path: base + '/_static/out/browser/serviceWorker.js', }, From f5b81aad7a99daaad0fb4b10ca7340b6204a1b1f Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 14:04:40 -0700 Subject: [PATCH 17/25] chore: refresh language patch --- patches/display-language.diff | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/patches/display-language.diff b/patches/display-language.diff index 6bfec9e9b12e..a7c73efb71e0 100644 --- a/patches/display-language.diff +++ b/patches/display-language.diff @@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts +++ code-server/lib/vscode/src/vs/server/node/serverServices.ts -@@ -212,6 +212,9 @@ export async function setupServerService +@@ -209,6 +209,9 @@ export async function setupServerService const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)); socketServer.registerChannel('extensions', channel); @@ -39,11 +39,11 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts *--------------------------------------------------------------------------------------------*/ -import * as nls from 'vs/nls'; - - const LANGUAGE_DEFAULT = 'en'; + export const LANGUAGE_DEFAULT = 'en'; let _isWindows = false; -@@ -81,17 +79,19 @@ if (typeof navigator === 'object' && !is - _isLinux = _userAgent.indexOf('Linux') >= 0; +@@ -83,17 +81,19 @@ if (typeof navigator === 'object' && !is + _isMobile = _userAgent?.indexOf('Mobi') >= 0; _isWeb = true; - const configuredLocale = nls.getConfiguredDefaultLocale( @@ -216,7 +216,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts const workbenchWebConfiguration = { remoteAuthority, -@@ -339,6 +342,7 @@ export class WebClientServer { +@@ -336,6 +339,7 @@ export class WebClientServer { WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''), BASE: base, VS_BASE: vscodeBase, @@ -236,7 +236,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts /* ----- server setup ----- */ -@@ -97,6 +98,7 @@ export interface ServerParsedArgs { +@@ -96,6 +97,7 @@ export interface ServerParsedArgs { 'disable-update-check'?: boolean; 'auth'?: string 'disable-file-downloads'?: boolean; @@ -248,7 +248,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts +++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts -@@ -122,8 +122,9 @@ import 'vs/workbench/contrib/logs/browse +@@ -123,8 +123,9 @@ import 'vs/workbench/contrib/logs/browse // Explorer import 'vs/workbench/contrib/files/browser/files.web.contribution'; @@ -314,19 +314,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true); return true; } -Index: code-server/lib/vscode/src/vs/base/node/languagePacks.js -=================================================================== ---- code-server.orig/lib/vscode/src/vs/base/node/languagePacks.js -+++ code-server/lib/vscode/src/vs/base/node/languagePacks.js -@@ -73,7 +73,10 @@ - function getLanguagePackConfigurations(userDataPath) { - const configFile = path.join(userDataPath, 'languagepacks.json'); - try { -- return nodeRequire(configFile); -+ // This must not use Node's require otherwise it will be cached forever. -+ // Code can get away with this since the process actually restarts but -+ // that is not currently the case with code-server. -+ return JSON.parse(fs.readFileSync(configFile, "utf8")); - } catch (err) { - // Do nothing. If we can't read the file we have no - // language pack config. From 77dfdae6a7792a31bc1d36812970a01ae70f7da8 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Fri, 14 Oct 2022 14:05:14 -0700 Subject: [PATCH 18/25] chore: refresh cli-window-open patch --- patches/cli-window-open.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/cli-window-open.diff b/patches/cli-window-open.diff index 8b5d09d96245..16d2ebc2b160 100644 --- a/patches/cli-window-open.diff +++ b/patches/cli-window-open.diff @@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts +++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts -@@ -99,10 +99,14 @@ class RemoteTerminalBackend extends Base +@@ -100,10 +100,14 @@ class RemoteTerminalBackend extends Base } const reqId = e.reqId; const commandId = e.commandId; From 0e7ccad5cade56531be2b98da89b177224d43717 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 13:49:47 -0700 Subject: [PATCH 19/25] Revert "fix: delete unique-db patch" This reverts commit ca0506c5f6b49da5644697bb2f5b29d135a8d201. --- patches/series | 1 + patches/unique-db.diff | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 patches/unique-db.diff diff --git a/patches/series b/patches/series index 08423359075a..66df7f905734 100644 --- a/patches/series +++ b/patches/series @@ -10,6 +10,7 @@ logout.diff store-socket.diff proxy-uri.diff github-auth.diff +unique-db.diff local-storage.diff service-worker.diff sourcemaps.diff diff --git a/patches/unique-db.diff b/patches/unique-db.diff new file mode 100644 index 000000000000..f03a3a933bcf --- /dev/null +++ b/patches/unique-db.diff @@ -0,0 +1,36 @@ +Prevent state collisions + +Previously if you opened different workspaces that had the same filesystem path +(for example if you have /home/coder on two different machines that are both +accessed through the same host) they would conflict with each other. This +ensures that different browser paths will be unique (for example /workspace1 and +/workspace2). + +The easiest way to test is to open files in the same workspace using both / and +/vscode and make sure they are not interacting with each other. + +Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts +=================================================================== +--- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts ++++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts +@@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi + import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; + import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; + import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; ++import { hash } from 'vs/base/common/hash'; + + export class BrowserStorageService extends AbstractStorageService { + +@@ -67,7 +68,11 @@ export class BrowserStorageService exten + return `global-${this.profileStorageProfile.id}`; + } + case StorageScope.WORKSPACE: +- return this.payload.id; ++ // Add a unique ID based on the current path for per-workspace databases. ++ // This prevents workspaces on different machines that share the same domain ++ // and file path from colliding (since it does not appear IndexedDB can be ++ // scoped to a path) as long as they are hosted on different paths. ++ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16); + } + } + From a80d4ee3dae3dda8ae0d1af1f9f299c8f5aeba86 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 13:58:58 -0700 Subject: [PATCH 20/25] fixup!: rm extra spaces integration patch --- patches/integration.diff | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/integration.diff b/patches/integration.diff index 8ef4d247c574..3916af32587a 100644 --- a/patches/integration.diff +++ b/patches/integration.diff @@ -228,9 +228,9 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html - - - -+ -+ -+ ++ ++ ++ From 2d8f136e338a2b6decef1313c39f5f10e6779d7b Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 14:22:04 -0700 Subject: [PATCH 21/25] fixup: space --- patches/base-path.diff | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/patches/base-path.diff b/patches/base-path.diff index d18a5c50c78a..1d29f7ccf7ab 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -40,12 +40,12 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -- -- -- -+ -+ -+ +- +- +- ++ ++ ++ From 2869031e1b26f33957664ee385c9a68dcebd5c9c Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 14:42:08 -0700 Subject: [PATCH 22/25] fixup! update unique-db patch --- patches/unique-db.diff | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/patches/unique-db.diff b/patches/unique-db.diff index f03a3a933bcf..576457373415 100644 --- a/patches/unique-db.diff +++ b/patches/unique-db.diff @@ -14,23 +14,23 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS --- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts +++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts @@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi - import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; + import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { hash } from 'vs/base/common/hash'; export class BrowserStorageService extends AbstractStorageService { -@@ -67,7 +68,11 @@ export class BrowserStorageService exten - return `global-${this.profileStorageProfile.id}`; - } - case StorageScope.WORKSPACE: -- return this.payload.id; -+ // Add a unique ID based on the current path for per-workspace databases. -+ // This prevents workspaces on different machines that share the same domain -+ // and file path from colliding (since it does not appear IndexedDB can be -+ // scoped to a path) as long as they are hosted on different paths. -+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16); - } +@@ -297,7 +298,11 @@ export class IndexedDBStorageDatabase ex } + static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise { +- return IndexedDBStorageDatabase.create({ id: workspaceId }, logService); ++ // Add a unique ID based on the current path for per-workspace databases. ++ // This prevents workspaces on different machines that share the same domain ++ // and file path from colliding (since it does not appear IndexedDB can be ++ // scoped to a path) as long as they are hosted on different paths. ++ return IndexedDBStorageDatabase.create({ id: workspaceId + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16) }, logService); + } + + static async create(options: IndexedDBStorageDatabaseOptions, logService: ILogService): Promise { From bfb4ebd046268914f16ab6be4c1d584da5b70578 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 14:57:33 -0700 Subject: [PATCH 23/25] fixup!: update hash in webview patch --- patches/webview.diff | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/patches/webview.diff b/patches/webview.diff index a06ef39852ca..49af19cb8612 100644 --- a/patches/webview.diff +++ b/patches/webview.diff @@ -20,6 +20,11 @@ webview host is separate by default but we serve on the same host). To test, open a few types of webviews (images, markdown, extension details, etc). +Make sure to update the hash. To do so: +1. run code-server +2. open any webview (i.e. preview Markdown) +3. see error in console and copy hash + Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts @@ -88,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor default-src 'none'; child-src 'self' data: blob:; - script-src 'self' 'unsafe-eval' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' https:; -+ script-src 'self' 'unsafe-eval' 'sha256-TkIM/TmudlFEe0ZRp0ptvN54LClwk30Rql4ZPE0hm/I=' https:; ++ script-src 'self' 'unsafe-eval' 'sha256-wwaDxsm1+SKIUb5YJXiZlYMyV7QPB8+zd6HPcTjigZs=' https:; connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/> From d07489c74f4954cf5fd44d2deffbd9f596e472b5 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 15:01:36 -0700 Subject: [PATCH 24/25] fixup! update marketplace patch --- patches/marketplace.diff | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/patches/marketplace.diff b/patches/marketplace.diff index 8ea1c762f808..77ab6898e4d3 100644 --- a/patches/marketplace.diff +++ b/patches/marketplace.diff @@ -19,22 +19,23 @@ 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 -@@ -50,7 +50,14 @@ else if (typeof require?.__$__nodeRequir - const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string }; - - Object.assign(product, { -- version: pkg.version -+ version: pkg.version, -+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || { -+ serviceUrl: "https://open-vsx.org/vscode/gallery", -+ itemUrl: "https://open-vsx.org/vscode/item", -+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", -+ controlUrl: "", -+ recommendationsUrl: "", -+ }), +@@ -53,6 +53,16 @@ else if (typeof require?.__$__nodeRequir + version: pkg.version }); } ++ ++ Object.assign(product, { ++ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || { ++ serviceUrl: "https://open-vsx.org/vscode/gallery", ++ itemUrl: "https://open-vsx.org/vscode/item", ++ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", ++ controlUrl: "", ++ recommendationsUrl: "", ++ }), ++ }); } + + // Web environment or unknown Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts From 28e86ad783cd7e9c51c3062292db4caf0e01599a Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 17 Oct 2022 15:04:12 -0700 Subject: [PATCH 25/25] fixup!: remove comma --- patches/marketplace.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/marketplace.diff b/patches/marketplace.diff index 77ab6898e4d3..4056dcd3f90b 100644 --- a/patches/marketplace.diff +++ b/patches/marketplace.diff @@ -31,7 +31,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts + resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}", + controlUrl: "", + recommendationsUrl: "", -+ }), ++ }) + }); }