2022-03-23 04:07:14 +08:00
|
|
|
Add Open VSX default and an env var for marketplace, fix old marketplace
|
|
|
|
|
|
|
|
Our old marketplace only supports `serviceUrl` but this causes the marketplace
|
|
|
|
to be disabled entirely so this moves the template var check to fix that.
|
|
|
|
|
|
|
|
This can be tested by setting EXTENSIONS_GALLERY set to:
|
|
|
|
|
|
|
|
'{"serviceUrl": "https://extensions.coder.com/api"}'
|
|
|
|
|
|
|
|
|
|
|
|
Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|
|
|
===================================================================
|
|
|
|
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
|
|
|
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|
|
|
@@ -45,7 +45,14 @@ else if (typeof require?.__$__nodeRequir
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.assign(product, {
|
|
|
|
- version: pkg.version
|
|
|
|
+ version: pkg.version,
|
|
|
|
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
|
|
|
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
|
|
|
+ itemUrl: "https://open-vsx.org/vscode/item",
|
|
|
|
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
|
|
|
+ controlUrl: "",
|
|
|
|
+ recommendationsUrl: "",
|
|
|
|
+ }),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2022-05-05 05:58:49 +08:00
|
|
|
@@ -293,14 +293,14 @@ export class WebClientServer {
|
2022-03-23 04:07:14 +08:00
|
|
|
rootEndpoint: base,
|
2022-04-01 05:14:03 +08:00
|
|
|
codeServerVersion: this._productService.codeServerVersion,
|
2022-03-31 07:33:58 +08:00
|
|
|
embedderIdentifier: 'server-distro',
|
2022-03-23 04:07:14 +08:00
|
|
|
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
|
|
|
+ extensionsGallery: {
|
|
|
|
...this._productService.extensionsGallery,
|
|
|
|
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
|
|
|
+ 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
|
|
|
|
scheme: 'http',
|
|
|
|
authority: remoteAuthority,
|
|
|
|
path: `web-extension-resource/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
|
|
|
- }).toString(true)
|
|
|
|
- } : undefined
|
|
|
|
+ }).toString(true) : undefined
|
|
|
|
+ },
|
|
|
|
}
|
|
|
|
})))
|
|
|
|
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|