@@ -3,6 +3,13 @@ Add Open VSX default and an env var for marketplace, fix old marketplace
3
3
Our old marketplace only supports `serviceUrl` but this causes the marketplace
4
4
to be disabled entirely so this moves the template var check to fix that.
5
5
6
+ This also removes serverRootPath from the web extension route because that will
7
+ include the commit. When you update code-server (including this update) the web
8
+ extension will continue using the old path since it is stored in the browser but
9
+ the path will 404 because the commit no longer matches. This change is only to
10
+ support current installations though because this patch also removes the
11
+ in-between and has web extensions install directly from the marketplace.
12
+
6
13
This can be tested by setting EXTENSIONS_GALLERY set to:
7
14
8
15
'{"serviceUrl": "https://extensions.coder.com/api"}'
@@ -32,22 +39,41 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
32
39
===================================================================
33
40
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
34
41
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
35
- @@ -308,14 +308,14 @@ export class WebClientServer {
42
+ @@ -111,7 +111,7 @@ export class WebClientServer {
43
+ const serverRootPath = getRemoteServerRootPath(_productService);
44
+ this._staticRoute = `${serverRootPath}/static`;
45
+ this._callbackRoute = `${serverRootPath}/callback`;
46
+ - this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
47
+ + this._webExtensionRoute = `/web-extension-resource`;
48
+ }
49
+
50
+ /**
51
+ @@ -308,14 +308,7 @@ export class WebClientServer {
36
52
codeServerVersion: this._productService.codeServerVersion,
37
53
rootEndpoint: base,
38
54
embedderIdentifier: 'server-distro',
39
55
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
40
- + extensionsGallery: {
41
- ...this._productService.extensionsGallery,
56
+ - ...this._productService.extensionsGallery,
42
57
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
43
- + 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
44
- scheme: 'http',
45
- authority: remoteAuthority,
46
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
58
+ - scheme: 'http',
59
+ - authority: remoteAuthority,
60
+ - path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
47
61
- }).toString(true)
48
62
- } : undefined
49
- + }).toString(true) : undefined
50
- + }
63
+ + extensionsGallery: this._productService.extensionsGallery,
51
64
},
52
65
callbackRoute: this._callbackRoute
53
66
};
67
+ Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
68
+ ===================================================================
69
+ --- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
70
+ +++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
71
+ @@ -60,7 +60,7 @@ export abstract class AbstractExtensionR
72
+ private readonly _environmentService: IEnvironmentService,
73
+ private readonly _configurationService: IConfigurationService,
74
+ ) {
75
+ - this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
76
+ + this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
77
+ if (_productService.extensionsGallery) {
78
+ this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
79
+ this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
0 commit comments