Compare commits

..

2 Commits

Author SHA1 Message Date
Asher c4f5427c3c
Update CSP hashes 2024-11-01 11:31:07 -08:00
Asher bd68646581
Fix mangled exports 2024-11-01 09:28:58 -08:00
2 changed files with 9 additions and 14 deletions

View File

@ -24,7 +24,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
import product from '../../platform/product/common/product.js'; import product from '../../platform/product/common/product.js';
import * as perf from '../../base/common/performance.js'; import * as perf from '../../base/common/performance.js';
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = { @@ -34,38 +34,47 @@ const errorReporter: ErrorReporter = {
} }
}; };
@ -80,7 +80,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
*/ */
-export function spawnCli() { -export function spawnCli() {
- runCli(args, REMOTE_DATA_FOLDER, serverOptions); - runCli(args, REMOTE_DATA_FOLDER, serverOptions);
+export function spawnCli(args = parse()): Promise<void> { +function spawnCli(args = parse()): Promise<void> {
+ return runCli(args, createDirs(args), serverOptions); + return runCli(args, createDirs(args), serverOptions);
} }
@ -89,9 +89,13 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
*/ */
-export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> { -export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> {
- return doCreateServer(address, args, REMOTE_DATA_FOLDER); - return doCreateServer(address, args, REMOTE_DATA_FOLDER);
+export function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> { +function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
+ return doCreateServer(address, args, createDirs(args)); + return doCreateServer(address, args, createDirs(args));
} }
+
+// The aliases prevent the names getting mangled during minification which would
+// make it difficult to import.
+export { spawnCli as spawnCli, createServer as createServer };
Index: code-server/lib/vscode/src/vs/base/common/processes.ts Index: code-server/lib/vscode/src/vs/base/common/processes.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts --- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
@ -319,7 +323,7 @@ Index: code-server/lib/vscode/src/server-main.ts
+ return loadCode(nlsConfiguration); + return loadCode(nlsConfiguration);
+} +}
+ +
+// This alias prevents the name getting mangled during obfuscation which would +// This alias prevents the name getting mangled during minification which would
+// make it difficult to import. +// make it difficult to import.
+export { loadCodeWithNls as loadCodeWithNls }; +export { loadCodeWithNls as loadCodeWithNls };
+ +

View File

@ -62,15 +62,6 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
_wrapWebWorkerExtHostInIframe, _wrapWebWorkerExtHostInIframe,
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() }, 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, settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
@@ -385,7 +386,7 @@ export class WebClientServer {
return void res.end('Not found');
}
- const webWorkerExtensionHostIframeScriptSHA = 'sha256-2Q+j4hfT09+1+imS46J2YlkCtHWQt0/BE79PXjJ0ZJ8=';
+ const webWorkerExtensionHostIframeScriptSHA = 'sha256-3Q+j4hfT09+1+imS46J2YlkCtHWQt0/BE79PXjJ0ZJ8=';
const cspDirectives = [
'default-src \'self\';',
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html 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.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
@ -123,7 +114,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
default-src 'none'; default-src 'none';
child-src 'self' data: blob:; child-src 'self' data: blob:;
- script-src 'self' 'unsafe-eval' 'sha256-xM2KVDKIoeb8vVxk4ezEUsxdTZh5wFnKO3YmFhy9tkk=' https: http://localhost:* blob:; - script-src 'self' 'unsafe-eval' 'sha256-xM2KVDKIoeb8vVxk4ezEUsxdTZh5wFnKO3YmFhy9tkk=' https: http://localhost:* blob:;
+ script-src 'self' 'unsafe-eval' 'sha256-yM2KVDKIoeb8vVxk4ezEUsxdTZh5wFnKO3YmFhy9tkk=' https: http://localhost:* blob:; + script-src 'self' 'unsafe-eval' 'sha256-6eZXxikxkENULU0EOkVQSd4hglGixLg3Aow9psZ6u2Y=' https: http://localhost:* blob:;
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/> connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
</head> </head>
<body> <body>