diff --git a/src/vs/gitpod/browser/workbench/workbench-dev.html b/src/vs/gitpod/browser/workbench/workbench-dev.html index 58651bc6c63d9..e5f2ea962cd23 100644 --- a/src/vs/gitpod/browser/workbench/workbench-dev.html +++ b/src/vs/gitpod/browser/workbench/workbench-dev.html @@ -2,6 +2,104 @@ + @@ -34,8 +132,8 @@ - - + + diff --git a/src/vs/gitpod/browser/workbench/workbench.html b/src/vs/gitpod/browser/workbench/workbench.html index 075e75149ba4d..ba4e8c59d0853 100644 --- a/src/vs/gitpod/browser/workbench/workbench.html +++ b/src/vs/gitpod/browser/workbench/workbench.html @@ -3,33 +3,37 @@ + @@ -101,9 +152,9 @@ - - - + + + - - - + + + diff --git a/src/vs/gitpod/common/insightsHelper.ts b/src/vs/gitpod/common/insightsHelper.ts index 235a4bc0fd868..31980071f6b35 100644 --- a/src/vs/gitpod/common/insightsHelper.ts +++ b/src/vs/gitpod/common/insightsHelper.ts @@ -28,6 +28,8 @@ export enum SenderKind { Node = 2 } +// TODO map 'UnhandledError' to our error and report it both only for window and remote-server + export function mapMetrics(source: 'window' | 'remote-server', eventName: string, data: any): IDEMetric[] | undefined { const maybeMetrics = doMapMetrics(source, eventName, data); return maybeMetrics instanceof Array ? maybeMetrics : typeof maybeMetrics === 'object' ? [maybeMetrics] : undefined; diff --git a/src/vs/server/node/webClientServer.ts b/src/vs/server/node/webClientServer.ts index 45e466e0bfc80..7d64fd8ad3bdc 100644 --- a/src/vs/server/node/webClientServer.ts +++ b/src/vs/server/node/webClientServer.ts @@ -323,6 +323,8 @@ export class WebClientServer { const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl; const values: { [key: string]: string } = { + VERSION: this._productService.version, + GITPOD_HOST: this._productService.gitpodPreview?.host || '', WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration), WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '', WORKBENCH_WEB_BASE_URL: this._staticRoute, @@ -353,9 +355,11 @@ export class WebClientServer { 'manifest-src \'self\';' ].join(' '); + const allowAllCSP = `default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';`; + const headers: http.OutgoingHttpHeaders = { 'Content-Type': 'text/html', - 'Content-Security-Policy': cspDirectives + 'Content-Security-Policy': this._environmentService.isBuilt ? cspDirectives : allowAllCSP }; if (this._connectionToken.type !== ServerConnectionTokenType.None) { // At this point we know the client has a valid cookie