mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 20:41:59 +02:00
Compare commits
58 Commits
v4.10.0-rc
...
v4.13.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2798322b03 | ||
|
|
b3b971480f | ||
|
|
6745a46034 | ||
|
|
43ef50b404 | ||
|
|
45c89856fd | ||
|
|
5f4ae75431 | ||
|
|
521ff44aed | ||
|
|
5708e6ce32 | ||
|
|
3f7db15fde | ||
|
|
8c99f41b90 | ||
|
|
e02d56dbfd | ||
|
|
aac5efa046 | ||
|
|
ff2764f7b1 | ||
|
|
bda6b631ab | ||
|
|
9bac70ea0d | ||
|
|
7722ef1437 | ||
|
|
951d8ac45e | ||
|
|
2e17735795 | ||
|
|
1da7cda39e | ||
|
|
c829d74203 | ||
|
|
39075b2cf3 | ||
|
|
aed1fc0119 | ||
|
|
6e411adb01 | ||
|
|
36ba646bcb | ||
|
|
278d0f2184 | ||
|
|
b954250018 | ||
|
|
2b72da22e6 | ||
|
|
3c838e2d02 | ||
|
|
f8d563c49b | ||
|
|
39e63af359 | ||
|
|
c995988b70 | ||
|
|
a44bd71043 | ||
|
|
19bcd043d7 | ||
|
|
c32a31d802 | ||
|
|
45ca68c362 | ||
|
|
8f1a70339d | ||
|
|
35209aa5b5 | ||
|
|
87f44599e5 | ||
|
|
71f01ec0f0 | ||
|
|
f8e2d00099 | ||
|
|
a485fec27c | ||
|
|
aa2276293a | ||
|
|
72eae01684 | ||
|
|
bca733de3d | ||
|
|
78282a1fd6 | ||
|
|
dbdd2edb62 | ||
|
|
a9d61daa91 | ||
|
|
6c08466b05 | ||
|
|
85e083580d | ||
|
|
b0431069a1 | ||
|
|
f9cc07926b | ||
|
|
be40eca5d9 | ||
|
|
9ba08907da | ||
|
|
d477972c68 | ||
|
|
a47cd81d8c | ||
|
|
c9fbcffd53 | ||
|
|
befa76d09d | ||
|
|
e0ece195c1 |
10
.github/workflows/build.yaml
vendored
10
.github/workflows/build.yaml
vendored
@@ -45,7 +45,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v26.1
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
docs/**
|
docs/**
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v26.1
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
ci/helm-chart/**
|
ci/helm-chart/**
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v26.1
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
**/*.ts
|
**/*.ts
|
||||||
@@ -163,7 +163,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v26.1
|
uses: tj-actions/changed-files@v35
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
**/*.ts
|
**/*.ts
|
||||||
@@ -248,7 +248,7 @@ jobs:
|
|||||||
# different and we need to rebuild.
|
# different and we need to rebuild.
|
||||||
- name: Get latest lib/vscode rev
|
- name: Get latest lib/vscode rev
|
||||||
id: vscode-rev
|
id: vscode-rev
|
||||||
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
|
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# We need to rebuild when we have a new version of Code, when any of
|
# We need to rebuild when we have a new version of Code, when any of
|
||||||
# the patches changed, or when the code-server version changes (since
|
# the patches changed, or when the code-server version changes (since
|
||||||
|
|||||||
8
.github/workflows/publish.yaml
vendored
8
.github/workflows/publish.yaml
vendored
@@ -29,6 +29,12 @@ jobs:
|
|||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Download npm package from release artifacts
|
- name: Download npm package from release artifacts
|
||||||
uses: robinraju/release-downloader@v1.7
|
uses: robinraju/release-downloader@v1.7
|
||||||
with:
|
with:
|
||||||
@@ -186,7 +192,7 @@ jobs:
|
|||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- name: Publish to Docker
|
- name: Publish to Docker
|
||||||
run: yarn publish:docker
|
run: ./ci/steps/docker-buildx-push.sh
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
7
.github/workflows/security.yaml
vendored
7
.github/workflows/security.yaml
vendored
@@ -12,9 +12,8 @@ on:
|
|||||||
# Runs every Monday morning PST
|
# Runs every Monday morning PST
|
||||||
- cron: "17 15 * * 1"
|
- cron: "17 15 * * 1"
|
||||||
|
|
||||||
# Cancel in-progress runs for pull requests when developers push
|
# Cancel in-progress runs for pull requests when developers push additional
|
||||||
# additional changes, and serialize builds in branches.
|
# changes, and serialize builds in branches.
|
||||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
@@ -65,7 +64,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in repo mode
|
- name: Run Trivy vulnerability scanner in repo mode
|
||||||
uses: aquasecurity/trivy-action@cff3e9a7f62c41dd51975266d0ae235709e39c41
|
uses: aquasecurity/trivy-action@e5f43133f6e8736992c9f3c1b3296e24b37e17f2
|
||||||
with:
|
with:
|
||||||
scan-type: "fs"
|
scan-type: "fs"
|
||||||
scan-ref: "."
|
scan-ref: "."
|
||||||
|
|||||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in image mode
|
- name: Run Trivy vulnerability scanner in image mode
|
||||||
uses: aquasecurity/trivy-action@cff3e9a7f62c41dd51975266d0ae235709e39c41
|
uses: aquasecurity/trivy-action@e5f43133f6e8736992c9f3c1b3296e24b37e17f2
|
||||||
with:
|
with:
|
||||||
image-ref: "docker.io/codercom/code-server:latest"
|
image-ref: "docker.io/codercom/code-server:latest"
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
|
|||||||
43
CHANGELOG.md
43
CHANGELOG.md
@@ -20,7 +20,46 @@ Code v99.99.999
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - TBD
|
## [4.12.0](https://github.com/coder/code-server/releases/tag/v4.12.0) - 2023-04-21
|
||||||
|
|
||||||
|
Code v1.77.3
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated to Code 1.77.3
|
||||||
|
- Ports panel will use domain-based proxy (instead of the default path-based
|
||||||
|
proxy) when set via --proxy-domain.
|
||||||
|
- Apply --app-name to the PWA title.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Thai translation for login page.
|
||||||
|
- Debug logs around the origin security check. If you are getting forbidden
|
||||||
|
errors on web sockets please run code-server with `--log debug` to see why the
|
||||||
|
requests are being blocked.
|
||||||
|
|
||||||
|
## [4.11.0](https://github.com/coder/code-server/releases/tag/v4.11.0) - 2023-03-16
|
||||||
|
|
||||||
|
Code v1.76.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated to Code 1.76.1
|
||||||
|
|
||||||
|
## [4.10.1](https://github.com/coder/code-server/releases/tag/v4.10.1) - 2023-03-04
|
||||||
|
|
||||||
|
Code v1.75.1
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
Added an origin check to web sockets to prevent cross-site hijacking attacks on
|
||||||
|
users using older or niche browser that do not support SameSite cookies and
|
||||||
|
attacks across sub-domains that share the same root domain.
|
||||||
|
|
||||||
|
The check requires the host header to be set so if you use a reverse proxy
|
||||||
|
ensure it forwards that information otherwise web sockets will be blocked.
|
||||||
|
|
||||||
|
## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - 2023-02-15
|
||||||
|
|
||||||
Code v1.75.1
|
Code v1.75.1
|
||||||
|
|
||||||
@@ -30,7 +69,7 @@ Code v1.75.1
|
|||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- Removed `--link` (was deprecated in 4.0.1).
|
- Removed `--link` (was deprecated over thirteen months ago in 4.0.1).
|
||||||
|
|
||||||
## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15
|
## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ This directory contains scripts used for the development of code-server.
|
|||||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
||||||
- Starts a process to build and launch code-server and restart on any code changes.
|
- Starts a process to build and launch code-server and restart on any code changes.
|
||||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
||||||
- [./ci/dev/gen_icons.sh](./ci/dev/gen_icons.sh) (`yarn icons`)
|
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`yarn icons`)
|
||||||
- Generates the various icons from a single `.svg` favicon in
|
- Generates the various icons from a single `.svg` favicon in
|
||||||
`src/browser/media/favicon.svg`.
|
`src/browser/media/favicon.svg`.
|
||||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
- Requires [imagemagick](https://imagemagick.org/index.php)
|
||||||
@@ -75,7 +75,7 @@ You can disable minification by setting `MINIFY=`.
|
|||||||
|
|
||||||
This directory contains the release docker container image.
|
This directory contains the release docker container image.
|
||||||
|
|
||||||
- [./ci/steps/build-docker-buildx-push.sh](./ci/steps/docker-buildx-push.sh)
|
- [./ci/steps/build-docker-buildx-push.sh](./steps/docker-buildx-push.sh)
|
||||||
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx` and pushes them.
|
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx` and pushes them.
|
||||||
- Assumes debian releases are ready in `./release-packages`.
|
- Assumes debian releases are ready in `./release-packages`.
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ copy-bin-script() {
|
|||||||
local dest="lib/vscode-reh-web-linux-x64/bin/$script"
|
local dest="lib/vscode-reh-web-linux-x64/bin/$script"
|
||||||
cp "lib/vscode/resources/server/bin/$script" "$dest"
|
cp "lib/vscode/resources/server/bin/$script" "$dest"
|
||||||
sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$dest"
|
sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$dest"
|
||||||
sed -i.bak "s/@@COMMIT@@/$VSCODE_DISTRO_COMMIT/g" "$dest"
|
sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$dest"
|
||||||
sed -i.bak "s/@@APPNAME@@/code-server/g" "$dest"
|
sed -i.bak "s/@@APPNAME@@/code-server/g" "$dest"
|
||||||
|
|
||||||
# Fix Node path on Darwin and Linux.
|
# Fix Node path on Darwin and Linux.
|
||||||
@@ -51,8 +51,8 @@ main() {
|
|||||||
# Set the commit Code will embed into the product.json. We need to do this
|
# Set the commit Code will embed into the product.json. We need to do this
|
||||||
# since Code tries to get the commit from the `.git` directory which will fail
|
# since Code tries to get the commit from the `.git` directory which will fail
|
||||||
# as it is a submodule.
|
# as it is a submodule.
|
||||||
export VSCODE_DISTRO_COMMIT
|
export BUILD_SOURCEVERSION
|
||||||
VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD)
|
BUILD_SOURCEVERSION=$(git rev-parse HEAD)
|
||||||
|
|
||||||
# Add the date, our name, links, and enable telemetry (this just makes
|
# Add the date, our name, links, and enable telemetry (this just makes
|
||||||
# telemetry available; telemetry can still be disabled by flag or setting).
|
# telemetry available; telemetry can still be disabled by flag or setting).
|
||||||
@@ -109,6 +109,15 @@ EOF
|
|||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
pushd lib/vscode-reh-web-linux-x64
|
||||||
|
# Make sure Code took the version we set in the environment variable. Not
|
||||||
|
# having a version will break display languages.
|
||||||
|
if ! jq -e .commit product.json ; then
|
||||||
|
echo "'commit' is missing from product.json"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
|
||||||
# These provide a `code-server` command in the integrated terminal to open
|
# These provide a `code-server` command in the integrated terminal to open
|
||||||
# files in the current instance.
|
# files in the current instance.
|
||||||
delete-bin-script remote-cli/code-server
|
delete-bin-script remote-cli/code-server
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 3.5.1
|
version: 3.8.0
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 4.9.1
|
appVersion: 4.12.0
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.9.1'
|
tag: '4.12.0'
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
# Specifies one or more secrets to be used when pulling images from a
|
# Specifies one or more secrets to be used when pulling images from a
|
||||||
|
|||||||
44
docs/FAQ.md
44
docs/FAQ.md
@@ -88,6 +88,12 @@ app (PWA):
|
|||||||
1. Start the editor
|
1. Start the editor
|
||||||
2. Click the **plus** icon in the URL toolbar to install the PWA
|
2. Click the **plus** icon in the URL toolbar to install the PWA
|
||||||
|
|
||||||
|
If you use Firefox, you can use the appropriate extension to install PWA.
|
||||||
|
|
||||||
|
1. Go to the installation [website](https://addons.mozilla.org/en-US/firefox/addon/pwas-for-firefox/) of the add-on
|
||||||
|
2. Add the add-on to Firefox
|
||||||
|
3. Follow the os-specific instructions on how to install the runtime counterpart
|
||||||
|
|
||||||
For other browsers, you'll have to remap keybindings for shortcuts to work.
|
For other browsers, you'll have to remap keybindings for shortcuts to work.
|
||||||
|
|
||||||
## Why can't code-server use Microsoft's extension marketplace?
|
## Why can't code-server use Microsoft's extension marketplace?
|
||||||
@@ -390,19 +396,13 @@ Theia doesn't allow you to reuse your existing VS Code config.
|
|||||||
## What's the difference between code-server and OpenVSCode-Server?
|
## What's the difference between code-server and OpenVSCode-Server?
|
||||||
|
|
||||||
code-server and OpenVSCode-Server both allow you to access VS Code via a
|
code-server and OpenVSCode-Server both allow you to access VS Code via a
|
||||||
browser. The two projects also use their own [forks of VS Code](https://github.com/coder/vscode) to
|
browser. OpenVSCode-Server is a direct fork of VS Code with changes comitted
|
||||||
leverage modern VS Code APIs and stay up to date with the upsteam version.
|
directly while code-server pulls VS Code in via a submodule and makes changes
|
||||||
|
via patch files.
|
||||||
|
|
||||||
However, OpenVSCode-Server is scoped at only making VS Code available in the web browser.
|
However, OpenVSCode-Server is scoped at only making VS Code available as-is in
|
||||||
code-server includes some other features:
|
the web browser. code-server contains additional changes to make the self-hosted
|
||||||
|
experience better (see the next section for details).
|
||||||
- password auth
|
|
||||||
- proxy web ports
|
|
||||||
- certificate support
|
|
||||||
- plugin API
|
|
||||||
- settings sync (coming soon)
|
|
||||||
|
|
||||||
For more details, see [this discussion post](https://github.com/coder/code-server/discussions/4267#discussioncomment-1411583).
|
|
||||||
|
|
||||||
## What's the difference between code-server and GitHub Codespaces?
|
## What's the difference between code-server and GitHub Codespaces?
|
||||||
|
|
||||||
@@ -410,8 +410,24 @@ Both code-server and GitHub Codespaces allow you to access VS Code via a
|
|||||||
browser. GitHub Codespaces, however, is a closed-source, paid service offered by
|
browser. GitHub Codespaces, however, is a closed-source, paid service offered by
|
||||||
GitHub and Microsoft.
|
GitHub and Microsoft.
|
||||||
|
|
||||||
On the other hand, code-server is self-hosted, free, open-source, and
|
On the other hand, code-server is self-hosted, free, open-source, and can be run
|
||||||
can be run on any machine with few limitations.
|
on any machine with few limitations.
|
||||||
|
|
||||||
|
Specific changes include:
|
||||||
|
|
||||||
|
- Password authentication
|
||||||
|
- The ability to host at sub-paths
|
||||||
|
- Self-contained web views that do not call out to Microsoft's servers
|
||||||
|
- The ability to use your own marketplace and collect your own telemetry
|
||||||
|
- Built-in proxy for accessing ports on the remote machine integrated into
|
||||||
|
VS Code's ports panel
|
||||||
|
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
||||||
|
- Notification when updates are available
|
||||||
|
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
||||||
|
|
||||||
|
Some of these changes appear very unlikely to ever be adopted by Microsoft.
|
||||||
|
Some may make their way upstream, further closing the gap, but at the moment it
|
||||||
|
looks like there will always be some subtle differences.
|
||||||
|
|
||||||
## Does code-server have any security login validation?
|
## Does code-server have any security login validation?
|
||||||
|
|
||||||
|
|||||||
@@ -21,3 +21,11 @@ nvm use 16
|
|||||||
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 --unsafe-perm`
|
||||||
9. Run code-server with `code-server`
|
9. Run code-server with `code-server`
|
||||||
10. Access on localhost:8080 in your browser
|
10. Access on localhost:8080 in your browser
|
||||||
|
|
||||||
|
# Running code-server using Nix-on-Droid
|
||||||
|
|
||||||
|
1. Install Nix-on-Droid from [F-Droid](https://f-droid.org/packages/com.termux.nix/)
|
||||||
|
2. Start app
|
||||||
|
3. Spawn a shell with code-server by running `nix-shell -p code-server`
|
||||||
|
4. Run code-server with `code-server`
|
||||||
|
5. Access on localhost:8080 in your browser
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ code-server
|
|||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git bash) as the default application for `.sh` files. If an additional dialog does not appear, run the install command again.
|
A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git bash) as the default shell for npm run-scripts. If an additional dialog does not appear, run the install command again.
|
||||||
|
|
||||||
If the `code-server` command is not found, you'll need to [add a directory to your PATH](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/). To find the directory, use the following command:
|
If the `code-server` command is not found, you'll need to [add a directory to your PATH](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/). To find the directory, use the following command:
|
||||||
|
|
||||||
|
|||||||
30
flake.lock
generated
30
flake.lock
generated
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1659877975,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -17,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1660639432,
|
"lastModified": 1683594133,
|
||||||
"narHash": "sha256-2WDiboOCfB0LhvnDVMXOAr8ZLDfm3WdO54CkoDPwN1A=",
|
"narHash": "sha256-iUhLhEAgOCnexSGDsYT2ouydis09uDoNzM7UC685XGE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6c6409e965a6c883677be7b9d87a95fab6c3472e",
|
"rev": "8d447c5626cfefb9b129d5b30103344377fe09bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -34,6 +37,21 @@
|
|||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
nodejs yarn' python pkg-config git rsync jq moreutils quilt bats
|
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
||||||
++ (with xorg; [ libX11 libxkbfile ])
|
++ (with xorg; [ libX11 libxkbfile ])
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Usage:
|
|||||||
Sets the prefix used by standalone release archives. Defaults to ~/.local
|
Sets the prefix used by standalone release archives. Defaults to ~/.local
|
||||||
The release is unarchived into ~/.local/lib/code-server-X.X.X
|
The release is unarchived into ~/.local/lib/code-server-X.X.X
|
||||||
and the binary symlinked into ~/.local/bin/code-server
|
and the binary symlinked into ~/.local/bin/code-server
|
||||||
To install system wide pass ---prefix=/usr/local
|
To install system wide pass --prefix=/usr/local
|
||||||
|
|
||||||
--rsh <bin>
|
--rsh <bin>
|
||||||
Specifies the remote shell for remote installation. Defaults to ssh.
|
Specifies the remote shell for remote installation. Defaults to ssh.
|
||||||
|
|||||||
Submodule lib/vscode updated: 441438abd1...b3e4e68a0b
@@ -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.orig/lib/vscode/src/vs/base/common/network.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
||||||
@@ -166,7 +166,9 @@ class RemoteAuthoritiesImpl {
|
@@ -167,7 +167,9 @@ class RemoteAuthoritiesImpl {
|
||||||
return URI.from({
|
return URI.from({
|
||||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||||
authority: `${host}:${port}`,
|
authority: `${host}:${port}`,
|
||||||
@@ -136,24 +136,20 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
if (!remoteAuthority) {
|
if (!remoteAuthority) {
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
}
|
}
|
||||||
@@ -298,6 +297,8 @@ export class WebClientServer {
|
@@ -298,8 +297,12 @@ export class WebClientServer {
|
||||||
scopes: [['user:email'], ['repo']]
|
scopes: [['user:email'], ['repo']]
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
+ const base = relativeRoot(getOriginalUrl(req))
|
+ const base = relativeRoot(getOriginalUrl(req))
|
||||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||||
|
+
|
||||||
const workbenchWebConfiguration = {
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
remoteAuthority,
|
|
||||||
@@ -309,6 +310,7 @@ export class WebClientServer {
|
|
||||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
|
||||||
productConfiguration: <Partial<IProductConfiguration>>{
|
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
+ rootEndpoint: base,
|
+ rootEndpoint: base,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -326,8 +328,10 @@ export class WebClientServer {
|
@@ -334,11 +337,12 @@ export class WebClientServer {
|
||||||
const values: { [key: string]: string } = {
|
const values: { [key: string]: string } = {
|
||||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||||
@@ -165,8 +161,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ VS_BASE: vscodeBase,
|
+ VS_BASE: vscodeBase,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
-
|
||||||
@@ -344,7 +348,7 @@ export class WebClientServer {
|
let data;
|
||||||
|
try {
|
||||||
|
const workbenchTemplate = (await fsp.readFile(filePath)).toString();
|
||||||
|
@@ -352,7 +356,7 @@ export class WebClientServer {
|
||||||
'default-src \'self\';',
|
'default-src \'self\';',
|
||||||
'img-src \'self\' https: data: blob:;',
|
'img-src \'self\' https: data: blob:;',
|
||||||
'media-src \'self\';',
|
'media-src \'self\';',
|
||||||
@@ -174,8 +173,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=';`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=';`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||||
'child-src \'self\';',
|
'child-src \'self\';',
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data:;',
|
'worker-src \'self\' data: blob:;',
|
||||||
@@ -417,3 +421,70 @@ export class WebClientServer {
|
@@ -425,3 +429,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -250,7 +249,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -32,6 +32,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -56,6 +56,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
@@ -290,7 +289,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
|||||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
|
|
||||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||||
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
|
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
|
||||||
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
|
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
|
||||||
if (this._extensionGalleryResourceUrlTemplate) {
|
if (this._extensionGalleryResourceUrlTemplate) {
|
||||||
|
|||||||
@@ -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.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
@@ -100,10 +100,14 @@ class RemoteTerminalBackend extends Base
|
@@ -97,10 +97,14 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
const reqId = e.reqId;
|
const reqId = e.reqId;
|
||||||
const commandId = e.commandId;
|
const commandId = e.commandId;
|
||||||
|
|||||||
@@ -12,7 +12,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.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO
|
@@ -260,6 +260,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly userDataPath?: string
|
readonly userDataPath?: string
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||||
@@ -104,6 +109,13 @@ export class BrowserWorkbenchEnvironment
|
@@ -101,6 +106,13 @@ export class BrowserWorkbenchEnvironment
|
||||||
return this.options.userDataPath;
|
return this.options.userDataPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -304,6 +304,7 @@ export class WebClientServer {
|
@@ -325,6 +325,7 @@ export class WebClientServer {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
@@ -92,10 +92,10 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
|
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
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 { 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, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
||||||
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
@@ -121,7 +121,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
@IProductService private readonly productService: IProductService,
|
@IProductService private readonly productService: IProductService,
|
||||||
@IEditorService private readonly editorService: IEditorService,
|
@IEditorService private readonly editorService: IEditorService,
|
||||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||||
@@ -202,6 +202,9 @@ export class WorkbenchContextKeysHandler
|
@@ -205,6 +205,9 @@ export class WorkbenchContextKeysHandler
|
||||||
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||||
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
|||||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { ThemeIcon } from 'vs/base/common/themables';
|
import { ThemeIcon } from 'vs/base/common/themables';
|
||||||
@@ -484,13 +484,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -485,13 +485,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
id: DOWNLOAD_COMMAND_ID,
|
id: DOWNLOAD_COMMAND_ID,
|
||||||
title: DOWNLOAD_LABEL
|
title: DOWNLOAD_LABEL
|
||||||
},
|
},
|
||||||
@@ -172,9 +172,9 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -32,6 +32,8 @@ export const IsFullscreenContext = new R
|
@@ -35,6 +35,8 @@ export const HasWebFileSystemAccess = ne
|
||||||
|
|
||||||
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
+
|
+
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ We can remove this once upstream supports all language packs.
|
|||||||
one but is worse because it does not handle non-existent or empty files.
|
one but is worse because it does not handle non-existent or empty files.
|
||||||
7. Replace some caching and Node requires because code-server does not restart
|
7. Replace some caching and Node requires because code-server does not restart
|
||||||
when changing the language unlike native Code.
|
when changing the language unlike native Code.
|
||||||
|
8. Make language extensions installable like normal rather than using the
|
||||||
|
special set/clear language actions.
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -220,6 +220,9 @@ export async function setupServerService
|
@@ -233,6 +233,9 @@ export async function setupServerService
|
||||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||||
socketServer.registerChannel('extensions', channel);
|
socketServer.registerChannel('extensions', channel);
|
||||||
|
|
||||||
@@ -42,7 +44,7 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
|||||||
export const LANGUAGE_DEFAULT = 'en';
|
export const LANGUAGE_DEFAULT = 'en';
|
||||||
|
|
||||||
let _isWindows = false;
|
let _isWindows = false;
|
||||||
@@ -86,17 +84,19 @@ if (typeof navigator === 'object' && !is
|
@@ -90,17 +88,21 @@ if (typeof navigator === 'object' && !is
|
||||||
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
||||||
_isWeb = true;
|
_isWeb = true;
|
||||||
|
|
||||||
@@ -56,16 +58,18 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
|||||||
-
|
-
|
||||||
- _locale = configuredLocale || LANGUAGE_DEFAULT;
|
- _locale = configuredLocale || LANGUAGE_DEFAULT;
|
||||||
+ _locale = LANGUAGE_DEFAULT;
|
+ _locale = LANGUAGE_DEFAULT;
|
||||||
|
|
||||||
_language = _locale;
|
_language = _locale;
|
||||||
|
_platformLocale = navigator.language;
|
||||||
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
||||||
+ const rawNlsConfig = el && el.getAttribute('data-settings');
|
+ const rawNlsConfig = el && el.getAttribute('data-settings');
|
||||||
+ if (rawNlsConfig) {
|
+ if (rawNlsConfig) {
|
||||||
+ try {
|
+ try {
|
||||||
+ const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
|
+ const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
|
||||||
|
+ const resolved = nlsConfig.availableLanguages['*'];
|
||||||
+ _locale = nlsConfig.locale;
|
+ _locale = nlsConfig.locale;
|
||||||
|
+ _platformLocale = nlsConfig.osLocale;
|
||||||
|
+ _language = resolved ? resolved : LANGUAGE_DEFAULT;
|
||||||
+ _translationsConfigFile = nlsConfig._translationsConfigFile;
|
+ _translationsConfigFile = nlsConfig._translationsConfigFile;
|
||||||
+ _language = nlsConfig.availableLanguages['*'] || LANGUAGE_DEFAULT;
|
|
||||||
+ } catch (error) { /* Oh well. */ }
|
+ } catch (error) { /* Oh well. */ }
|
||||||
+ }
|
+ }
|
||||||
}
|
}
|
||||||
@@ -125,7 +129,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentServ
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
@@ -107,7 +107,7 @@ export abstract class AbstractNativeEnvi
|
@@ -101,7 +101,7 @@ export abstract class AbstractNativeEnvi
|
||||||
return URI.file(join(vscodePortable, 'argv.json'));
|
return URI.file(join(vscodePortable, 'argv.json'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
@@ -30,6 +30,12 @@ export function getNLSConfiguration(lang
|
@@ -32,6 +32,12 @@ export function getNLSConfiguration(lang
|
||||||
if (InternalNLSConfiguration.is(value)) {
|
if (InternalNLSConfiguration.is(value)) {
|
||||||
value._languagePackSupport = true;
|
value._languagePackSupport = true;
|
||||||
}
|
}
|
||||||
@@ -151,7 +155,7 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
|||||||
return value;
|
return value;
|
||||||
});
|
});
|
||||||
_cache.set(key, result);
|
_cache.set(key, result);
|
||||||
@@ -44,3 +50,43 @@ export namespace InternalNLSConfiguratio
|
@@ -46,3 +52,43 @@ export namespace InternalNLSConfiguratio
|
||||||
return candidate && typeof candidate._languagePackId === 'string';
|
return candidate && typeof candidate._languagePackId === 'string';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,23 +211,23 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
import { CharCode } from 'vs/base/common/charCode';
|
import { CharCode } from 'vs/base/common/charCode';
|
||||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
|
|
||||||
@@ -299,6 +300,8 @@ export class WebClientServer {
|
@@ -337,6 +338,8 @@ export class WebClientServer {
|
||||||
|
callbackRoute: this._callbackRoute
|
||||||
|
};
|
||||||
|
|
||||||
const base = relativeRoot(getOriginalUrl(req))
|
|
||||||
const vscodeBase = relativePath(getOriginalUrl(req))
|
|
||||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
||||||
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
||||||
|
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
||||||
const workbenchWebConfiguration = {
|
const values: { [key: string]: string } = {
|
||||||
remoteAuthority,
|
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||||
@@ -336,6 +339,7 @@ export class WebClientServer {
|
@@ -345,6 +348,7 @@ export class WebClientServer {
|
||||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||||
BASE: base,
|
BASE: base,
|
||||||
VS_BASE: vscodeBase,
|
VS_BASE: vscodeBase,
|
||||||
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let data;
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -248,9 +252,18 @@ 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.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
@@ -119,8 +119,9 @@ import 'vs/workbench/contrib/logs/browse
|
@@ -52,7 +52,7 @@ import 'vs/workbench/services/dialogs/br
|
||||||
// Explorer
|
import 'vs/workbench/services/host/browser/browserHostService';
|
||||||
import 'vs/workbench/contrib/files/browser/files.web.contribution';
|
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
|
||||||
|
import 'vs/workbench/services/clipboard/browser/clipboardService';
|
||||||
|
-import 'vs/workbench/services/localization/browser/localeService';
|
||||||
|
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
|
||||||
|
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,
|
||||||
|
// Logs
|
||||||
|
import 'vs/workbench/contrib/logs/browser/logs.contribution';
|
||||||
|
|
||||||
-// Localization
|
-// Localization
|
||||||
-import 'vs/workbench/contrib/localization/browser/localization.contribution';
|
-import 'vs/workbench/contrib/localization/browser/localization.contribution';
|
||||||
@@ -264,9 +277,9 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
@@ -6,18 +6,24 @@
|
@@ -5,18 +5,24 @@
|
||||||
|
|
||||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||||
import { Language } from 'vs/base/common/platform';
|
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from 'vs/base/common/uri';
|
||||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||||
@@ -289,8 +302,8 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
|
|||||||
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'))
|
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'))
|
||||||
}
|
}
|
||||||
|
|
||||||
async getBuiltInExtensionTranslationsUri(id: string): Promise<URI | undefined> {
|
async getBuiltInExtensionTranslationsUri(id: string, language: string): Promise<URI | undefined> {
|
||||||
@@ -73,6 +79,6 @@ export class WebLanguagePacksService ext
|
@@ -72,6 +78,6 @@ export class WebLanguagePacksService ext
|
||||||
|
|
||||||
// Web doesn't have a concept of language packs, so we just return an empty array
|
// Web doesn't have a concept of language packs, so we just return an empty array
|
||||||
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
|
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
|
||||||
@@ -298,11 +311,11 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
|
|||||||
+ return this.languagePackService.getInstalledLanguages()
|
+ return this.languagePackService.getInstalledLanguages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
@@ -41,7 +41,8 @@ export class NativeLocaleService impleme
|
@@ -51,7 +51,8 @@ class NativeLocaleService implements ILo
|
||||||
@IProductService private readonly productService: IProductService
|
@IProductService private readonly productService: IProductService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
@@ -312,7 +325,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
|
|||||||
try {
|
try {
|
||||||
const content = await this.textFileService.read(this.environmentService.argvResource, { encoding: 'utf8' });
|
const content = await this.textFileService.read(this.environmentService.argvResource, { encoding: 'utf8' });
|
||||||
|
|
||||||
@@ -68,9 +69,6 @@ export class NativeLocaleService impleme
|
@@ -78,9 +79,6 @@ class NativeLocaleService implements ILo
|
||||||
}
|
}
|
||||||
|
|
||||||
private async writeLocaleValue(locale: string | undefined): Promise<boolean> {
|
private async writeLocaleValue(locale: string | undefined): Promise<boolean> {
|
||||||
@@ -322,3 +335,70 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
|
|||||||
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
|
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
|
===================================================================
|
||||||
|
--- 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
|
||||||
|
@@ -335,9 +335,6 @@ export abstract class AbstractInstallAct
|
||||||
|
if (this.extension.isBuiltin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
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();
|
||||||
|
@@ -715,7 +712,7 @@ export abstract class InstallInOtherServ
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
|
- return true;
|
||||||
|
+ return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Prefers to run on UI
|
||||||
|
@@ -1803,17 +1800,6 @@ export class SetLanguageAction extends E
|
||||||
|
update(): void {
|
||||||
|
this.enabled = false;
|
||||||
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
|
- if (!this.extension) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- this.enabled = true;
|
||||||
|
- this.class = SetLanguageAction.EnabledClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
override async run(): Promise<any> {
|
||||||
|
@@ -1830,7 +1816,6 @@ export class ClearLanguageAction extends
|
||||||
|
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||||
|
@ILocaleService private readonly localeService: ILocaleService,
|
||||||
|
) {
|
||||||
|
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||||
|
@@ -1840,17 +1825,6 @@ export class ClearLanguageAction extends
|
||||||
|
update(): void {
|
||||||
|
this.enabled = false;
|
||||||
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
|
- if (!this.extension) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- this.enabled = true;
|
||||||
|
- this.class = ClearLanguageAction.EnabledClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
override async run(): Promise<any> {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||||
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
||||||
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
|
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
|
||||||
@@ -759,6 +759,72 @@ export class GettingStartedPage extends
|
@@ -817,6 +817,72 @@ export class GettingStartedPage extends
|
||||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -89,14 +89,54 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
+ );
|
+ );
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
||||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||||
@@ -776,13 +842,23 @@ export class GettingStartedPage extends
|
|
||||||
|
@@ -835,13 +901,23 @@ export class GettingStartedPage extends
|
||||||
const layoutLists = () => {
|
const layoutLists = () => {
|
||||||
if (gettingStartedList.itemCount) {
|
if (gettingStartedList.itemCount) {
|
||||||
this.container.classList.remove('noWalkthroughs');
|
this.container.classList.remove('noWalkthroughs');
|
||||||
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
- reset(rightColumn, featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ reset(rightColumn, gettingStartedCoder);
|
||||||
|
+ } else {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
+ reset(rightColumn, featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.container.classList.add('noWalkthroughs');
|
||||||
|
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
- reset(rightColumn, featuredExtensionList.getDomElement());
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), featuredExtensionList.getDomElement());
|
||||||
|
+ reset(rightColumn, gettingStartedCoder);
|
||||||
|
+ } else {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
+ reset(rightColumn, featuredExtensionList.getDomElement());
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
setTimeout(() => this.categoriesPageScrollbar?.scanDomNode(), 50);
|
||||||
|
};
|
||||||
|
@@ -849,13 +925,23 @@ export class GettingStartedPage extends
|
||||||
|
const layoutFeaturedExtension = () => {
|
||||||
|
if (featuredExtensionList.itemCount) {
|
||||||
|
this.container.classList.remove('noExtensions');
|
||||||
|
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
- reset(rightColumn, featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ reset(rightColumn, gettingStartedCoder);
|
||||||
|
+ } else {
|
||||||
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
|
+ reset(rightColumn, featuredExtensionList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.container.classList.add('noExtensions');
|
||||||
|
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
- reset(rightColumn, gettingStartedList.getDomElement());
|
- reset(rightColumn, gettingStartedList.getDomElement());
|
||||||
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
||||||
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
|
||||||
@@ -105,20 +145,9 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
+ reset(rightColumn, gettingStartedList.getDomElement());
|
+ reset(rightColumn, gettingStartedList.getDomElement());
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
recentList.setLimit(5);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.container.classList.add('noWalkthroughs');
|
|
||||||
- reset(leftColumn, startList.getDomElement());
|
|
||||||
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
|
||||||
+ reset(leftColumn, startList.getDomElement(), gettingStartedCoder);
|
|
||||||
+ } else {
|
|
||||||
+ reset(leftColumn, startList.getDomElement());
|
|
||||||
+ }
|
|
||||||
reset(rightColumn, recentList.getDomElement());
|
|
||||||
recentList.setLimit(10);
|
|
||||||
}
|
}
|
||||||
|
setTimeout(() => this.categoriesPageScrollbar?.scanDomNode(), 50);
|
||||||
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
@@ -143,7 +172,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.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO
|
@@ -265,6 +265,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly isEnabledFileDownloads?: boolean
|
readonly isEnabledFileDownloads?: boolean
|
||||||
|
|
||||||
@@ -171,7 +200,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||||
@@ -116,6 +121,13 @@ export class BrowserWorkbenchEnvironment
|
@@ -113,6 +118,13 @@ export class BrowserWorkbenchEnvironment
|
||||||
return this.options.isEnabledFileDownloads;
|
return this.options.isEnabledFileDownloads;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +230,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
'auth'?: string
|
'auth'?: string
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'locale'?: string
|
'locale'?: string
|
||||||
+ 'disable-getting-started-override'?: boolean;
|
+ 'disable-getting-started-override'?: boolean,
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -209,7 +238,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
@@ -328,6 +328,7 @@ export class WebClientServer {
|
||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
@@ -223,14 +252,14 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
|
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
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 { 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, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted } from 'vs/workbench/common/contextkeys';
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
||||||
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
@@ -204,6 +204,7 @@ export class WorkbenchContextKeysHandler
|
@@ -207,6 +207,7 @@ export class WorkbenchContextKeysHandler
|
||||||
|
|
||||||
// code-server
|
// code-server
|
||||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
@@ -242,8 +271,8 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -33,6 +33,7 @@ export const IsFullscreenContext = new R
|
@@ -36,6 +36,7 @@ export const HasWebFileSystemAccess = ne
|
||||||
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
+export const IsEnabledCoderGettingStarted = new RawContextKey<boolean>('isEnabledCoderGettingStarted', true, true);
|
+export const IsEnabledCoderGettingStarted = new RawContextKey<boolean>('isEnabledCoderGettingStarted', true, true);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/processes.ts
|
+++ code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||||
@@ -111,6 +111,8 @@ export function sanitizeProcessEnvironme
|
@@ -111,6 +111,8 @@ export function sanitizeProcessEnvironme
|
||||||
/^VSCODE_(?!(PORTABLE|SHELL_LOGIN)).+$/,
|
/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,
|
||||||
/^SNAP(|_.*)$/,
|
/^SNAP(|_.*)$/,
|
||||||
/^GDK_PIXBUF_.+$/,
|
/^GDK_PIXBUF_.+$/,
|
||||||
+ /^CODE_SERVER_.+$/,
|
+ /^CODE_SERVER_.+$/,
|
||||||
@@ -107,7 +107,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
@@ -145,8 +145,11 @@ export class BrowserDialogHandler implem
|
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend
|
||||||
|
|
||||||
async about(): Promise<void> {
|
async about(): Promise<void> {
|
||||||
const detailString = (useAgo: boolean): string => {
|
const detailString = (useAgo: boolean): string => {
|
||||||
@@ -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 { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||||
@@ -119,6 +120,9 @@ export class BrowserMain extends Disposa
|
@@ -123,6 +124,9 @@ export class BrowserMain extends Disposa
|
||||||
// Startup
|
// Startup
|
||||||
const instantiationService = workbench.startup();
|
const instantiationService = workbench.startup();
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -31,6 +31,8 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -55,6 +55,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
@@ -264,10 +264,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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
@@ -299,6 +299,7 @@ export class WebClientServer {
|
||||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
} : undefined;
|
||||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
|
||||||
productConfiguration: <Partial<IProductConfiguration>>{
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
+ codeServerVersion: this._productService.codeServerVersion,
|
+ codeServerVersion: this._productService.codeServerVersion,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -303,6 +303,7 @@ export class WebClientServer {
|
@@ -320,6 +320,7 @@ export class WebClientServer {
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
@@ -32,7 +32,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.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -261,6 +261,11 @@ export interface IWorkbenchConstructionO
|
@@ -255,6 +255,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly configurationDefaults?: Record<string, any>;
|
readonly configurationDefaults?: Record<string, any>;
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
@@ -95,7 +95,14 @@ export class BrowserWorkbenchEnvironment
|
@@ -92,7 +92,14 @@ export class BrowserWorkbenchEnvironment
|
||||||
get logFile(): URI { return joinPath(this.windowLogsPath, 'window.log'); }
|
get logFile(): URI { return joinPath(this.windowLogsPath, 'window.log'); }
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -34,6 +34,7 @@ export interface IProductConfiguration {
|
@@ -58,6 +58,7 @@ export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
@@ -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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -313,6 +313,7 @@ export class WebClientServer {
|
@@ -304,6 +304,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -312,14 +312,7 @@ export class WebClientServer {
|
@@ -304,14 +304,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
@@ -62,9 +62,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
- }).toString(true)
|
- }).toString(true)
|
||||||
- } : undefined
|
- } : undefined
|
||||||
+ extensionsGallery: this._productService.extensionsGallery,
|
+ extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
|
||||||
callbackRoute: this._callbackRoute
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!this._environmentService.isBuilt) {
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
@@ -75,7 +75,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
|||||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
|
|
||||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||||
|
|
||||||
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
|
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
|
||||||
private readonly _environmentService: IEnvironmentService,
|
private readonly _environmentService: IEnvironmentService,
|
||||||
|
|||||||
@@ -6,24 +6,11 @@ https://github.com/microsoft/vscode-extension-samples/tree/ddae6c0c9ff203b4ed6f6
|
|||||||
We also override isProposedApiEnabled in case an extension does not declare the
|
We also override isProposedApiEnabled in case an extension does not declare the
|
||||||
APIs it needs correctly (the Jupyter extension had this issue).
|
APIs it needs correctly (the Jupyter extension had this issue).
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
|
||||||
@@ -1486,7 +1486,7 @@ class ProposedApiController {
|
|
||||||
|
|
||||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
|
||||||
|
|
||||||
- this._envEnablesProposedApiForAll =
|
|
||||||
+ this._envEnablesProposedApiForAll = true ||
|
|
||||||
!_environmentService.isBuilt || // always allow proposed API when running out of sources
|
|
||||||
(_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
|
|
||||||
(this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
@@ -364,10 +364,7 @@ function extensionDescriptionArrayToMap(
|
@@ -260,10 +260,7 @@ function extensionDescriptionArrayToMap(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||||
@@ -35,3 +22,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
|
export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||||
|
@@ -24,7 +24,7 @@ export class ExtensionsProposedApi {
|
||||||
|
|
||||||
|
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||||
|
|
||||||
|
- this._envEnablesProposedApiForAll =
|
||||||
|
+ this._envEnablesProposedApiForAll = true ||
|
||||||
|
!_environmentService.isBuilt || // always allow proposed API when running out of sources
|
||||||
|
(_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
|
||||||
|
(this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -35,6 +35,7 @@ export interface IProductConfiguration {
|
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
@@ -80,14 +80,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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -314,6 +314,7 @@ export class WebClientServer {
|
@@ -305,6 +305,7 @@ export class WebClientServer {
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
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
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -36,6 +36,10 @@ export interface IProductConfiguration {
|
@@ -60,6 +60,10 @@ export interface IProductConfiguration {
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
readonly proxyEndpointTemplate?: string
|
readonly proxyEndpointTemplate?: string
|
||||||
@@ -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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -316,6 +316,10 @@ export class WebClientServer {
|
@@ -306,6 +306,10 @@ export class WebClientServer {
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
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',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
};
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
@@ -192,8 +192,7 @@ function packageTask(type, platform, arc
|
@@ -197,8 +197,7 @@ function packageTask(type, platform, arc
|
||||||
|
|
||||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||||
const isUIExtension = (manifest) => {
|
const isUIExtension = (manifest) => {
|
||||||
@@ -232,9 +231,9 @@ function packageTask(type, platform, arc
|
@@ -237,9 +236,9 @@ function packageTask(type, platform, arc
|
||||||
.map(name => `.build/extensions/${name}/**`);
|
.map(name => `.build/extensions/${name}/**`);
|
||||||
|
|
||||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||||
@@ -32,7 +32,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
let version = packageJson.version;
|
let version = packageJson.version;
|
||||||
const quality = product.quality;
|
const quality = product.quality;
|
||||||
@@ -389,7 +388,7 @@ function tweakProductForServerWeb(produc
|
@@ -394,7 +393,7 @@ function tweakProductForServerWeb(produc
|
||||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||||
optimizeTask,
|
optimizeTask,
|
||||||
util.rimraf(`out-vscode-${type}-min`),
|
util.rimraf(`out-vscode-${type}-min`),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -70,6 +70,7 @@ import { IExtensionsScannerService } fro
|
@@ -69,6 +69,7 @@ import { IExtensionsScannerService } fro
|
||||||
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
||||||
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||||
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||||
@@ -20,8 +20,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||||
@@ -142,10 +143,13 @@ export async function setupServerService
|
@@ -150,10 +151,13 @@ export async function setupServerService
|
||||||
const machineId = await getMachineId();
|
let oneDsAppender: ITelemetryAppender = NullAppender;
|
||||||
const isInternal = isInternalTelemetry(productService, configurationService);
|
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||||
if (supportsTelemetry(productService, environmentService)) {
|
if (supportsTelemetry(productService, environmentService)) {
|
||||||
- if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
- if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
||||||
@@ -94,11 +94,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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -321,6 +321,7 @@ export class WebClientServer {
|
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: base + '/_static/out/browser/serviceWorker.js',
|
path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
+ enableTelemetry: this._productService.enableTelemetry,
|
+ enableTelemetry: this._productService.enableTelemetry,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
};
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -33,6 +33,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
@@ -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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
@@ -303,6 +303,7 @@ export class WebClientServer {
|
||||||
productConfiguration: <Partial<IProductConfiguration>>{
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
@@ -224,7 +224,7 @@ export class BrowserWorkbenchEnvironment
|
@@ -215,7 +215,7 @@ export class BrowserWorkbenchEnvironment
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
get webviewExternalEndpoint(): string {
|
get webviewExternalEndpoint(): string {
|
||||||
@@ -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.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -302,6 +302,7 @@ export class WebClientServer {
|
@@ -316,6 +316,7 @@ export class WebClientServer {
|
||||||
|
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
@@ -62,15 +62,6 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
_wrapWebWorkerExtHostInIframe,
|
_wrapWebWorkerExtHostInIframe,
|
||||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||||
@@ -344,7 +345,7 @@ export class WebClientServer {
|
|
||||||
`script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=';`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
|
||||||
'child-src \'self\';',
|
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
|
||||||
- 'worker-src \'self\' data:;',
|
|
||||||
+ 'worker-src \'self\' data: blob:;',
|
|
||||||
'style-src \'self\' \'unsafe-inline\';',
|
|
||||||
'connect-src \'self\' ws: wss: https:;',
|
|
||||||
'font-src \'self\' blob:;',
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||||
@@ -79,12 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<meta http-equiv="Content-Security-Policy"
|
<meta http-equiv="Content-Security-Policy"
|
||||||
- content="default-src 'none'; script-src 'sha256-RaCvj6SRgHm+2C3LKzSAamDwa3Bp4u4iQ1Y2Sm+97tE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-N4YFn5ze5crjPqMK/opogKs7bSGWtf3lmjV/3LfbSOs=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-mi72idjvdhsPSBMKFqU82FG/kZVJjKR0TfHLE13gB+w=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-B5FRTRmagxqZ2yiS/ip5EgFZJPHAF0G0O3NgwgN6hhg=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -325,6 +325,12 @@
|
@@ -334,6 +334,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
@@ -101,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.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
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
||||||
@@ -324,6 +324,12 @@
|
@@ -333,6 +333,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export enum HttpCode {
|
|||||||
NotFound = 404,
|
NotFound = 404,
|
||||||
BadRequest = 400,
|
BadRequest = 400,
|
||||||
Unauthorized = 401,
|
Unauthorized = 401,
|
||||||
|
Forbidden = 403,
|
||||||
LargePayload = 413,
|
LargePayload = 413,
|
||||||
ServerError = 500,
|
ServerError = 500,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,15 @@ import { promises as fs } from "fs"
|
|||||||
import { load } from "js-yaml"
|
import { load } from "js-yaml"
|
||||||
import * as os from "os"
|
import * as os from "os"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { canConnect, generateCertificate, generatePassword, humanPath, paths, isNodeJSErrnoException } from "./util"
|
import {
|
||||||
|
canConnect,
|
||||||
|
generateCertificate,
|
||||||
|
generatePassword,
|
||||||
|
humanPath,
|
||||||
|
paths,
|
||||||
|
isNodeJSErrnoException,
|
||||||
|
splitOnFirstEquals,
|
||||||
|
} from "./util"
|
||||||
|
|
||||||
const DEFAULT_SOCKET_PATH = path.join(os.tmpdir(), "vscode-ipc")
|
const DEFAULT_SOCKET_PATH = path.join(os.tmpdir(), "vscode-ipc")
|
||||||
|
|
||||||
@@ -292,19 +300,6 @@ export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedAr
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function splitOnFirstEquals(str: string): string[] {
|
|
||||||
// we use regex instead of "=" to ensure we split at the first
|
|
||||||
// "=" and return the following substring with it
|
|
||||||
// important for the hashed-password which looks like this
|
|
||||||
// $argon2i$v=19$m=4096,t=3,p=1$0qR/o+0t00hsbJFQCKSfdQ$oFcM4rL6o+B7oxpuA4qlXubypbBPsf+8L531U7P9HYY
|
|
||||||
// 2 means return two items
|
|
||||||
// Source: https://stackoverflow.com/a/4607799/3015595
|
|
||||||
// We use the ? to say the the substr after the = is optional
|
|
||||||
const split = str.split(/=(.+)?/, 2)
|
|
||||||
|
|
||||||
return split
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse arguments into UserProvidedArgs. This should not go beyond checking
|
* Parse arguments into UserProvidedArgs. This should not go beyond checking
|
||||||
* that arguments are valid types and have values when required.
|
* that arguments are valid types and have values when required.
|
||||||
@@ -438,17 +433,21 @@ export const parse = (
|
|||||||
throw new Error("--cert-key is missing")
|
throw new Error("--cert-key is missing")
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(() => [
|
logger.debug(() => [`parsed ${opts?.configFile ? "config" : "command line"}`, field("args", redactArgs(args))])
|
||||||
`parsed ${opts?.configFile ? "config" : "command line"}`,
|
|
||||||
field("args", {
|
return args
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redact sensitive information from arguments for logging.
|
||||||
|
*/
|
||||||
|
export const redactArgs = (args: UserProvidedArgs): UserProvidedArgs => {
|
||||||
|
return {
|
||||||
...args,
|
...args,
|
||||||
password: args.password ? "<redacted>" : undefined,
|
password: args.password ? "<redacted>" : undefined,
|
||||||
"hashed-password": args["hashed-password"] ? "<redacted>" : undefined,
|
"hashed-password": args["hashed-password"] ? "<redacted>" : undefined,
|
||||||
"github-auth": args["github-auth"] ? "<redacted>" : undefined,
|
"github-auth": args["github-auth"] ? "<redacted>" : undefined,
|
||||||
}),
|
}
|
||||||
])
|
|
||||||
|
|
||||||
return args
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -576,6 +575,9 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
|||||||
// Filter duplicate proxy domains and remove any leading `*.`.
|
// Filter duplicate proxy domains and remove any leading `*.`.
|
||||||
const proxyDomains = new Set((args["proxy-domain"] || []).map((d) => d.replace(/^\*\./, "")))
|
const proxyDomains = new Set((args["proxy-domain"] || []).map((d) => d.replace(/^\*\./, "")))
|
||||||
args["proxy-domain"] = Array.from(proxyDomains)
|
args["proxy-domain"] = Array.from(proxyDomains)
|
||||||
|
if (args["proxy-domain"].length > 0 && !process.env.VSCODE_PROXY_URI) {
|
||||||
|
process.env.VSCODE_PROXY_URI = `{{port}}.${args["proxy-domain"][0]}`
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof args._ === "undefined") {
|
if (typeof args._ === "undefined") {
|
||||||
args._ = []
|
args._ = []
|
||||||
|
|||||||
@@ -12,7 +12,15 @@ import { version as codeServerVersion } from "./constants"
|
|||||||
import { Heart } from "./heart"
|
import { Heart } from "./heart"
|
||||||
import { CoderSettings, SettingsProvider } from "./settings"
|
import { CoderSettings, SettingsProvider } from "./settings"
|
||||||
import { UpdateProvider } from "./update"
|
import { UpdateProvider } from "./update"
|
||||||
import { getPasswordMethod, IsCookieValidArgs, isCookieValid, sanitizeString, escapeHtml, escapeJSON } from "./util"
|
import {
|
||||||
|
getPasswordMethod,
|
||||||
|
IsCookieValidArgs,
|
||||||
|
isCookieValid,
|
||||||
|
sanitizeString,
|
||||||
|
escapeHtml,
|
||||||
|
escapeJSON,
|
||||||
|
splitOnFirstEquals,
|
||||||
|
} from "./util"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base options included on every page.
|
* Base options included on every page.
|
||||||
@@ -308,3 +316,86 @@ export const getCookieOptions = (req: express.Request): express.CookieOptions =>
|
|||||||
export const self = (req: express.Request): string => {
|
export const self = (req: express.Request): string => {
|
||||||
return normalize(`${req.baseUrl}${req.originalUrl.endsWith("/") ? "/" : ""}`, true)
|
return normalize(`${req.baseUrl}${req.originalUrl.endsWith("/") ? "/" : ""}`, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFirstHeader(req: http.IncomingMessage, headerName: string): string | undefined {
|
||||||
|
const val = req.headers[headerName]
|
||||||
|
return Array.isArray(val) ? val[0] : val
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Throw a forbidden error if origin checks fail. Call `next` if provided.
|
||||||
|
*/
|
||||||
|
export function ensureOrigin(req: express.Request, _?: express.Response, next?: express.NextFunction): void {
|
||||||
|
try {
|
||||||
|
authenticateOrigin(req)
|
||||||
|
if (next) {
|
||||||
|
next()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
logger.debug(`${error instanceof Error ? error.message : error}; blocking request to ${req.originalUrl}`)
|
||||||
|
throw new HttpError("Forbidden", HttpCode.Forbidden)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authenticate the request origin against the host. Throw if invalid.
|
||||||
|
*/
|
||||||
|
export function authenticateOrigin(req: express.Request): void {
|
||||||
|
// A missing origin probably means the source is non-browser. Not sure we
|
||||||
|
// have a use case for this but let it through.
|
||||||
|
const originRaw = getFirstHeader(req, "origin")
|
||||||
|
if (!originRaw) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let origin: string
|
||||||
|
try {
|
||||||
|
origin = new URL(originRaw).host.trim().toLowerCase()
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`unable to parse malformed origin "${originRaw}"`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const host = getHost(req)
|
||||||
|
if (typeof host === "undefined") {
|
||||||
|
// A missing host likely means the reverse proxy has not been configured to
|
||||||
|
// forward the host which means we cannot perform the check. Emit an error
|
||||||
|
// so an admin can fix the issue.
|
||||||
|
logger.error("No host headers found")
|
||||||
|
logger.error("Are you behind a reverse proxy that does not forward the host?")
|
||||||
|
throw new Error("no host headers found")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (host !== origin) {
|
||||||
|
throw new Error(`host "${host}" does not match origin "${origin}"`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the host from headers. It will be trimmed and lowercased.
|
||||||
|
*/
|
||||||
|
function getHost(req: express.Request): string | undefined {
|
||||||
|
// Honor Forwarded if present.
|
||||||
|
const forwardedRaw = getFirstHeader(req, "forwarded")
|
||||||
|
if (forwardedRaw) {
|
||||||
|
const parts = forwardedRaw.split(/[;,]/)
|
||||||
|
for (let i = 0; i < parts.length; ++i) {
|
||||||
|
const [key, value] = splitOnFirstEquals(parts[i])
|
||||||
|
if (key.trim().toLowerCase() === "host" && value) {
|
||||||
|
return value.trim().toLowerCase()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Honor X-Forwarded-Host if present. Some reverse proxies will set multiple
|
||||||
|
// comma-separated hosts.
|
||||||
|
const xHost = getFirstHeader(req, "x-forwarded-host")
|
||||||
|
if (xHost) {
|
||||||
|
const firstXHost = xHost.split(",")[0]
|
||||||
|
if (firstXHost) {
|
||||||
|
return firstXHost.trim().toLowerCase()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const host = getFirstHeader(req, "host")
|
||||||
|
return host ? host.trim().toLowerCase() : undefined
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import i18next, { init } from "i18next"
|
import i18next, { init } from "i18next"
|
||||||
import * as en from "./locales/en.json"
|
import * as en from "./locales/en.json"
|
||||||
import * as zhCn from "./locales/zh-cn.json"
|
import * as zhCn from "./locales/zh-cn.json"
|
||||||
|
import * as th from "./locales/th.json"
|
||||||
init({
|
init({
|
||||||
lng: "en",
|
lng: "en",
|
||||||
fallbackLng: "en", // language to use if translations in user language are not available.
|
fallbackLng: "en", // language to use if translations in user language are not available.
|
||||||
@@ -15,6 +15,9 @@ init({
|
|||||||
"zh-cn": {
|
"zh-cn": {
|
||||||
translation: zhCn,
|
translation: zhCn,
|
||||||
},
|
},
|
||||||
|
th: {
|
||||||
|
translation: th,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
13
src/node/i18n/locales/th.json
Normal file
13
src/node/i18n/locales/th.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"LOGIN_TITLE": "เข้าสู่ระบบ {{app}}",
|
||||||
|
"LOGIN_BELOW": "กรุณาเข้าสู่ระบบด้านล่าง",
|
||||||
|
"WELCOME": "ยินดีต้อนรับสู่ {{app}}",
|
||||||
|
"LOGIN_PASSWORD": "ตรวจสอบไฟล์กำหนดค่าที่ {{configFile}} เพื่อดูรหัสผ่าน",
|
||||||
|
"LOGIN_USING_ENV_PASSWORD": "รหัสผ่านถูกกำหนดเป็น $PASSWORD",
|
||||||
|
"LOGIN_USING_HASHED_PASSWORD": "รรหัสผ่านถูกกำหนดเป็น $HASHED_PASSWORD",
|
||||||
|
"SUBMIT": "ส่ง",
|
||||||
|
"PASSWORD_PLACEHOLDER": "รหัสผ่าน",
|
||||||
|
"LOGIN_RATE_LIMIT": "ถึงขีดจำกัดอัตราการเข้าสู่ระบบ!",
|
||||||
|
"MISS_PASSWORD": "รหัสผ่านหายไป",
|
||||||
|
"INCORRECT_PASSWORD": "รหัสผ่านไม่ถูกต้อง"
|
||||||
|
}
|
||||||
@@ -3,9 +3,19 @@ import { HttpCode } from "../common/http"
|
|||||||
|
|
||||||
export const proxy = proxyServer.createProxyServer({})
|
export const proxy = proxyServer.createProxyServer({})
|
||||||
|
|
||||||
|
// The error handler catches when the proxy fails to connect (for example when
|
||||||
|
// there is nothing running on the target port).
|
||||||
proxy.on("error", (error, _, res) => {
|
proxy.on("error", (error, _, res) => {
|
||||||
|
// This could be for either a web socket or a regular request. Despite what
|
||||||
|
// the types say, writeHead() will not exist on web socket requests (nor will
|
||||||
|
// status() from Express). But writing out the code manually does not work
|
||||||
|
// for regular requests thus the branching behavior.
|
||||||
|
if (typeof res.writeHead !== "undefined") {
|
||||||
res.writeHead(HttpCode.ServerError)
|
res.writeHead(HttpCode.ServerError)
|
||||||
res.end(error.message)
|
res.end(error.message)
|
||||||
|
} else {
|
||||||
|
res.end(`HTTP/1.1 ${HttpCode.ServerError} ${error.message}\r\n\r\n`)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Intercept the response to rewrite absolute redirects against the base path.
|
// Intercept the response to rewrite absolute redirects against the base path.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Request, Router } from "express"
|
import { Request, Router } from "express"
|
||||||
import { HttpCode, HttpError } from "../../common/http"
|
import { HttpCode, HttpError } from "../../common/http"
|
||||||
import { authenticated, ensureAuthenticated, redirect, self } from "../http"
|
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
|
||||||
import { proxy } from "../proxy"
|
import { proxy } from "../proxy"
|
||||||
import { Router as WsRouter } from "../wsRouter"
|
import { Router as WsRouter } from "../wsRouter"
|
||||||
|
|
||||||
@@ -78,10 +78,8 @@ wsRouter.ws("*", async (req, _, next) => {
|
|||||||
if (!port) {
|
if (!port) {
|
||||||
return next()
|
return next()
|
||||||
}
|
}
|
||||||
|
ensureOrigin(req)
|
||||||
// Must be authenticated to use the proxy.
|
|
||||||
await ensureAuthenticated(req)
|
await ensureAuthenticated(req)
|
||||||
|
|
||||||
proxy.ws(req, req.ws, req.head, {
|
proxy.ws(req, req.ws, req.head, {
|
||||||
ignorePath: true,
|
ignorePath: true,
|
||||||
target: `http://0.0.0.0:${port}${req.originalUrl}`,
|
target: `http://0.0.0.0:${port}${req.originalUrl}`,
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ export const errorHandler: express.ErrorRequestHandler = async (err, req, res, n
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
||||||
|
let statusCode = 500
|
||||||
|
if (errorHasStatusCode(err)) {
|
||||||
|
statusCode = err.statusCode
|
||||||
|
} else if (errorHasCode(err) && notFoundCodes.includes(err.code)) {
|
||||||
|
statusCode = HttpCode.NotFound
|
||||||
|
}
|
||||||
|
if (statusCode >= 500) {
|
||||||
logger.error(`${err.message} ${err.stack}`)
|
logger.error(`${err.message} ${err.stack}`)
|
||||||
;(req as WebsocketRequest).ws.end()
|
} else {
|
||||||
|
logger.debug(`${err.message} ${err.stack}`)
|
||||||
|
}
|
||||||
|
;(req as WebsocketRequest).ws.end(`HTTP/1.1 ${statusCode} ${err.message}\r\n\r\n`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as path from "path"
|
|||||||
import * as qs from "qs"
|
import * as qs from "qs"
|
||||||
import * as pluginapi from "../../../typings/pluginapi"
|
import * as pluginapi from "../../../typings/pluginapi"
|
||||||
import { HttpCode, HttpError } from "../../common/http"
|
import { HttpCode, HttpError } from "../../common/http"
|
||||||
import { authenticated, ensureAuthenticated, redirect, self } from "../http"
|
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
|
||||||
import { proxy as _proxy } from "../proxy"
|
import { proxy as _proxy } from "../proxy"
|
||||||
|
|
||||||
const getProxyTarget = (req: Request, passthroughPath?: boolean): string => {
|
const getProxyTarget = (req: Request, passthroughPath?: boolean): string => {
|
||||||
@@ -11,7 +11,7 @@ const getProxyTarget = (req: Request, passthroughPath?: boolean): string => {
|
|||||||
return `http://0.0.0.0:${req.params.port}/${req.originalUrl}`
|
return `http://0.0.0.0:${req.params.port}/${req.originalUrl}`
|
||||||
}
|
}
|
||||||
const query = qs.stringify(req.query)
|
const query = qs.stringify(req.query)
|
||||||
return `http://0.0.0.0:${req.params.port}/${req.params[0] || ""}${query ? `?${query}` : ""}`
|
return encodeURI(`http://0.0.0.0:${req.params.port}${req.params[0] || ""}${query ? `?${query}` : ""}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function proxy(
|
export async function proxy(
|
||||||
@@ -50,6 +50,7 @@ export async function wsProxy(
|
|||||||
passthroughPath?: boolean
|
passthroughPath?: boolean
|
||||||
},
|
},
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
ensureOrigin(req)
|
||||||
await ensureAuthenticated(req)
|
await ensureAuthenticated(req)
|
||||||
_proxy.ws(req, req.ws, req.head, {
|
_proxy.ws(req, req.ws, req.head, {
|
||||||
ignorePath: true,
|
ignorePath: true,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { WebsocketRequest } from "../../../typings/pluginapi"
|
|||||||
import { logError } from "../../common/util"
|
import { logError } from "../../common/util"
|
||||||
import { CodeArgs, toCodeArgs } from "../cli"
|
import { CodeArgs, toCodeArgs } from "../cli"
|
||||||
import { isDevMode } from "../constants"
|
import { isDevMode } from "../constants"
|
||||||
import { authenticated, ensureAuthenticated, redirect, replaceTemplates, self } from "../http"
|
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, replaceTemplates, self } from "../http"
|
||||||
import { SocketProxyProvider } from "../socket"
|
import { SocketProxyProvider } from "../socket"
|
||||||
import { isFile, loadAMDModule } from "../util"
|
import { isFile, loadAMDModule } from "../util"
|
||||||
import { Router as WsRouter } from "../wsRouter"
|
import { Router as WsRouter } from "../wsRouter"
|
||||||
@@ -40,6 +40,7 @@ export class CodeServerRouteWrapper {
|
|||||||
//#region Route Handlers
|
//#region Route Handlers
|
||||||
|
|
||||||
private manifest: express.Handler = async (req, res, next) => {
|
private manifest: express.Handler = async (req, res, next) => {
|
||||||
|
const appName = req.args["app-name"] || "code-server"
|
||||||
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
||||||
|
|
||||||
return res.end(
|
return res.end(
|
||||||
@@ -47,8 +48,8 @@ export class CodeServerRouteWrapper {
|
|||||||
req,
|
req,
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
{
|
{
|
||||||
name: "code-server",
|
name: appName,
|
||||||
short_name: "code-server",
|
short_name: appName,
|
||||||
start_url: ".",
|
start_url: ".",
|
||||||
display: "fullscreen",
|
display: "fullscreen",
|
||||||
description: "Run Code on a remote server.",
|
description: "Run Code on a remote server.",
|
||||||
@@ -173,7 +174,7 @@ export class CodeServerRouteWrapper {
|
|||||||
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
|
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
|
||||||
this.router.get("/manifest.json", this.manifest)
|
this.router.get("/manifest.json", this.manifest)
|
||||||
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
|
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
|
||||||
this._wsRouterWrapper.ws("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
|
this._wsRouterWrapper.ws("*", ensureOrigin, ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose() {
|
dispose() {
|
||||||
|
|||||||
@@ -541,3 +541,13 @@ export const loadAMDModule = async <T>(amdPath: string, exportName: string): Pro
|
|||||||
|
|
||||||
return module[exportName] as T
|
return module[exportName] as T
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Split a string on the first equals. The result will always be an array with
|
||||||
|
* two items regardless of how many equals there are. The second item will be
|
||||||
|
* undefined if empty or missing.
|
||||||
|
*/
|
||||||
|
export function splitOnFirstEquals(str: string): [string, string | undefined] {
|
||||||
|
const split = str.split(/=(.+)?/, 2)
|
||||||
|
return [split[0], split[1]]
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as cp from "child_process"
|
|||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import * as rfs from "rotating-file-stream"
|
import * as rfs from "rotating-file-stream"
|
||||||
import { Emitter } from "../common/emitter"
|
import { Emitter } from "../common/emitter"
|
||||||
import { DefaultedArgs } from "./cli"
|
import { DefaultedArgs, redactArgs } from "./cli"
|
||||||
import { paths } from "./util"
|
import { paths } from "./util"
|
||||||
|
|
||||||
const timeoutInterval = 10000 // 10s, matches VS Code's timeouts.
|
const timeoutInterval = 10000 // 10s, matches VS Code's timeouts.
|
||||||
@@ -44,10 +44,11 @@ export function onMessage<M, T extends M>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const onMessage = (message: M) => {
|
const onMessage = (message: M) => {
|
||||||
;(customLogger || logger).trace("got message", field("message", message))
|
|
||||||
if (fn(message)) {
|
if (fn(message)) {
|
||||||
cleanup()
|
cleanup()
|
||||||
resolve(message)
|
resolve(message)
|
||||||
|
} else {
|
||||||
|
;(customLogger || logger).debug("got unhandled message", field("message", message))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,6 +173,7 @@ export class ChildProcess extends Process {
|
|||||||
* Initiate the handshake and wait for a response from the parent.
|
* Initiate the handshake and wait for a response from the parent.
|
||||||
*/
|
*/
|
||||||
public async handshake(): Promise<DefaultedArgs> {
|
public async handshake(): Promise<DefaultedArgs> {
|
||||||
|
this.logger.debug("initiating handshake")
|
||||||
this.send({ type: "handshake" })
|
this.send({ type: "handshake" })
|
||||||
const message = await onMessage<ParentMessage, ParentHandshakeMessage>(
|
const message = await onMessage<ParentMessage, ParentHandshakeMessage>(
|
||||||
process,
|
process,
|
||||||
@@ -180,6 +182,13 @@ export class ChildProcess extends Process {
|
|||||||
},
|
},
|
||||||
this.logger,
|
this.logger,
|
||||||
)
|
)
|
||||||
|
this.logger.debug(
|
||||||
|
"got message",
|
||||||
|
field("message", {
|
||||||
|
type: message.type,
|
||||||
|
args: redactArgs(message.args),
|
||||||
|
}),
|
||||||
|
)
|
||||||
return message.args
|
return message.args
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,6 +289,10 @@ export class ParentProcess extends Process {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public start(args: DefaultedArgs): Promise<void> {
|
public start(args: DefaultedArgs): Promise<void> {
|
||||||
|
// Our logger was created before we parsed CLI arguments so update the level
|
||||||
|
// in case it has changed.
|
||||||
|
this.logger.level = logger.level
|
||||||
|
|
||||||
// Store for relaunches.
|
// Store for relaunches.
|
||||||
this.args = args
|
this.args = args
|
||||||
if (!this.started) {
|
if (!this.started) {
|
||||||
@@ -306,7 +319,7 @@ export class ParentProcess extends Process {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug(`spawned inner process ${child.pid}`)
|
this.logger.debug(`spawned child process ${child.pid}`)
|
||||||
|
|
||||||
await this.handshake(child)
|
await this.handshake(child)
|
||||||
|
|
||||||
@@ -334,13 +347,14 @@ export class ParentProcess extends Process {
|
|||||||
if (!this.args) {
|
if (!this.args) {
|
||||||
throw new Error("started without args")
|
throw new Error("started without args")
|
||||||
}
|
}
|
||||||
await onMessage<ChildMessage, ChildHandshakeMessage>(
|
const message = await onMessage<ChildMessage, ChildHandshakeMessage>(
|
||||||
child,
|
child,
|
||||||
(message): message is ChildHandshakeMessage => {
|
(message): message is ChildHandshakeMessage => {
|
||||||
return message.type === "handshake"
|
return message.type === "handshake"
|
||||||
},
|
},
|
||||||
this.logger,
|
this.logger,
|
||||||
)
|
)
|
||||||
|
this.logger.debug("got message", field("message", message))
|
||||||
this.send(child, { type: "handshake", args: this.args })
|
this.send(child, { type: "handshake", args: this.args })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ export class WebsocketRouter {
|
|||||||
/**
|
/**
|
||||||
* Handle a websocket at this route. Note that websockets are immediately
|
* Handle a websocket at this route. Note that websockets are immediately
|
||||||
* paused when they come in.
|
* paused when they come in.
|
||||||
|
*
|
||||||
|
* If the origin header exists it must match the host or the connection will
|
||||||
|
* be prevented.
|
||||||
*/
|
*/
|
||||||
public ws(route: expressCore.PathParams, ...handlers: pluginapi.WebSocketHandler[]): void {
|
public ws(route: expressCore.PathParams, ...handlers: pluginapi.WebSocketHandler[]): void {
|
||||||
this.router.get(
|
this.router.get(
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ describe("--install-extension", () => {
|
|||||||
setupFlags = ["--extensions-dir", tempDir]
|
setupFlags = ["--extensions-dir", tempDir]
|
||||||
})
|
})
|
||||||
it("should use EXTENSIONS_GALLERY when set", async () => {
|
it("should use EXTENSIONS_GALLERY when set", async () => {
|
||||||
const extName = `author.extension-1.0.0`
|
const extName = "author.extension"
|
||||||
const { stderr } = await runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
const { stderr } = await runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
||||||
EXTENSIONS_GALLERY: "{}",
|
EXTENSIONS_GALLERY: "{}",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"jsdom": "^16.4.0",
|
"jsdom": "^16.4.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.7",
|
||||||
"playwright": "^1.16.3",
|
"playwright": "^1.16.3",
|
||||||
"supertest": "^6.1.6",
|
"supertest": "^6.1.6",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
readSocketPath,
|
readSocketPath,
|
||||||
setDefaults,
|
setDefaults,
|
||||||
shouldOpenInExistingInstance,
|
shouldOpenInExistingInstance,
|
||||||
splitOnFirstEquals,
|
|
||||||
toCodeArgs,
|
toCodeArgs,
|
||||||
optionDescriptions,
|
optionDescriptions,
|
||||||
options,
|
options,
|
||||||
@@ -44,6 +43,7 @@ describe("parser", () => {
|
|||||||
delete process.env.PASSWORD
|
delete process.env.PASSWORD
|
||||||
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
||||||
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
||||||
|
delete process.env.VSCODE_PROXY_URI
|
||||||
console.log = jest.fn()
|
console.log = jest.fn()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -458,6 +458,31 @@ describe("parser", () => {
|
|||||||
port: 8082,
|
port: 8082,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should not set proxy uri", async () => {
|
||||||
|
await setDefaults(parse([]))
|
||||||
|
expect(process.env.VSCODE_PROXY_URI).toBeUndefined()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should set proxy uri", async () => {
|
||||||
|
await setDefaults(parse(["--proxy-domain", "coder.org"]))
|
||||||
|
expect(process.env.VSCODE_PROXY_URI).toEqual("{{port}}.coder.org")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should set proxy uri to first domain", async () => {
|
||||||
|
await setDefaults(
|
||||||
|
parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "coder.com", "--proxy-domain", "coder.org"]),
|
||||||
|
)
|
||||||
|
expect(process.env.VSCODE_PROXY_URI).toEqual("{{port}}.coder.com")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should not override existing proxy uri", async () => {
|
||||||
|
process.env.VSCODE_PROXY_URI = "foo"
|
||||||
|
await setDefaults(
|
||||||
|
parse(["--proxy-domain", "*.coder.com", "--proxy-domain", "coder.com", "--proxy-domain", "coder.org"]),
|
||||||
|
)
|
||||||
|
expect(process.env.VSCODE_PROXY_URI).toEqual("foo")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("cli", () => {
|
describe("cli", () => {
|
||||||
@@ -535,31 +560,6 @@ describe("cli", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("splitOnFirstEquals", () => {
|
|
||||||
it("should split on the first equals", () => {
|
|
||||||
const testStr = "enabled-proposed-api=test=value"
|
|
||||||
const actual = splitOnFirstEquals(testStr)
|
|
||||||
const expected = ["enabled-proposed-api", "test=value"]
|
|
||||||
expect(actual).toEqual(expect.arrayContaining(expected))
|
|
||||||
})
|
|
||||||
it("should split on first equals regardless of multiple equals signs", () => {
|
|
||||||
const testStr =
|
|
||||||
"hashed-password=$argon2i$v=19$m=4096,t=3,p=1$0qR/o+0t00hsbJFQCKSfdQ$oFcM4rL6o+B7oxpuA4qlXubypbBPsf+8L531U7P9HYY"
|
|
||||||
const actual = splitOnFirstEquals(testStr)
|
|
||||||
const expected = [
|
|
||||||
"hashed-password",
|
|
||||||
"$argon2i$v=19$m=4096,t=3,p=1$0qR/o+0t00hsbJFQCKSfdQ$oFcM4rL6o+B7oxpuA4qlXubypbBPsf+8L531U7P9HYY",
|
|
||||||
]
|
|
||||||
expect(actual).toEqual(expect.arrayContaining(expected))
|
|
||||||
})
|
|
||||||
it("should always return the first element before an equals", () => {
|
|
||||||
const testStr = "auth="
|
|
||||||
const actual = splitOnFirstEquals(testStr)
|
|
||||||
const expected = ["auth"]
|
|
||||||
expect(actual).toEqual(expect.arrayContaining(expected))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("shouldSpawnCliProcess", () => {
|
describe("shouldSpawnCliProcess", () => {
|
||||||
it("should return false if no 'extension' related args passed in", async () => {
|
it("should return false if no 'extension' related args passed in", async () => {
|
||||||
const args = {}
|
const args = {}
|
||||||
|
|||||||
@@ -1,24 +1,94 @@
|
|||||||
import { getMockReq } from "@jest-mock/express"
|
import { getMockReq } from "@jest-mock/express"
|
||||||
import { constructRedirectPath, relativeRoot } from "../../../src/node/http"
|
import * as http from "../../../src/node/http"
|
||||||
|
import { mockLogger } from "../../utils/helpers"
|
||||||
|
|
||||||
describe("http", () => {
|
describe("http", () => {
|
||||||
it("should construct a relative path to the root", () => {
|
beforeEach(() => {
|
||||||
expect(relativeRoot("/")).toStrictEqual(".")
|
mockLogger()
|
||||||
expect(relativeRoot("/foo")).toStrictEqual(".")
|
|
||||||
expect(relativeRoot("/foo/")).toStrictEqual("./..")
|
|
||||||
expect(relativeRoot("/foo/bar ")).toStrictEqual("./..")
|
|
||||||
expect(relativeRoot("/foo/bar/")).toStrictEqual("./../..")
|
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
describe("constructRedirectPath", () => {
|
afterEach(() => {
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should construct a relative path to the root", () => {
|
||||||
|
expect(http.relativeRoot("/")).toStrictEqual(".")
|
||||||
|
expect(http.relativeRoot("/foo")).toStrictEqual(".")
|
||||||
|
expect(http.relativeRoot("/foo/")).toStrictEqual("./..")
|
||||||
|
expect(http.relativeRoot("/foo/bar ")).toStrictEqual("./..")
|
||||||
|
expect(http.relativeRoot("/foo/bar/")).toStrictEqual("./../..")
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("origin", () => {
|
||||||
|
;[
|
||||||
|
{
|
||||||
|
origin: "",
|
||||||
|
host: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://localhost:8080",
|
||||||
|
host: "",
|
||||||
|
expected: "no host headers",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://localhost:8080",
|
||||||
|
host: " ",
|
||||||
|
expected: "does not match",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://localhost:8080",
|
||||||
|
host: "localhost:8080",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://localhost:8080",
|
||||||
|
host: "localhost:8081",
|
||||||
|
expected: "does not match",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "localhost:8080",
|
||||||
|
host: "localhost:8080",
|
||||||
|
expected: "does not match", // Gets parsed as host: localhost and path: 8080.
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "test.org",
|
||||||
|
host: "localhost:8080",
|
||||||
|
expected: "malformed", // Parsing fails completely.
|
||||||
|
},
|
||||||
|
].forEach((test) => {
|
||||||
|
;[
|
||||||
|
["host", test.host],
|
||||||
|
["x-forwarded-host", test.host],
|
||||||
|
["x-forwarded-host", `${test.host}, ${test.host}`],
|
||||||
|
["forwarded", `for=127.0.0.1, host=${test.host}, proto=http`],
|
||||||
|
["forwarded", `for=127.0.0.1;proto=http;host=${test.host}`],
|
||||||
|
["forwarded", `proto=http;host=${test.host}, for=127.0.0.1`],
|
||||||
|
].forEach(([key, value]) => {
|
||||||
|
it(`${test.origin} -> [${key}: ${value}]`, () => {
|
||||||
|
const req = getMockReq({
|
||||||
|
originalUrl: "localhost:8080",
|
||||||
|
headers: {
|
||||||
|
origin: test.origin,
|
||||||
|
[key]: value,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if (typeof test.expected === "string") {
|
||||||
|
expect(() => http.authenticateOrigin(req)).toThrow(test.expected)
|
||||||
|
} else {
|
||||||
|
expect(() => http.authenticateOrigin(req)).not.toThrow()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("constructRedirectPath", () => {
|
||||||
it("should preserve slashes in queryString so they are human-readable", () => {
|
it("should preserve slashes in queryString so they are human-readable", () => {
|
||||||
const mockReq = getMockReq({
|
const mockReq = getMockReq({
|
||||||
originalUrl: "localhost:8080",
|
originalUrl: "localhost:8080",
|
||||||
})
|
})
|
||||||
const mockQueryParams = { folder: "/Users/jp/dev/coder" }
|
const mockQueryParams = { folder: "/Users/jp/dev/coder" }
|
||||||
const mockTo = ""
|
const mockTo = ""
|
||||||
const actual = constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
const actual = http.constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
||||||
const expected = "./?folder=/Users/jp/dev/coder"
|
const expected = "./?folder=/Users/jp/dev/coder"
|
||||||
expect(actual).toBe(expected)
|
expect(actual).toBe(expected)
|
||||||
})
|
})
|
||||||
@@ -28,7 +98,7 @@ describe("constructRedirectPath", () => {
|
|||||||
})
|
})
|
||||||
const mockQueryParams = {}
|
const mockQueryParams = {}
|
||||||
const mockTo = ""
|
const mockTo = ""
|
||||||
const actual = constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
const actual = http.constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
||||||
const expected = "./"
|
const expected = "./"
|
||||||
expect(actual).toBe(expected)
|
expect(actual).toBe(expected)
|
||||||
})
|
})
|
||||||
@@ -38,7 +108,7 @@ describe("constructRedirectPath", () => {
|
|||||||
})
|
})
|
||||||
const mockQueryParams = {}
|
const mockQueryParams = {}
|
||||||
const mockTo = "vscode"
|
const mockTo = "vscode"
|
||||||
const actual = constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
const actual = http.constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
||||||
const expected = "./vscode"
|
const expected = "./vscode"
|
||||||
expect(actual).toBe(expected)
|
expect(actual).toBe(expected)
|
||||||
})
|
})
|
||||||
@@ -48,8 +118,9 @@ describe("constructRedirectPath", () => {
|
|||||||
})
|
})
|
||||||
const mockQueryParams = { folder: "/Users/jp/dev/coder" }
|
const mockQueryParams = { folder: "/Users/jp/dev/coder" }
|
||||||
const mockTo = "vscode"
|
const mockTo = "vscode"
|
||||||
const actual = constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
const actual = http.constructRedirectPath(mockReq, mockQueryParams, mockTo)
|
||||||
const expected = "./vscode?folder=/Users/jp/dev/coder"
|
const expected = "./vscode?folder=/Users/jp/dev/coder"
|
||||||
expect(actual).toBe(expected)
|
expect(actual).toBe(expected)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,21 +4,26 @@ import * as http from "http"
|
|||||||
import nodeFetch from "node-fetch"
|
import nodeFetch from "node-fetch"
|
||||||
import { HttpCode } from "../../../src/common/http"
|
import { HttpCode } from "../../../src/common/http"
|
||||||
import { proxy } from "../../../src/node/proxy"
|
import { proxy } from "../../../src/node/proxy"
|
||||||
import { getAvailablePort } from "../../utils/helpers"
|
import { wss, Router as WsRouter } from "../../../src/node/wsRouter"
|
||||||
|
import { getAvailablePort, mockLogger } from "../../utils/helpers"
|
||||||
import * as httpserver from "../../utils/httpserver"
|
import * as httpserver from "../../utils/httpserver"
|
||||||
import * as integration from "../../utils/integration"
|
import * as integration from "../../utils/integration"
|
||||||
|
|
||||||
describe("proxy", () => {
|
describe("proxy", () => {
|
||||||
const nhooyrDevServer = new httpserver.HttpServer()
|
const nhooyrDevServer = new httpserver.HttpServer()
|
||||||
|
const wsApp = express.default()
|
||||||
|
const wsRouter = WsRouter()
|
||||||
let codeServer: httpserver.HttpServer | undefined
|
let codeServer: httpserver.HttpServer | undefined
|
||||||
let proxyPath: string
|
let proxyPath: string
|
||||||
let absProxyPath: string
|
let absProxyPath: string
|
||||||
let e: express.Express
|
let e: express.Express
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
wsApp.use("/", wsRouter.router)
|
||||||
await nhooyrDevServer.listen((req, res) => {
|
await nhooyrDevServer.listen((req, res) => {
|
||||||
e(req, res)
|
e(req, res)
|
||||||
})
|
})
|
||||||
|
nhooyrDevServer.listenUpgrade(wsApp)
|
||||||
proxyPath = `/proxy/${nhooyrDevServer.port()}/wsup`
|
proxyPath = `/proxy/${nhooyrDevServer.port()}/wsup`
|
||||||
absProxyPath = proxyPath.replace("/proxy/", "/absproxy/")
|
absProxyPath = proxyPath.replace("/proxy/", "/absproxy/")
|
||||||
})
|
})
|
||||||
@@ -29,6 +34,7 @@ describe("proxy", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
e = express.default()
|
e = express.default()
|
||||||
|
mockLogger()
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
@@ -36,6 +42,7 @@ describe("proxy", () => {
|
|||||||
await codeServer.dispose()
|
await codeServer.dispose()
|
||||||
codeServer = undefined
|
codeServer = undefined
|
||||||
}
|
}
|
||||||
|
jest.clearAllMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should rewrite the base path", async () => {
|
it("should rewrite the base path", async () => {
|
||||||
@@ -151,6 +158,46 @@ describe("proxy", () => {
|
|||||||
expect(resp.status).toBe(500)
|
expect(resp.status).toBe(500)
|
||||||
expect(resp.statusText).toMatch("Internal Server Error")
|
expect(resp.statusText).toMatch("Internal Server Error")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should pass origin check", async () => {
|
||||||
|
wsRouter.ws("/wsup", async (req) => {
|
||||||
|
wss.handleUpgrade(req, req.ws, req.head, (ws) => {
|
||||||
|
ws.send("hello")
|
||||||
|
req.ws.resume()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
codeServer = await integration.setup(["--auth=none"], "")
|
||||||
|
const ws = await codeServer.wsWait(proxyPath, {
|
||||||
|
headers: {
|
||||||
|
host: "localhost:8080",
|
||||||
|
origin: "https://localhost:8080",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
ws.terminate()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should fail origin check", async () => {
|
||||||
|
await expect(async () => {
|
||||||
|
codeServer = await integration.setup(["--auth=none"], "")
|
||||||
|
await codeServer.wsWait(proxyPath, {
|
||||||
|
headers: {
|
||||||
|
host: "localhost:8080",
|
||||||
|
origin: "https://evil.org",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}).rejects.toThrow()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should proxy non-ASCII", async () => {
|
||||||
|
e.get("*", (req, res) => {
|
||||||
|
res.json("ほげ")
|
||||||
|
})
|
||||||
|
codeServer = await integration.setup(["--auth=none"], "")
|
||||||
|
const resp = await codeServer.fetch(proxyPath.replace("wsup", "ほげ"))
|
||||||
|
expect(resp.status).toBe(200)
|
||||||
|
const json = await resp.json()
|
||||||
|
expect(json).toBe("ほげ")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
// NOTE@jsjoeio
|
// NOTE@jsjoeio
|
||||||
@@ -190,18 +237,18 @@ describe("proxy (standalone)", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Start both servers
|
// Start both servers
|
||||||
await proxyTarget.listen(PROXY_PORT)
|
proxyTarget.listen(PROXY_PORT)
|
||||||
await testServer.listen(PORT)
|
testServer.listen(PORT)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
await testServer.close()
|
testServer.close()
|
||||||
await proxyTarget.close()
|
proxyTarget.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should return a 500 when proxy target errors ", async () => {
|
it("should return a 500 when proxy target errors ", async () => {
|
||||||
// Close the proxy target so that proxy errors
|
// Close the proxy target so that proxy errors
|
||||||
await proxyTarget.close()
|
proxyTarget.close()
|
||||||
const errorResp = await nodeFetch(`${URL}/error`)
|
const errorResp = await nodeFetch(`${URL}/error`)
|
||||||
expect(errorResp.status).toBe(HttpCode.ServerError)
|
expect(errorResp.status).toBe(HttpCode.ServerError)
|
||||||
expect(errorResp.statusText).toBe("Internal Server Error")
|
expect(errorResp.statusText).toBe("Internal Server Error")
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ describe("health", () => {
|
|||||||
codeServer = await integration.setup(["--auth=none"], "")
|
codeServer = await integration.setup(["--auth=none"], "")
|
||||||
const ws = codeServer.ws("/healthz")
|
const ws = codeServer.ws("/healthz")
|
||||||
const message = await new Promise((resolve, reject) => {
|
const message = await new Promise((resolve, reject) => {
|
||||||
ws.on("error", console.error)
|
ws.on("error", (err) => {
|
||||||
|
console.error("[healthz]", err)
|
||||||
|
})
|
||||||
ws.on("message", (message) => {
|
ws.on("message", (message) => {
|
||||||
try {
|
try {
|
||||||
const j = JSON.parse(message.toString())
|
const j = JSON.parse(message.toString())
|
||||||
|
|||||||
30
test/unit/node/routes/vscode.test.ts
Normal file
30
test/unit/node/routes/vscode.test.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import * as httpserver from "../../../utils/httpserver"
|
||||||
|
import * as integration from "../../../utils/integration"
|
||||||
|
import { mockLogger } from "../../../utils/helpers"
|
||||||
|
|
||||||
|
describe("vscode", () => {
|
||||||
|
let codeServer: httpserver.HttpServer | undefined
|
||||||
|
beforeEach(() => {
|
||||||
|
mockLogger()
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
|
if (codeServer) {
|
||||||
|
await codeServer.dispose()
|
||||||
|
codeServer = undefined
|
||||||
|
}
|
||||||
|
jest.clearAllMocks()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should fail origin check", async () => {
|
||||||
|
await expect(async () => {
|
||||||
|
codeServer = await integration.setup(["--auth=none"], "")
|
||||||
|
await codeServer.wsWait("/vscode", {
|
||||||
|
headers: {
|
||||||
|
host: "localhost:8080",
|
||||||
|
origin: "https://evil.org",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}).rejects.toThrow()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -601,3 +601,41 @@ describe("constructOpenOptions", () => {
|
|||||||
expect(urlSearch).toBe("?q=^&test")
|
expect(urlSearch).toBe("?q=^&test")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("splitOnFirstEquals", () => {
|
||||||
|
const tests = [
|
||||||
|
{
|
||||||
|
name: "empty",
|
||||||
|
key: "",
|
||||||
|
value: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "split on first equals",
|
||||||
|
key: "foo",
|
||||||
|
value: "bar",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "split on first equals even with multiple equals",
|
||||||
|
key: "foo",
|
||||||
|
value: "bar=baz",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "split with empty value",
|
||||||
|
key: "foo",
|
||||||
|
value: "",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "split with no value",
|
||||||
|
key: "foo",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
tests.forEach((test) => {
|
||||||
|
it("should ${test.name}", () => {
|
||||||
|
const input = test.key && typeof test.value !== "undefined" ? `${test.key}=${test.value}` : test.key
|
||||||
|
const [key, value] = util.splitOnFirstEquals(input)
|
||||||
|
expect(key).toStrictEqual(test.key)
|
||||||
|
expect(value).toStrictEqual(test.value || undefined)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { Disposable } from "../../src/common/emitter"
|
|||||||
import * as util from "../../src/common/util"
|
import * as util from "../../src/common/util"
|
||||||
import { ensureAddress } from "../../src/node/app"
|
import { ensureAddress } from "../../src/node/app"
|
||||||
import { disposer } from "../../src/node/http"
|
import { disposer } from "../../src/node/http"
|
||||||
|
|
||||||
import { handleUpgrade } from "../../src/node/wsRouter"
|
import { handleUpgrade } from "../../src/node/wsRouter"
|
||||||
|
|
||||||
// Perhaps an abstraction similar to this should be used in app.ts as well.
|
// Perhaps an abstraction similar to this should be used in app.ts as well.
|
||||||
@@ -76,14 +75,25 @@ export class HttpServer {
|
|||||||
/**
|
/**
|
||||||
* Open a websocket against the request path.
|
* Open a websocket against the request path.
|
||||||
*/
|
*/
|
||||||
public ws(requestPath: string): Websocket {
|
public ws(requestPath: string, options?: Websocket.ClientOptions): Websocket {
|
||||||
const address = ensureAddress(this.hs, "ws")
|
const address = ensureAddress(this.hs, "ws")
|
||||||
if (typeof address === "string") {
|
if (typeof address === "string") {
|
||||||
throw new Error("Cannot open websocket to socket path")
|
throw new Error("Cannot open websocket to socket path")
|
||||||
}
|
}
|
||||||
address.pathname = requestPath
|
address.pathname = requestPath
|
||||||
|
|
||||||
return new Websocket(address.toString())
|
return new Websocket(address.toString(), options)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a websocket and wait for it to fully open.
|
||||||
|
*/
|
||||||
|
public wsWait(requestPath: string, options?: Websocket.ClientOptions): Promise<Websocket> {
|
||||||
|
const ws = this.ws(requestPath, options)
|
||||||
|
return new Promise<Websocket>((resolve, reject) => {
|
||||||
|
ws.on("error", (err) => reject(err))
|
||||||
|
ws.on("open", () => resolve(ws))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public port(): number {
|
public port(): number {
|
||||||
|
|||||||
@@ -1285,16 +1285,16 @@ convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
|
|||||||
safe-buffer "~5.1.1"
|
safe-buffer "~5.1.1"
|
||||||
|
|
||||||
cookiejar@^2.1.3:
|
cookiejar@^2.1.3:
|
||||||
version "2.1.3"
|
version "2.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc"
|
resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b"
|
||||||
integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==
|
integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==
|
||||||
|
|
||||||
cross-fetch@^3.0.4:
|
cross-fetch@^3.0.4:
|
||||||
version "3.1.4"
|
version "3.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39"
|
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
|
||||||
integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==
|
integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
node-fetch "2.6.1"
|
node-fetch "2.6.7"
|
||||||
|
|
||||||
cross-spawn@^7.0.3:
|
cross-spawn@^7.0.3:
|
||||||
version "7.0.3"
|
version "7.0.3"
|
||||||
@@ -2334,9 +2334,9 @@ jest@^27.3.1:
|
|||||||
jest-cli "^27.4.7"
|
jest-cli "^27.4.7"
|
||||||
|
|
||||||
jpeg-js@^0.4.2:
|
jpeg-js@^0.4.2:
|
||||||
version "0.4.3"
|
version "0.4.4"
|
||||||
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.3.tgz#6158e09f1983ad773813704be80680550eff977b"
|
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.4.tgz#a9f1c6f1f9f0fa80cdb3484ed9635054d28936aa"
|
||||||
integrity sha512-ru1HWKek8octvUHFHvE5ZzQ1yAsJmIvRdGWvSoKV52XKyuyYA437QWDttXT8eZXDSbuMpHlLzPDZUPd6idIz+Q==
|
integrity sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==
|
||||||
|
|
||||||
js-tokens@^4.0.0:
|
js-tokens@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
@@ -2395,11 +2395,9 @@ json-schema@^0.4.0:
|
|||||||
integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==
|
integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==
|
||||||
|
|
||||||
json5@2.x, json5@^2.1.2:
|
json5@2.x, json5@^2.1.2:
|
||||||
version "2.2.0"
|
version "2.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3"
|
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
||||||
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
|
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
|
||||||
dependencies:
|
|
||||||
minimist "^1.2.5"
|
|
||||||
|
|
||||||
kleur@^3.0.3:
|
kleur@^3.0.3:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
@@ -2503,17 +2501,12 @@ mimic-fn@^2.1.0:
|
|||||||
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
|
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
|
||||||
|
|
||||||
minimatch@^3.0.3, minimatch@^3.0.4:
|
minimatch@^3.0.3, minimatch@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||||
dependencies:
|
dependencies:
|
||||||
brace-expansion "^1.1.7"
|
brace-expansion "^1.1.7"
|
||||||
|
|
||||||
minimist@^1.2.5:
|
|
||||||
version "1.2.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
|
|
||||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
|
||||||
|
|
||||||
minipass@^3.0.0:
|
minipass@^3.0.0:
|
||||||
version "3.1.6"
|
version "3.1.6"
|
||||||
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee"
|
resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee"
|
||||||
@@ -2554,19 +2547,7 @@ node-addon-api@^4.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f"
|
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f"
|
||||||
integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==
|
integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==
|
||||||
|
|
||||||
node-fetch@2.6.1:
|
node-fetch@2.6.7, node-fetch@^2.6.5, node-fetch@^2.6.7:
|
||||||
version "2.6.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
|
|
||||||
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
|
|
||||||
|
|
||||||
node-fetch@^2.6.1:
|
|
||||||
version "2.6.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
|
|
||||||
integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==
|
|
||||||
dependencies:
|
|
||||||
whatwg-url "^5.0.0"
|
|
||||||
|
|
||||||
node-fetch@^2.6.5:
|
|
||||||
version "2.6.7"
|
version "2.6.7"
|
||||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
|
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
|
||||||
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
|
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
|
||||||
|
|||||||
Reference in New Issue
Block a user