Compare commits

...

12 Commits

Author SHA1 Message Date
cdrci
fba2fbc41e Update Code to 1.129.0 2026-07-16 14:42:17 -08:00
Asher
3e76a04b1b Fix automatic CSP hash update
The problem was that whenever the hashe needed an update, the current
patch would create a conflict which cannot be easily auto-resolved.

Instead, put the hashes in a separate patch that is deleted and
regenerated each time, avoiding the conflicts.

Also the web worker iframe hash was not being updated.
2026-07-16 12:41:14 -08:00
cdrci
421e7eb084 Update Helm chart and changelog with 4.128.0 (#7891) 2026-07-13 08:56:29 -08:00
cdrci
cb22f74650 Update Code to 1.128.0 (#7889) 2026-07-10 12:08:44 -08:00
Asher
d103d5057a Fix update script using old Node version
It needs to parse the version *after* the VS Code update, otherwise it
is just pulling whatever the previous version was.

That means we cannot use it in the step title without some refactoring;
opted to just omit it for now.
2026-07-09 22:58:44 -08:00
Asher
aed61bf6ab Remove @schemastore/package
Providing our own type is trivial.
2026-07-02 12:29:55 -08:00
cdrci
1e160477be Update Helm chart and changelog with 4.127.0 (#7882) 2026-07-02 12:05:31 -08:00
cdrci
1e6ed874e3 Update Code to 1.127.0 (#7880)
There is a new use of parsedArgs so we have to pass that in since we
parse on demand instead of globally.
2026-07-01 13:01:48 -08:00
cdrci
dd48f7753b Update Helm chart and changelog with 4.126.0 (#7869) 2026-06-24 14:08:03 -08:00
cdrci
2c06497ca9 Update Code to 1.126.0 (#7868) 2026-06-24 12:05:00 -08:00
Asher
9ccf763b02 Match update PRs titles with commits 2026-06-22 11:31:25 -08:00
cdrci
40b39293fa Update Helm chart and changelog with 4.125.0 (#7863) 2026-06-22 11:29:01 -08:00
24 changed files with 172 additions and 127 deletions

View File

@@ -95,7 +95,7 @@ jobs:
git add . git add .
git commit -m "Update to ${{ env.VERSION }}" git commit -m "Update to ${{ env.VERSION }}"
git push -u origin $(git branch --show) git push -u origin $(git branch --show)
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR gh pr create --repo coder/code-server-aur --title "Update to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -164,4 +164,4 @@ jobs:
gh pr create \ gh pr create \
--repo coder/code-server \ --repo coder/code-server \
--body-file .cache/checklist \ --body-file .cache/checklist \
--title "Update to $VERSION" --title "Update Helm chart and changelog with $VERSION"

View File

@@ -1 +1 @@
24.15.0 24.18.0

View File

@@ -22,6 +22,38 @@ Code v99.99.999
## Unreleased ## Unreleased
Code v1.129.0
### Changed
- Update to Code 1.129.0
## [4.128.0](https://github.com/coder/code-server/releases/tag/v4.128.0) - 2026-07-11
Code v1.128.0
### Changed
- Update to Code 1.128.0
## [4.127.0](https://github.com/coder/code-server/releases/tag/v4.127.0) - 2026-07-02
Code v1.127.0
### Changed
- Update to Code 1.127.0
## [4.126.0](https://github.com/coder/code-server/releases/tag/v4.126.0) - 2026-06-24
Code v1.126.0
### Changed
- Update to Code 1.126.0
## [4.125.0](https://github.com/coder/code-server/releases/tag/v4.125.0) - 2026-06-18
Code v1.125.0 Code v1.125.0
### Changed ### Changed

View File

@@ -4,7 +4,7 @@ set -Eeuo pipefail
function unapply_patches() { function unapply_patches() {
local -i exit_code=0 local -i exit_code=0
quiet quilt pop -af || exit_code=$? quiet quilt pop -af 2>&1 || exit_code=$?
case $exit_code in case $exit_code in
# Sucessfully unapplied. # Sucessfully unapplied.
0) ;; 0) ;;
@@ -15,6 +15,19 @@ function unapply_patches() {
esac esac
} }
function apply_patches() {
local -i exit_code=0
quiet quilt push -a 2>&1 || exit_code=$?
case $exit_code in
# Sucessfully applied.
0) ;;
# No more patches to apply.
2) ;;
# Some error.
*) return $exit_code ;;
esac
}
function update_vscode() { function update_vscode() {
pushd lib/vscode pushd lib/vscode
if ! git checkout 2>&1 "$target_vscode_version" ; then if ! git checkout 2>&1 "$target_vscode_version" ; then
@@ -28,8 +41,8 @@ function update_vscode() {
function refresh_patches() { function refresh_patches() {
local -i exit_code=0 local -i exit_code=0
while quiet quilt push ; ! (( exit_code=$? )) ; do while quiet quilt push 2>&1 ; ! (( exit_code=$? )) ; do
quilt refresh quilt refresh 2>&1
done done
case $exit_code in case $exit_code in
# No more patches to apply. # No more patches to apply.
@@ -42,6 +55,8 @@ function refresh_patches() {
function update_node() { function update_node() {
local node_version local node_version
node_version=$(cat .node-version) node_version=$(cat .node-version)
local target_node_version
target_node_version=$(grep target lib/vscode/remote/.npmrc | awk -F= '{print $2}' | tr -d '"')
if [[ $node_version == "$target_node_version" ]] ; then if [[ $node_version == "$target_node_version" ]] ; then
echo "Already set to $target_node_version" echo "Already set to $target_node_version"
else else
@@ -54,50 +69,41 @@ function get-webview-script-hash() {
local html local html
html=$(<"$1") html=$(<"$1")
local start_tag='<script async type="module">' local start_tag='<script async type="module">'
if [[ $file == */webWorkerExtensionHostIframe.html ]] ; then
start_tag='<script>'
fi
local end_tag="</script>" local end_tag="</script>"
html=${html##*"$start_tag"} html=${html##*"$start_tag"}
html=${html%%"$end_tag"*} html=${html%%"$end_tag"*}
echo -n "$html" | openssl sha256 -binary | openssl base64 echo -n "$html" | openssl sha256 -binary | openssl base64
} }
function update_csp() { function delete_csp() {
local current quilt delete csp-hashes.diff
current=$(quilt top 2>/dev/null || echo "") }
local patch_action=""
echo "Currently at ${current:-base}" function update_csp() {
if [[ $current != */webview.diff ]] ; then apply_patches
echo "Moving to patches/webview.diff..."
local -i exit_code=0 local files=(
if quilt applied 2>/dev/null | grep --quiet webview.diff ; then ./lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
quiet quilt pop webview || exit_code=$? ./lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
patch_action=pop )
else
quiet quilt push webview || exit_code=$? quilt new csp-hashes.diff
patch_action=push
fi local file
case $exit_code in for file in "${files[@]}" ; do
# Successfully moved. quilt add "$file"
0) ;;
# Some error.
*) return $exit_code ;;
esac
fi
local file=lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
local hash local hash
hash=$(get-webview-script-hash "$file") hash=$(get-webview-script-hash "$file")
echo "Calculated hash as $hash" echo "Calculated hash as $hash"
# Use octothorpe as a delimiter since the hash may contain a slash. # Use octothorpe as a delimiter since the hash may contain a slash.
sed -i.bak "s#script-src 'sha256-[^']\+'#script-src 'sha256-$hash'#" "$file" sed -i.bak "s#'sha256-[^']\+'#'sha256-$hash'#" "$file"
quilt refresh done
if [[ $patch_action != "" ]] ; then quilt refresh
echo "Moving back to ${current:-base}..."
case $patch_action in
pop) quiet quilt push "$current" ;;
push) quiet quilt pop "${current:--a}" ;;
esac
fi
} }
function add_changelog() { function add_changelog() {
@@ -116,11 +122,11 @@ function main() {
source ./ci/lib.sh source ./ci/lib.sh
local target_node_version
target_node_version=$(grep target lib/vscode/remote/.npmrc | awk -F= '{print $2}' | tr -d '"')
declare -a steps declare -a steps
# Hashes are always regenerated to avoid having to resolve conflicts..
steps+=("Revert CSP hashes" "delete_csp")
# If version is not set, assume we are already at the target version and the # If version is not set, assume we are already at the target version and the
# user is just trying to resolve conflics. # user is just trying to resolve conflics.
local target_vscode_version local target_vscode_version
@@ -141,8 +147,8 @@ function main() {
fi fi
steps+=( steps+=(
"Set Node version to $target_node_version" "update_node" "Update Node version" "update_node"
"Update CSP webview hash" "update_csp" "Regenerate CSP hashes" "update_csp"
"Add changelog note" "add_changelog" "Add changelog note" "add_changelog"
) )

View File

@@ -15,9 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 3.39.0 version: 3.43.0
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using. # follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.124.2 appVersion: 4.128.0

View File

@@ -6,7 +6,7 @@ replicaCount: 1
image: image:
repository: codercom/code-server repository: codercom/code-server
tag: '4.124.2' tag: '4.128.0'
pullPolicy: Always pullPolicy: Always
# Specifies one or more secrets to be used when pulling images from a # Specifies one or more secrets to be used when pulling images from a

View File

@@ -85,18 +85,20 @@ run-steps() {
while (( $# )) ; do while (( $# )) ; do
local name=$1 ; shift local name=$1 ; shift
local fn=$1 ; shift local fn=$1 ; shift
# Only run if an earlier step has not failed.
if [[ $failed == 0 ]] ; then
echo "$name..." echo "$name..."
# Only run if an earlier step has not failed.
# For all failed steps, write out an empty checkbox.
if [[ $failed == 0 ]] ; then
if $fn | indent ; then if $fn | indent ; then
echo "- [X] $name" >> .cache/checklist echo "- [X] $name" >> .cache/checklist
else else
((failed++)) ((failed++))
echo "- [-] $name" >> .cache/checklist
echo "Failed" | indent
fi fi
fi else
# For all failed steps, write out an empty checkbox.
if [[ $failed != 0 ]] ; then
echo "- [ ] $name" >> .cache/checklist echo "- [ ] $name" >> .cache/checklist
echo "Skipped" | indent
fi fi
done done
if [[ $failed != 0 ]] ; then if [[ $failed != 0 ]] ; then

8
package-lock.json generated
View File

@@ -38,7 +38,6 @@
"@eslint/compat": "^1.2.0", "@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0", "@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0", "@eslint/js": "^9.12.0",
"@schemastore/package": "^0.0.10",
"@types/compression": "^1.7.3", "@types/compression": "^1.7.3",
"@types/cookie-parser": "^1.4.4", "@types/cookie-parser": "^1.4.4",
"@types/eslint__js": "^8.42.3", "@types/eslint__js": "^8.42.3",
@@ -438,13 +437,6 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@schemastore/package": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/@schemastore/package/-/package-0.0.10.tgz",
"integrity": "sha512-D3LxMCnkgsb4LO5sDKf6E+yahM2SqpEHmkqMPDSJis5Cy/j2MgWo/g/iq0lECK0mrPWfx3hqKm2ZJlqxwbRJQA==",
"dev": true,
"license": "MIT"
},
"node_modules/@textlint/ast-node-types": { "node_modules/@textlint/ast-node-types": {
"version": "15.7.1", "version": "15.7.1",
"resolved": "https://registry.npmjs.org/@textlint/ast-node-types/-/ast-node-types-15.7.1.tgz", "resolved": "https://registry.npmjs.org/@textlint/ast-node-types/-/ast-node-types-15.7.1.tgz",

View File

@@ -39,7 +39,6 @@
"@eslint/compat": "^1.2.0", "@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0", "@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0", "@eslint/js": "^9.12.0",
"@schemastore/package": "^0.0.10",
"@types/compression": "^1.7.3", "@types/compression": "^1.7.3",
"@types/cookie-parser": "^1.4.4", "@types/cookie-parser": "^1.4.4",
"@types/eslint__js": "^8.42.3", "@types/eslint__js": "^8.42.3",

View File

@@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
embedderIdentifier: 'server-distro', embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? { extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery, ...this._productService.extensionsGallery,
@@ -407,7 +414,9 @@ export class WebClientServer { @@ -401,7 +408,9 @@ export class WebClientServer {
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '', WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
WORKBENCH_WEB_BASE_URL: staticRoute, WORKBENCH_WEB_BASE_URL: staticRoute,
WORKBENCH_NLS_URL, WORKBENCH_NLS_URL,
@@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
}; };
// DEV --------------------------------------------------------------------------------------- // DEV ---------------------------------------------------------------------------------------
@@ -444,7 +453,7 @@ export class WebClientServer { @@ -438,7 +447,7 @@ export class WebClientServer {
'default-src \'self\';', 'default-src \'self\';',
'img-src \'self\' https: data: blob:;', 'img-src \'self\' https: data: blob:;',
'media-src \'self\';', 'media-src \'self\';',
@@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
'child-src \'self\';', 'child-src \'self\';',
`frame-src 'self' https://*.vscode-cdn.net data:;`, `frame-src 'self' https://*.vscode-cdn.net data:;`,
'worker-src \'self\' data: blob:;', 'worker-src \'self\' data: blob:;',
@@ -517,3 +526,70 @@ export class WebClientServer { @@ -511,3 +520,70 @@ export class WebClientServer {
return void res.end(data); return void res.end(data);
} }
} }

26
patches/csp-hashes.diff Normal file
View File

@@ -0,0 +1,26 @@
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/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
@@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-nXjtuhBilO++r8hfxl5VjEScSmdm07wDAk6jw228DgM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-A6/szVNdTzyi4hDa+9OLbzS8tSd2iUV4CqimLNWex2Y=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming -->
<meta name="viewport"
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
@@ -4,7 +4,7 @@
<meta http-equiv="Content-Security-Policy" content="
default-src 'none';
child-src 'self' data: blob:;
- script-src 'self' 'unsafe-eval' 'sha256-daEgfo2VIXpx2Np71KqCCbkeQwv+68vPrx54XRcbdcs=' https: http://localhost:* blob:;
+ script-src 'self' 'unsafe-eval' 'sha256-gfjiOVjAlxqrivZAfTq2d83mOaz0fnAxbGaFpj5IjD8=' https: http://localhost:* blob:;
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
</head>
<body>

View File

@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js'; import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js'; import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
@@ -359,6 +359,9 @@ export async function setupServerService @@ -358,6 +358,9 @@ export async function setupServerService
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority))); socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
@@ -161,7 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
import { CharCode } from '../../base/common/charCode.js'; import { CharCode } from '../../base/common/charCode.js';
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js'; import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js'; import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
@@ -405,14 +406,22 @@ export class WebClientServer { @@ -399,14 +400,22 @@ export class WebClientServer {
}; };
const cookies = cookie.parse(req.headers.cookie || ''); const cookies = cookie.parse(req.headers.cookie || '');

View File

@@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -389,6 +389,8 @@ export class WebClientServer { @@ -383,6 +383,8 @@ export class WebClientServer {
serverBasePath: basePath, serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
userDataPath: this._environmentService.userDataPath, userDataPath: this._environmentService.userDataPath,
@@ -147,7 +147,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
@IProductService private readonly productService: IProductService, @IProductService private readonly productService: IProductService,
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService, @IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
@IEditorService private readonly editorService: IEditorService, @IEditorService private readonly editorService: IEditorService,
@@ -201,6 +201,10 @@ export class WorkbenchContextKeysHandler @@ -202,6 +202,10 @@ export class WorkbenchContextKeysHandler
this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService); this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService);
this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized()); this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized());

View File

@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -393,6 +393,7 @@ export class WebClientServer { @@ -387,6 +387,7 @@ export class WebClientServer {
userDataPath: this._environmentService.userDataPath, userDataPath: this._environmentService.userDataPath,
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'], isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'], isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
@@ -222,7 +222,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js'; import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
import { IConfigurationService } from '../../platform/configuration/common/configuration.js'; import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js'; import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
@@ -204,6 +204,7 @@ export class WorkbenchContextKeysHandler @@ -205,6 +205,7 @@ export class WorkbenchContextKeysHandler
// code-server // code-server
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true) IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true) IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)

View File

@@ -164,7 +164,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts +++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
@@ -65,6 +65,7 @@ import { IOpenerService } from '../../pl @@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl
import { mixin, safeStringify } from '../../base/common/objects.js'; import { mixin, safeStringify } from '../../base/common/objects.js';
import { IndexedDB } from '../../base/browser/indexedDB.js'; import { IndexedDB } from '../../base/browser/indexedDB.js';
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js'; import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
@@ -172,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
import { IProgressService } from '../../platform/progress/common/progress.js'; import { IProgressService } from '../../platform/progress/common/progress.js';
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js'; import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
import { dirname, joinPath } from '../../base/common/resources.js'; import { dirname, joinPath } from '../../base/common/resources.js';
@@ -140,6 +141,9 @@ export class BrowserMain extends Disposa @@ -139,6 +140,9 @@ export class BrowserMain extends Disposa
// Startup // Startup
const instantiationService = workbench.startup(); const instantiationService = workbench.startup();
@@ -263,7 +263,7 @@ Index: code-server/lib/vscode/src/server-main.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/server-main.ts --- code-server.orig/lib/vscode/src/server-main.ts
+++ code-server/lib/vscode/src/server-main.ts +++ code-server/lib/vscode/src/server-main.ts
@@ -22,6 +22,9 @@ import { IServerAPI } from './vs/server/ @@ -23,6 +23,9 @@ import { IServerAPI } from './vs/server/
perf.mark('code/server/start'); perf.mark('code/server/start');
(globalThis as { vscodeServerStartTime?: number }).vscodeServerStartTime = performance.now(); (globalThis as { vscodeServerStartTime?: number }).vscodeServerStartTime = performance.now();
@@ -273,7 +273,16 @@ Index: code-server/lib/vscode/src/server-main.ts
// Do a quick parse to determine if a server or the cli needs to be started // Do a quick parse to determine if a server or the cli needs to be started
const parsedArgs = minimist(process.argv.slice(2), { const parsedArgs = minimist(process.argv.slice(2), {
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'], boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
@@ -150,6 +153,7 @@ if (shouldSpawnCli) { @@ -50,7 +53,7 @@ if (shouldSpawnCli) {
mod.spawnCli();
});
} else {
- installServerProcessExitDiagnostics();
+ installServerProcessExitDiagnostics(parsedArgs);
let _remoteExtensionHostAgentServer: IServerAPI | null = null;
let _remoteExtensionHostAgentServerPromise: Promise<IServerAPI> | null = null;
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
} }
}); });
} }
@@ -281,7 +290,16 @@ Index: code-server/lib/vscode/src/server-main.ts
function sanitizeStringArg(val: unknown): string | undefined { function sanitizeStringArg(val: unknown): string | undefined {
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
@@ -283,3 +287,22 @@ function prompt(question: string): Promi @@ -173,7 +177,7 @@ function sanitizeStringArg(val: unknown)
* provided) so they survive process teardown (an async stdio write from an
* `exit` handler does not).
*/
-function installServerProcessExitDiagnostics(): void {
+function installServerProcessExitDiagnostics(parsedArgs: minimist.ParsedArgs): void {
if (!process.env['VSCODE_SERVER_EXIT_DIAGNOSTICS']) {
return;
}
@@ -406,3 +410,22 @@ function prompt(question: string): Promi
}); });
}); });
} }

View File

@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -384,6 +384,7 @@ export class WebClientServer { @@ -378,6 +378,7 @@ export class WebClientServer {
remoteAuthority, remoteAuthority,
serverBasePath: basePath, serverBasePath: basePath,
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre', webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',

View File

@@ -64,7 +64,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
+ extensionsGallery: this._productService.extensionsGallery, + extensionsGallery: this._productService.extensionsGallery,
}; };
const proposedApi = this._environmentService.args['enable-proposed-api']; if (!this._environmentService.isBuilt) {
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts 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.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts

View File

@@ -10,18 +10,14 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts +++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
@@ -321,10 +321,7 @@ function extensionDescriptionArrayToMap( @@ -324,6 +324,7 @@ function extensionDescriptionArrayToMap(
} }
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean { export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
- if (!extension.enabledApiProposals) { + return true;
- return false; if (!extension.enabledApiProposals) {
- } return false;
- return true;// extension.enabledApiProposals.includes(proposal);
+ return true
} }
export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts

View File

@@ -24,3 +24,4 @@ trusted-domains.diff
signature-verification.diff signature-verification.diff
copilot.diff copilot.diff
app-name.diff app-name.diff
csp-hashes.diff

View File

@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.ts --- code-server.orig/lib/vscode/build/gulpfile.reh.ts
+++ code-server/lib/vscode/build/gulpfile.reh.ts +++ code-server/lib/vscode/build/gulpfile.reh.ts
@@ -297,10 +297,15 @@ function packageTask(type: string, platf @@ -344,10 +344,15 @@ function packageTask(type: string, platf
const destination = path.join(BUILD_ROOT, destinationFolderName); const destination = path.join(BUILD_ROOT, destinationFolderName);
return () => { return () => {

View File

@@ -46,4 +46,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
+ linkProtectionTrustedDomains, + linkProtectionTrustedDomains,
}; };
const proposedApi = this._environmentService.args['enable-proposed-api']; if (!this._environmentService.isBuilt) {

View File

@@ -3,9 +3,6 @@ Serve webviews from the same origin
Normally webviews are served from vscode-webview.net but we would rather them be Normally webviews are served from vscode-webview.net but we would rather them be
self-hosted. self-hosted.
When doing this CSP will block resources (for example when viewing images) so
add 'self' to the CSP to fix that.
Additionally the service worker defaults to handling *all* requests made to the Additionally the service worker defaults to handling *all* requests made to the
current host but when self-hosting the webview this will end up including the current host but when self-hosting the webview this will end up including the
webview HTML itself which means these requests will fail since the communication webview HTML itself which means these requests will fail since the communication
@@ -20,16 +17,6 @@ webview host is separate by default but we serve on the same host).
To test, open a few types of webviews (images, markdown, extension details, etc). To test, open a few types of webviews (images, markdown, extension details, etc).
Make sure to update the hash. To do so:
1. run code-server
2. open any webview (i.e. preview Markdown)
3. see error in console and copy hash
That will test the hash change in pre/index.html
Double-check the console to make sure there are no console errors for the webWorkerExtensionHostIframe
which also requires a hash change.
parentOriginHash changes parentOriginHash changes
This fixes webviews from not working properly due to a change upstream. This fixes webviews from not working properly due to a change upstream.
@@ -54,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -380,6 +380,7 @@ export class WebClientServer { @@ -374,6 +374,7 @@ export class WebClientServer {
const workbenchWebConfiguration = { const workbenchWebConfiguration = {
remoteAuthority, remoteAuthority,
serverBasePath: basePath, serverBasePath: basePath,
@@ -66,15 +53,6 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
=================================================================== ===================================================================
--- 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
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html +++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
@@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-nXjtuhBilO++r8hfxl5VjEScSmdm07wDAk6jw228DgM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-A6/szVNdTzyi4hDa+9OLbzS8tSd2iUV4CqimLNWex2Y=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming -->
<meta name="viewport"
@@ -253,7 +253,7 @@ @@ -253,7 +253,7 @@
} }
@@ -101,17 +79,8 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html --- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html +++ code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
@@ -4,7 +4,7 @@ @@ -34,6 +34,13 @@
<meta http-equiv="Content-Security-Policy" content=" }
default-src 'none';
child-src 'self' data: blob:;
- script-src 'self' 'unsafe-eval' 'sha256-cl8ijlOzEe+0GRCQNJQu2k6nUQ0fAYNYIuuKEm72JDs=' https: http://localhost:* blob:;
+ script-src 'self' 'unsafe-eval' 'sha256-yhZXuB8LS6t73dvNg6rtLX8y4PHLnqRm5+6DdOGkOcw=' https: http://localhost:* blob:;
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
</head>
<body>
@@ -25,6 +25,13 @@
// validation not requested
return start(); return start();
} }
+ +

View File

@@ -1,9 +1,13 @@
import { logger } from "@coder/logger" import { logger } from "@coder/logger"
import type { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
import * as os from "os" import * as os from "os"
import * as path from "path" import * as path from "path"
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles { type PackageJson = {
version: string
commit: string
}
export function getPackageJson(relativePath: string): PackageJson {
let pkg = {} let pkg = {}
try { try {
pkg = require(relativePath) pkg = require(relativePath)
@@ -11,7 +15,7 @@ export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJso
logger.warn(error.message) logger.warn(error.message)
} }
return pkg return pkg as PackageJson
} }
export const rootPath = path.resolve(__dirname, "../..") export const rootPath = path.resolve(__dirname, "../..")