mirror of
https://github.com/coder/code-server.git
synced 2026-11-02 22:09:11 +01:00
Compare commits
25 Commits
87cac20790
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea7032040d | ||
|
|
68810a6bd6 | ||
|
|
ee31cdbe02 | ||
|
|
27808460b1 | ||
|
|
70fc911358 | ||
|
|
761b0d2a19 | ||
|
|
09012065c9 | ||
|
|
e999549684 | ||
|
|
9d0eee156e | ||
|
|
b87ae88bc6 | ||
|
|
89cba83cb4 | ||
|
|
b45f29491d | ||
|
|
4677c9d865 | ||
|
|
22ddf60dbc | ||
|
|
e777c1f963 | ||
|
|
279b5702aa | ||
|
|
27baccf843 | ||
|
|
8aab1b0d72 | ||
|
|
777c493a9b | ||
|
|
f07405cba3 | ||
|
|
c5fee2d2f9 | ||
|
|
83670e50c6 | ||
|
|
41cf6f7eaf | ||
|
|
78aad47ce6 | ||
|
|
8b41915d25 |
9
.github/workflows/release.yaml
vendored
9
.github/workflows/release.yaml
vendored
@@ -79,6 +79,9 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
with:
|
||||
submodules: true
|
||||
# When an update/ branch is merged, a release is automatically created
|
||||
# which requires secrets.
|
||||
allow-unsafe-pr-checkout: true
|
||||
- run: quilt push -a
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
||||
with:
|
||||
@@ -173,6 +176,9 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
with:
|
||||
submodules: true
|
||||
# When an update/ branch is merged, a release is automatically created
|
||||
# which requires secrets.
|
||||
allow-unsafe-pr-checkout: true
|
||||
- run: quilt push -a
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
||||
with:
|
||||
@@ -233,6 +239,9 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
with:
|
||||
submodules: true
|
||||
# When an update/ branch is merged, a release is automatically created
|
||||
# which requires secrets.
|
||||
allow-unsafe-pr-checkout: true
|
||||
|
||||
# quilt has no windows build. The patches are ordinary -p1 diffs
|
||||
# against the repository root, so git applies them in series order.
|
||||
|
||||
2
.github/workflows/security.yaml
vendored
2
.github/workflows/security.yaml
vendored
@@ -62,7 +62,7 @@ jobs:
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
|
||||
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
|
||||
with:
|
||||
sarif_file: "trivy-repo-results.sarif"
|
||||
|
||||
|
||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -58,6 +58,6 @@ jobs:
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@5595ccaf912efad79be6eef63a5619ff05969be3 # v4
|
||||
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
|
||||
with:
|
||||
sarif_file: "trivy-image-results.sarif"
|
||||
|
||||
@@ -1 +1 @@
|
||||
24.21.0
|
||||
24.22.1
|
||||
|
||||
71
CHANGELOG.md
71
CHANGELOG.md
@@ -22,6 +22,77 @@ Code v99.99.999
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [4.144.0](https://github.com/coder/code-server/releases/tag/v4.144.0) - 2026-10-29
|
||||
|
||||
Code v1.144.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.144.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- `--socket-fd` now works: the inherited socket is passed on to the process
|
||||
that listens, and the address is logged as `fd:<n>`. Previously code-server
|
||||
failed with `listen EEXIST` or `Server has no address`.
|
||||
- The cookie domain was not being set against the shared root host of proxy
|
||||
domains when proxy domains contained template variables like `{{port}}`,
|
||||
resulting in having to sign in multiple times per domain instead of only once
|
||||
as originally intended.
|
||||
- When doing the web socket origin check, if the host does not already contain a
|
||||
port, fall back to `X-Forwarded-Port`.
|
||||
- Fix default ports not matching in the web socket origin check (for example
|
||||
`https://coder.com` will now match `https://coder.com:443`).
|
||||
|
||||
## [4.143.1](https://github.com/coder/code-server/releases/tag/v4.143.1) - 2026-10-23
|
||||
|
||||
Code v1.143.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.143.1
|
||||
|
||||
## [4.141.1](https://github.com/coder/code-server/releases/tag/v4.141.1) - 2026-10-23
|
||||
|
||||
### Security
|
||||
|
||||
- Update bundled Node.js to 24.22.1 to fix a remote code execution bug in the
|
||||
Brotli decoder (CVE-2026-111497).
|
||||
- Reject compressed request bodies (`Content-Encoding: br`, `gzip`, or
|
||||
`deflate`) instead of decompressing them.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Boolean flags in the `--flag=false` form and in the config file now respect
|
||||
being set to false.
|
||||
|
||||
### Added
|
||||
|
||||
- Turkish locale.
|
||||
|
||||
### Changed
|
||||
|
||||
- Expand values from path options in the config file that start with a tilde.
|
||||
|
||||
## [4.141.0](https://github.com/coder/code-server/releases/tag/v4.141.0) - 2026-10-08
|
||||
|
||||
Code v1.141.0
|
||||
|
||||
### Added
|
||||
|
||||
- A new `--enable-remote-storage` flag can be used to make code-server persist
|
||||
workbench storage on the remote server instead of browser storage. Use this if
|
||||
you want to share storage between multiple devices.
|
||||
|
||||
### Fixed
|
||||
|
||||
- The Typescript extension was trying to load as a browser extension even though
|
||||
we build the remote server version, causing it to fail to activate.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.141.0
|
||||
|
||||
## [4.140.0](https://github.com/coder/code-server/releases/tag/v4.140.0) - 2026-10-02
|
||||
|
||||
Code v1.140.0
|
||||
|
||||
@@ -58,10 +58,17 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add the date, our name, links, enable telemetry (this just makes telemetry
|
||||
# available; telemetry can still be disabled by flag or setting), and
|
||||
# configure trusted extensions (since some, like github.copilot-chat, never
|
||||
# ask to be trusted and this is the only way to get auth working).
|
||||
# Modify the product.json:
|
||||
# - Add the date
|
||||
# - Set the code-server name.
|
||||
# - Add our links
|
||||
# - Enable telemetry (this just makes telemetry available; telemetry can still
|
||||
# be disabled by flag or setting)
|
||||
# - Configure trusted extensions (since some, like github.copilot-chat, never
|
||||
# ask to be trusted and this is the only way to get auth working).
|
||||
# - Make Typescript server plugins run in the workspace. We build the remote
|
||||
# server version, so there is no browser distribution, and this key is not
|
||||
# added automatically.
|
||||
#
|
||||
# This needs to be done before building as Code will read this file and embed
|
||||
# it into the client-side code.
|
||||
@@ -103,6 +110,9 @@ main() {
|
||||
],
|
||||
"aiConfig": {
|
||||
"ariaKey": "code-server"
|
||||
},
|
||||
"extensionPointExtensionKind": {
|
||||
"typescriptServerPlugins": ["workspace"]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
@@ -101,6 +101,14 @@ function update_csp() {
|
||||
echo "Calculated hash as $hash"
|
||||
# Use octothorpe as a delimiter since the hash may contain a slash.
|
||||
sed -i.bak "s#'sha256-[^']\+'#'sha256-$hash'#" "$file"
|
||||
# For the web worker extension host iframe, there is a matching sha in the
|
||||
# web server.
|
||||
if [[ $file == */webWorkerExtensionHostIframe.html ]] ; then
|
||||
quilt add ./lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
sed -i.bak \
|
||||
"s#webWorkerExtensionHostIframeScriptSHA = 'sha256-[^']\+'#webWorkerExtensionHostIframeScriptSHA = 'sha256-$hash'#" \
|
||||
./lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
fi
|
||||
done
|
||||
|
||||
quilt refresh
|
||||
|
||||
@@ -15,9 +15,9 @@ type: application
|
||||
# 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.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 3.55.0
|
||||
version: 3.58.0
|
||||
|
||||
# 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
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 4.140.0
|
||||
appVersion: 4.144.0
|
||||
|
||||
@@ -4,8 +4,13 @@ metadata:
|
||||
name: {{ include "code-server.fullname" . }}
|
||||
labels:
|
||||
{{- include "code-server.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
{{- with .Values.service.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
loadBalancerClass: {{ .Values.service.loadBalancerClass }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.140.0'
|
||||
tag: '4.144.0'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
@@ -48,6 +48,8 @@ priorityClassName: ""
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8080
|
||||
loadBalancerClass: null
|
||||
annotations: {}
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
|
||||
Submodule lib/vscode updated: 07f806f999...2c33b50b16
194
package-lock.json
generated
194
package-lock.json
generated
@@ -269,9 +269,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint/eslintrc/node_modules/js-yaml": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
|
||||
"integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
|
||||
"integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -857,17 +857,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.71.0.tgz",
|
||||
"integrity": "sha512-pqcS9c1HxZTHt7End4nXqd0s5lJrrFzrgCkKFJrsbUnaL6M3+6oBFZaslg6Gjsl3argl2DDRFROnXARaZ2e4Nw==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.69.0.tgz",
|
||||
"integrity": "sha512-t5jQTKPIgVW1PE6dR6H6Qz5gm8zjMlX5/2gRaOGd9eO6V7J+tQc6iWKukEe7dY8u9HyYasQ0yfF0/FSSTEO2gA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.71.0",
|
||||
"@typescript-eslint/type-utils": "8.71.0",
|
||||
"@typescript-eslint/utils": "8.71.0",
|
||||
"@typescript-eslint/visitor-keys": "8.71.0",
|
||||
"@typescript-eslint/scope-manager": "8.69.0",
|
||||
"@typescript-eslint/type-utils": "8.69.0",
|
||||
"@typescript-eslint/utils": "8.69.0",
|
||||
"@typescript-eslint/visitor-keys": "8.69.0",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -880,15 +880,15 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.71.0",
|
||||
"@typescript-eslint/parser": "^8.69.0",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.11.tgz",
|
||||
"integrity": "sha512-YChdK5txDjwGUvgR7oCJcLGkwi3LDh8Zx8tS7ndYciLEg/oOCL26VUBSUEtgS7EjiybcBqFxh5j0rAdDX7/bbg==",
|
||||
"version": "7.0.8",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.8.tgz",
|
||||
"integrity": "sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -896,16 +896,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.71.0.tgz",
|
||||
"integrity": "sha512-CG4nPk1f2zc8yw4pALqHsFYH2hdo+h1T9daSp21+Hnxi9LOE3GT9hAfTKJCBXVNM2GmYs1eMEP615wPoeOgk3A==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.69.0.tgz",
|
||||
"integrity": "sha512-l4b0DhWioGg6Gt2ebGlvfkFMOjRsauxtsnDRwUSRX1qHq3HdTfQHV8wW9zEXeciai6HfeaKOedQn2Zoofx3WBw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.71.0",
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/typescript-estree": "8.71.0",
|
||||
"@typescript-eslint/visitor-keys": "8.71.0",
|
||||
"@typescript-eslint/scope-manager": "8.69.0",
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"@typescript-eslint/typescript-estree": "8.69.0",
|
||||
"@typescript-eslint/visitor-keys": "8.69.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -921,14 +921,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.0.tgz",
|
||||
"integrity": "sha512-aABjw5rjBacYONVPaPiWOCjJu0vEF4a25iQuodlmQYL1trtLZ0X/y+2Vzl3BKI1odM4LnwLE1oUDXYp1wzx1TQ==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.69.0.tgz",
|
||||
"integrity": "sha512-yi4obFrHMmnsesWehHbkg9zMA7Jt8cXT+mKM08G999pH1yT6nqgsHx7MYm0uY1wAj8CqiBXYRJ7WAT0QdQHQXg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.71.0",
|
||||
"@typescript-eslint/types": "^8.71.0",
|
||||
"@typescript-eslint/tsconfig-utils": "^8.69.0",
|
||||
"@typescript-eslint/types": "^8.69.0",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -943,14 +943,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.0.tgz",
|
||||
"integrity": "sha512-gWF0BhUcnjZxSpLE8ngS/59n2SB0J3YqRxvX1+2aoRJk9hNtHSLOV+TcarFiOr5ipXm3yc1QrI4c9YZc8zyCxw==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.69.0.tgz",
|
||||
"integrity": "sha512-ewfspqWvSxKSOaplqAUNbaSFO0eB6w1EtQ+esfYFRm3614Ty4uNtExkcbgd6nWsXphbqKyf9ZYdbZdv2xEoWEQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/visitor-keys": "8.71.0"
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"@typescript-eslint/visitor-keys": "8.69.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -961,9 +961,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.0.tgz",
|
||||
"integrity": "sha512-Z1UlWHADEK2Mlb9NpWfDeSjqoZ5EyrOv4R3eQpbkzqn/EwaIdOpXXupEA1+0ZIOSJSZZDBHG0BrQyN8zUG6Pwg==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.69.0.tgz",
|
||||
"integrity": "sha512-xNqK7YTDZsLniQMV/4rpFR8Z5JlqeRvVjuG1YgF/mdPVH84HSD19L8CczMA0qg2RfwEV231GHH3VnToJDo4MfQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -978,15 +978,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.71.0.tgz",
|
||||
"integrity": "sha512-i8uO1qbdxeKgRnS5sCRt6On3/nfo2d2DwQe3Yvjx543zLy7r8ySqRuPPiIIXAhS03U0v5NfAFx+rUgxFzKKwNw==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.69.0.tgz",
|
||||
"integrity": "sha512-ZfoJAVg3JZndQEpEl9petVlxau3lRuElc4HRMuAlLCf8to04/iHz692RUSNmXKDjEuJmIL+KZ2/BsOcBc16dsA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/typescript-estree": "8.71.0",
|
||||
"@typescript-eslint/utils": "8.71.0",
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"@typescript-eslint/typescript-estree": "8.69.0",
|
||||
"@typescript-eslint/utils": "8.69.0",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -1003,9 +1003,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.0.tgz",
|
||||
"integrity": "sha512-cJ4OoxPGWvFnBTnSZyaU+qJzGTqPTGJY+gDchj6cRyLRdmIdt4rcsE4twj+zPfrNiWuVi38wijHzShL++Z9atQ==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.69.0.tgz",
|
||||
"integrity": "sha512-K3VrubUPhlo9VDBS6QdI8YB5j7ClpqLRdefcz6PFrhnwicehBweqQ9Evhl4l+FYz0HdDmMqIiSX0aldGRYtDCA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1017,16 +1017,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.0.tgz",
|
||||
"integrity": "sha512-PEEF4G5sLLWAS5BpPrUvms4ySZkiBQQZM4z+3ReI46axK5Vqr/vXBQatJQIZZOYdGyPUAKTtsrWzpqKuU+3DEw==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.69.0.tgz",
|
||||
"integrity": "sha512-AdFkgqck3Vudb/kWnxlyafU/4aBhHrbQ9locP2N4psXTy5mOBg0SHJumnLvx7r6g1gV4DKvUFwV2nJZBoqOD8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.71.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.71.0",
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/visitor-keys": "8.71.0",
|
||||
"@typescript-eslint/project-service": "8.69.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.69.0",
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"@typescript-eslint/visitor-keys": "8.69.0",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
@@ -1084,16 +1084,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.0.tgz",
|
||||
"integrity": "sha512-pKR/tEMVrXZG23UFKUn5BQf3zfmfk7KQceI2cGzywZ5nxM5Eu3hEJU1utjWzydtzBbcJAQhHN8iPCxobHpPcZQ==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.69.0.tgz",
|
||||
"integrity": "sha512-tUbx60BBqQa31kXF5MCsOOLL5E/WzUuxIn7YpAvq+eaUlqvk8/NXnXMBNAdLCr0icjkzem7iUA5QqWHe/hJ1aw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.71.0",
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/typescript-estree": "8.71.0"
|
||||
"@typescript-eslint/scope-manager": "8.69.0",
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"@typescript-eslint/typescript-estree": "8.69.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -1108,13 +1108,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.0.tgz",
|
||||
"integrity": "sha512-8eQ9R218XORK+KLosnf4bu/QsUXvUyVwTbArg7/0NMB1Pu87OJKvj4nhFblkYE8gQV73mW1dx1ptlPCkwRGa7A==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.69.0.tgz",
|
||||
"integrity": "sha512-+rmdgPA+EXkNgKYvHvFfhrs35utXbwaC5PGpDquSXcoXQDKUA5UjV0LmTucG/4JXkM31BTu4TilHtrN8IVBe8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.71.0",
|
||||
"@typescript-eslint/types": "8.69.0",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -1726,27 +1726,27 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/basic-ftp": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.3.1.tgz",
|
||||
"integrity": "sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==",
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-6.2.3.tgz",
|
||||
"integrity": "sha512-T7GYtQ2eKJUN5YORG7A8u2WfB9JMN0a4/wl3MI64qq2qTRfa3FXzoNq0DDojZDkDyStcL+TkfKsz4JHEZx5kGQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
||||
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
|
||||
"integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^2.0.0",
|
||||
"content-type": "^2.1.0",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.1",
|
||||
"iconv-lite": "^0.7.2",
|
||||
"iconv-lite": "^0.7.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.15.2",
|
||||
"qs": "^6.16.1",
|
||||
"raw-body": "^3.0.2",
|
||||
"type-is": "^2.1.0"
|
||||
},
|
||||
@@ -1759,9 +1759,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/content-type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",
|
||||
"integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
@@ -1779,9 +1779,9 @@
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.18",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
|
||||
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
|
||||
"version": "1.1.21",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz",
|
||||
"integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -3245,9 +3245,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||
"version": "1.16.2",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.2.tgz",
|
||||
"integrity": "sha512-/kVP2U8z596Ia0gwFrwyIeo74ta5aVmSeU1FfAUMAmcEP5EP7zydmag3SLiN64NaRKef3lxsq7i/g7ltJQDGow==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -3703,9 +3703,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
|
||||
"integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
|
||||
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
@@ -3777,9 +3777,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ip-address": {
|
||||
"version": "10.7.2",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",
|
||||
"integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",
|
||||
"version": "10.7.5",
|
||||
"resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.5.tgz",
|
||||
"integrity": "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
@@ -4270,9 +4270,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.1.tgz",
|
||||
"integrity": "sha512-28R/k+NAjeuf7+CKlTxWZVExJGwVVLwY06DgEnOMz2gEpfNkDcD7QvyiVPT0xy0XXhU8vHsd4Ot42OOPdJG7dQ==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.3.tgz",
|
||||
"integrity": "sha512-yzzNtgczwgoVHNigCyKTXcQJU4Y8t/ikU4UxXW0BvrLfHTGWZhsNcOT2s/a7vn81/4KqVnNmHjaUEPlvWnNwVw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -5366,9 +5366,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.16.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
|
||||
"integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
|
||||
"version": "6.16.1",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz",
|
||||
"integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.1",
|
||||
@@ -6373,16 +6373,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript-eslint": {
|
||||
"version": "8.71.0",
|
||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.71.0.tgz",
|
||||
"integrity": "sha512-fBdHYiqQ14RW6mOMXD14Svn82ZsCYAoQSzGRzyEjR59S5A2Krh/l7fGTOQ7iCr8gGy/mHVXtEF7s5fgjEdV0Pw==",
|
||||
"version": "8.69.0",
|
||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.69.0.tgz",
|
||||
"integrity": "sha512-B3MltX0VqjUBNEe3b3sSuiRbfa6XrfHFtBiPamjT5AsW/dfq+y+bc0wyuS9DxAS1LyzCxRp2+rxzpLUvqM2BvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "8.71.0",
|
||||
"@typescript-eslint/parser": "8.71.0",
|
||||
"@typescript-eslint/typescript-estree": "8.71.0",
|
||||
"@typescript-eslint/utils": "8.71.0"
|
||||
"@typescript-eslint/eslint-plugin": "8.69.0",
|
||||
"@typescript-eslint/parser": "8.69.0",
|
||||
"@typescript-eslint/typescript-estree": "8.69.0",
|
||||
"@typescript-eslint/utils": "8.69.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
"resolutions": {
|
||||
"@types/node": "24.x"
|
||||
},
|
||||
"overrides": {
|
||||
"basic-ftp": "^6.2.1"
|
||||
},
|
||||
"bin": {
|
||||
"code-server": "out/node/entry.js"
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ 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
|
||||
@@ -256,7 +256,9 @@ class RemoteAuthoritiesImpl {
|
||||
@@ -262,7 +262,9 @@ class RemoteAuthoritiesImpl {
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
@@ -48,8 +48,8 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||
|
||||
</head>
|
||||
@@ -41,7 +41,7 @@
|
||||
<!-- Startup fallback: shown only if the scripts below never run, e.g. because a proxy,
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<script nonce="{{WORKBENCH_SCRIPT_NONCE}}">
|
||||
@@ -85,8 +85,8 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||
|
||||
</head>
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- Startup fallback: shown only if the scripts below never run, e.g. because a proxy,
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<script nonce="{{WORKBENCH_SCRIPT_NONCE}}">
|
||||
@@ -281,8 +281,8 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
-
|
||||
(function () {
|
||||
|
||||
// Find config by checking for DOM
|
||||
@@ -610,8 +600,8 @@ function readCookie(name: string): strin
|
||||
// This script running at all means the page scripts were not blocked or rewritten.
|
||||
@@ -614,8 +604,8 @@ function readCookie(name: string): strin
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ Index: code-server/lib/vscode/build/gulpfile.extensions.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/gulpfile.extensions.ts
|
||||
+++ code-server/lib/vscode/build/gulpfile.extensions.ts
|
||||
@@ -291,6 +291,29 @@ export const compileCopilotExtensionBuil
|
||||
@@ -283,6 +283,29 @@ export const compileCopilotExtensionBuil
|
||||
task.task(compileCopilotExtensionBuildTask);
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
- content="default-src 'none'; script-src 'sha256-FFQoOVVa2tOE3uqUvirwaMNT20TZmrHcL2aaOjJ8BUo=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-24QqbpzqcqSyIGvg/ZwFRy5pPlhmVBa8CkUREEIUnBw=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
- content="default-src 'none'; script-src 'sha256-Q3Tfcw0dGu/YD4dGBrRqBeOnmRMAH8HbKxArK4YSXBc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-BmcTt6YZr75RujSQ3gF/UQL77e1RrOx62jNeikpwtxc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport"
|
||||
@@ -24,3 +24,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
|
||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||
</head>
|
||||
<body>
|
||||
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
|
||||
@@ -114,7 +114,7 @@ const APP_ROOT = dirname(FileAccess.asFi
|
||||
const STATIC_PATH = `/static`;
|
||||
const CALLBACK_PATH = `/callback`;
|
||||
const WEB_EXTENSION_PATH = `/web-extension-resource`;
|
||||
-const webWorkerExtensionHostIframeScriptSHA = 'sha256-daEgfo2VIXpx2Np71KqCCbkeQwv+68vPrx54XRcbdcs=';
|
||||
+const webWorkerExtensionHostIframeScriptSHA = 'sha256-gfjiOVjAlxqrivZAfTq2d83mOaz0fnAxbGaFpj5IjD8=';
|
||||
|
||||
/**
|
||||
* Substitutes the `{{...}}` placeholders of a workbench template. Placeholders must only ever
|
||||
|
||||
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
@@ -343,6 +343,10 @@ export class Extension implements IExten
|
||||
@@ -344,6 +344,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable' && !this.productService.builtInExtensionsEnabledWithAutoUpdates?.some(id => id.toLowerCase() === this.identifier.id.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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 { createRandomIPCHandle } from '../../base/parts/ipc/node/ipc.net.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
@@ -418,6 +418,9 @@ export async function setupServerService
|
||||
@@ -444,6 +444,9 @@ export async function setupServerService
|
||||
|
||||
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
||||
|
||||
@@ -272,7 +272,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
@@ -475,9 +475,6 @@ export class InstallAction extends Exten
|
||||
@@ -479,9 +479,6 @@ export class InstallAction extends Exten
|
||||
if (this.extension.isBuiltin) {
|
||||
return;
|
||||
}
|
||||
@@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||
return;
|
||||
}
|
||||
@@ -782,7 +779,7 @@ export abstract class InstallInOtherServ
|
||||
@@ -786,7 +783,7 @@ export abstract class InstallInOtherServ
|
||||
}
|
||||
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
@@ -291,7 +291,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
// Prefers to run on UI
|
||||
@@ -2281,17 +2278,6 @@ export class SetLanguageAction extends E
|
||||
@@ -2285,17 +2282,6 @@ export class SetLanguageAction extends E
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = SetLanguageAction.DisabledClass;
|
||||
@@ -309,7 +309,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
@@ -2308,7 +2294,6 @@ export class ClearLanguageAction extends
|
||||
@@ -2312,7 +2298,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
@@ -317,7 +317,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
@ILocaleService private readonly localeService: ILocaleService,
|
||||
) {
|
||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||
@@ -2318,17 +2303,6 @@ export class ClearLanguageAction extends
|
||||
@@ -2322,17 +2307,6 @@ export class ClearLanguageAction extends
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = ClearLanguageAction.DisabledClass;
|
||||
|
||||
@@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||
@@ -65,6 +65,7 @@ import { timeout } from '../../../../../
|
||||
@@ -62,6 +62,7 @@ import { defaultCountBadgeStyles } from
|
||||
import { IFilesConfigurationService } from '../../../../services/filesConfiguration/common/filesConfigurationService.js';
|
||||
import { mainWindow } from '../../../../../base/browser/window.js';
|
||||
import { IExplorerFileContribution, explorerFileContribRegistry } from '../explorerFileContrib.js';
|
||||
@@ -290,7 +290,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
||||
import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js';
|
||||
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
||||
@@ -1587,7 +1588,8 @@ export class FileDragAndDrop implements
|
||||
@@ -1515,7 +1516,8 @@ export class FileDragAndDrop implements
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
||||
@@ -300,7 +300,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
) {
|
||||
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
||||
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
||||
@@ -1812,15 +1814,17 @@ export class FileDragAndDrop implements
|
||||
@@ -1740,15 +1742,17 @@ export class FileDragAndDrop implements
|
||||
|
||||
// External file DND (Import/Upload file)
|
||||
if (data instanceof NativeDragAndDropData) {
|
||||
|
||||
@@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
||||
import { status } from '../../../../base/browser/ui/aria/aria.js';
|
||||
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
||||
@@ -55,7 +55,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||
@@ -56,7 +56,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
||||
import { EditorPane } from '../../../browser/parts/editor/editorPane.js';
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||
import './gettingStartedColors.js';
|
||||
@@ -930,6 +930,72 @@ export class GettingStartedPage extends
|
||||
@@ -944,6 +944,72 @@ export class GettingStartedPage extends
|
||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||
);
|
||||
|
||||
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||
|
||||
@@ -980,6 +1046,9 @@ export class GettingStartedPage extends
|
||||
@@ -1000,6 +1066,9 @@ export class GettingStartedPage extends
|
||||
recentList.setLimit(5);
|
||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||
}
|
||||
@@ -115,7 +115,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||
@@ -60,6 +60,15 @@
|
||||
@@ -63,6 +63,15 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
-delete process.env[agentHostBridgeConnectionTokenEnvironmentVariable];
|
||||
-
|
||||
-const REMOTE_DATA_FOLDER = args['server-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote');
|
||||
-const USER_DATA_PATH = join(REMOTE_DATA_FOLDER, 'data');
|
||||
-const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data');
|
||||
-const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
|
||||
-const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
|
||||
-const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
|
||||
@@ -169,7 +169,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/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl
|
||||
@@ -65,6 +65,7 @@ import { IOpenerService } from '../../pl
|
||||
import { mixin, safeStringify } from '../../base/common/objects.js';
|
||||
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
||||
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
||||
@@ -177,7 +177,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
import { IProgressService } from '../../platform/progress/common/progress.js';
|
||||
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
||||
import { dirname, joinPath } from '../../base/common/resources.js';
|
||||
@@ -140,6 +141,9 @@ export class BrowserMain extends Disposa
|
||||
@@ -141,6 +142,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
|
||||
@@ -225,7 +225,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||
|
||||
</head>
|
||||
<!-- Startup fallback: shown only if the scripts below never run, e.g. because a proxy,
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -251,7 +251,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||
|
||||
</head>
|
||||
<!-- Startup fallback: shown only if the scripts below never run, e.g. because a proxy,
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
|
||||
@@ -77,7 +77,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
||||
import { TargetPlatform } from '../../extensions/common/extensions.js';
|
||||
import { ExtensionGalleryResourceType, getExtensionGalleryManifestResourceUri, IExtensionGalleryManifest, IExtensionGalleryManifestService } from '../../extensionManagement/common/extensionGalleryManifest.js';
|
||||
import { ILogService } from '../../log/common/log.js';
|
||||
@@ -163,9 +162,9 @@ export abstract class AbstractExtensionR
|
||||
@@ -167,9 +166,9 @@ export abstract class AbstractExtensionR
|
||||
}
|
||||
|
||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
||||
|
||||
@@ -10,7 +10,7 @@ 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/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
@@ -321,6 +321,10 @@ function extensionDescriptionArrayToMap(
|
||||
@@ -324,6 +324,10 @@ function extensionDescriptionArrayToMap(
|
||||
}
|
||||
|
||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||
|
||||
@@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||
|
||||
@@ -612,6 +613,44 @@ class WorkspaceProvider implements IWork
|
||||
@@ -616,6 +617,44 @@ class WorkspaceProvider implements IWork
|
||||
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
||||
workspaceProvider: WorkspaceProvider.create(config),
|
||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
||||
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExpl
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||
@@ -99,8 +99,8 @@ export class ForwardedPortsView extends
|
||||
@@ -100,8 +100,8 @@ export class ForwardedPortsView extends
|
||||
private async enableForwardedPortsFeatures() {
|
||||
this.contextKeyListener.clear();
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@ Index: code-server/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
@@ -139,8 +139,13 @@ export class BaseSecretStorageService ex
|
||||
@@ -144,8 +144,13 @@ export class BaseSecretStorageService ex
|
||||
return await readEncryptedSecret(
|
||||
key,
|
||||
(fullKey) => this.getValueFromStorage(key, fullKey, storageService),
|
||||
(fullKey) => this.getValueFromStorage(key, fullKey, storageService),
|
||||
- // If the storage service is in-memory, we don't need to decrypt
|
||||
- this._type === 'in-memory' ? (v) => Promise.resolve(v) : (v) => this._encryptionService.decrypt(v),
|
||||
+ // Don't decrypt if storage is in-memory or if encryption service is not available
|
||||
@@ -19,10 +19,10 @@ Index: code-server/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
this._logService,
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -160,8 +165,13 @@ export class BaseSecretStorageService ex
|
||||
@@ -168,8 +173,13 @@ export class BaseSecretStorageService ex
|
||||
key,
|
||||
value,
|
||||
(fullKey, encrypted) => this.setValueInStorage(key, fullKey, encrypted, storageService),
|
||||
(fullKey, encrypted) => this.setValueInStorage(key, fullKey, encrypted, storageService),
|
||||
- // If the storage service is in-memory, we don't need to encrypt
|
||||
- this._type === 'in-memory' ? (v) => Promise.resolve(v) : (v) => this._encryptionService.encrypt(v),
|
||||
+ // Don't encrypt if storage is in-memory or if encryption service is not available
|
||||
@@ -35,7 +35,7 @@ Index: code-server/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
this._logService,
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -194,8 +204,9 @@ export class BaseSecretStorageService ex
|
||||
@@ -224,8 +234,9 @@ export class BaseSecretStorageService ex
|
||||
|
||||
private async initialize(): Promise<IStorageService> {
|
||||
let storageService;
|
||||
@@ -47,7 +47,7 @@ Index: code-server/lib/vscode/src/vs/platform/secrets/common/secrets.ts
|
||||
this._type = 'persisted';
|
||||
storageService = this._storageService;
|
||||
} else {
|
||||
@@ -203,7 +214,7 @@ export class BaseSecretStorageService ex
|
||||
@@ -233,7 +244,7 @@ export class BaseSecretStorageService ex
|
||||
if (this._type === 'in-memory') {
|
||||
return this._storageService;
|
||||
}
|
||||
@@ -77,10 +77,14 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -625,2 +625,2 @@
|
||||
@@ -655,8 +655,8 @@ class WorkspaceProvider implements IWork
|
||||
})
|
||||
}
|
||||
},
|
||||
- secretStorageProvider: config.remoteAuthority && !secretStorageKeyPath
|
||||
- ? undefined /* with a remote without embedder-preferred storage, store on the remote */
|
||||
+ secretStorageProvider: config.remoteStorageEnabled || (config.remoteAuthority && !secretStorageKeyPath)
|
||||
+ ? undefined /* with remote storage enabled, or without embedder-prefered storage, store on the remote */
|
||||
: new LocalStorageSecretStorageProvider(secretStorageCrypto),
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
Reuse VS Code's Electron storage service for remote persistence
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/storage/electron-main/storageMainService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/storage/electron-main/storageMainService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/storage/electron-main/storageMainService.ts
|
||||
@@ -14 +14,6 @@
|
||||
@@ -11,7 +11,12 @@ import { IStorage } from '../../../base/
|
||||
import { INativeEnvironmentService } from '../../environment/common/environment.js';
|
||||
import { IFileService } from '../../files/common/files.js';
|
||||
import { createDecorator } from '../../instantiation/common/instantiation.js';
|
||||
-import { ILifecycleMainService, LifecycleMainPhase, ShutdownReason } from '../../lifecycle/electron-main/lifecycleMainService.js';
|
||||
+import type { ILifecycleMainService, ShutdownReason } from '../../lifecycle/electron-main/lifecycleMainService.js';
|
||||
+
|
||||
@@ -10,44 +15,110 @@ Reuse VS Code's Electron storage service for remote persistence
|
||||
+// that module imports Electron, which is not present in the code-server server image.
|
||||
+const LIFECYCLE_MAIN_PHASE_AFTER_WINDOW_OPEN = 3;
|
||||
+const SHUTDOWN_REASON_KILL = 2;
|
||||
@@ -101 +101 @@
|
||||
import { ILogService } from '../../log/common/log.js';
|
||||
import { AbstractStorageService, isProfileUsingDefaultStorage, IStorageService, StorageScope, StorageTarget } from '../common/storage.js';
|
||||
import { ApplicationStorageMain, ApplicationSharedStorageMain, ProfileStorageMain, InMemoryStorageMain, IStorageMain, IStorageMainOptions, WorkspaceStorageMain, IStorageChangeEvent } from './storageMain.js';
|
||||
@@ -92,7 +97,7 @@ export class StorageMainService extends
|
||||
@ILogService private readonly logService: ILogService,
|
||||
@INativeEnvironmentService private readonly environmentService: INativeEnvironmentService,
|
||||
@IUserDataProfilesMainService private readonly userDataProfilesService: IUserDataProfilesMainService,
|
||||
- @ILifecycleMainService private readonly lifecycleMainService: ILifecycleMainService,
|
||||
+ private readonly lifecycleMainService: ILifecycleMainService,
|
||||
@@ -117 +117 @@
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
|
||||
) {
|
||||
@@ -114,7 +119,7 @@ export class StorageMainService extends
|
||||
|
||||
// Application Storage: Warmup when any window opens
|
||||
(async () => {
|
||||
- await this.lifecycleMainService.when(LifecycleMainPhase.AfterWindowOpen);
|
||||
+ await this.lifecycleMainService.when(LIFECYCLE_MAIN_PHASE_AFTER_WINDOW_OPEN);
|
||||
@@ -256 +256 @@
|
||||
|
||||
this.applicationStorage.init();
|
||||
this.applicationSharedStorage.init();
|
||||
@@ -253,7 +258,7 @@ export class StorageMainService extends
|
||||
}
|
||||
|
||||
private createProfileStorage(profile: IUserDataProfile): IStorageMain {
|
||||
- if (this.shutdownReason === ShutdownReason.KILL) {
|
||||
+ if (this.shutdownReason === SHUTDOWN_REASON_KILL) {
|
||||
@@ -295 +295 @@
|
||||
|
||||
// Workaround for native crashes that we see when
|
||||
// SQLite DBs are being created even after shutdown
|
||||
@@ -292,7 +297,7 @@ export class StorageMainService extends
|
||||
}
|
||||
|
||||
private createWorkspaceStorage(workspace: IAnyWorkspaceIdentifier): IStorageMain {
|
||||
- if (this.shutdownReason === ShutdownReason.KILL) {
|
||||
+ if (this.shutdownReason === SHUTDOWN_REASON_KILL) {
|
||||
|
||||
|
||||
// Workaround for native crashes that we see when
|
||||
// SQLite DBs are being created even after shutdown
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/storage/electron-browser/storageService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/storage/electron-browser/storageService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/storage/electron-browser/storageService.ts
|
||||
@@ -6 +6 @@
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
-import { IMainProcessService } from '../../../../platform/ipc/common/mainProcessService.js';
|
||||
+import { IRemoteService } from '../../../../platform/ipc/common/services.js';
|
||||
@@ -22 +22 @@
|
||||
import { IStorage, Storage, MigratingStorage } from '../../../../base/parts/storage/common/storage.js';
|
||||
import { RemoteStorageService } from '../../../../platform/storage/common/storageService.js';
|
||||
import { FallbackApplicationStorageDatabaseClient, ApplicationSharedStorageDatabaseClient } from '../../../../platform/storage/common/storageIpc.js';
|
||||
@@ -19,10 +19,10 @@ export class NativeWorkbenchStorageServi
|
||||
workspace: IAnyWorkspaceIdentifier | undefined,
|
||||
private readonly userDataProfileService: IUserDataProfileService,
|
||||
userDataProfilesService: IUserDataProfilesService,
|
||||
- mainProcessService: IMainProcessService,
|
||||
+ remoteService: Pick<IRemoteService, 'getChannel'>,
|
||||
@@ -25 +25 @@
|
||||
private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService,
|
||||
) {
|
||||
- super(workspace, { currentProfile: userDataProfileService.currentProfile, defaultProfile: userDataProfilesService.defaultProfile }, mainProcessService, workbenchEnvironmentService);
|
||||
+ super(workspace, { currentProfile: userDataProfileService.currentProfile, defaultProfile: userDataProfilesService.defaultProfile }, remoteService as IRemoteService, workbenchEnvironmentService);
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -68,0 +69 @@
|
||||
@@ -66,6 +66,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-experiments': OPTIONS['disable-experiments'],
|
||||
'disable-workspace-trust': OPTIONS['disable-workspace-trust'],
|
||||
'file-watcher-polling': { type: 'string', deprecates: ['fileWatcherPolling'] },
|
||||
+ 'enable-remote-storage': { type: 'boolean', cat: 'o', description: nls.localize('enable-remote-storage', 'Persist browser storage (settings, state, etc.) on the server instead of browser IndexedDB. Enables state portability across browsers/devices.') },
|
||||
@@ -214,0 +216 @@
|
||||
'log': OPTIONS['log'],
|
||||
'logsPath': OPTIONS['logsPath'],
|
||||
'force-disable-user-env': OPTIONS['force-disable-user-env'],
|
||||
@@ -212,6 +213,7 @@ export interface ServerParsedArgs {
|
||||
'logsPath'?: string;
|
||||
|
||||
'force-disable-user-env'?: boolean;
|
||||
+ 'enable-remote-storage'?: boolean;
|
||||
'enable-proposed-api'?: string[];
|
||||
|
||||
/* ----- vs code web options ----- */
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -107,0 +108,4 @@
|
||||
@@ -106,6 +106,10 @@ import { McpManagementChannel } from '..
|
||||
import { AllowedMcpServersService } from '../../platform/mcp/common/allowedMcpServersService.js';
|
||||
import { IMcpGalleryManifestService } from '../../platform/mcp/common/mcpGalleryManifest.js';
|
||||
import { McpGalleryManifestIPCService } from '../../platform/mcp/common/mcpGalleryManifestServiceIpc.js';
|
||||
+import { StorageDatabaseChannel } from '../../platform/storage/electron-main/storageIpc.js';
|
||||
+import { StorageMainService } from '../../platform/storage/electron-main/storageMainService.js';
|
||||
+import type { ILifecycleMainService } from '../../platform/lifecycle/electron-main/lifecycleMainService.js';
|
||||
+import type { IUserDataProfilesMainService } from '../../platform/userDataProfile/electron-main/userDataProfile.js';
|
||||
@@ -240,0 +245,15 @@
|
||||
import { SANDBOX_HELPER_CHANNEL_NAME, SandboxHelperChannel } from '../../platform/sandbox/common/sandboxHelperIpc.js';
|
||||
import { SandboxHelperService } from '../../platform/sandbox/node/sandboxHelper.js';
|
||||
|
||||
@@ -244,6 +248,21 @@ export async function setupServerService
|
||||
services.set(IMcpGatewayService, new SyncDescriptor(McpGatewayService));
|
||||
|
||||
const instantiationService: IInstantiationService = new InstantiationService(services);
|
||||
+ // Reuse the Electron storage service on the remote. The server has no
|
||||
+ // windows, so its lifecycle is always ready and never loads a window.
|
||||
+ const storageMainService = disposables.add(new StorageMainService(
|
||||
@@ -63,7 +134,10 @@ Reuse VS Code's Electron storage service for remote persistence
|
||||
+ uriIdentityService,
|
||||
+ ));
|
||||
+
|
||||
@@ -419,6 +439,7 @@ export async function setupServerServices(connectionToken: ServerConnectionToken
|
||||
services.set(ILanguagePackService, instantiationService.createInstance(NativeLanguagePackService));
|
||||
|
||||
const ptyHostStarter = instantiationService.createInstance(
|
||||
@@ -446,6 +465,7 @@ export async function setupServerService
|
||||
|
||||
const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService), disposables);
|
||||
socketServer.registerChannel('languagePacks', languagePackChannel);
|
||||
@@ -71,28 +145,61 @@ Reuse VS Code's Electron storage service for remote persistence
|
||||
|
||||
// clean up extensions folder
|
||||
remoteExtensionsScanner.whenExtensionsReady().then(() => extensionManagementService.cleanUp());
|
||||
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
|
||||
@@ -411 +411,2 @@
|
||||
@@ -451,7 +451,8 @@ export class WebClientServer {
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration,
|
||||
- callbackRoute: callbackRoute
|
||||
+ callbackRoute: callbackRoute,
|
||||
+ remoteStorageEnabled: this._environmentService.args['enable-remote-storage'] ? true : undefined
|
||||
};
|
||||
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
@@ -413,0 +414,5 @@
|
||||
@@ -411,6 +411,11 @@ export interface IWorkbenchConstructionO
|
||||
readonly authenticationProviders?: readonly IAuthenticationProvider[];
|
||||
|
||||
//#endregion
|
||||
+ /**
|
||||
+ * Persist workbench storage on the remote server instead of browser IndexedDB.
|
||||
+ */
|
||||
+ readonly remoteStorageEnabled?: boolean;
|
||||
+
|
||||
|
||||
//#region Development options
|
||||
|
||||
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/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -35,0 +36 @@
|
||||
@@ -34,6 +34,7 @@ import { ISignService } from '../../plat
|
||||
import { SignService } from '../../platform/sign/browser/signService.js';
|
||||
import { IWorkbenchConstructionOptions, IWorkbench, IWorkspace, ITunnel } from './web.api.js';
|
||||
import { BrowserStorageService } from '../services/storage/browser/storageService.js';
|
||||
+import { NativeWorkbenchStorageService } from '../services/storage/electron-browser/storageService.js';
|
||||
@@ -479 +480 @@
|
||||
import { IStorageService } from '../../platform/storage/common/storage.js';
|
||||
import { toLocalISOString } from '../../base/common/date.js';
|
||||
import { isWorkspaceToOpen, isFolderToOpen } from '../../platform/window/common/window.js';
|
||||
@@ -488,7 +489,7 @@ export class BrowserMain extends Disposa
|
||||
serviceCollection.set(IWorkbenchConfigurationService, service);
|
||||
return service;
|
||||
}),
|
||||
- this.createStorageService(workspace, logService, userDataProfileService).then(service => {
|
||||
+ this.createStorageService(workspace, environmentService, logService, userDataProfileService, userDataProfilesService, remoteAgentService).then(service => {
|
||||
@@ -601 +602,15 @@
|
||||
serviceCollection.set(IStorageService, service);
|
||||
return service;
|
||||
})
|
||||
@@ -610,7 +611,21 @@ export class BrowserMain extends Disposa
|
||||
}));
|
||||
}
|
||||
|
||||
- protected async createStorageService(workspace: IAnyWorkspaceIdentifier, logService: ILogService, userDataProfileService: IUserDataProfileService): Promise<IStorageService> {
|
||||
+ protected async createStorageService(workspace: IAnyWorkspaceIdentifier, environmentService: IBrowserWorkbenchEnvironmentService, logService: ILogService, userDataProfileService: IUserDataProfileService, userDataProfilesService: IUserDataProfilesService, remoteAgentService: IRemoteAgentService): Promise<IStorageService> {
|
||||
+ const connection = remoteAgentService.getConnection();
|
||||
@@ -109,14 +216,31 @@ Reuse VS Code's Electron storage service for remote persistence
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
const storageService = new BrowserStorageService(workspace, userDataProfileService, logService);
|
||||
|
||||
try {
|
||||
Index: code-server/lib/vscode/src/vs/sessions/browser/web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/sessions/browser/web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/sessions/browser/web.main.ts
|
||||
@@ -42 +42 @@
|
||||
@@ -39,9 +39,9 @@ export class SessionsBrowserMain extends
|
||||
_workspace: IAnyWorkspaceIdentifier,
|
||||
environmentService: IBrowserWorkbenchEnvironmentService,
|
||||
userDataProfileService: IUserDataProfileService,
|
||||
- _userDataProfilesService: BrowserUserDataProfilesService,
|
||||
+ userDataProfilesService: BrowserUserDataProfilesService,
|
||||
@@ -44 +44 @@
|
||||
fileService: FileService,
|
||||
- _remoteAgentService: IRemoteAgentService,
|
||||
+ remoteAgentService: IRemoteAgentService,
|
||||
@@ -85 +85 @@
|
||||
uriIdentityService: IUriIdentityService,
|
||||
policyService: IPolicyService,
|
||||
logService: ILogService,
|
||||
@@ -82,7 +82,7 @@ export class SessionsBrowserMain extends
|
||||
serviceCollection.set(IWorkbenchConfigurationService, configurationService);
|
||||
|
||||
// Storage
|
||||
- const storageService = await this.createStorageService(workspaceIdentifier, logService, userDataProfileService);
|
||||
+ const storageService = await this.createStorageService(workspaceIdentifier, environmentService, logService, userDataProfileService, userDataProfilesService, remoteAgentService);
|
||||
serviceCollection.set(IStorageService, storageService);
|
||||
|
||||
// Workspace Trust Service
|
||||
|
||||
@@ -24,6 +24,6 @@ trusted-domains.diff
|
||||
signature-verification.diff
|
||||
copilot.diff
|
||||
app-name.diff
|
||||
csp-hashes.diff
|
||||
remote-storage.diff
|
||||
remote-secret-storage.diff
|
||||
csp-hashes.diff
|
||||
|
||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||
@@ -179,11 +180,23 @@ export async function setupServerService
|
||||
@@ -184,11 +185,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||
services.set(IRequestService, requestService);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS
|
||||
|
||||
export class BrowserStorageService extends AbstractStorageService {
|
||||
|
||||
@@ -354,7 +355,11 @@ export class IndexedDBStorageDatabase ex
|
||||
@@ -365,7 +366,11 @@ export class IndexedDBStorageDatabase ex
|
||||
}
|
||||
|
||||
static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
||||
|
||||
@@ -53,7 +53,7 @@ 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/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||
@@ -253,7 +253,7 @@
|
||||
@@ -266,7 +266,7 @@
|
||||
}
|
||||
|
||||
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}&platform=${searchParams.get('platform')}`);
|
||||
@@ -62,7 +62,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
||||
.then(async registration => {
|
||||
if (navigator.serviceWorker.controller) {
|
||||
// A previous SW is already controlling. Force an update
|
||||
@@ -332,6 +332,12 @@
|
||||
@@ -345,6 +345,12 @@
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
|
||||
@@ -111,9 +111,14 @@ export const createApp = async (args: DefaultedArgs): Promise<App> => {
|
||||
*
|
||||
* The address might be a URL or it might be a pipe or socket path.
|
||||
*/
|
||||
export const ensureAddress = (server: http.Server, protocol: string): URL | string => {
|
||||
export const ensureAddress = (server: http.Server, protocol: string, socketFd?: number): URL | string => {
|
||||
const addr = server.address()
|
||||
|
||||
// Node reports no address for a Unix socket adopted by fd.
|
||||
if (!addr && typeof socketFd === "number") {
|
||||
return `fd:${socketFd}`
|
||||
}
|
||||
|
||||
if (!addr) {
|
||||
throw new Error("Server has no address")
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as crypto from "crypto"
|
||||
import { promises as fs } from "fs"
|
||||
import { load } from "js-yaml"
|
||||
import * as path from "path"
|
||||
import { generateCertificate, generatePassword, paths, splitOnFirstEquals } from "./util"
|
||||
import { expandTilde, generateCertificate, generatePassword, paths, splitOnFirstEquals } from "./util"
|
||||
import { EditorSessionManagerClient } from "./vscodeSocket"
|
||||
|
||||
export enum Feature {
|
||||
@@ -436,7 +436,11 @@ export const parse = (
|
||||
|
||||
const option = options[key]
|
||||
if (option.type === "boolean") {
|
||||
;(args[key] as boolean) = true
|
||||
// Booleans set to false (for example `--flag=false`, which is also how
|
||||
// false values from the config file are passed in) are ignored.
|
||||
if (value !== "false") {
|
||||
;(args[key] as boolean) = true
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -462,7 +466,7 @@ export const parse = (
|
||||
}
|
||||
|
||||
if (option.path) {
|
||||
value = path.resolve(value)
|
||||
value = path.resolve(expandTilde(value))
|
||||
}
|
||||
|
||||
switch (option.type) {
|
||||
|
||||
@@ -235,7 +235,16 @@ export const getCookieDomain = (host: string, proxyDomains: string[]): string |
|
||||
return undefined
|
||||
}
|
||||
|
||||
proxyDomains.forEach((domain) => {
|
||||
proxyDomains.forEach((proxyDomain) => {
|
||||
// Proxy domains are patterns like `{{port}}.domain.tld` or
|
||||
// `prefix-{{port}}-suffix.domain.tld` so use the part after the label that
|
||||
// contains the port.
|
||||
const portIndex = proxyDomain.indexOf("{{port}}")
|
||||
const domain = portIndex === -1 ? proxyDomain : proxyDomain.substring(proxyDomain.indexOf(".", portIndex) + 1)
|
||||
// Skip patterns we cannot turn into a domain, like `{{port}}.{{host}}`.
|
||||
if (!domain || domain.includes("{{")) {
|
||||
return
|
||||
}
|
||||
if (host.endsWith(domain) && domain.length < host.length) {
|
||||
host = domain
|
||||
}
|
||||
@@ -381,19 +390,20 @@ export function authenticateOrigin(req: express.Request): void {
|
||||
return
|
||||
}
|
||||
|
||||
let origin: string
|
||||
let originUrl: URL
|
||||
try {
|
||||
origin = new URL(originRaw).host.trim().toLowerCase()
|
||||
originUrl = new URL(originRaw)
|
||||
} catch (error) {
|
||||
throw new Error(`unable to parse malformed origin "${originRaw}"`)
|
||||
}
|
||||
const origin = originUrl.host.trim().toLowerCase()
|
||||
|
||||
const trustedOrigins = req.args["trusted-origins"] || []
|
||||
if (isTrustedOrigin(origin, trustedOrigins)) {
|
||||
return
|
||||
}
|
||||
|
||||
const host = getHost(req)
|
||||
const host = getHost(req, true)
|
||||
if (typeof host === "undefined") {
|
||||
// A missing host likely means the reverse proxy has not been configured to
|
||||
// forward the host which means we cannot perform the check. Emit an error
|
||||
@@ -403,15 +413,64 @@ export function authenticateOrigin(req: express.Request): void {
|
||||
throw new Error("no host headers found")
|
||||
}
|
||||
|
||||
if (host !== origin) {
|
||||
if (!hostMatchesOrigin(host, originUrl)) {
|
||||
throw new Error(`host "${host}" does not match origin "${origin}"`)
|
||||
}
|
||||
}
|
||||
|
||||
const defaultPorts: { [protocol: string]: string } = {
|
||||
"http:": "80",
|
||||
"https:": "443",
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a host like `example.com:8080` or `[::1]:8080`. A non-special scheme
|
||||
* keeps the port as written instead of dropping default ports.
|
||||
*/
|
||||
function parseHost(host: string): URL | undefined {
|
||||
try {
|
||||
return new URL(`host://${host}`)
|
||||
} catch (error) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the host from the request headers matches the origin.
|
||||
*
|
||||
* This is an exact match, except that a default port (80 for http, 443 for
|
||||
* https) is the same as no port, since `example.com:443` and
|
||||
* `https://example.com` are the same origin.
|
||||
*/
|
||||
export function hostMatchesOrigin(host: string, origin: URL): boolean {
|
||||
const parsed = parseHost(host)
|
||||
if (!parsed) {
|
||||
return false
|
||||
}
|
||||
const port = parsed.port === defaultPorts[origin.protocol] ? "" : parsed.port
|
||||
return parsed.hostname === origin.hostname.toLowerCase() && port === origin.port
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the port from X-Forwarded-Port to a host that does not have one. Some
|
||||
* reverse proxies (for example nginx with `$host`) forward the host without
|
||||
* the port and send the port separately.
|
||||
*/
|
||||
function addForwardedPort(req: express.Request, host: string): string {
|
||||
const port = getFirstHeader(req, "x-forwarded-port")?.split(",")[0].trim()
|
||||
if (!port || !/^\d+$/.test(port) || parseHost(host)?.port !== "") {
|
||||
return host
|
||||
}
|
||||
return `${host}:${port}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the host from headers. It will be trimmed and lowercased.
|
||||
*
|
||||
* If `withForwardedPort` is set and the host comes from X-Forwarded-Host
|
||||
* without a port, the port from X-Forwarded-Port is added.
|
||||
*/
|
||||
export function getHost(req: express.Request): string | undefined {
|
||||
export function getHost(req: express.Request, withForwardedPort = false): string | undefined {
|
||||
// Honor Forwarded if present.
|
||||
const forwardedRaw = getFirstHeader(req, "forwarded")
|
||||
if (forwardedRaw) {
|
||||
@@ -430,7 +489,8 @@ export function getHost(req: express.Request): string | undefined {
|
||||
if (xHost) {
|
||||
const firstXHost = xHost.split(",")[0]
|
||||
if (firstXHost) {
|
||||
return firstXHost.trim().toLowerCase()
|
||||
const host = firstXHost.trim().toLowerCase()
|
||||
return withForwardedPort ? addForwardedPort(req, host) : host
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import i18next, { init } from "i18next"
|
||||
import * as en from "./locales/en.json"
|
||||
import * as ja from "./locales/ja.json"
|
||||
import * as th from "./locales/th.json"
|
||||
import * as tr from "./locales/tr.json"
|
||||
import * as ur from "./locales/ur.json"
|
||||
import * as zhCn from "./locales/zh-cn.json"
|
||||
|
||||
@@ -16,6 +17,9 @@ const defaultResources = {
|
||||
th: {
|
||||
translation: th,
|
||||
},
|
||||
tr: {
|
||||
translation: tr,
|
||||
},
|
||||
ja: {
|
||||
translation: ja,
|
||||
},
|
||||
|
||||
13
src/node/i18n/locales/tr.json
Normal file
13
src/node/i18n/locales/tr.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"LOGIN_TITLE": "{{app}} girişi",
|
||||
"LOGIN_BELOW": "Lütfen aşağıdan giriş yapın.",
|
||||
"WELCOME": "{{app}} uygulamasına hoş geldiniz",
|
||||
"LOGIN_PASSWORD": "Parola için yapılandırma dosyasını kontrol edin.",
|
||||
"LOGIN_USING_ENV_PASSWORD": "Parola $PASSWORD ortam değişkeninden ayarlandı.",
|
||||
"LOGIN_USING_HASHED_PASSWORD": "Parola $HASHED_PASSWORD ortam değişkeninden ayarlandı.",
|
||||
"SUBMIT": "GÖNDER",
|
||||
"PASSWORD_PLACEHOLDER": "PAROLA",
|
||||
"LOGIN_RATE_LIMIT": "Giriş denemesi sınırına ulaşıldı!",
|
||||
"MISS_PASSWORD": "Parola eksik",
|
||||
"INCORRECT_PASSWORD": "Parola yanlış."
|
||||
}
|
||||
@@ -141,7 +141,7 @@ export const runCodeServer = async (
|
||||
|
||||
const app = await createApp(args)
|
||||
const protocol = args.cert ? "https" : "http"
|
||||
const serverAddress = ensureAddress(app.server, protocol)
|
||||
const serverAddress = ensureAddress(app.server, protocol, args["socket-fd"])
|
||||
const { disposeRoutes, heart } = await register(app, args)
|
||||
|
||||
logger.info(`Using config file ${args.config}`)
|
||||
|
||||
@@ -132,8 +132,10 @@ export const register = async (
|
||||
})
|
||||
})
|
||||
|
||||
app.router.use(express.json())
|
||||
app.router.use(express.urlencoded({ extended: true }))
|
||||
// Reject compressed request bodies so unauthenticated requests cannot reach
|
||||
// the zlib/Brotli decoders. Browsers never compress request bodies.
|
||||
app.router.use(express.json({ inflate: false }))
|
||||
app.router.use(express.urlencoded({ extended: true, inflate: false }))
|
||||
|
||||
app.router.use(
|
||||
"/_static",
|
||||
|
||||
@@ -511,3 +511,18 @@ export function splitOnFirstEquals(str: string): [string, string | undefined] {
|
||||
const split = str.split(/=(.+)?/, 2)
|
||||
return [split[0], split[1]]
|
||||
}
|
||||
|
||||
/**
|
||||
* Expand a leading `~` to the home directory. The shell does this for
|
||||
* command-line arguments but values from the config file are not expanded.
|
||||
* `~user` forms are left alone.
|
||||
*/
|
||||
export function expandTilde(p: string): string {
|
||||
if (p === "~") {
|
||||
return os.homedir()
|
||||
}
|
||||
if (p.startsWith("~/") || p.startsWith(`~${path.sep}`)) {
|
||||
return path.join(os.homedir(), p.slice(2))
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function makeEditorSessionManagerServer(
|
||||
): Promise<http.Server> {
|
||||
const router = express()
|
||||
|
||||
router.use(express.json())
|
||||
router.use(express.json({ inflate: false }))
|
||||
|
||||
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
||||
"/session",
|
||||
|
||||
@@ -8,6 +8,9 @@ import { paths } from "./util"
|
||||
|
||||
const timeoutInterval = 10000 // 10s, matches VS Code's timeouts.
|
||||
|
||||
// Fd 3 in the child is the IPC channel, so the inherited socket goes to fd 4.
|
||||
const CHILD_SOCKET_FD = 4
|
||||
|
||||
/**
|
||||
* Listen to a single message from a process. Reject if the process errors,
|
||||
* exits, or times out.
|
||||
@@ -334,13 +337,14 @@ export class ParentProcess extends Process {
|
||||
}
|
||||
|
||||
private spawn(): cp.ChildProcess {
|
||||
const socketFd = this.args?.["socket-fd"]
|
||||
return cp.fork(path.join(__dirname, "entry"), {
|
||||
env: {
|
||||
...process.env,
|
||||
CODE_SERVER_PARENT_PID: process.pid.toString(),
|
||||
NODE_EXEC_PATH: process.execPath,
|
||||
},
|
||||
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
||||
stdio: typeof socketFd === "number" ? ["pipe", "pipe", "pipe", "ipc", socketFd] : ["pipe", "pipe", "pipe", "ipc"],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -359,7 +363,8 @@ export class ParentProcess extends Process {
|
||||
this.logger,
|
||||
)
|
||||
this.logger.debug("got message", field("message", message))
|
||||
this.send(child, { type: "handshake", args: this.args })
|
||||
const args = typeof this.args["socket-fd"] === "number" ? { ...this.args, "socket-fd": CHILD_SOCKET_FD } : this.args
|
||||
this.send(child, { type: "handshake", args })
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,8 @@ import * as vscode from "vscode"
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
vscode.window.showInformationMessage("test extension loaded")
|
||||
// Test extension
|
||||
|
||||
// Prints the current proxy URI into a notification.
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
|
||||
if (process.env.VSCODE_PROXY_URI) {
|
||||
@@ -13,7 +14,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}),
|
||||
)
|
||||
|
||||
// asExternalUri extension
|
||||
// Asks for a URI, then runs it through asExternalUri and prints the result
|
||||
// into a notification.
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("codeServerTest.asExternalUri", async () => {
|
||||
const input = await vscode.window.showInputBox({
|
||||
@@ -28,4 +30,29 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
const secretKey = "code-server-test-secret"
|
||||
|
||||
// Asks for a string, then stores it as a secret.
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("codeServerTest.setSecret", async () => {
|
||||
const input = await vscode.window.showInputBox({
|
||||
prompt: "Secret to store",
|
||||
})
|
||||
|
||||
if (input) {
|
||||
await context.secrets.store(secretKey, input)
|
||||
vscode.window.showInformationMessage(`set secret: ${input}`)
|
||||
} else {
|
||||
vscode.window.showErrorMessage(`Failed to run test case. No input provided.`)
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
// Prints the current secret, if any.
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand("codeServerTest.getSecret", async () => {
|
||||
vscode.window.showInformationMessage(`get secret: ${await context.secrets.get(secretKey)}`)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,16 @@
|
||||
"command": "codeServerTest.asExternalUri",
|
||||
"title": "asExternalUri test",
|
||||
"category": "code-server"
|
||||
},
|
||||
{
|
||||
"command": "codeServerTest.setSecret",
|
||||
"title": "Set test secret",
|
||||
"category": "code-server"
|
||||
},
|
||||
{
|
||||
"command": "codeServerTest.getSecret",
|
||||
"title": "Get test secret",
|
||||
"category": "code-server"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -363,13 +363,14 @@ export class CodeServerPage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the test extension loaded
|
||||
* Checks if the test extension loaded by waiting for its notification. Once
|
||||
* it appears, dismiss the notification.
|
||||
*/
|
||||
async waitForTestExtensionLoaded(): Promise<void> {
|
||||
const selector = "text=test extension loaded"
|
||||
this.codeServer.logger.debug("Waiting for test extension to load...")
|
||||
|
||||
await this.page.waitForSelector(selector)
|
||||
const locator = this.page.getByRole("dialog", { name: "Info: test extension loaded" })
|
||||
await locator.hover()
|
||||
await locator.getByLabel("Clear Notification (Del)").click()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { promises as fs } from "fs"
|
||||
import * as path from "path"
|
||||
import { clean } from "../utils/helpers"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
|
||||
61
test/e2e/storage.test.ts
Normal file
61
test/e2e/storage.test.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { promises as fs } from "fs"
|
||||
import * as path from "path"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
const tests = [
|
||||
{
|
||||
name: "browser storage",
|
||||
args: [],
|
||||
},
|
||||
{
|
||||
name: "remote storage",
|
||||
args: ["--enable-remote-storage"],
|
||||
},
|
||||
]
|
||||
|
||||
for (const tc of tests) {
|
||||
const args = ["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions"), ...tc.args]
|
||||
describe(tc.name, args, {}, () => {
|
||||
test("should store workbench state and secrets", async ({ codeServerPage }) => {
|
||||
// Create and open a file.
|
||||
const dir = await codeServerPage.workspaceDir
|
||||
const file = path.join(dir, "foo")
|
||||
await fs.writeFile(file, "bar")
|
||||
await codeServerPage.openFile(file)
|
||||
|
||||
// Store a secret.
|
||||
const secret = "foo-bar-baz"
|
||||
await codeServerPage.waitForTestExtensionLoaded()
|
||||
await codeServerPage.executeCommandViaMenus("code-server: Set test secret")
|
||||
await codeServerPage.page.waitForSelector(".quick-input-widget:focus-within")
|
||||
await codeServerPage.page.keyboard.type(secret)
|
||||
await codeServerPage.page.keyboard.press("Enter")
|
||||
await expect(codeServerPage.page.getByText(`Info: set secret: ${secret}`)).toBeVisible()
|
||||
|
||||
// There should be a workspace storage directory.
|
||||
const userDir = path.join(dir, "User/workspaceStorage")
|
||||
const dirs = await fs.readdir(userDir)
|
||||
expect(dirs.length).toBe(1)
|
||||
|
||||
const storageFile = path.join(userDir, dirs[0], "state.vscdb")
|
||||
if (tc.args.includes("--enable-remote-storage")) {
|
||||
// The sqlite database should exist.
|
||||
fs.stat(storageFile)
|
||||
} else {
|
||||
// But no sqlite database.
|
||||
expect(() => fs.stat(storageFile)).rejects.toThrow("ENOENT")
|
||||
}
|
||||
|
||||
// Reload using a command so it has a chance to flush storage.
|
||||
await codeServerPage.executeCommandViaMenus("Developer: Reload Window")
|
||||
await codeServerPage.waitForTestExtensionLoaded()
|
||||
|
||||
// Should see the same file.
|
||||
await codeServerPage.waitForTab(file)
|
||||
|
||||
// Should be able to retrieve the secret.
|
||||
await codeServerPage.executeCommandViaMenus("code-server: Get test secret")
|
||||
await expect(codeServerPage.page.getByText(`Info: get secret: ${secret}`)).toBeVisible()
|
||||
})
|
||||
})
|
||||
}
|
||||
19
test/e2e/typescript.test.ts
Normal file
19
test/e2e/typescript.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { promises as fs } from "fs"
|
||||
import * as path from "path"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
const args = ["--disable-workspace-trust"]
|
||||
|
||||
describe("typescript extension", args, {}, () => {
|
||||
test("should load as a workspace extension", async ({ codeServerPage }) => {
|
||||
const dir = await codeServerPage.workspaceDir
|
||||
const file = path.join(dir, "foo.ts")
|
||||
await fs.writeFile(file, 'const n: number = "x"')
|
||||
await codeServerPage.openFile(file)
|
||||
|
||||
await codeServerPage.executeCommandViaMenus("Developer: Show Running Extensions")
|
||||
await expect(
|
||||
codeServerPage.page.getByLabel("typescript-language-features").getByText(/localhost:\d+/),
|
||||
).toBeVisible()
|
||||
})
|
||||
})
|
||||
80
test/integration/socketFd.test.ts
Normal file
80
test/integration/socketFd.test.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
import { ChildProcess, spawn } from "child_process"
|
||||
import { promises as fs } from "fs"
|
||||
import * as http from "http"
|
||||
import * as net from "net"
|
||||
import * as path from "path"
|
||||
import { clean, tmpdir } from "../utils/helpers"
|
||||
|
||||
describe("--socket-fd", () => {
|
||||
const testName = "socketFd"
|
||||
const codeServerPath = process.env.CODE_SERVER_PATH || path.resolve("../../release-standalone/bin/code-server")
|
||||
let tempDir: string
|
||||
let socketDir: string | undefined
|
||||
let child: ChildProcess | undefined
|
||||
|
||||
beforeEach(async () => {
|
||||
await clean(testName)
|
||||
tempDir = await tmpdir(testName)
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
if (child?.pid && child.exitCode === null) {
|
||||
// Kill the process group so that the wrapper's inner process also stops.
|
||||
process.kill(-child.pid, "SIGKILL")
|
||||
}
|
||||
if (socketDir) {
|
||||
await fs.rm(socketDir, { force: true, recursive: true })
|
||||
socketDir = undefined
|
||||
}
|
||||
})
|
||||
|
||||
// Give the listener to code-server as fd 3, as systemd socket activation does.
|
||||
const getHealthzThroughFd = async (server: net.Server, target: http.RequestOptions): Promise<number> => {
|
||||
const fd: number = (server as any)._handle.fd
|
||||
let output = ""
|
||||
child = spawn(
|
||||
codeServerPath,
|
||||
[
|
||||
"--socket-fd=3",
|
||||
"--auth=none",
|
||||
`--user-data-dir=${path.join(tempDir, "data")}`,
|
||||
`--config=${path.join(tempDir, "config.yaml")}`,
|
||||
],
|
||||
{ detached: true, stdio: ["ignore", "pipe", "pipe", fd] },
|
||||
)
|
||||
child.stdout?.on("data", (chunk) => (output += chunk))
|
||||
child.stderr?.on("data", (chunk) => (output += chunk))
|
||||
await new Promise((resolve) => server.close(resolve))
|
||||
|
||||
const exited = new Promise<never>((_, reject) => {
|
||||
child?.once("exit", (code) => reject(new Error(`code-server exited with code ${code}:\n${output}`)))
|
||||
})
|
||||
const status = new Promise<number>((resolve, reject) => {
|
||||
http
|
||||
.get({ ...target, path: "/healthz" }, (res) => {
|
||||
res.resume()
|
||||
resolve(res.statusCode ?? 0)
|
||||
})
|
||||
.once("error", (error) => reject(new Error(`${error.message}:\n${output}`)))
|
||||
})
|
||||
return Promise.race([status, exited])
|
||||
}
|
||||
|
||||
it("should serve requests on a Unix socket passed as a file descriptor", async () => {
|
||||
// macOS limits socket paths to 104 bytes, and os.tmpdir() can be too long.
|
||||
socketDir = await fs.mkdtemp("/tmp/cs-fd-")
|
||||
const server = net.createServer()
|
||||
await new Promise<void>((resolve) => server.listen(path.join(socketDir!, "listen.sock"), resolve))
|
||||
// server.close() unlinks the socket path, so connect through a hard link.
|
||||
const socketPath = path.join(socketDir, "connect.sock")
|
||||
await fs.link(path.join(socketDir, "listen.sock"), socketPath)
|
||||
expect(await getHealthzThroughFd(server, { socketPath })).toBe(200)
|
||||
}, 60000)
|
||||
|
||||
it("should serve requests on a TCP socket passed as a file descriptor", async () => {
|
||||
const server = net.createServer()
|
||||
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve))
|
||||
const { port } = server.address() as net.AddressInfo
|
||||
expect(await getHealthzThroughFd(server, { host: "127.0.0.1", port })).toBe(200)
|
||||
}, 60000)
|
||||
})
|
||||
@@ -152,6 +152,9 @@ describe("ensureAddress", () => {
|
||||
it("should throw and error if no address", () => {
|
||||
expect(() => ensureAddress(mockServer, "http")).toThrow("Server has no address")
|
||||
})
|
||||
it("should describe a --socket-fd listener by its fd when node reports no address", () => {
|
||||
expect(ensureAddress(mockServer, "http", 4)).toBe("fd:4")
|
||||
})
|
||||
it("should return the address if it's a string", async () => {
|
||||
mockServer.address = () => "/path/to/unix.sock"
|
||||
const address = ensureAddress(mockServer, "http")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Level, logger } from "@coder/logger"
|
||||
import { promises as fs } from "fs"
|
||||
import * as os from "os"
|
||||
import * as path from "path"
|
||||
import {
|
||||
UserProvidedArgs,
|
||||
@@ -575,9 +576,33 @@ describe("parser", () => {
|
||||
"install-extension": ["extension.number1", "extension.number2"],
|
||||
})
|
||||
})
|
||||
it("should expand ~ in path options from the config file", () => {
|
||||
const configContents = `
|
||||
user-data-dir: ~/.config/code-server-data
|
||||
extensions-dir: ~/extensions
|
||||
`
|
||||
expect(parseConfigFile(configContents, "/fake-config-path")).toEqual({
|
||||
config: "/fake-config-path",
|
||||
"user-data-dir": path.join(os.homedir(), ".config/code-server-data"),
|
||||
"extensions-dir": path.join(os.homedir(), "extensions"),
|
||||
})
|
||||
})
|
||||
it("should ignore optional strings set to false", async () => {
|
||||
expect(parse(["--cert=false"])).toEqual({})
|
||||
})
|
||||
it("should ignore booleans set to false", async () => {
|
||||
expect(parse(["--disable-telemetry=false"])).toEqual({})
|
||||
})
|
||||
it("should parse booleans set to false in the config file", () => {
|
||||
const configContents = `
|
||||
disable-telemetry: false
|
||||
disable-update-check: true
|
||||
`
|
||||
expect(parseConfigFile(configContents, "/fake-config-path")).toEqual({
|
||||
config: "/fake-config-path",
|
||||
"disable-update-check": true,
|
||||
})
|
||||
})
|
||||
it("should use last flag", async () => {
|
||||
expect(parse(["--port", "8081", "--port", "8082"])).toEqual({
|
||||
port: 8082,
|
||||
|
||||
@@ -68,6 +68,43 @@ describe("http", () => {
|
||||
host: "localhost:8081",
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com",
|
||||
host: "example.com:443", // Explicit default port.
|
||||
},
|
||||
{
|
||||
origin: "http://example.com",
|
||||
host: "example.com:80",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com",
|
||||
host: "example.com:80", // Default port of the other protocol.
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
host: "example.com", // Missing port is not ignored.
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com",
|
||||
host: "example.com:8443",
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "http://example.com:8080",
|
||||
host: "other.com",
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "http://[::1]:8080",
|
||||
host: "[::1]:8080",
|
||||
},
|
||||
{
|
||||
origin: "http://[::1]:8080",
|
||||
host: "[::1]:8081",
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "localhost:8080",
|
||||
host: "localhost:8080",
|
||||
@@ -122,6 +159,104 @@ describe("http", () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("x-forwarded-port", () => {
|
||||
;[
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { "x-forwarded-host": "example.com", "x-forwarded-port": "8080" },
|
||||
},
|
||||
{
|
||||
origin: "https://example.com",
|
||||
headers: { "x-forwarded-host": "example.com", "x-forwarded-port": "443" },
|
||||
},
|
||||
{
|
||||
origin: "http://[::1]:8080",
|
||||
headers: { "x-forwarded-host": "[::1]", "x-forwarded-port": "8080" },
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { "x-forwarded-host": "example.com", "x-forwarded-port": "8080, 443" },
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { "x-forwarded-host": "example.com", "x-forwarded-port": "8081" },
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { "x-forwarded-host": "example.com:8081", "x-forwarded-port": "8080" },
|
||||
expected: "does not match", // The port in the host wins.
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { "x-forwarded-host": "example.com", "x-forwarded-port": "foo" },
|
||||
expected: "does not match",
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { host: "example.com", "x-forwarded-port": "8080" },
|
||||
expected: "does not match", // Only used with X-Forwarded-Host.
|
||||
},
|
||||
{
|
||||
origin: "https://example.com:8080",
|
||||
headers: { forwarded: "host=example.com", "x-forwarded-port": "8080" },
|
||||
expected: "does not match",
|
||||
},
|
||||
].forEach((test) => {
|
||||
it(`${test.origin} -> ${JSON.stringify(test.headers)}`, () => {
|
||||
const req = getMockReq({
|
||||
originalUrl: "localhost:8080",
|
||||
headers: {
|
||||
origin: test.origin,
|
||||
...test.headers,
|
||||
},
|
||||
args: {},
|
||||
})
|
||||
if (typeof test.expected === "string") {
|
||||
expect(() => http.authenticateOrigin(req)).toThrow(test.expected)
|
||||
} else {
|
||||
expect(() => http.authenticateOrigin(req)).not.toThrow()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it("should not add the port to the host for other uses", () => {
|
||||
const req = getMockReq({
|
||||
headers: { "x-forwarded-host": "code-8080.example.com", "x-forwarded-port": "443" },
|
||||
})
|
||||
expect(http.getHost(req)).toBe("code-8080.example.com")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("getCookieDomain", () => {
|
||||
it("should use the proxy domain for the cookie", () => {
|
||||
const proxyDomains = ["{{port}}.example.com", "code-{{port}}.test.com"]
|
||||
expect(http.getCookieDomain("example.com", proxyDomains)).toBe("example.com")
|
||||
expect(http.getCookieDomain("8080.example.com", proxyDomains)).toBe("example.com")
|
||||
expect(http.getCookieDomain("8080.example.com:443", proxyDomains)).toBe("example.com")
|
||||
expect(http.getCookieDomain("code-8080.test.com", proxyDomains)).toBe("test.com")
|
||||
})
|
||||
|
||||
it("should use the highest level proxy domain", () => {
|
||||
const proxyDomains = ["{{port}}.test.example.com", "{{port}}.example.com"]
|
||||
expect(http.getCookieDomain("test.example.com", proxyDomains)).toBe("example.com")
|
||||
expect(http.getCookieDomain("8080.test.example.com", proxyDomains)).toBe("example.com")
|
||||
})
|
||||
|
||||
it("should use the host when no proxy domain matches", () => {
|
||||
expect(http.getCookieDomain("code.other.com", ["{{port}}.example.com"])).toBe("code.other.com")
|
||||
expect(http.getCookieDomain("8080.example.com", ["{{port}}.{{host}}"])).toBe("8080.example.com")
|
||||
expect(http.getCookieDomain("8080.example.com", [])).toBe("8080.example.com")
|
||||
})
|
||||
|
||||
it("should not set a domain for localhost or IP addresses", () => {
|
||||
const proxyDomains = ["{{port}}.example.com"]
|
||||
expect(http.getCookieDomain("localhost:8080", proxyDomains)).toBe(undefined)
|
||||
expect(http.getCookieDomain("127.0.0.1:8080", proxyDomains)).toBe(undefined)
|
||||
expect(http.getCookieDomain("8080.dev.localhost", proxyDomains)).toBe(undefined)
|
||||
})
|
||||
})
|
||||
|
||||
describe("constructRedirectPath", () => {
|
||||
|
||||
@@ -75,6 +75,17 @@ describe("login", () => {
|
||||
expect(htmlContent).toContain("Missing password")
|
||||
})
|
||||
|
||||
it("should reject compressed request bodies", async () => {
|
||||
for (const encoding of ["br", "gzip", "deflate"]) {
|
||||
const resp = await codeServer().fetch("/login", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded", "Content-Encoding": encoding },
|
||||
body: "password=test",
|
||||
})
|
||||
expect(resp.status).toBe(415)
|
||||
}
|
||||
})
|
||||
|
||||
it("should return HTML with 'Incorrect password' message", async () => {
|
||||
const params = new URLSearchParams()
|
||||
params.append("password", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as cp from "child_process"
|
||||
import { promises as fs } from "fs"
|
||||
import * as os from "os"
|
||||
import * as path from "path"
|
||||
import { generateUuid } from "../../../src/common/util"
|
||||
import { tmpdir } from "../../../src/node/constants"
|
||||
@@ -623,3 +624,18 @@ describe("splitOnFirstEquals", () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("expandTilde", () => {
|
||||
it("should expand a bare ~", () => {
|
||||
expect(util.expandTilde("~")).toBe(os.homedir())
|
||||
})
|
||||
it("should expand a leading ~/", () => {
|
||||
expect(util.expandTilde("~/.config/code-server")).toBe(path.join(os.homedir(), ".config/code-server"))
|
||||
})
|
||||
it("should leave other paths alone", () => {
|
||||
expect(util.expandTilde("/tmp/~/data")).toBe("/tmp/~/data")
|
||||
expect(util.expandTilde("relative/~")).toBe("relative/~")
|
||||
expect(util.expandTilde("~user/data")).toBe("~user/data")
|
||||
expect(util.expandTilde("")).toBe("")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user