mirror of
https://github.com/coder/code-server.git
synced 2026-04-13 21:32:52 -05:00
Compare commits
66 Commits
v4.22.0-rc
...
v4.90.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dce1d6e172 | ||
|
|
a73549539b | ||
|
|
e7ca9cd6ac | ||
|
|
9da9f2029c | ||
|
|
0c802ba165 | ||
|
|
1bd2b9cf08 | ||
|
|
3b467dec95 | ||
|
|
6d9530aa6b | ||
|
|
fc47b4f1c5 | ||
|
|
479eb5bfa5 | ||
|
|
095c072a43 | ||
|
|
4ff509d8db | ||
|
|
efc6edf536 | ||
|
|
3b6ad479a6 | ||
|
|
effc6e95b4 | ||
|
|
ab4b36f573 | ||
|
|
0f4791b816 | ||
|
|
97653152dd | ||
|
|
2633bca30b | ||
|
|
125a972c81 | ||
|
|
7050002fb6 | ||
|
|
4563517d90 | ||
|
|
b8cdab2184 | ||
|
|
264e023ab8 | ||
|
|
ea815df22d | ||
|
|
6757907c8b | ||
|
|
2adb215d03 | ||
|
|
1a7265b392 | ||
|
|
e6dd7fe228 | ||
|
|
fb2afbd9d6 | ||
|
|
3d8d544f89 | ||
|
|
323a1f3234 | ||
|
|
b8d830b826 | ||
|
|
417c1f36cb | ||
|
|
3eb9cf7a08 | ||
|
|
f81fe3030a | ||
|
|
4bc9956537 | ||
|
|
9a28bc29db | ||
|
|
deebb21345 | ||
|
|
73e615da4e | ||
|
|
bec6ab2678 | ||
|
|
ebd79ed958 | ||
|
|
30d343c0bd | ||
|
|
71780f6f00 | ||
|
|
93f9dfcb1d | ||
|
|
1abb2ee567 | ||
|
|
1c5bfeeb99 | ||
|
|
bae68548d0 | ||
|
|
0cca7c67a4 | ||
|
|
45e96ec3b0 | ||
|
|
66364429e3 | ||
|
|
0e384d5442 | ||
|
|
760d1318e9 | ||
|
|
c65b1f2870 | ||
|
|
132f7d1470 | ||
|
|
8c65ff8d0d | ||
|
|
f9c0624f85 | ||
|
|
4c4c566d86 | ||
|
|
720d14db3e | ||
|
|
5453d02872 | ||
|
|
9f2c776a77 | ||
|
|
66c7f7d8b1 | ||
|
|
107a3fd410 | ||
|
|
56b5992280 | ||
|
|
275c130845 | ||
|
|
223ecf7c30 |
50
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
50
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -1,6 +1,5 @@
|
||||
name: Bug report
|
||||
description: File a bug report
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
@@ -10,6 +9,7 @@ body:
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: OS/Web Information
|
||||
@@ -28,55 +28,74 @@ body:
|
||||
- `code-server --version`:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: |
|
||||
1. open code-server
|
||||
2. install extension
|
||||
3. run command
|
||||
Please describe exactly how to reproduce the bug. For example:
|
||||
1. Open code-server in Firefox
|
||||
2. Install extension `foo.bar` from the extensions sidebar
|
||||
3. Run command `foo.bar.baz`
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected
|
||||
description: What should happen?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual
|
||||
description: What actually happens?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs
|
||||
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshot/Video
|
||||
description: Please include a screenshot, gif or screen recording of your issue.
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Does this issue happen in VS Code or GitHub Codespaces?
|
||||
description: Please try reproducing this issue in VS Code and GitHub Codespaces. If the bug reproduces in either VS Code or GitHub Codespaces, please submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||
label: Does this bug reproduce in native VS Code?
|
||||
description: If the bug reproduces in native VS Code, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||
options:
|
||||
- label: I tested this in native VS Code.
|
||||
required: false
|
||||
- label: This does not happen in native VS Code.
|
||||
required: false
|
||||
- label: I tested this in GitHub Codespaces.
|
||||
required: false
|
||||
- label: This does not happen in GitHub Codespaces.
|
||||
required: false
|
||||
- Yes, this is also broken in native VS Code
|
||||
- No, this works as expected in native VS Code
|
||||
- This cannot be tested in native VS Code
|
||||
- I did not test native VS Code
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Does this bug reproduce in GitHub Codespaces?
|
||||
description: If the bug reproduces in GitHub Codespaces, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||
options:
|
||||
- Yes, this is also broken in GitHub Codespaces
|
||||
- No, this works as expected in GitHub Codespaces
|
||||
- This cannot be tested in GitHub Codespaces
|
||||
- I did not test GitHub Codespaces
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you accessing code-server over a secure context?
|
||||
@@ -84,6 +103,7 @@ body:
|
||||
options:
|
||||
- label: I am using a secure context.
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Notes
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/doc.md
vendored
2
.github/ISSUE_TEMPLATE/doc.md
vendored
@@ -1,9 +1,7 @@
|
||||
---
|
||||
name: Documentation improvement
|
||||
about: Suggest a documentation improvement
|
||||
title: "[Docs]: "
|
||||
labels: "docs"
|
||||
assignees: "@jsjoeio"
|
||||
---
|
||||
|
||||
## What is your suggestion?
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -1,9 +1,7 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea to improve code-server
|
||||
title: "[Feat]: "
|
||||
labels: enhancement
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## What is your suggestion?
|
||||
|
||||
13
.github/workflows/build.yaml
vendored
13
.github/workflows/build.yaml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
docs/**
|
||||
@@ -76,14 +76,14 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
ci/helm-chart/**
|
||||
|
||||
- name: Install helm
|
||||
if: steps.changed-files.outputs.any_changed == 'true'
|
||||
uses: azure/setup-helm@v3.5
|
||||
uses: azure/setup-helm@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -107,7 +107,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
**/*.ts
|
||||
@@ -163,7 +163,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v42
|
||||
uses: tj-actions/changed-files@v44
|
||||
with:
|
||||
files: |
|
||||
**/*.ts
|
||||
@@ -195,7 +195,7 @@ jobs:
|
||||
run: yarn test:unit
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
if: success()
|
||||
@@ -206,6 +206,7 @@ jobs:
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
DISABLE_V8_COMPILE_CACHE: 1
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
8
.github/workflows/publish.yaml
vendored
8
.github/workflows/publish.yaml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
cache: "yarn"
|
||||
|
||||
- name: Download npm package from release artifacts
|
||||
uses: robinraju/release-downloader@v1.9
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Validate package
|
||||
uses: hapakaien/archlinux-package-action@v2
|
||||
uses: heyhusen/archlinux-package-action@v2.2.1
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
with:
|
||||
@@ -184,7 +184,7 @@ jobs:
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download deb artifacts
|
||||
uses: robinraju/release-downloader@v1.9
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
@@ -192,7 +192,7 @@ jobs:
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Download rpm artifacts
|
||||
uses: robinraju/release-downloader@v1.9
|
||||
uses: robinraju/release-downloader@v1.10
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
|
||||
13
.github/workflows/release.yaml
vendored
13
.github/workflows/release.yaml
vendored
@@ -77,10 +77,11 @@ jobs:
|
||||
run: yarn test:integration
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
if: success()
|
||||
continue-on-error: true
|
||||
|
||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||
# i.e. v4.9.1 -> 4.9.1
|
||||
@@ -94,7 +95,7 @@ jobs:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: yarn package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -190,7 +191,7 @@ jobs:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: npm run package ${npm_config_arch}
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -221,7 +222,7 @@ jobs:
|
||||
# next update Node we can probably remove this. For now, install
|
||||
# setuptools since it contains distutils.
|
||||
- name: Install Python utilities
|
||||
run: python3 -m pip install setuptools
|
||||
run: brew install python-setuptools
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -252,7 +253,7 @@ jobs:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: yarn package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
@@ -269,7 +270,7 @@ jobs:
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
- uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
|
||||
2
.github/workflows/security.yaml
vendored
2
.github/workflows/security.yaml
vendored
@@ -55,7 +55,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@d43c1f16c00cfd3978dde6c07f4bbcf9eb6993ca
|
||||
uses: aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
|
||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@d43c1f16c00cfd3978dde6c07f4bbcf9eb6993ca
|
||||
uses: aquasecurity/trivy-action@fd25fed6972e341ff0007ddb61f77e88103953c2
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
18.17.1
|
||||
20.11.1
|
||||
|
||||
104
CHANGELOG.md
104
CHANGELOG.md
@@ -22,44 +22,128 @@ Code v99.99.999
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [4.21.2](https://github.com/coder/code-server/releases/tag/v4.21.2) - 2021-02-28
|
||||
Code v1.90.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Cache a call to get CPU information used in telemetry that could result in a
|
||||
lack responsiveness if it was particularly slow.
|
||||
|
||||
## [4.90.0](https://github.com/coder/code-server/releases/tag/v4.90.0) - 2024-06-11
|
||||
|
||||
Code v1.90.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.0.
|
||||
- Updated Node to 20.11.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Send contents to the clipboard in the integrated terminal by piping to
|
||||
`code-server --stdin-to-clipboard` or `code-server -c`.
|
||||
|
||||
You may want to make this an alias:
|
||||
|
||||
```
|
||||
alias xclip="code-server --stdin-to-clipboard"
|
||||
echo -n "hello world" | xclip
|
||||
```
|
||||
|
||||
## [4.89.1](https://github.com/coder/code-server/releases/tag/v4.89.1) - 2024-04-14
|
||||
|
||||
Code v1.89.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.1.
|
||||
|
||||
## [4.89.0](https://github.com/coder/code-server/releases/tag/v4.89.0) - 2024-04-08
|
||||
|
||||
Code v1.89.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.0.
|
||||
|
||||
## [4.23.1](https://github.com/coder/code-server/releases/tag/v4.23.1) - 2024-04-15
|
||||
|
||||
Code v1.88.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.1.
|
||||
|
||||
## [4.23.0](https://github.com/coder/code-server/releases/tag/v4.23.0) - 2024-04-08
|
||||
|
||||
Code v1.88.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.0.
|
||||
- Updated Node to 18.18.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix masking the exit code when failing to install extensions on the command
|
||||
line outside the integrated terminal. Installing extensions inside the
|
||||
integrated terminal still masks the exit code and is an upstream bug.
|
||||
|
||||
## [4.22.1](https://github.com/coder/code-server/releases/tag/v4.22.1) - 2024-03-14
|
||||
|
||||
Code v1.87.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.2.
|
||||
- Enable keep-alive for proxy agent.
|
||||
|
||||
## [4.22.0](https://github.com/coder/code-server/releases/tag/v4.22.0) - 2024-03-03
|
||||
|
||||
Code v1.87.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.0.
|
||||
|
||||
## [4.21.2](https://github.com/coder/code-server/releases/tag/v4.21.2) - 2024-02-28
|
||||
|
||||
Code v1.86.2
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.2.
|
||||
|
||||
## [4.21.1](https://github.com/coder/code-server/releases/tag/v4.21.1) - 2021-02-09
|
||||
## [4.21.1](https://github.com/coder/code-server/releases/tag/v4.21.1) - 2024-02-09
|
||||
|
||||
Code v1.86.1
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.1.
|
||||
- Updated to Node 18.17.1.
|
||||
|
||||
## Added
|
||||
### Added
|
||||
|
||||
- Docker images for Fedora and openSUSE.
|
||||
|
||||
## [4.21.0](https://github.com/coder/code-server/releases/tag/v4.21.0) - 2021-02-05
|
||||
## [4.21.0](https://github.com/coder/code-server/releases/tag/v4.21.0) - 2024-02-05
|
||||
|
||||
Code v1.86.0
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.0.
|
||||
|
||||
## [4.20.1](https://github.com/coder/code-server/releases/tag/v4.20.1) - 2021-01-22
|
||||
## [4.20.1](https://github.com/coder/code-server/releases/tag/v4.20.1) - 2024-01-22
|
||||
|
||||
Code v1.85.2
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.85.2.
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
|
||||
- Query variables are no longer double-encoded when going over the path proxy.
|
||||
|
||||
|
||||
@@ -51,6 +51,18 @@ symlink_bin_script() {
|
||||
cd "$oldpwd"
|
||||
}
|
||||
|
||||
command_exists() {
|
||||
if [ ! "$1" ]; then return 1; fi
|
||||
command -v "$@" > /dev/null
|
||||
}
|
||||
|
||||
is_root() {
|
||||
if command_exists id && [ "$(id -u)" = 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
OS="$(os)"
|
||||
|
||||
main() {
|
||||
@@ -64,8 +76,8 @@ main() {
|
||||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
|
||||
echo "ERROR: code-server currently requires node v18."
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-20}" ]; then
|
||||
echo "ERROR: code-server currently requires node v20."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
@@ -75,17 +87,20 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${npm_config_user_agent-}" in npm*)
|
||||
# We are running under npm.
|
||||
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
||||
echo "Please pass --unsafe-perm to npm to install code-server"
|
||||
echo "Otherwise the postinstall script does not have permissions to run"
|
||||
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
||||
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# Under npm, if we are running as root, we need --unsafe-perm otherwise
|
||||
# post-install scripts will not have sufficient permissions to do their thing.
|
||||
if is_root; then
|
||||
case "${npm_config_user_agent-}" in npm*)
|
||||
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
||||
echo "Please pass --unsafe-perm to npm to install code-server"
|
||||
echo "Otherwise post-install scripts will not have permissions to run"
|
||||
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
||||
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if ! vscode_install; then
|
||||
echo "You may not have the required dependencies to build the native modules."
|
||||
|
||||
@@ -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.17.2
|
||||
version: 3.20.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.21.2
|
||||
appVersion: 4.89.1
|
||||
|
||||
@@ -177,9 +177,12 @@ spec:
|
||||
{{- if .existingClaim }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .existingClaim }}
|
||||
{{- else }}
|
||||
{{- else if .hostPath }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
type: Directory
|
||||
{{- else }}
|
||||
emptyDir:
|
||||
{{- toYaml .emptyDir | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.21.2'
|
||||
tag: '4.89.1'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
@@ -190,6 +190,7 @@ extraVolumeMounts: []
|
||||
# readOnly: true
|
||||
# existingClaim: volume-claim
|
||||
# hostPath: ""
|
||||
# emptyDir: {}
|
||||
|
||||
extraConfigmapMounts: []
|
||||
# - name: certs-configmap
|
||||
|
||||
@@ -18,6 +18,7 @@ group "default" {
|
||||
targets = [
|
||||
"code-server-debian-12",
|
||||
"code-server-ubuntu-focal",
|
||||
"code-server-ubuntu-noble",
|
||||
"code-server-fedora-39",
|
||||
"code-server-opensuse-tumbleweed",
|
||||
]
|
||||
@@ -69,6 +70,17 @@ target "code-server-ubuntu-focal" {
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-ubuntu-noble" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("noble"),
|
||||
)
|
||||
args = {
|
||||
BASE = "ubuntu:noble"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-fedora-39" {
|
||||
dockerfile = "ci/release-image/Dockerfile.fedora"
|
||||
tags = concat(
|
||||
|
||||
@@ -37,7 +37,7 @@ for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v18.x
|
||||
- `node` v20.x
|
||||
- `git` v2.x or greater
|
||||
- [`git-lfs`](https://git-lfs.github.com)
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
|
||||
@@ -11,14 +11,14 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||
```
|
||||
|
||||
6. Exit the terminal using `exit` and then reopen the terminal
|
||||
7. Install and use Node.js 18:
|
||||
7. Install and use Node.js 20:
|
||||
|
||||
```shell
|
||||
nvm install 18
|
||||
nvm use 18
|
||||
```
|
||||
|
||||
8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`
|
||||
8. Install code-server globally on device with: `npm install --global code-server`
|
||||
9. Run code-server with `code-server`
|
||||
10. Access on localhost:8080 in your browser
|
||||
|
||||
|
||||
12
docs/npm.md
12
docs/npm.md
@@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
|
||||
## Node.js version
|
||||
|
||||
We use the same major version of Node.js shipped with Code's remote, which is
|
||||
currently `18.x`. VS Code also [lists Node.js
|
||||
currently `20.x`. VS Code also [lists Node.js
|
||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
|
||||
Using other versions of Node.js [may lead to unexpected
|
||||
@@ -79,7 +79,7 @@ Proceed to [installing](#installing)
|
||||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node18 pkgconf
|
||||
pkg install -y git python npm-node20 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
@@ -92,7 +92,7 @@ Installing code-server requires all of the [prerequisites for VS Code developmen
|
||||
Next, install code-server with:
|
||||
|
||||
```bash
|
||||
npm install --global code-server --unsafe-perm
|
||||
npm install --global code-server
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
@@ -112,7 +112,7 @@ For help and additional troubleshooting, see [#1397](https://github.com/coder/co
|
||||
After adding the dependencies for your OS, install the code-server package globally:
|
||||
|
||||
```bash
|
||||
npm install --global code-server --unsafe-perm
|
||||
npm install --global code-server
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
@@ -144,8 +144,8 @@ To debug installation issues, install with `npm`:
|
||||
|
||||
```shell
|
||||
# Uninstall
|
||||
npm uninstall --global --unsafe-perm code-server > /dev/null 2>&1
|
||||
npm uninstall --global code-server > /dev/null 2>&1
|
||||
|
||||
# Install with logging
|
||||
npm install --loglevel verbose --global --unsafe-perm code-server
|
||||
npm install --loglevel verbose --global code-server
|
||||
```
|
||||
|
||||
@@ -57,7 +57,7 @@ npm config set python python3
|
||||
node -v
|
||||
```
|
||||
|
||||
you will get Node version `v18`
|
||||
you will get Node version `v20`
|
||||
|
||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||
|
||||
@@ -70,7 +70,7 @@ code-server --auth none
|
||||
7. If already installed then use the following command for upgradation.
|
||||
|
||||
```
|
||||
npm update --global code-server --unsafe-perm
|
||||
npm update --global code-server
|
||||
```
|
||||
|
||||
## Upgrade
|
||||
|
||||
17
flake.lock
generated
17
flake.lock
generated
@@ -5,11 +5,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -20,12 +20,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1683594133,
|
||||
"narHash": "sha256-iUhLhEAgOCnexSGDsYT2ouydis09uDoNzM7UC685XGE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8d447c5626cfefb9b129d5b30103344377fe09bc",
|
||||
"type": "github"
|
||||
"lastModified": 1716137900,
|
||||
"narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=",
|
||||
"path": "/nix/store/r8nhgnkxacbnf4kv8kdi8b6ks3k9b16i-source",
|
||||
"rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
nodejs = pkgs.nodejs-18_x;
|
||||
nodejs = pkgs.nodejs_20;
|
||||
yarn' = pkgs.yarn.override { inherit nodejs; };
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
||||
@@ -441,7 +441,7 @@ install_npm() {
|
||||
return
|
||||
fi
|
||||
echoerr "Please install npm to install code-server!"
|
||||
echoerr "You will need at least node v18 and a few C dependencies."
|
||||
echoerr "You will need at least node v20 and a few C dependencies."
|
||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||
|
||||
exit 1
|
||||
|
||||
Submodule lib/vscode updated: 019f4d1419...611f9bfce6
18
package.json
18
package.json
@@ -44,14 +44,14 @@
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/http-proxy": "1.17.7",
|
||||
"@types/js-yaml": "^4.0.6",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/node": "20.x",
|
||||
"@types/pem": "^1.14.1",
|
||||
"@types/proxy-from-env": "^1.0.1",
|
||||
"@types/safe-compare": "^1.1.0",
|
||||
"@types/semver": "^7.5.2",
|
||||
"@types/trusted-types": "^2.0.4",
|
||||
"@types/ws": "^8.5.5",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"audit-ci": "^6.6.1",
|
||||
"doctoc": "^2.2.1",
|
||||
@@ -61,7 +61,7 @@
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier-plugin-sh": "^0.13.1",
|
||||
"prettier-plugin-sh": "^0.14.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
@@ -71,7 +71,7 @@
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"env-paths": "^2.2.1",
|
||||
"express": "5.0.0-alpha.8",
|
||||
"express": "5.0.0-beta.3",
|
||||
"http-proxy": "^1.18.1",
|
||||
"httpolyglot": "^0.1.2",
|
||||
"i18next": "^23.5.1",
|
||||
@@ -79,7 +79,7 @@
|
||||
"limiter": "^2.1.0",
|
||||
"pem": "^1.14.8",
|
||||
"proxy-agent": "^6.3.1",
|
||||
"qs": "6.9.7",
|
||||
"qs": "6.12.1",
|
||||
"rotating-file-stream": "^3.1.1",
|
||||
"safe-buffer": "^5.2.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
@@ -88,11 +88,7 @@
|
||||
"xdg-basedir": "^4.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "^18.0.0",
|
||||
"qs": "6.9.7"
|
||||
},
|
||||
"overrides": {
|
||||
"qs": "6.9.7"
|
||||
"@types/node": "20.x"
|
||||
},
|
||||
"bin": {
|
||||
"code-server": "out/node/entry.js"
|
||||
@@ -107,7 +103,7 @@
|
||||
"remote-development"
|
||||
],
|
||||
"engines": {
|
||||
"node": "18"
|
||||
"node": "20"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
||||
@@ -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
|
||||
@@ -194,7 +194,9 @@ class RemoteAuthoritiesImpl {
|
||||
@@ -212,7 +212,9 @@ class RemoteAuthoritiesImpl {
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
@@ -111,7 +111,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -269,16 +269,15 @@ export class WebClientServer {
|
||||
@@ -270,16 +270,15 @@ export class WebClientServer {
|
||||
return void res.end();
|
||||
}
|
||||
|
||||
@@ -133,20 +133,20 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
);
|
||||
if (!remoteAuthority) {
|
||||
return serveError(req, res, 400, `Bad request.`);
|
||||
@@ -305,8 +304,12 @@ export class WebClientServer {
|
||||
@@ -306,8 +305,12 @@ export class WebClientServer {
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -341,8 +344,10 @@ export class WebClientServer {
|
||||
@@ -343,8 +346,10 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
};
|
||||
|
||||
if (useTestResolver) {
|
||||
@@ -369,7 +374,7 @@ export class WebClientServer {
|
||||
@@ -371,7 +376,7 @@ export class WebClientServer {
|
||||
'default-src \'self\';',
|
||||
'img-src \'self\' https: data: blob:;',
|
||||
'media-src \'self\';',
|
||||
@@ -168,7 +168,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
'child-src \'self\';',
|
||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||
'worker-src \'self\' data: blob:;',
|
||||
@@ -442,3 +447,70 @@ export class WebClientServer {
|
||||
@@ -444,3 +449,70 @@ export class WebClientServer {
|
||||
return void res.end(data);
|
||||
}
|
||||
}
|
||||
@@ -303,10 +303,10 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
@@ -102,7 +101,7 @@ export abstract class AbstractExtensionR
|
||||
const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
|
||||
@@ -99,7 +98,7 @@ export abstract class AbstractExtensionR
|
||||
: version,
|
||||
path: 'extension'
|
||||
}));
|
||||
|
||||
@@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
@@ -104,10 +104,14 @@ class RemoteTerminalBackend extends Base
|
||||
@@ -106,10 +106,14 @@ class RemoteTerminalBackend extends Base
|
||||
}
|
||||
const reqId = e.reqId;
|
||||
const commandId = e.commandId;
|
||||
|
||||
136
patches/clipboard.diff
Normal file
136
patches/clipboard.diff
Normal file
@@ -0,0 +1,136 @@
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
@@ -8,6 +8,7 @@ import { isWeb } from 'vs/base/common/pl
|
||||
import { isString } from 'vs/base/common/types';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { localize } from 'vs/nls';
|
||||
+import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI';
|
||||
@@ -89,6 +90,11 @@ CommandsRegistry.registerCommand('_remot
|
||||
return lines.join('\n');
|
||||
});
|
||||
|
||||
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
||||
+ const clipboardService = accessor.get(IClipboardService);
|
||||
+ clipboardService.writeText(content);
|
||||
+})
|
||||
+
|
||||
class RemoteExtensionManagementCLI extends ExtensionManagementCLI {
|
||||
|
||||
private _location: string | undefined;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
-export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
||||
+export interface ClipboardPipeArgs {
|
||||
+ type: 'clipboard';
|
||||
+ content: string;
|
||||
+}
|
||||
+
|
||||
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
@@ -105,6 +110,9 @@ export class CLIServerBase {
|
||||
case 'extensionManagement':
|
||||
returnObj = await this.manageExtensions(data);
|
||||
break;
|
||||
+ case 'clipboard':
|
||||
+ returnObj = await this.clipboard(data);
|
||||
+ break;
|
||||
default:
|
||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
||||
break;
|
||||
@@ -172,6 +180,10 @@ export class CLIServerBase {
|
||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||
}
|
||||
|
||||
+ private async clipboard(data: ClipboardPipeArgs): Promise<undefined> {
|
||||
+ return await this._commands.executeCommand('_remoteCLI.setClipboard', data.content);
|
||||
+ }
|
||||
+
|
||||
dispose(): void {
|
||||
this._server.close();
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
@@ -97,7 +97,7 @@ class RemoteTerminalBackend extends Base
|
||||
}
|
||||
});
|
||||
|
||||
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
||||
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
||||
// Ensure this request for for this window
|
||||
const pty = this._ptys.get(e.persistentProcessId);
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
|
||||
sandbox?: boolean;
|
||||
|
||||
'enable-coi'?: boolean;
|
||||
+ 'stdin-to-clipboard'?: boolean;
|
||||
|
||||
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
|
||||
'no-proxy-server'?: boolean;
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
|
||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
+ 'stdin-to-clipboard': { type: 'boolean', cat: 'o', alias: 'c', description: localize('clipboard', "copies the STDIN to the clipboard") },
|
||||
|
||||
'extensions-dir': { type: 'string', deprecates: ['extensionHomePath'], cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
||||
'extensions-download-dir': { type: 'string' },
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
@@ -76,6 +76,7 @@ const isSupportedForPipe = (optionId: ke
|
||||
case 'verbose':
|
||||
case 'remote':
|
||||
case 'locate-shell-integration-path':
|
||||
+ case 'stdin-to-clipboard':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -293,6 +294,23 @@ export async function main(desc: Product
|
||||
}
|
||||
}
|
||||
} else {
|
||||
+ if (parsedArgs['stdin-to-clipboard']) {
|
||||
+ if(!hasStdinWithoutTty()) {
|
||||
+ console.error("stdin has a tty.");
|
||||
+ return;
|
||||
+ }
|
||||
+ const fs = require("fs");
|
||||
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
||||
+ const clipboardContent = stdinBuffer.toString();
|
||||
+ sendToPipe({
|
||||
+ type: 'clipboard',
|
||||
+ content: clipboardContent
|
||||
+ }, verbose).catch(e => {
|
||||
+ console.error('Error when requesting status:', e);
|
||||
+ });
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (parsedArgs.status) {
|
||||
sendToPipe({
|
||||
type: 'status'
|
||||
@@ -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
|
||||
@@ -248,6 +248,10 @@ export class Extension implements IExten
|
||||
@@ -285,6 +285,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -11,7 +11,7 @@ import * as path from 'vs/base/common/pa
|
||||
import { IURITransformer } from 'vs/base/common/uriIpc';
|
||||
import { getMachineId, getSqmMachineId } from 'vs/base/node/id';
|
||||
import { getMachineId, getSqmMachineId, getdevDeviceId } from 'vs/base/node/id';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
|
||||
@@ -228,6 +228,9 @@ export async function setupServerService
|
||||
@@ -238,6 +238,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
|
||||
@@ -53,7 +53,7 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
export const LANGUAGE_DEFAULT = 'en';
|
||||
|
||||
let _isWindows = false;
|
||||
@@ -111,17 +109,21 @@ else if (typeof navigator === 'object' &
|
||||
@@ -112,17 +110,21 @@ else if (typeof navigator === 'object' &
|
||||
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
||||
_isWeb = true;
|
||||
|
||||
@@ -218,9 +218,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
import { isString } from 'vs/base/common/types';
|
||||
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
||||
import { CharCode } from 'vs/base/common/charCode';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
||||
@@ -345,6 +346,8 @@ export class WebClientServer {
|
||||
|
||||
@@ -348,6 +349,8 @@ export class WebClientServer {
|
||||
callbackRoute: this._callbackRoute
|
||||
};
|
||||
|
||||
@@ -229,7 +229,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
@@ -353,6 +356,7 @@ export class WebClientServer {
|
||||
@@ -356,6 +359,7 @@ export class WebClientServer {
|
||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
BASE: base,
|
||||
VS_BASE: vscodeBase,
|
||||
@@ -249,8 +249,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -102,6 +103,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string
|
||||
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
||||
'auth'?: string;
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
+ 'locale'?: string
|
||||
@@ -261,7 +261,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
@@ -50,7 +50,7 @@ import 'vs/workbench/services/dialogs/br
|
||||
@@ -52,7 +52,7 @@ import 'vs/workbench/services/dialogs/br
|
||||
import 'vs/workbench/services/host/browser/browserHostService';
|
||||
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
|
||||
import 'vs/workbench/services/clipboard/browser/clipboardService';
|
||||
@@ -270,7 +270,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
import 'vs/workbench/services/path/browser/pathService';
|
||||
import 'vs/workbench/services/themes/browser/browserHostColorSchemeService';
|
||||
import 'vs/workbench/services/encryption/browser/encryptionService';
|
||||
@@ -116,8 +116,9 @@ registerSingleton(ILanguagePackService,
|
||||
@@ -118,8 +118,9 @@ registerSingleton(ILanguagePackService,
|
||||
// Logs
|
||||
import 'vs/workbench/contrib/logs/browser/logs.contribution';
|
||||
|
||||
@@ -348,7 +348,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
|
||||
@@ -340,9 +340,6 @@ export class InstallAction extends Exten
|
||||
@@ -341,9 +341,6 @@ export class InstallAction extends Exten
|
||||
if (this.extension.isBuiltin) {
|
||||
return;
|
||||
}
|
||||
@@ -358,7 +358,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
||||
this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
||||
this.updateLabel();
|
||||
@@ -610,7 +607,7 @@ export abstract class InstallInOtherServ
|
||||
@@ -614,7 +611,7 @@ export abstract class InstallInOtherServ
|
||||
}
|
||||
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
@@ -367,7 +367,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
// Prefers to run on UI
|
||||
@@ -1782,17 +1779,6 @@ export class SetLanguageAction extends E
|
||||
@@ -1848,17 +1845,6 @@ export class SetLanguageAction extends E
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = SetLanguageAction.DisabledClass;
|
||||
@@ -385,7 +385,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
@@ -1809,7 +1795,6 @@ export class ClearLanguageAction extends
|
||||
@@ -1875,7 +1861,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
@@ -393,7 +393,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);
|
||||
@@ -1819,17 +1804,6 @@ export class ClearLanguageAction extends
|
||||
@@ -1885,17 +1870,6 @@ export class ClearLanguageAction extends
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = ClearLanguageAction.DisabledClass;
|
||||
|
||||
@@ -27,7 +27,7 @@ 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
|
||||
@@ -282,6 +282,16 @@ export interface IWorkbenchConstructionO
|
||||
@@ -303,6 +303,16 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly userDataPath?: string
|
||||
|
||||
@@ -99,10 +99,10 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -98,6 +100,8 @@ export interface ServerParsedArgs {
|
||||
@@ -99,6 +101,8 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
'auth'?: string;
|
||||
+ 'disable-file-downloads'?: boolean;
|
||||
+ 'disable-file-uploads'?: boolean;
|
||||
|
||||
@@ -112,8 +112,8 @@ 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
|
||||
@@ -332,6 +332,8 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
@@ -334,6 +334,8 @@ export class WebClientServer {
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
@@ -125,31 +125,30 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -7,12 +7,12 @@ import { Event } from 'vs/base/common/ev
|
||||
@@ -7,11 +7,11 @@ import { Event } from 'vs/base/common/ev
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
@@ -87,7 +87,7 @@ export class WorkbenchContextKeysHandler
|
||||
import { getRemoteName } from 'vs/platform/remote/common/remoteHosts';
|
||||
@@ -70,7 +70,7 @@ export class WorkbenchContextKeysHandler
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||
@@ -224,6 +224,10 @@ export class WorkbenchContextKeysHandler
|
||||
@@ -197,6 +197,10 @@ export class WorkbenchContextKeysHandler
|
||||
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||
|
||||
@@ -168,12 +167,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
@@ -550,13 +550,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
@@ -561,13 +561,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
id: DOWNLOAD_COMMAND_ID,
|
||||
title: DOWNLOAD_LABEL
|
||||
},
|
||||
@@ -197,7 +196,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||
)
|
||||
}));
|
||||
|
||||
@@ -568,6 +571,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
@@ -579,6 +582,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
title: UPLOAD_LABEL,
|
||||
},
|
||||
when: ContextKeyExpr.and(
|
||||
@@ -282,7 +281,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
|
||||
@@ -68,6 +68,7 @@ import { HoverPosition } from 'vs/base/b
|
||||
@@ -65,6 +65,7 @@ import { timeout } from 'vs/base/common/
|
||||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { mainWindow } from 'vs/base/browser/window';
|
||||
import { IExplorerFileContribution, explorerFileContribRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
|
||||
@@ -290,7 +289,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||
|
||||
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||
|
||||
@@ -1079,7 +1080,8 @@ export class FileDragAndDrop implements
|
||||
@@ -1001,7 +1002,8 @@ export class FileDragAndDrop implements
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
||||
@@ -300,7 +299,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')) {
|
||||
@@ -1304,15 +1306,17 @@ export class FileDragAndDrop implements
|
||||
@@ -1226,15 +1228,17 @@ export class FileDragAndDrop implements
|
||||
|
||||
// External file DND (Import/Upload file)
|
||||
if (data instanceof NativeDragAndDropData) {
|
||||
|
||||
@@ -14,12 +14,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
-import { $, Dimension, addDisposableListener, append, clearNode, getWindow, reset } from 'vs/base/browser/dom';
|
||||
+import { $, Dimension, addDisposableListener, append, clearNode, getWindow, reset, prepend } from 'vs/base/browser/dom';
|
||||
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from 'vs/base/browser/dom';
|
||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from 'vs/base/browser/dom';
|
||||
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
@@ -55,7 +55,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||
@@ -54,7 +54,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||
import { IEditorOpenContext, IEditorSerializer } from 'vs/workbench/common/editor';
|
||||
import { IWebviewElement, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedColors';
|
||||
@@ -801,6 +801,72 @@ export class GettingStartedPage extends
|
||||
@@ -816,6 +816,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', {},);
|
||||
|
||||
@@ -837,6 +903,9 @@ export class GettingStartedPage extends
|
||||
@@ -887,6 +953,9 @@ export class GettingStartedPage extends
|
||||
recentList.setLimit(5);
|
||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||
}
|
||||
@@ -135,7 +135,7 @@ 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
|
||||
@@ -292,6 +292,11 @@ export interface IWorkbenchConstructionO
|
||||
@@ -313,6 +313,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly isEnabledFileUploads?: boolean
|
||||
|
||||
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -104,6 +105,7 @@ export interface ServerParsedArgs {
|
||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
'locale'?: string
|
||||
@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -336,6 +336,7 @@ export class WebClientServer {
|
||||
@@ -339,6 +339,7 @@ export class WebClientServer {
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||
@@ -217,12 +217,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from 'vs/workbench/common/contextkeys';
|
||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from 'vs/workbench/common/contextkeys';
|
||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
@@ -227,6 +227,7 @@ export class WorkbenchContextKeysHandler
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -200,6 +200,7 @@ export class WorkbenchContextKeysHandler
|
||||
// code-server
|
||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
||||
|
||||
@@ -184,7 +184,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa
|
||||
@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
|
||||
@@ -264,11 +264,11 @@ 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
|
||||
@@ -306,6 +306,7 @@ export class WebClientServer {
|
||||
@@ -307,6 +307,7 @@ export class WebClientServer {
|
||||
} : undefined;
|
||||
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
const productConfiguration = {
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
|
||||
15
patches/keepalive.diff
Normal file
15
patches/keepalive.diff
Normal file
@@ -0,0 +1,15 @@
|
||||
This can be removed after upgrading to Node >= 19 as keepAlive is defaulted to
|
||||
true after 19.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
||||
@@ -42,6 +42,7 @@ export async function getProxyAgent(rawR
|
||||
port: (proxyEndpoint.port ? +proxyEndpoint.port : 0) || (proxyEndpoint.protocol === 'https' ? 443 : 80),
|
||||
auth: proxyEndpoint.auth,
|
||||
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true,
|
||||
+ keepAlive: true,
|
||||
};
|
||||
|
||||
return requestURL.protocol === 'http:'
|
||||
@@ -18,9 +18,9 @@ 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
|
||||
@@ -327,6 +327,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
@@ -329,6 +329,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
+ userDataPath: this._environmentService.userDataPath,
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
@@ -30,7 +30,7 @@ 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
|
||||
@@ -277,6 +277,11 @@ export interface IWorkbenchConstructionO
|
||||
@@ -298,6 +298,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly configurationDefaults?: Record<string, any>;
|
||||
|
||||
|
||||
@@ -28,11 +28,11 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -96,6 +97,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -97,6 +98,7 @@ export const serverOptions: OptionDescri
|
||||
export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
+ 'auth'?: string
|
||||
+ 'auth'?: string;
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -40,14 +40,14 @@ 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
|
||||
@@ -311,6 +311,7 @@ export class WebClientServer {
|
||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
|
||||
@@ -40,8 +40,8 @@ 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
|
||||
@@ -113,7 +113,7 @@ export class WebClientServer {
|
||||
const serverRootPath = getRemoteServerRootPath(_productService);
|
||||
@@ -114,7 +114,7 @@ export class WebClientServer {
|
||||
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
||||
@@ -49,40 +49,51 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -311,14 +311,7 @@ export class WebClientServer {
|
||||
@@ -312,14 +312,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
- ...this._productService.extensionsGallery,
|
||||
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
||||
- scheme: 'http',
|
||||
- authority: remoteAuthority,
|
||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
|
||||
if (!this._environmentService.isBuilt) {
|
||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
||||
@@ -140,9 +140,9 @@ export abstract class AbstractExtensionR
|
||||
}
|
||||
|
||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
||||
- const uriPath = uri.path, serverRootPath = RemoteAuthorities.getServerRootPath();
|
||||
- // test if the path starts with the server root path followed by the web extension resource end point segment
|
||||
- return uriPath.startsWith(serverRootPath) && uriPath.startsWith(WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT, serverRootPath.length);
|
||||
+ const uriPath = uri.path;
|
||||
+ // test if the path starts with the web extension resource end point segment
|
||||
+ return uriPath.startsWith(WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT);
|
||||
}
|
||||
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
||||
@@ -114,7 +114,10 @@ export class ExtensionsDownloader extend
|
||||
return false;
|
||||
}
|
||||
|
||||
+ return false
|
||||
+ // @ts-expect-error
|
||||
const value = this.configurationService.getValue('extensions.verifySignature');
|
||||
+ // @ts-expect-error
|
||||
return isBoolean(value) ? value : true;
|
||||
}
|
||||
|
||||
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||
@@ -77,7 +76,7 @@ export abstract class AbstractExtensionR
|
||||
private readonly _environmentService: IEnvironmentService,
|
||||
private readonly _configurationService: IConfigurationService,
|
||||
) {
|
||||
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
+ this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
if (_productService.extensionsGallery) {
|
||||
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
||||
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
|
||||
|
||||
@@ -42,16 +42,16 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityReso
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
@@ -34,7 +34,7 @@ export class RemoteAuthorityResolverServ
|
||||
isWorkbenchOptionsBasedResolution: boolean,
|
||||
@@ -35,7 +35,7 @@ export class RemoteAuthorityResolverServ
|
||||
connectionToken: Promise<string> | string | undefined,
|
||||
resourceUriProvider: ((uri: URI) => URI) | undefined,
|
||||
serverBasePath: string | undefined,
|
||||
- @IProductService productService: IProductService,
|
||||
+ @IProductService private readonly productService: IProductService,
|
||||
@ILogService private readonly _logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
@@ -85,9 +85,14 @@ export class RemoteAuthorityResolverServ
|
||||
@@ -86,9 +86,14 @@ export class RemoteAuthorityResolverServ
|
||||
const connectionToken = await Promise.resolve(this._connectionTokens.get(authority) || this._connectionToken);
|
||||
performance.mark(`code/didResolveConnectionToken/${authorityPrefix}`);
|
||||
this._logService.info(`Resolved connection token (${authorityPrefix}) after ${sw.elapsed()} ms`);
|
||||
@@ -71,14 +71,14 @@ 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
|
||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||
@@ -313,6 +313,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
|
||||
@@ -19,3 +19,5 @@ display-language.diff
|
||||
cli-window-open.diff
|
||||
getting-started.diff
|
||||
safari.diff
|
||||
keepalive.diff
|
||||
clipboard.diff
|
||||
|
||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -313,6 +313,10 @@ export class WebClientServer {
|
||||
@@ -314,6 +314,10 @@ export class WebClientServer {
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||
@@ -64,4 +64,4 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+ },
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
|
||||
@@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
|
||||
let version = packageJson.version;
|
||||
const quality = product.quality;
|
||||
@@ -433,7 +432,7 @@ function tweakProductForServerWeb(produc
|
||||
@@ -439,7 +438,7 @@ function tweakProductForServerWeb(produc
|
||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||
optimizeTask,
|
||||
util.rimraf(`out-vscode-${type}-min`),
|
||||
|
||||
@@ -20,60 +20,96 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||
@@ -149,7 +150,10 @@ export async function setupServerService
|
||||
@@ -147,11 +148,23 @@ export async function setupServerService
|
||||
const requestService = new RequestService(configurationService, environmentService, logService, loggerService);
|
||||
services.set(IRequestService, requestService);
|
||||
|
||||
+ let isContainer = undefined;
|
||||
+ try {
|
||||
+ await Promises.stat('/run/.containerenv');
|
||||
+ isContainer = true;
|
||||
+ } catch (error) { /* Does not exist, probably. */ }
|
||||
+ if (!isContainer) {
|
||||
+ try {
|
||||
+ const content = await Promises.readFile('/proc/self/cgroup', 'utf8')
|
||||
+ isContainer = content.includes('docker');
|
||||
+ } catch (error) { /* Permission denied, probably. */ }
|
||||
+ }
|
||||
+
|
||||
let oneDsAppender: ITelemetryAppender = NullAppender;
|
||||
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||
if (supportsTelemetry(productService, environmentService)) {
|
||||
- if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
||||
+ const telemetryEndpoint = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
|
||||
+ if (telemetryEndpoint) {
|
||||
+ oneDsAppender = new OneDataSystemAppender(requestService, false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint));
|
||||
+ } else if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
||||
oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
||||
- oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
||||
+ if (!isLoggingOnly(productService, environmentService) && productService.telemetryEndpoint) {
|
||||
+ oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, () => new TelemetryClient(productService.telemetryEndpoint!, machineId, isContainer));
|
||||
disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
||||
}
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
@@ -0,0 +1,49 @@
|
||||
@@ -0,0 +1,71 @@
|
||||
+import { AppInsightsCore, IExtendedTelemetryItem, ITelemetryItem } from '@microsoft/1ds-core-js';
|
||||
+import * as https from 'https';
|
||||
+import * as http from 'http';
|
||||
+import * as os from 'os';
|
||||
+
|
||||
+interface SystemInfo {
|
||||
+ measurements: Record<string, number | undefined>;
|
||||
+ properties: Record<string, string | boolean | null | undefined>;
|
||||
+}
|
||||
+
|
||||
+export class TelemetryClient extends AppInsightsCore {
|
||||
+ public constructor(private readonly endpoint: string) {
|
||||
+ private readonly systemInfo: SystemInfo = {
|
||||
+ measurements: {},
|
||||
+ properties: {},
|
||||
+ };
|
||||
+
|
||||
+ public constructor(
|
||||
+ private readonly endpoint: string,
|
||||
+ machineId: string,
|
||||
+ isContainer: boolean | undefined) {
|
||||
+ super();
|
||||
+
|
||||
+ // os.cpus() can take a very long time sometimes (personally I see 1-2
|
||||
+ // seconds in a Coder workspace). This adds up significantly, especially
|
||||
+ // when many telemetry requests are sent during startup, which can cause
|
||||
+ // connection timeouts. Try to cache as much as we can.
|
||||
+ try {
|
||||
+ const cpus = os.cpus();
|
||||
+ this.systemInfo.measurements.cores = cpus.length;
|
||||
+ this.systemInfo.properties['common.cpuModel'] = cpus[0].model;
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ this.systemInfo.properties['common.shell'] = os.userInfo().shell;
|
||||
+ this.systemInfo.properties['common.release'] = os.release();
|
||||
+ this.systemInfo.properties['common.arch'] = os.arch();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ this.systemInfo.properties['common.remoteMachineId'] = machineId;
|
||||
+ this.systemInfo.properties['common.isContainer'] = isContainer;
|
||||
+ }
|
||||
+
|
||||
+ public override track(item: IExtendedTelemetryItem | ITelemetryItem): void {
|
||||
+ const options = item.baseData || {}
|
||||
+ if (!options.properties) {
|
||||
+ options.properties = {};
|
||||
+ options.measurements = {
|
||||
+ ...(options.measurements || {}),
|
||||
+ ...this.systemInfo.measurements,
|
||||
+ }
|
||||
+ if (!options.measurements) {
|
||||
+ options.measurements = {};
|
||||
+ options.properties = {
|
||||
+ ...(options.properties || {}),
|
||||
+ ...this.systemInfo.properties,
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ const cpus = os.cpus();
|
||||
+ options.measurements.cores = cpus.length;
|
||||
+ options.properties['common.cpuModel'] = cpus[0].model;
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.measurements.memoryFree = os.freemem();
|
||||
+ options.measurements.memoryTotal = os.totalmem();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.properties['common.shell'] = os.userInfo().shell;
|
||||
+ options.properties['common.release'] = os.release();
|
||||
+ options.properties['common.arch'] = os.arch();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ const request = (/^http:/.test(this.endpoint) ? http : https).request(this.endpoint, {
|
||||
+ method: 'POST',
|
||||
+ headers: {
|
||||
@@ -90,11 +126,38 @@ 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
|
||||
@@ -317,6 +317,7 @@ export class WebClientServer {
|
||||
@@ -318,6 +318,8 @@ export class WebClientServer {
|
||||
scope: vscodeBase + '/',
|
||||
path: base + '/_static/out/browser/serviceWorker.js',
|
||||
},
|
||||
+ enableTelemetry: this._productService.enableTelemetry,
|
||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -64,6 +64,7 @@ export interface IProductConfiguration {
|
||||
readonly path: string;
|
||||
readonly scope: string;
|
||||
}
|
||||
+ readonly telemetryEndpoint?: string
|
||||
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
@@ -55,7 +55,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||
controlUrl: "",
|
||||
recommendationsUrl: "",
|
||||
- })
|
||||
+ }),
|
||||
+ telemetryEndpoint: env.CS_TELEMETRY_URL || product.telemetryEndpoint || "https://v1.telemetry.coder.com/track",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -105,14 +105,14 @@ 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
|
||||
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||
@@ -311,6 +311,7 @@ export class WebClientServer {
|
||||
const productConfiguration = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
};
|
||||
} satisfies Partial<IProductConfiguration>;
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -92,6 +94,8 @@ export const serverOptions: OptionDescri
|
||||
@@ -93,6 +95,8 @@ export const serverOptions: OptionDescri
|
||||
};
|
||||
|
||||
export interface ServerParsedArgs {
|
||||
|
||||
@@ -54,10 +54,10 @@ 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
|
||||
@@ -323,6 +323,7 @@ export class WebClientServer {
|
||||
|
||||
@@ -325,6 +325,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
serverBasePath: this._basePath,
|
||||
+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||
@@ -70,12 +70,12 @@ 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-MbYFw/X6HjRtVlnfFTL3ylPDt3RsDzWrYVjfrzKJbMA=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-GMHk6lNeQWxwh8HIKzVGfpEl6cvmfTYJeAVaOdbHfSc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
- content="default-src 'none'; script-src 'sha256-bQPwjO6bLiyf6v9eDVtAI67LrfonA1w49aFkRXBy4/g=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-R3BsSkqy7qFbvWSmwr7WqT1eg6Sq4zSe0uIlrUQ4EKE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport"
|
||||
@@ -339,6 +339,12 @@
|
||||
@@ -344,6 +344,12 @@
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
@@ -92,7 +92,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-no-csp.html
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
||||
@@ -338,6 +338,12 @@
|
||||
@@ -343,6 +343,12 @@
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
|
||||
@@ -833,8 +833,8 @@ export interface CodeArgs extends UserProvidedCodeArgs {
|
||||
version: boolean
|
||||
"without-connection-token"?: boolean
|
||||
"without-browser-env-var"?: boolean
|
||||
compatibility: string
|
||||
log: string[] | undefined
|
||||
compatibility?: string
|
||||
log?: string[]
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -843,15 +843,12 @@ export interface CodeArgs extends UserProvidedCodeArgs {
|
||||
export type SpawnCodeCli = (args: CodeArgs) => Promise<void>
|
||||
|
||||
/**
|
||||
* Convert our arguments to VS Code server arguments.
|
||||
* Convert our arguments to equivalent VS Code server arguments.
|
||||
* Does not add any extra arguments.
|
||||
*/
|
||||
export const toCodeArgs = async (args: DefaultedArgs): Promise<CodeArgs> => {
|
||||
return {
|
||||
...args,
|
||||
"accept-server-license-terms": true,
|
||||
// This seems to be used to make the connection token flags optional (when
|
||||
// set to 1.63) but we have always included them.
|
||||
compatibility: "1.64",
|
||||
/** Type casting. */
|
||||
help: !!args.help,
|
||||
version: !!args.version,
|
||||
|
||||
@@ -319,8 +319,8 @@ export const getCookieOptions = (req: express.Request): express.CookieOptions =>
|
||||
// URL of that page) and the relative path to the root as given to it by the
|
||||
// backend. Using these two we can determine the true absolute root.
|
||||
const url = new URL(
|
||||
req.query.base || req.body.base || "/",
|
||||
req.query.href || req.body.href || "http://" + (req.headers.host || "localhost"),
|
||||
req.query.base || req.body?.base || "/",
|
||||
req.query.href || req.body?.href || "http://" + (req.headers.host || "localhost"),
|
||||
)
|
||||
return {
|
||||
domain: getCookieDomain(url.host, req.args["proxy-domain"]),
|
||||
|
||||
@@ -52,12 +52,17 @@ export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
|
||||
|
||||
try {
|
||||
await spawnCli(await toCodeArgs(args))
|
||||
// Rather than have the caller handle errors and exit, spawnCli will exit
|
||||
// itself. Additionally, it does this on a timeout set to 0. So, try
|
||||
// waiting for VS Code to exit before giving up and doing it ourselves.
|
||||
await new Promise((r) => setTimeout(r, 1000))
|
||||
logger.warn("Code never exited")
|
||||
process.exit(0)
|
||||
} catch (error: any) {
|
||||
// spawnCli catches all errors, but just in case that changes.
|
||||
logger.error("Got error from Code", error)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
export const openInExistingInstance = async (args: DefaultedArgs, socketPath: string): Promise<void> => {
|
||||
|
||||
@@ -53,7 +53,7 @@ const maybeProxy = (req: Request): string | undefined => {
|
||||
return undefined
|
||||
}
|
||||
|
||||
router.all("*", async (req, res, next) => {
|
||||
router.all(/.*/, async (req, res, next) => {
|
||||
const port = maybeProxy(req)
|
||||
if (!port) {
|
||||
return next()
|
||||
@@ -97,7 +97,7 @@ router.all("*", async (req, res, next) => {
|
||||
|
||||
export const wsRouter = WsRouter()
|
||||
|
||||
wsRouter.ws("*", async (req, _, next) => {
|
||||
wsRouter.ws(/.*/, async (req, _, next) => {
|
||||
const port = maybeProxy(req)
|
||||
if (!port) {
|
||||
return next()
|
||||
|
||||
@@ -25,7 +25,7 @@ import * as login from "./login"
|
||||
import * as logout from "./logout"
|
||||
import * as pathProxy from "./pathProxy"
|
||||
import * as update from "./update"
|
||||
import { CodeServerRouteWrapper } from "./vscode"
|
||||
import * as vscode from "./vscode"
|
||||
|
||||
/**
|
||||
* Register all routes and middleware.
|
||||
@@ -109,21 +109,21 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
||||
app.router.use("/", domainProxy.router)
|
||||
app.wsRouter.use("/", domainProxy.wsRouter.router)
|
||||
|
||||
app.router.all("/proxy/(:port)(/*)?", async (req, res) => {
|
||||
app.router.all("/proxy/:port/:path(.*)?", async (req, res) => {
|
||||
await pathProxy.proxy(req, res)
|
||||
})
|
||||
app.wsRouter.get("/proxy/(:port)(/*)?", async (req) => {
|
||||
app.wsRouter.get("/proxy/:port/:path(.*)?", async (req) => {
|
||||
await pathProxy.wsProxy(req as pluginapi.WebsocketRequest)
|
||||
})
|
||||
// These two routes pass through the path directly.
|
||||
// So the proxied app must be aware it is running
|
||||
// under /absproxy/<someport>/
|
||||
app.router.all("/absproxy/(:port)(/*)?", async (req, res) => {
|
||||
app.router.all("/absproxy/:port/:path(.*)?", async (req, res) => {
|
||||
await pathProxy.proxy(req, res, {
|
||||
passthroughPath: true,
|
||||
})
|
||||
})
|
||||
app.wsRouter.get("/absproxy/(:port)(/*)?", async (req) => {
|
||||
app.wsRouter.get("/absproxy/:port/:path(.*)?", async (req) => {
|
||||
await pathProxy.wsProxy(req as pluginapi.WebsocketRequest, {
|
||||
passthroughPath: true,
|
||||
})
|
||||
@@ -170,12 +170,10 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
||||
|
||||
app.router.use("/update", update.router)
|
||||
|
||||
const vsServerRouteHandler = new CodeServerRouteWrapper()
|
||||
|
||||
// Note that the root route is replaced in Coder Enterprise by the plugin API.
|
||||
for (const routePrefix of ["/vscode", "/"]) {
|
||||
app.router.use(routePrefix, vsServerRouteHandler.router)
|
||||
app.wsRouter.use(routePrefix, vsServerRouteHandler.wsRouter)
|
||||
app.router.use(routePrefix, vscode.router)
|
||||
app.wsRouter.use(routePrefix, vscode.wsRouter.router)
|
||||
}
|
||||
|
||||
app.router.use(() => {
|
||||
@@ -188,6 +186,6 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
||||
return () => {
|
||||
heart.dispose()
|
||||
pluginApi?.dispose()
|
||||
vsServerRouteHandler.dispose()
|
||||
vscode.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ router.get("/", async (req, res) => {
|
||||
res.send(await getRoot(req))
|
||||
})
|
||||
|
||||
router.post<{}, string, { password: string; base?: string }, { to?: string }>("/", async (req, res) => {
|
||||
const password = sanitizeString(req.body.password)
|
||||
router.post<{}, string, { password?: string; base?: string } | undefined, { to?: string }>("/", async (req, res) => {
|
||||
const password = sanitizeString(req.body?.password)
|
||||
const hashedPasswordFromArgs = req.args["hashed-password"]
|
||||
|
||||
try {
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function proxy(
|
||||
|
||||
if (!(await authenticated(req))) {
|
||||
// If visiting the root (/:port only) redirect to the login page.
|
||||
if (!req.params[0] || req.params[0] === "/") {
|
||||
if (!req.params.path || req.params.path === "/") {
|
||||
const to = self(req)
|
||||
return redirect(req, res, "login", {
|
||||
to: to !== "/" ? to : undefined,
|
||||
|
||||
@@ -14,203 +14,190 @@ import { SocketProxyProvider } from "../socket"
|
||||
import { isFile, loadAMDModule } from "../util"
|
||||
import { Router as WsRouter } from "../wsRouter"
|
||||
|
||||
export const router = express.Router()
|
||||
|
||||
export const wsRouter = WsRouter()
|
||||
|
||||
/**
|
||||
* This is the API of Code's web client server. code-server delegates requests
|
||||
* to Code here.
|
||||
* The API of VS Code's web client server. code-server delegates requests to VS
|
||||
* Code here.
|
||||
*
|
||||
* @see ../../../lib/vscode/src/vs/server/node/server.main.ts:72
|
||||
*/
|
||||
export interface IServerAPI {
|
||||
export interface IVSCodeServerAPI {
|
||||
handleRequest(req: http.IncomingMessage, res: http.ServerResponse): Promise<void>
|
||||
handleUpgrade(req: http.IncomingMessage, socket: net.Socket): void
|
||||
handleServerError(err: Error): void
|
||||
dispose(): void
|
||||
}
|
||||
|
||||
// Types for ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
export type CreateServer = (address: string | net.AddressInfo | null, args: CodeArgs) => Promise<IServerAPI>
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
export type CreateServer = (address: string | net.AddressInfo | null, args: CodeArgs) => Promise<IVSCodeServerAPI>
|
||||
|
||||
export class CodeServerRouteWrapper {
|
||||
/** Assigned in `ensureCodeServerLoaded` */
|
||||
private _codeServerMain!: IServerAPI
|
||||
private _wsRouterWrapper = WsRouter()
|
||||
private _socketProxyProvider = new SocketProxyProvider()
|
||||
public router = express.Router()
|
||||
private mintKeyPromise: Promise<Buffer> | undefined
|
||||
|
||||
public get wsRouter() {
|
||||
return this._wsRouterWrapper.router
|
||||
}
|
||||
|
||||
//#region Route Handlers
|
||||
|
||||
private manifest: express.Handler = async (req, res, next) => {
|
||||
const appName = req.args["app-name"] || "code-server"
|
||||
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
||||
|
||||
return res.end(
|
||||
replaceTemplates(
|
||||
req,
|
||||
JSON.stringify(
|
||||
{
|
||||
name: appName,
|
||||
short_name: appName,
|
||||
start_url: ".",
|
||||
display: "fullscreen",
|
||||
display_override: ["window-controls-overlay"],
|
||||
description: "Run Code on a remote server.",
|
||||
icons: [192, 512].map((size) => ({
|
||||
src: `{{BASE}}/_static/src/browser/media/pwa-icon-${size}.png`,
|
||||
type: "image/png",
|
||||
sizes: `${size}x${size}`,
|
||||
})),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private mintKey: express.Handler = async (req, res, next) => {
|
||||
if (!this.mintKeyPromise) {
|
||||
this.mintKeyPromise = new Promise(async (resolve) => {
|
||||
const keyPath = path.join(req.args["user-data-dir"], "serve-web-key-half")
|
||||
logger.debug(`Reading server web key half from ${keyPath}`)
|
||||
try {
|
||||
resolve(await fs.readFile(keyPath))
|
||||
return
|
||||
} catch (error: any) {
|
||||
if (error.code !== "ENOENT") {
|
||||
logError(logger, `read ${keyPath}`, error)
|
||||
}
|
||||
}
|
||||
// VS Code wants 256 bits.
|
||||
const key = crypto.randomBytes(32)
|
||||
try {
|
||||
await fs.writeFile(keyPath, key)
|
||||
} catch (error: any) {
|
||||
logError(logger, `write ${keyPath}`, error)
|
||||
}
|
||||
resolve(key)
|
||||
})
|
||||
}
|
||||
const key = await this.mintKeyPromise
|
||||
res.end(key)
|
||||
}
|
||||
|
||||
private $root: express.Handler = async (req, res, next) => {
|
||||
const isAuthenticated = await authenticated(req)
|
||||
const NO_FOLDER_OR_WORKSPACE_QUERY = !req.query.folder && !req.query.workspace
|
||||
// Ew means the workspace was closed so clear the last folder/workspace.
|
||||
const FOLDER_OR_WORKSPACE_WAS_CLOSED = req.query.ew
|
||||
|
||||
if (!isAuthenticated) {
|
||||
const to = self(req)
|
||||
return redirect(req, res, "login", {
|
||||
to: to !== "/" ? to : undefined,
|
||||
})
|
||||
}
|
||||
|
||||
if (NO_FOLDER_OR_WORKSPACE_QUERY && !FOLDER_OR_WORKSPACE_WAS_CLOSED) {
|
||||
const settings = await req.settings.read()
|
||||
const lastOpened = settings.query || {}
|
||||
// This flag disables the last opened behavior
|
||||
const IGNORE_LAST_OPENED = req.args["ignore-last-opened"]
|
||||
const HAS_LAST_OPENED_FOLDER_OR_WORKSPACE = lastOpened.folder || lastOpened.workspace
|
||||
const HAS_FOLDER_OR_WORKSPACE_FROM_CLI = req.args._.length > 0
|
||||
const to = self(req)
|
||||
|
||||
let folder = undefined
|
||||
let workspace = undefined
|
||||
|
||||
// Redirect to the last folder/workspace if nothing else is opened.
|
||||
if (HAS_LAST_OPENED_FOLDER_OR_WORKSPACE && !IGNORE_LAST_OPENED) {
|
||||
folder = lastOpened.folder
|
||||
workspace = lastOpened.workspace
|
||||
} else if (HAS_FOLDER_OR_WORKSPACE_FROM_CLI) {
|
||||
const lastEntry = path.resolve(req.args._[req.args._.length - 1])
|
||||
const entryIsFile = await isFile(lastEntry)
|
||||
const IS_WORKSPACE_FILE = entryIsFile && path.extname(lastEntry) === ".code-workspace"
|
||||
|
||||
if (IS_WORKSPACE_FILE) {
|
||||
workspace = lastEntry
|
||||
} else if (!entryIsFile) {
|
||||
folder = lastEntry
|
||||
}
|
||||
}
|
||||
|
||||
if (folder || workspace) {
|
||||
return redirect(req, res, to, {
|
||||
folder,
|
||||
workspace,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Store the query parameters so we can use them on the next load. This
|
||||
// also allows users to create functionality around query parameters.
|
||||
await req.settings.write({ query: req.query })
|
||||
|
||||
next()
|
||||
}
|
||||
|
||||
private $proxyRequest: express.Handler = async (req, res, next) => {
|
||||
this._codeServerMain.handleRequest(req, res)
|
||||
}
|
||||
|
||||
private $proxyWebsocket = async (req: WebsocketRequest) => {
|
||||
const wrappedSocket = await this._socketProxyProvider.createProxy(req.ws)
|
||||
// This should actually accept a duplex stream but it seems Code has not
|
||||
// been updated to match the Node 16 types so cast for now. There does not
|
||||
// appear to be any code specific to sockets so this should be fine.
|
||||
this._codeServerMain.handleUpgrade(req, wrappedSocket as net.Socket)
|
||||
|
||||
req.ws.resume()
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
/**
|
||||
* Fetches a code server instance asynchronously to avoid an initial memory overhead.
|
||||
*/
|
||||
private ensureCodeServerLoaded: express.Handler = async (req, _res, next) => {
|
||||
if (this._codeServerMain) {
|
||||
// Already loaded...
|
||||
return next()
|
||||
}
|
||||
|
||||
// Create the server...
|
||||
|
||||
const { args } = req
|
||||
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
const createVSServer = await loadAMDModule<CreateServer>("vs/server/node/server.main", "createServer")
|
||||
|
||||
try {
|
||||
this._codeServerMain = await createVSServer(null, {
|
||||
...(await toCodeArgs(args)),
|
||||
"without-connection-token": true,
|
||||
})
|
||||
} catch (error) {
|
||||
logError(logger, "CodeServerRouteWrapper", error)
|
||||
if (isDevMode) {
|
||||
return next(new Error((error instanceof Error ? error.message : error) + " (VS Code may still be compiling)"))
|
||||
}
|
||||
return next(error)
|
||||
}
|
||||
// The VS Code server is dynamically loaded in when a request is made to this
|
||||
// router by `ensureCodeServerLoaded`.
|
||||
let vscodeServer: IVSCodeServerAPI | undefined
|
||||
|
||||
/**
|
||||
* Ensure the VS Code server is loaded.
|
||||
*/
|
||||
export const ensureVSCodeLoaded = async (
|
||||
req: express.Request,
|
||||
_: express.Response,
|
||||
next: express.NextFunction,
|
||||
): Promise<void> => {
|
||||
if (vscodeServer) {
|
||||
return next()
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
|
||||
this.router.get("/manifest.json", this.manifest)
|
||||
this.router.post("/mint-key", this.mintKey)
|
||||
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
|
||||
this._wsRouterWrapper.ws("*", ensureOrigin, ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._codeServerMain?.dispose()
|
||||
this._socketProxyProvider.stop()
|
||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||
const createVSServer = await loadAMDModule<CreateServer>("vs/server/node/server.main", "createServer")
|
||||
try {
|
||||
vscodeServer = await createVSServer(null, {
|
||||
...(await toCodeArgs(req.args)),
|
||||
"accept-server-license-terms": true,
|
||||
// This seems to be used to make the connection token flags optional (when
|
||||
// set to 1.63) but we have always included them.
|
||||
compatibility: "1.64",
|
||||
"without-connection-token": true,
|
||||
})
|
||||
} catch (error) {
|
||||
logError(logger, "CodeServerRouteWrapper", error)
|
||||
if (isDevMode) {
|
||||
return next(new Error((error instanceof Error ? error.message : error) + " (VS Code may still be compiling)"))
|
||||
}
|
||||
return next(error)
|
||||
}
|
||||
return next()
|
||||
}
|
||||
|
||||
router.get("/", ensureVSCodeLoaded, async (req, res, next) => {
|
||||
const isAuthenticated = await authenticated(req)
|
||||
const NO_FOLDER_OR_WORKSPACE_QUERY = !req.query.folder && !req.query.workspace
|
||||
// Ew means the workspace was closed so clear the last folder/workspace.
|
||||
const FOLDER_OR_WORKSPACE_WAS_CLOSED = req.query.ew
|
||||
|
||||
if (!isAuthenticated) {
|
||||
const to = self(req)
|
||||
return redirect(req, res, "login", {
|
||||
to: to !== "/" ? to : undefined,
|
||||
})
|
||||
}
|
||||
|
||||
if (NO_FOLDER_OR_WORKSPACE_QUERY && !FOLDER_OR_WORKSPACE_WAS_CLOSED) {
|
||||
const settings = await req.settings.read()
|
||||
const lastOpened = settings.query || {}
|
||||
// This flag disables the last opened behavior
|
||||
const IGNORE_LAST_OPENED = req.args["ignore-last-opened"]
|
||||
const HAS_LAST_OPENED_FOLDER_OR_WORKSPACE = lastOpened.folder || lastOpened.workspace
|
||||
const HAS_FOLDER_OR_WORKSPACE_FROM_CLI = req.args._.length > 0
|
||||
const to = self(req)
|
||||
|
||||
let folder = undefined
|
||||
let workspace = undefined
|
||||
|
||||
// Redirect to the last folder/workspace if nothing else is opened.
|
||||
if (HAS_LAST_OPENED_FOLDER_OR_WORKSPACE && !IGNORE_LAST_OPENED) {
|
||||
folder = lastOpened.folder
|
||||
workspace = lastOpened.workspace
|
||||
} else if (HAS_FOLDER_OR_WORKSPACE_FROM_CLI) {
|
||||
const lastEntry = path.resolve(req.args._[req.args._.length - 1])
|
||||
const entryIsFile = await isFile(lastEntry)
|
||||
const IS_WORKSPACE_FILE = entryIsFile && path.extname(lastEntry) === ".code-workspace"
|
||||
|
||||
if (IS_WORKSPACE_FILE) {
|
||||
workspace = lastEntry
|
||||
} else if (!entryIsFile) {
|
||||
folder = lastEntry
|
||||
}
|
||||
}
|
||||
|
||||
if (folder || workspace) {
|
||||
return redirect(req, res, to, {
|
||||
folder,
|
||||
workspace,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Store the query parameters so we can use them on the next load. This
|
||||
// also allows users to create functionality around query parameters.
|
||||
await req.settings.write({ query: req.query })
|
||||
|
||||
next()
|
||||
})
|
||||
|
||||
router.get("/manifest.json", async (req, res) => {
|
||||
const appName = req.args["app-name"] || "code-server"
|
||||
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
||||
|
||||
return res.end(
|
||||
replaceTemplates(
|
||||
req,
|
||||
JSON.stringify(
|
||||
{
|
||||
name: appName,
|
||||
short_name: appName,
|
||||
start_url: ".",
|
||||
display: "fullscreen",
|
||||
display_override: ["window-controls-overlay"],
|
||||
description: "Run Code on a remote server.",
|
||||
icons: [192, 512].map((size) => ({
|
||||
src: `{{BASE}}/_static/src/browser/media/pwa-icon-${size}.png`,
|
||||
type: "image/png",
|
||||
sizes: `${size}x${size}`,
|
||||
})),
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
),
|
||||
)
|
||||
})
|
||||
|
||||
let mintKeyPromise: Promise<Buffer> | undefined
|
||||
router.post("/mint-key", async (req, res) => {
|
||||
if (!mintKeyPromise) {
|
||||
mintKeyPromise = new Promise(async (resolve) => {
|
||||
const keyPath = path.join(req.args["user-data-dir"], "serve-web-key-half")
|
||||
logger.debug(`Reading server web key half from ${keyPath}`)
|
||||
try {
|
||||
resolve(await fs.readFile(keyPath))
|
||||
return
|
||||
} catch (error: any) {
|
||||
if (error.code !== "ENOENT") {
|
||||
logError(logger, `read ${keyPath}`, error)
|
||||
}
|
||||
}
|
||||
// VS Code wants 256 bits.
|
||||
const key = crypto.randomBytes(32)
|
||||
try {
|
||||
await fs.writeFile(keyPath, key)
|
||||
} catch (error: any) {
|
||||
logError(logger, `write ${keyPath}`, error)
|
||||
}
|
||||
resolve(key)
|
||||
})
|
||||
}
|
||||
const key = await mintKeyPromise
|
||||
res.end(key)
|
||||
})
|
||||
|
||||
router.all(/.*/, ensureAuthenticated, ensureVSCodeLoaded, async (req, res) => {
|
||||
vscodeServer!.handleRequest(req, res)
|
||||
})
|
||||
|
||||
const socketProxyProvider = new SocketProxyProvider()
|
||||
wsRouter.ws(/.*/, ensureOrigin, ensureAuthenticated, ensureVSCodeLoaded, async (req: WebsocketRequest) => {
|
||||
const wrappedSocket = await socketProxyProvider.createProxy(req.ws)
|
||||
// This should actually accept a duplex stream but it seems Code has not
|
||||
// been updated to match the Node 16 types so cast for now. There does not
|
||||
// appear to be any code specific to sockets so this should be fine.
|
||||
vscodeServer!.handleUpgrade(req, wrappedSocket as net.Socket)
|
||||
|
||||
req.ws.resume()
|
||||
})
|
||||
|
||||
export function dispose() {
|
||||
vscodeServer?.dispose()
|
||||
socketProxyProvider.stop()
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ export class UpdateProvider {
|
||||
logger.debug("Making request", field("uri", uri))
|
||||
const isHttps = uri.startsWith("https")
|
||||
const agent = new ProxyAgent({
|
||||
keepAlive: true,
|
||||
getProxyForUrl: () => httpProxyUri || "",
|
||||
})
|
||||
const httpx = isHttps ? https : http
|
||||
|
||||
@@ -20,11 +20,11 @@ export interface EditorSessionEntry {
|
||||
}
|
||||
|
||||
interface DeleteSessionRequest {
|
||||
socketPath: string
|
||||
socketPath?: string
|
||||
}
|
||||
|
||||
interface AddSessionRequest {
|
||||
entry: EditorSessionEntry
|
||||
entry?: EditorSessionEntry
|
||||
}
|
||||
|
||||
interface GetSessionResponse {
|
||||
@@ -40,37 +40,42 @@ export async function makeEditorSessionManagerServer(
|
||||
// eslint-disable-next-line import/no-named-as-default-member
|
||||
router.use(express.json())
|
||||
|
||||
router.get("/session", async (req, res) => {
|
||||
const filePath = req.query.filePath as string
|
||||
if (!filePath) {
|
||||
res.status(HttpCode.BadRequest).send("filePath is required")
|
||||
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
||||
"/session",
|
||||
async (req, res) => {
|
||||
const filePath = req.query.filePath
|
||||
if (!filePath) {
|
||||
res.status(HttpCode.BadRequest).send("filePath is required")
|
||||
return
|
||||
}
|
||||
try {
|
||||
const socketPath = await editorSessionManager.getConnectedSocketPath(filePath)
|
||||
const response: GetSessionResponse = { socketPath }
|
||||
res.json(response)
|
||||
} catch (error: unknown) {
|
||||
res.status(HttpCode.ServerError).send(error)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
router.post<{}, string, AddSessionRequest | undefined>("/add-session", async (req, res) => {
|
||||
const entry = req.body?.entry
|
||||
if (!entry) {
|
||||
res.status(400).send("entry is required")
|
||||
return
|
||||
}
|
||||
try {
|
||||
const socketPath = await editorSessionManager.getConnectedSocketPath(filePath)
|
||||
const response: GetSessionResponse = { socketPath }
|
||||
res.json(response)
|
||||
} catch (error: unknown) {
|
||||
res.status(HttpCode.ServerError).send(error)
|
||||
}
|
||||
editorSessionManager.addSession(entry)
|
||||
res.status(200).send("session added")
|
||||
})
|
||||
|
||||
router.post("/add-session", async (req, res) => {
|
||||
const request = req.body as AddSessionRequest
|
||||
if (!request.entry) {
|
||||
res.status(400).send("entry is required")
|
||||
}
|
||||
editorSessionManager.addSession(request.entry)
|
||||
res.status(200).send()
|
||||
})
|
||||
|
||||
router.post("/delete-session", async (req, res) => {
|
||||
const request = req.body as DeleteSessionRequest
|
||||
if (!request.socketPath) {
|
||||
router.post<{}, string, DeleteSessionRequest | undefined>("/delete-session", async (req, res) => {
|
||||
const socketPath = req.body?.socketPath
|
||||
if (!socketPath) {
|
||||
res.status(400).send("socketPath is required")
|
||||
return
|
||||
}
|
||||
editorSessionManager.deleteSession(request.socketPath)
|
||||
res.status(200).send()
|
||||
editorSessionManager.deleteSession(socketPath)
|
||||
res.status(200).send("session deleted")
|
||||
})
|
||||
|
||||
const server = http.createServer(router)
|
||||
|
||||
@@ -13,9 +13,10 @@ describe("--install-extension", () => {
|
||||
})
|
||||
it("should use EXTENSIONS_GALLERY when set", async () => {
|
||||
const extName = "author.extension"
|
||||
const { stderr } = await runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
||||
EXTENSIONS_GALLERY: "{}",
|
||||
})
|
||||
expect(stderr).toMatch("No extension gallery service configured")
|
||||
await expect(
|
||||
runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
||||
EXTENSIONS_GALLERY: "{}",
|
||||
}),
|
||||
).rejects.toThrow("No extension gallery service configured")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -912,8 +912,6 @@ cert: false`)
|
||||
describe("toCodeArgs", () => {
|
||||
const vscodeDefaults = {
|
||||
...defaults,
|
||||
"accept-server-license-terms": true,
|
||||
compatibility: "1.64",
|
||||
help: false,
|
||||
port: "8080",
|
||||
version: false,
|
||||
|
||||
@@ -199,7 +199,7 @@ describe("proxy", () => {
|
||||
})
|
||||
|
||||
it("should proxy non-ASCII", async () => {
|
||||
e.get("*", (req, res) => {
|
||||
e.get(/.*/, (req, res) => {
|
||||
res.json("ほげ")
|
||||
})
|
||||
codeServer = await integration.setup(["--auth=none"], "")
|
||||
@@ -211,7 +211,7 @@ describe("proxy", () => {
|
||||
|
||||
it("should not double-encode query variables", async () => {
|
||||
const spy = jest.fn()
|
||||
e.get("*", (req, res) => {
|
||||
e.get(/.*/, (req, res) => {
|
||||
spy([req.originalUrl, req.query])
|
||||
res.end()
|
||||
})
|
||||
|
||||
@@ -68,13 +68,10 @@ describe("login", () => {
|
||||
}
|
||||
})
|
||||
|
||||
it("should return HTML with 'Missing password' message", async () => {
|
||||
it("should return 'Missing password' without body", async () => {
|
||||
const resp = await codeServer().fetch("/login", { method: "POST" })
|
||||
|
||||
expect(resp.status).toBe(200)
|
||||
|
||||
const htmlContent = await resp.text()
|
||||
|
||||
expect(resp.status).toBe(200)
|
||||
expect(htmlContent).toContain("Missing password")
|
||||
})
|
||||
|
||||
|
||||
@@ -2626,6 +2626,11 @@ minipass@^3.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
minipass@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d"
|
||||
integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==
|
||||
|
||||
minizlib@^2.1.1:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
|
||||
@@ -3293,13 +3298,13 @@ symbol-tree@^3.2.4:
|
||||
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
|
||||
|
||||
tar@^6.1.11, tar@^6.1.9:
|
||||
version "6.1.11"
|
||||
resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
|
||||
integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
|
||||
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==
|
||||
dependencies:
|
||||
chownr "^2.0.0"
|
||||
fs-minipass "^2.0.0"
|
||||
minipass "^3.0.0"
|
||||
minipass "^5.0.0"
|
||||
minizlib "^2.1.1"
|
||||
mkdirp "^1.0.3"
|
||||
yallist "^4.0.0"
|
||||
|
||||
Reference in New Issue
Block a user