Skip to content

Commit 6b83057

Browse files
committed
Update patches
The only changes were to context except: - The URL callback provider uses a new _callbackRoute argument and moved locations. - The telemetry provider gets passed the request service as the first argument now. - CSP hash changed, as usual.
1 parent 5d22954 commit 6b83057

16 files changed

+91
-94
lines changed

patches/base-path.diff

+17-15
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
111111
===================================================================
112112
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
113113
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
114-
@@ -268,16 +268,15 @@ export class WebClientServer {
114+
@@ -269,16 +269,15 @@ export class WebClientServer {
115115
return void res.end();
116116
}
117117

@@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133133
);
134134
if (!remoteAuthority) {
135135
return serveError(req, res, 400, `Bad request.`);
136-
@@ -304,8 +303,12 @@ export class WebClientServer {
136+
@@ -305,8 +304,12 @@ export class WebClientServer {
137137
scopes: [['user:email'], ['repo']]
138138
} : undefined;
139139

@@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
146146
embedderIdentifier: 'server-distro',
147147
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
148148
...this._productService.extensionsGallery,
149-
@@ -340,8 +343,10 @@ export class WebClientServer {
149+
@@ -341,8 +344,10 @@ export class WebClientServer {
150150
const values: { [key: string]: string } = {
151151
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
152152
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
159159
};
160160

161161
if (useTestResolver) {
162-
@@ -366,7 +371,7 @@ export class WebClientServer {
162+
@@ -367,7 +372,7 @@ export class WebClientServer {
163163
'default-src \'self\';',
164164
'img-src \'self\' https: data: blob:;',
165165
'media-src \'self\';',
@@ -168,7 +168,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
168168
'child-src \'self\';',
169169
`frame-src 'self' https://*.vscode-cdn.net data:;`,
170170
'worker-src \'self\' data: blob:;',
171-
@@ -439,3 +444,70 @@ export class WebClientServer {
171+
@@ -440,3 +445,70 @@ export class WebClientServer {
172172
return void res.end(data);
173173
}
174174
}
@@ -255,23 +255,25 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
255255
===================================================================
256256
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
257257
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
258-
@@ -484,6 +484,7 @@ function doCreateUri(path: string, query
259-
});
260-
}
258+
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
259+
this.startListening();
260+
}
261261

262-
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
263-
return URI.parse(window.location.href).with({ path, query });
264-
}
262+
- return URI.parse(window.location.href).with({ path: this._callbackRoute, query: queryParams.join('&') });
263+
+ const path = (window.location.pathname + "/" + this._callbackRoute).replace(/\/\/+/g, "/");
264+
+ return URI.parse(window.location.href).with({ path: path, query: queryParams.join('&') });
265+
}
265266

266-
@@ -495,7 +496,7 @@ function doCreateUri(path: string, query
267+
private startListening(): void {
268+
@@ -569,7 +570,7 @@ function readCookie(name: string): strin
267269
if (!configElement || !configElementAttribute) {
268270
throw new Error('Missing web configuration element');
269271
}
270272
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
271273
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
272-
273-
// Create workbench
274-
create(document.body, {
274+
const secretStorageKeyPath = readCookie('vscode-secret-key-path');
275+
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
276+
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
275277
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
276278
===================================================================
277279
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts

patches/cli-window-open.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
1717
===================================================================
1818
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
1919
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
20-
@@ -103,10 +103,14 @@ class RemoteTerminalBackend extends Base
20+
@@ -104,10 +104,14 @@ class RemoteTerminalBackend extends Base
2121
}
2222
const reqId = e.reqId;
2323
const commandId = e.commandId;

patches/disable-builtin-ext-update.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
77
===================================================================
88
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
99
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
10-
@@ -243,6 +243,10 @@ export class Extension implements IExten
10+
@@ -244,6 +244,10 @@ export class Extension implements IExten
1111
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
1212
return false;
1313
}

patches/disable-downloads.diff

+9-9
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
5858
===================================================================
5959
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
6060
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
61-
@@ -14,6 +14,7 @@ export const serverOptions: OptionDescri
61+
@@ -16,6 +16,7 @@ export const serverOptions: OptionDescri
6262
/* ----- code-server ----- */
6363
'disable-update-check': { type: 'boolean' },
6464
'auth': { type: 'string' },
6565
+ 'disable-file-downloads': { type: 'boolean' },
6666

6767
/* ----- server setup ----- */
6868

69-
@@ -95,6 +96,7 @@ export interface ServerParsedArgs {
69+
@@ -97,6 +98,7 @@ export interface ServerParsedArgs {
7070
/* ----- code-server ----- */
7171
'disable-update-check'?: boolean;
7272
'auth'?: string
@@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
7878
===================================================================
7979
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
8080
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
81-
@@ -331,6 +331,7 @@ export class WebClientServer {
81+
@@ -332,6 +332,7 @@ export class WebClientServer {
8282
remoteAuthority,
8383
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
8484
userDataPath: this._environmentService.userDataPath,
@@ -94,9 +94,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
9494
import { Disposable } from 'vs/base/common/lifecycle';
9595
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
9696
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
97-
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
98-
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
99-
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
97+
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
98+
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
99+
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
100100
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
101101
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
102102
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -105,7 +105,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
105105
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
106106
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
107107
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
108-
@@ -80,7 +80,7 @@ export class WorkbenchContextKeysHandler
108+
@@ -79,7 +79,7 @@ export class WorkbenchContextKeysHandler
109109
@IContextKeyService private readonly contextKeyService: IContextKeyService,
110110
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
111111
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -114,7 +114,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
114114
@IProductService private readonly productService: IProductService,
115115
@IEditorService private readonly editorService: IEditorService,
116116
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
117-
@@ -210,6 +210,9 @@ export class WorkbenchContextKeysHandler
117+
@@ -209,6 +209,9 @@ export class WorkbenchContextKeysHandler
118118
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
119119
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
120120

@@ -165,7 +165,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
165165
===================================================================
166166
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
167167
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
168-
@@ -35,6 +35,8 @@ export const HasWebFileSystemAccess = ne
168+
@@ -38,6 +38,8 @@ export const HasWebFileSystemAccess = ne
169169

170170
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'));
171171

0 commit comments

Comments
 (0)