@@ -133,34 +133,27 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
133133===================================================================
134134--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
135135+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
136- @@ -304,6 +304,10 @@ export class WebClientServer {
137- const workbenchWebConfiguration: IWorkbenchConstructionOptions & { settingsSyncOptions?: ISettingsSyncOptions } = {
138- remoteAuthority,
139- webviewEndpoint: this._staticRoute + this._webviewEndpoint,
136+ @@ -368,5 +368,9 @@ export class WebClientServer {
137+ folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
138+ workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
139+ productConfiguration,
140+ - callbackRoute: callbackRoute
141+ + callbackRoute: callbackRoute,
140142+ // OpenReplay configuration - passed to HTML template
141143+ openReplayProjectKey: process.env.OPENREPLAY_PROJECT_KEY || '',
142- + openReplayUserEmail: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || '',
144+ + openReplayUserEmail: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || ''
143145+ // End OpenReplay configuration
144- _wrapWebWorkerExtHostInIframe,
145- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
146- settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
147- @@ -384,6 +388,8 @@ export class WebClientServer {
148-
149- let data;
150- if (!this._environmentService.isBuilt) {
151- + data = data.replace(/{{OPENREPLAY_PROJECT_KEY}}/g, workbenchWebConfiguration.openReplayProjectKey || '');
152- + data = data.replace(/{{OPENREPLAY_USER_EMAIL}}/g, workbenchWebConfiguration.openReplayUserEmail || '');
153- data = data.replace('{{WORKBENCH_WEB_BASE_URL}}', this._staticRoute);
154- data = data.replace('{{WORKBENCH_NLS_BASE_URL}}', nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '');
155- data = data.replace('{{WORKBENCH_NLS_FALLBACK_URL}}', '');
156- @@ -414,6 +420,10 @@ export class WebClientServer {
157- values[`{{${key}}}`] = String(nlsConfiguration[key as keyof typeof nlsConfiguration]);
158- }
146+ };
159147
148+ const cookies = cookie.parse(req.headers.cookie || '');
149+ @@ -385,6 +389,9 @@ export class WebClientServer {
150+ WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
151+ WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
152+ WORKBENCH_WEB_BASE_URL: staticRoute,
153+ WORKBENCH_NLS_URL,
154+ - WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
155+ + WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
160156+ // OpenReplay configuration
161- + values['{{OPENREPLAY_PROJECT_KEY}}'] = workbenchWebConfiguration.openReplayProjectKey || '';
162- + values['{{OPENREPLAY_USER_EMAIL}}'] = workbenchWebConfiguration.openReplayUserEmail || '';
163- +
164- let newData = data;
165- for (const key in values) {
166- newData = newData.replace(new RegExp(escapeRegExpCharacters(key), 'g'), values[key]);
157+ + OPENREPLAY_PROJECT_KEY: process.env.OPENREPLAY_PROJECT_KEY || '',
158+ + OPENREPLAY_USER_EMAIL: process.env.JUPYTERHUB_USER || process.env.USER_EMAIL || ''
159+ };
0 commit comments