mirror of
https://github.com/coder/code-server.git
synced 2025-07-24 01:48:22 +08:00
Update Code to 1.97.0 (#7199)
* Update Code to 1.97.0 * Update flake This is to get a newer version of Node since we need > 20.18.1. * Hijack new base path var * Update test path matchers
This commit is contained in:
12
flake.lock
generated
12
flake.lock
generated
@ -5,11 +5,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1726560853,
|
||||
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -20,11 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1730359060,
|
||||
"narHash": "sha256-Hkk0mf4pgvX9Ut0YA397nsFqMLhzFVBdFHc4PhBrxYE=",
|
||||
"lastModified": 1739303263,
|
||||
"narHash": "sha256-c/Z/6gZLN8BIpYh1B3qMzEn0TArjf4F2lmy59lDLVBM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e19cfce6f3f08d07653157d8826f5c920c770d7b",
|
||||
"rev": "6cc4213488e886db863878a1e3dc26cc932d38b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
Submodule lib/vscode updated: cd4ee3b1c3...33fc5a94a3
@ -111,21 +111,26 @@ 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
|
||||
@@ -271,16 +271,15 @@ export class WebClientServer {
|
||||
return void res.end();
|
||||
}
|
||||
@@ -246,7 +246,9 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
// Prefix routes with basePath for clients
|
||||
- const basePath = getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||
+ const rootBase = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+ const basePath = vscodeBase || getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||
|
||||
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
|
||||
if (typeof queryConnectionToken === 'string') {
|
||||
@@ -285,10 +287,14 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
- const getFirstHeader = (headerName: string) => {
|
||||
- const val = req.headers[headerName];
|
||||
- return Array.isArray(val) ? val[0] : val;
|
||||
- };
|
||||
-
|
||||
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
||||
+ // For now we are getting the remote authority from the client to avoid
|
||||
+ // needing specific configuration for reverse proxies to work. Set this to
|
||||
+ // something invalid to make sure we catch code that is using this value
|
||||
+ // from the backend when it should not.
|
||||
const remoteAuthority = (
|
||||
let remoteAuthority = (
|
||||
useTestResolver
|
||||
? 'test+test'
|
||||
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
|
||||
@ -133,43 +138,26 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
);
|
||||
if (!remoteAuthority) {
|
||||
return serveError(req, res, 400, `Bad request.`);
|
||||
@@ -307,8 +306,12 @@ export class WebClientServer {
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
@@ -335,6 +341,7 @@ export class WebClientServer {
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: base,
|
||||
+ rootEndpoint: rootBase,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -337,7 +340,7 @@ export class WebClientServer {
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration,
|
||||
- callbackRoute: this._callbackRoute
|
||||
+ callbackRoute: vscodeBase + this._callbackRoute
|
||||
};
|
||||
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
@@ -354,9 +357,11 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
@@ -382,7 +389,9 @@ export class WebClientServer {
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||
WORKBENCH_WEB_BASE_URL: staticRoute,
|
||||
WORKBENCH_NLS_URL,
|
||||
- WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
|
||||
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
|
||||
+ BASE: base,
|
||||
+ VS_BASE: vscodeBase,
|
||||
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
|
||||
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
|
||||
+ BASE: rootBase,
|
||||
+ VS_BASE: basePath,
|
||||
};
|
||||
|
||||
// DEV ---------------------------------------------------------------------------------------
|
||||
@@ -393,7 +398,7 @@ export class WebClientServer {
|
||||
@@ -419,7 +428,7 @@ export class WebClientServer {
|
||||
'default-src \'self\';',
|
||||
'img-src \'self\' https: data: blob:;',
|
||||
'media-src \'self\';',
|
||||
@ -178,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
'child-src \'self\';',
|
||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||
'worker-src \'self\' data: blob:;',
|
||||
@@ -466,3 +471,70 @@ export class WebClientServer {
|
||||
@@ -492,3 +501,70 @@ export class WebClientServer {
|
||||
return void res.end(data);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
|
||||
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
@@ -105,6 +110,9 @@ export class CLIServerBase {
|
||||
@@ -106,6 +111,9 @@ export class CLIServerBase {
|
||||
case 'extensionManagement':
|
||||
returnObj = await this.manageExtensions(data);
|
||||
break;
|
||||
@ -50,7 +50,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
default:
|
||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
||||
break;
|
||||
@@ -172,6 +180,10 @@ export class CLIServerBase {
|
||||
@@ -173,6 +181,10 @@ export class CLIServerBase {
|
||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
|
||||
@@ -121,6 +121,7 @@ export interface NativeParsedArgs {
|
||||
sandbox?: boolean;
|
||||
|
||||
'enable-coi'?: boolean;
|
||||
@ -90,7 +90,7 @@ 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/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
|
||||
@@ -91,6 +91,7 @@ export const OPTIONS: OptionDescriptions
|
||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
@ -102,7 +102,7 @@ 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
|
||||
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
|
||||
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
|
||||
case 'verbose':
|
||||
case 'remote':
|
||||
case 'locate-shell-integration-path':
|
||||
@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -293,6 +294,22 @@ export async function main(desc: Product
|
||||
@@ -295,6 +296,22 @@ export async function main(desc: Product
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -131,5 +131,5 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
+ }
|
||||
+
|
||||
if (parsedArgs.status) {
|
||||
sendToPipe({
|
||||
await sendToPipe({
|
||||
type: 'status'
|
||||
|
@ -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
|
||||
@@ -320,6 +320,10 @@ export class Extension implements IExten
|
||||
@@ -321,6 +321,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
|
@ -161,23 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
import { CharCode } from '../../base/common/charCode.js';
|
||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||
@@ -98,6 +99,7 @@ export class WebClientServer {
|
||||
private readonly _webExtensionResourceUrlTemplate: URI | undefined;
|
||||
|
||||
private readonly _staticRoute: string;
|
||||
+ private readonly _serverRoot: string;
|
||||
private readonly _callbackRoute: string;
|
||||
private readonly _webExtensionRoute: string;
|
||||
|
||||
@@ -113,6 +115,7 @@ export class WebClientServer {
|
||||
) {
|
||||
this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined;
|
||||
|
||||
+ this._serverRoot = serverRootPath;
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
this._webExtensionRoute = `/web-extension-resource`;
|
||||
@@ -351,14 +354,22 @@ export class WebClientServer {
|
||||
@@ -380,14 +381,22 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
@ -193,7 +177,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ try {
|
||||
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
||||
+ WORKBENCH_NLS_URL = nlsFile
|
||||
+ ? `${vscodeBase}${this._serverRoot}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
||||
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
||||
+ : '';
|
||||
+ } catch (error) {
|
||||
+ console.error("Failed to generate translations", error);
|
||||
@ -214,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||
@@ -106,6 +107,7 @@ export interface ServerParsedArgs {
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
'disable-getting-started-override'?: boolean,
|
||||
|
@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -99,6 +101,8 @@ export interface ServerParsedArgs {
|
||||
@@ -100,6 +102,8 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string;
|
||||
@ -112,9 +112,9 @@ 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
|
||||
@@ -335,6 +335,8 @@ export class WebClientServer {
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
@@ -364,6 +364,8 @@ export class WebClientServer {
|
||||
serverBasePath: basePath,
|
||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
+ isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||
@ -240,10 +240,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
||||
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
||||
@IPathService protected readonly pathService: IPathService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@@ -283,20 +283,22 @@ export class SimpleFileDialog extends Di
|
||||
this.filePickBox.sortByLabel = false;
|
||||
@@ -284,20 +284,22 @@ export class SimpleFileDialog extends Di
|
||||
this.filePickBox.ignoreFocusOut = true;
|
||||
this.filePickBox.ok = true;
|
||||
this.filePickBox.okLabel = this.options.openLabel;
|
||||
- if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
||||
- this.filePickBox.customButton = true;
|
||||
- this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
|
||||
|
@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||
import './gettingStartedColors.js';
|
||||
@@ -834,6 +834,72 @@ export class GettingStartedPage extends
|
||||
@@ -869,6 +869,72 @@ export class GettingStartedPage extends
|
||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||
);
|
||||
|
||||
@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||
|
||||
@@ -869,6 +935,9 @@ export class GettingStartedPage extends
|
||||
@@ -904,6 +970,9 @@ export class GettingStartedPage extends
|
||||
recentList.setLimit(5);
|
||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||
}
|
||||
@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
||||
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string;
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -339,6 +339,7 @@ export class WebClientServer {
|
||||
@@ -368,6 +368,7 @@ export class WebClientServer {
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||
|
@ -113,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
|
||||
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend
|
||||
|
||||
async about(): Promise<void> {
|
||||
const detailString = (useAgo: boolean): string => {
|
||||
@ -187,10 +187,10 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
||||
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
||||
+import { CodeServerClient } from '../../workbench/browser/client.js';
|
||||
import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js';
|
||||
import { IProgressService } from '../../platform/progress/common/progress.js';
|
||||
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
||||
@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa
|
||||
import { dirname, joinPath } from '../../base/common/resources.js';
|
||||
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
|
||||
@ -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/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
||||
@@ -334,6 +334,7 @@ export class WebClientServer {
|
||||
} : undefined;
|
||||
|
||||
const productConfiguration = {
|
||||
|
@ -18,10 +18,10 @@ 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
|
||||
@@ -330,6 +330,7 @@ export class WebClientServer {
|
||||
@@ -359,6 +359,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
serverBasePath: basePath,
|
||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
+ userDataPath: this._environmentService.userDataPath,
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||
@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
||||
@@ -145,8 +145,10 @@ export class WorkspaceService extends Di
|
||||
@@ -147,8 +147,10 @@ export class WorkspaceService extends Di
|
||||
this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService));
|
||||
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
|
||||
this.onWorkspaceConfigurationChanged(fromCache).then(() => {
|
||||
@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
|
||||
});
|
||||
}));
|
||||
|
||||
@@ -552,6 +554,12 @@ export class WorkspaceService extends Di
|
||||
@@ -555,6 +557,12 @@ export class WorkspaceService extends Di
|
||||
previousFolders = this.workspace.folders;
|
||||
this.workspace.update(workspace);
|
||||
} else {
|
||||
|
@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -97,6 +98,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -98,6 +99,7 @@ export const serverOptions: OptionDescri
|
||||
export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
@ -40,11 +40,11 @@ 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
|
||||
@@ -313,6 +313,7 @@ export class WebClientServer {
|
||||
@@ -342,6 +342,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
rootEndpoint: rootBase,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
|
@ -40,25 +40,24 @@ 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
|
||||
@@ -115,7 +115,7 @@ export class WebClientServer {
|
||||
@@ -327,7 +327,6 @@ export class WebClientServer {
|
||||
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
||||
+ this._webExtensionRoute = `/web-extension-resource`;
|
||||
}
|
||||
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
|
||||
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
|
||||
- const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
|
||||
|
||||
/**
|
||||
@@ -313,14 +313,7 @@ export class WebClientServer {
|
||||
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(path.resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
|
||||
|
||||
@@ -343,14 +342,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
rootEndpoint: rootBase,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
- ...this._productService.extensionsGallery,
|
||||
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
||||
- scheme: 'http',
|
||||
- authority: remoteAuthority,
|
||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- path: `${webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ extensionsGallery: this._productService.extensionsGallery,
|
||||
|
@ -71,11 +71,11 @@ 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
|
||||
@@ -314,6 +314,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
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}}/',
|
||||
@@ -343,6 +343,7 @@ export class WebClientServer {
|
||||
rootEndpoint: rootBase,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
@ -148,7 +148,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExpl
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
@@ -77,8 +77,8 @@ export class ForwardedPortsView extends
|
||||
@@ -83,8 +83,8 @@ export class ForwardedPortsView extends
|
||||
private async enableForwardedPortsFeatures() {
|
||||
this.contextKeyListener.clear();
|
||||
|
||||
|
@ -54,13 +54,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -315,6 +315,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}}/',
|
||||
@@ -344,6 +344,10 @@ export class WebClientServer {
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||
+ serviceWorker: {
|
||||
+ scope: vscodeBase + '/',
|
||||
+ path: base + '/_static/out/browser/serviceWorker.js',
|
||||
+ path: rootBase + '/_static/out/browser/serviceWorker.js',
|
||||
+ },
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
|
@ -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
|
||||
@@ -253,8 +253,7 @@ function packageTask(type, platform, arc
|
||||
@@ -256,8 +256,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) => {
|
||||
@@ -293,9 +292,9 @@ function packageTask(type, platform, arc
|
||||
@@ -296,9 +295,9 @@ function packageTask(type, platform, arc
|
||||
.map(name => `.build/extensions/${name}/**`);
|
||||
|
||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||
@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -454,7 +453,7 @@ function tweakProductForServerWeb(produc
|
||||
@@ -457,7 +456,7 @@ function tweakProductForServerWeb(produc
|
||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||
bundleTask,
|
||||
util.rimraf(`out-vscode-${type}-min`),
|
||||
|
@ -29,7 +29,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||
@@ -152,11 +154,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService(configurationService, environmentService, logService);
|
||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||
services.set(IRequestService, requestService);
|
||||
|
||||
+ let isContainer = undefined;
|
||||
@ -134,9 +134,9 @@ 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,8 @@ export class WebClientServer {
|
||||
@@ -348,6 +348,8 @@ export class WebClientServer {
|
||||
scope: vscodeBase + '/',
|
||||
path: base + '/_static/out/browser/serviceWorker.js',
|
||||
path: rootBase + '/_static/out/browser/serviceWorker.js',
|
||||
},
|
||||
+ enableTelemetry: this._productService.enableTelemetry,
|
||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||
|
@ -105,11 +105,11 @@ 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
|
||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||
@@ -341,6 +341,7 @@ export class WebClientServer {
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
rootEndpoint: rootBase,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -93,6 +95,8 @@ export const serverOptions: OptionDescri
|
||||
@@ -94,6 +96,8 @@ export const serverOptions: OptionDescri
|
||||
};
|
||||
|
||||
export interface ServerParsedArgs {
|
||||
|
@ -54,11 +54,11 @@ 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
|
||||
@@ -326,6 +326,7 @@ export class WebClientServer {
|
||||
@@ -355,6 +355,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
serverBasePath: basePath,
|
||||
+ webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
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,
|
||||
@ -113,12 +113,12 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'none';
|
||||
child-src 'self' data: blob:;
|
||||
- script-src 'self' 'unsafe-eval' 'sha256-xM2KVDKIoeb8vVxk4ezEUsxdTZh5wFnKO3YmFhy9tkk=' https: http://localhost:* blob:;
|
||||
+ script-src 'self' 'unsafe-eval' 'sha256-6eZXxikxkENULU0EOkVQSd4hglGixLg3Aow9psZ6u2Y=' https: http://localhost:* blob:;
|
||||
- script-src 'self' 'unsafe-eval' 'sha256-cl8ijlOzEe+0GRCQNJQu2k6nUQ0fAYNYIuuKEm72JDs=' https: http://localhost:* blob:;
|
||||
+ script-src 'self' 'unsafe-eval' 'sha256-yhZXuB8LS6t73dvNg6rtLX8y4PHLnqRm5+6DdOGkOcw=' https: http://localhost:* blob:;
|
||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||
</head>
|
||||
<body>
|
||||
@@ -23,6 +23,13 @@
|
||||
@@ -25,6 +25,13 @@
|
||||
// validation not requested
|
||||
return start();
|
||||
}
|
||||
|
@ -1,7 +1,26 @@
|
||||
import { clean, getMaybeProxiedPathname } from "../utils/helpers"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
const routes = ["/", "/vscode", "/vscode/"]
|
||||
const routes = {
|
||||
"/": [
|
||||
/\.\/manifest.json/,
|
||||
/\.\/_static\//,
|
||||
/[a-z]+-[0-9a-z]+\/static\//,
|
||||
/http:\/\/localhost:[0-9]+\/[a-z]+-[0-9a-z]+\/static\//,
|
||||
],
|
||||
"/vscode": [
|
||||
/\.\/vscode\/manifest.json/,
|
||||
/\.\/_static\//,
|
||||
/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||
/http:\/\/localhost:[0-9]+\/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||
],
|
||||
"/vscode/": [
|
||||
/\.\/manifest.json/,
|
||||
/\.\/\.\.\/_static\//,
|
||||
/[a-z]+-[0-9a-z]+\/static\//,
|
||||
/http:\/\/localhost:[0-9]+\/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||
],
|
||||
}
|
||||
|
||||
describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
||||
const testName = "vscode-routes-default"
|
||||
@ -10,7 +29,7 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
||||
})
|
||||
|
||||
test("should load all route variations", async ({ codeServerPage }) => {
|
||||
for (const route of routes) {
|
||||
for (const [route, matchers] of Object.entries(routes)) {
|
||||
await codeServerPage.navigate(route)
|
||||
|
||||
// Check there were no redirections
|
||||
@ -18,21 +37,16 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
||||
const pathname = getMaybeProxiedPathname(url)
|
||||
expect(pathname).toBe(route)
|
||||
|
||||
// TODO@jsjoeio
|
||||
// now that we are in a proper browser instead of scraping the HTML we
|
||||
// could possibly intercept requests to make sure assets are loading from
|
||||
// the right spot.
|
||||
//
|
||||
// Check that page loaded from correct route
|
||||
const html = await codeServerPage.page.innerHTML("html")
|
||||
switch (route) {
|
||||
case "/":
|
||||
case "/vscode/":
|
||||
expect(html).toMatch(/src="\.\/[a-z]+-[0-9a-z]+\/static\//)
|
||||
break
|
||||
case "/vscode":
|
||||
expect(html).toMatch(/src="\.\/vscode\/[a-z]+-[0-9a-z]+\/static\//)
|
||||
break
|
||||
// Check that assets are pointing to the right spot. Some will be
|
||||
// relative, without a leading dot (VS Code's assets). Some will be
|
||||
// relative with a leading dot (our assets). Others will have been
|
||||
// resolved against the origin.
|
||||
const elements = await codeServerPage.page.locator("[src]").all()
|
||||
for (const element of elements) {
|
||||
const src = await element.getAttribute("src")
|
||||
if (src && !matchers.some((m) => m.test(src))) {
|
||||
throw new Error(`${src} did not match any validators for route ${route}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -85,7 +99,7 @@ describe("VS Code Routes with no workspace or folder", ["--disable-workspace-tru
|
||||
|
||||
// If you visit again without query parameters it will re-attach them by
|
||||
// redirecting. It should always redirect to the same route.
|
||||
for (const route of routes) {
|
||||
for (const route of Object.keys(routes)) {
|
||||
await codeServerPage.navigate(route)
|
||||
const url = new URL(codeServerPage.page.url())
|
||||
const pathname = getMaybeProxiedPathname(url)
|
||||
|
Reference in New Issue
Block a user