diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index e484b2518..8bcf82307 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -98,43 +98,6 @@ bundle_vscode() { rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH" - # Add the commit, date, our name, links, and enable telemetry. This just makes - # telemetry available; telemetry can still be disabled by flag or setting. - jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <( - cat << EOF - { - "enableTelemetry": true, - "commit": "$(cd "$VSCODE_SRC_PATH" && git rev-parse HEAD)", - "quality": "stable", - "date": $(jq -n 'now | todate'), - "codeServerVersion": "$VERSION", - "nameShort": "code-server", - "nameLong": "code-server", - "applicationName": "code-server", - "dataFolderName": ".code-server", - "win32MutexName": "codeserver", - "licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE", - "win32DirName": "code-server", - "win32NameVersion": "code-server", - "win32AppUserModelId": "coder.code-server", - "win32ShellNameShort": "c&ode-server", - "darwinBundleIdentifier": "com.coder.code.server", - "linuxIconName": "com.coder.code.server", - "reportIssueUrl": "https://github.com/coder/code-server/issues/new", - "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", - "keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143", - "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144", - "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145", - "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", - "tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118", - "newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter", - "linkProtectionTrustedDomains": [ - "https://open-vsx.org" - ] - } -EOF - ) > "$VSCODE_OUT_PATH/product.json" - # Use the package.json for the web/remote server. It does not have the right # version though so pull that from the main package.json. jq --slurp '.[0] * {version: .[1].version}' \ diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh index bb3225a2b..71d33960f 100755 --- a/ci/build/build-vscode.sh +++ b/ci/build/build-vscode.sh @@ -9,10 +9,62 @@ MINIFY=${MINIFY-true} main() { cd "$(dirname "${0}")/../.." + source ./ci/lib.sh + cd lib/vscode + # Set the commit Code will embed into the product.json. We need to do this + # since Code tries to get the commit from the `.git` directory which will fail + # as it is a submodule. + export VSCODE_DISTRO_COMMIT + VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD) + + # Add the date, our name, links, and enable telemetry (this just makes + # telemetry available; telemetry can still be disabled by flag or setting). + # This needs to be done before building as Code will read this file and embed + # it into the client-side code. + git checkout product.json # Reset in case the script exited early. + cp product.json product.original.json # Since jq has no inline edit. + jq --slurp '.[0] * .[1]' product.original.json <( + cat << EOF + { + "enableTelemetry": true, + "quality": "stable", + "codeServerVersion": "$VERSION", + "nameShort": "code-server", + "nameLong": "code-server", + "applicationName": "code-server", + "dataFolderName": ".code-server", + "win32MutexName": "codeserver", + "licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE", + "win32DirName": "code-server", + "win32NameVersion": "code-server", + "win32AppUserModelId": "coder.code-server", + "win32ShellNameShort": "c&ode-server", + "darwinBundleIdentifier": "com.coder.code.server", + "linuxIconName": "com.coder.code.server", + "reportIssueUrl": "https://github.com/coder/code-server/issues/new", + "documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode", + "keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143", + "keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144", + "keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145", + "introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146", + "tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118", + "newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter", + "linkProtectionTrustedDomains": [ + "https://open-vsx.org" + ] + } +EOF + ) > product.json + # Any platform works since we have our own packaging step (for now). yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}" + + # Reset so if you develop after building you will not be stuck with the wrong + # commit (the dev client will use `oss-dev` but the dev server will still use + # product.json which will have `stable-$commit`). + git checkout product.json } main "$@" diff --git a/lib/vscode b/lib/vscode index dfd34e826..30d9c6cd9 160000 --- a/lib/vscode +++ b/lib/vscode @@ -1 +1 @@ -Subproject commit dfd34e8260c270da74b5c2d86d61aee4b6d56977 +Subproject commit 30d9c6cd9483b2cc586687151bcbcd635f373630 diff --git a/patches/base-path.diff b/patches/base-path.diff index 95bb8388e..bf1698465 100644 --- a/patches/base-path.diff +++ b/patches/base-path.diff @@ -10,16 +10,14 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts =================================================================== --- code-server.orig/lib/vscode/src/vs/base/common/network.ts +++ code-server/lib/vscode/src/vs/base/common/network.ts -@@ -151,8 +151,10 @@ class RemoteAuthoritiesImpl { - } +@@ -157,7 +157,9 @@ class RemoteAuthoritiesImpl { return URI.from({ scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource, -- authority: `${host}:${port}`, -- path: `/vscode-remote-resource`, -+ authority: platform.isWeb ? window.location.host : `${host}:${port}`, + authority: `${host}:${port}`, +- path: this._remoteResourcesPath, + path: platform.isWeb -+ ? URI.joinPath(URI.parse(window.location.href), `/vscode-remote-resource`).path -+ : `/vscode-remote-resource`, ++ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/") ++ : this._remoteResourcesPath, query }); } @@ -38,40 +36,28 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html -@@ -27,23 +27,26 @@ +@@ -27,9 +27,9 @@ - -- +- - + -+ ++ +
- - - -- -- -+ -+ +@@ -39,7 +39,7 @@ + + -- -+ -+ - -- -- -- -+ -+ -+ -