mirror of
https://github.com/coder/code-server.git
synced 2024-12-27 19:56:57 +03:00
8377bd23df
* chore: upgrade Code to 1.74.1 * chore: remove require in integration.diff I don't know what the impact of this is but in192c67db71
they removed the usage of `require` in `server.main.ts`. More details in PR: https://github.com/microsoft/vscode/pull/165831 * chore: update marketplace.diff * chore: update sha hash in webview.diff * chore: update disable-builtin-ext-update.diff If my logic is right, then this patch is now simplified thanks to this: https://github.com/microsoft/vscode/blob/1.74.1/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts#L1238 * chore: refresh proxy-uri patch * chore: refresh local-storage.diff * chore: refresh sourcemaps.diff * chore: refresh disable-downloads.diff * chore: refresh display-language.diff * chore: refresh getting-started.diff * docs: update testing notes for cli-window-open * docs: update telemetry testing instructions * fix: add GITHUB_TOKEN to build code-server job Downloading @vscode/ripgrep is failing only in CI so adding this environment variable to see if it increases the rate limit. Ref: https://github.com/microsoft/vscode-ripgrep#github-api-limit-note * refactor: use own cache key build code-server job * temp: disable vscode test * refactor: delete wrapper test * Revert "refactor: delete wrapper test" This reverts commit3999279b73
. * refactor: move vscode tests to e2e (#5911) * wip: migrate vscode tests to e2e * feat: add codeWorkspace to global setup * refactor: only use dir in spawn when we should * wip: migrate more tests * refactor: move all vscode tests to e2e * refactor(ci): move unit to own job * fixup: add codecov to unit test step * Update test/e2e/models/CodeServer.ts * Update test/e2e/models/CodeServer.ts * docs: add note about intercept requests * refactor: rm unused clean() calls * refactor: delete duplicate test * refactor: update 'should not redirect' test * refactor: rm unused imports * refactor: rm unnecessary navigate call in test * fixup: formatting * wip: update test * refactor: modify assertion for proxy * fixup: use REVERSE_PROXY_BASE_PATH * refactor: add helper fn getMaybeProxiedPathname * fixup: formatting * fixup: rm unused import * chore: increase playwright timeout * Revert "chore: increase playwright timeout" This reverts commita059129252
. * chore: rm timeout
89 lines
4.5 KiB
Diff
89 lines
4.5 KiB
Diff
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 also removes serverRootPath from the web extension route because that will
|
|
include the commit. When you update code-server (including this update) the web
|
|
extension will continue using the old path since it is stored in the browser but
|
|
the path will 404 because the commit no longer matches. This change is only to
|
|
support current installations though because this patch also removes the
|
|
in-between and has web extensions install directly from the marketplace.
|
|
|
|
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
|
|
@@ -47,6 +47,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
|
version: pkg.version
|
|
});
|
|
}
|
|
+
|
|
+ Object.assign(product, {
|
|
+ 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: "",
|
|
+ })
|
|
+ });
|
|
}
|
|
|
|
// Web environment or unknown
|
|
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
|
|
@@ -111,7 +111,7 @@ export class WebClientServer {
|
|
const serverRootPath = getRemoteServerRootPath(_productService);
|
|
this._staticRoute = `${serverRootPath}/static`;
|
|
this._callbackRoute = `${serverRootPath}/callback`;
|
|
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
|
+ this._webExtensionRoute = `/web-extension-resource`;
|
|
}
|
|
|
|
/**
|
|
@@ -312,14 +312,7 @@ export class WebClientServer {
|
|
codeServerVersion: this._productService.codeServerVersion,
|
|
rootEndpoint: base,
|
|
embedderIdentifier: 'server-distro',
|
|
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
|
- ...this._productService.extensionsGallery,
|
|
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
|
- scheme: 'http',
|
|
- authority: remoteAuthority,
|
|
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
|
- }).toString(true)
|
|
- } : undefined
|
|
+ extensionsGallery: this._productService.extensionsGallery,
|
|
},
|
|
callbackRoute: this._callbackRoute
|
|
};
|
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
|
===================================================================
|
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
|
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
|
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
|
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
|
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
|
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
|
|
|
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
|
|
|
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
|
|
private readonly _environmentService: IEnvironmentService,
|
|
private readonly _configurationService: IConfigurationService,
|
|
) {
|
|
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
|
+ this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
|
if (_productService.extensionsGallery) {
|
|
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
|
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
|