mirror of
https://github.com/coder/code-server.git
synced 2026-04-14 15:19:07 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64fa789278 | ||
|
|
76db1a1467 | ||
|
|
9ffc2fdfe0 | ||
|
|
674382fb7f | ||
|
|
853fb91eb7 | ||
|
|
51a066dedc | ||
|
|
408e15aee0 | ||
|
|
0a895e6d0e | ||
|
|
a5d3212389 | ||
|
|
2588f1ea24 | ||
|
|
eea8171c56 |
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
6
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -66,13 +66,11 @@ body:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Does this issue happen in VS Code or GitHub Codespaces?
|
||||
description: Please try reproducing this issue in VS Code or GitHub Codespaces
|
||||
label: Does this issue happen in VS Code?
|
||||
description: Please try reproducing this issue in VS Code
|
||||
options:
|
||||
- label: I cannot reproduce this in VS Code.
|
||||
required: true
|
||||
- label: I cannot reproduce this in GitHub Codespaces.
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you accessing code-server over HTTPS?
|
||||
|
||||
67
.github/workflows/ci.yaml
vendored
67
.github/workflows/ci.yaml
vendored
@@ -33,13 +33,13 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install helm
|
||||
uses: azure/setup-helm@v3.0
|
||||
uses: azure/setup-helm@v1.1
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -74,10 +74,10 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -116,10 +116,10 @@ jobs:
|
||||
- name: Patch Code
|
||||
run: quilt push -a
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -164,9 +164,7 @@ jobs:
|
||||
if: success()
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
run: yarn coverage
|
||||
if: success()
|
||||
|
||||
# The release package does not contain any native modules
|
||||
@@ -255,21 +253,20 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install development tools
|
||||
run: |
|
||||
yum install -y epel-release centos-release-scl
|
||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
|
||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync
|
||||
|
||||
- name: Install nfpm and envsubst
|
||||
run: |
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
curl -L https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
||||
chmod +x envsubst
|
||||
mv envsubst ~/.local/bin
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
@@ -290,11 +287,8 @@ jobs:
|
||||
- name: Build standalone release
|
||||
run: source scl_source enable devtoolset-9 && yarn release:standalone
|
||||
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||
|
||||
- name: Run integration tests on standalone release
|
||||
run: yarn test:integration
|
||||
- name: Sanity test standalone release
|
||||
run: yarn test:standalone-release
|
||||
|
||||
- name: Build packages with nfpm
|
||||
run: yarn package
|
||||
@@ -343,7 +337,7 @@ jobs:
|
||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
||||
NODE_VERSION: v16.13.0
|
||||
NODE_VERSION: v14.17.4
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
@@ -351,15 +345,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install cross-compiler
|
||||
@@ -404,15 +397,14 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Download npm package
|
||||
@@ -426,11 +418,8 @@ jobs:
|
||||
- name: Build standalone release
|
||||
run: yarn release:standalone
|
||||
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||
|
||||
- name: Run integration tests on standalone release
|
||||
run: yarn test:integration
|
||||
- name: Sanity test standalone release
|
||||
run: yarn test:standalone-release
|
||||
|
||||
- name: Build packages with nfpm
|
||||
run: yarn package
|
||||
@@ -457,10 +446,10 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v16
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
node-version: "14"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -517,7 +506,7 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
|
||||
uses: aquasecurity/trivy-action@40c4ca9e7421287d0c5576712fdff370978f9c3c
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
@@ -528,6 +517,6 @@ jobs:
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: "trivy-repo-results.sarif"
|
||||
|
||||
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -35,13 +35,13 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
config-file: ./.github/codeql-config.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v1
|
||||
|
||||
31
.github/workflows/docker.yaml
vendored
31
.github/workflows/docker.yaml
vendored
@@ -24,37 +24,32 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||
|
||||
- name: Download release artifacts
|
||||
uses: robinraju/release-downloader@v1.4
|
||||
- name: Download artifact
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
id: download
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ steps.version.outputs.version }}
|
||||
fileName: "*.deb"
|
||||
out-file-path: "release-packages"
|
||||
branch: v${{ steps.version.outputs.version }}
|
||||
workflow: ci.yaml
|
||||
workflow_conclusion: completed
|
||||
name: "release-packages"
|
||||
path: release-packages
|
||||
|
||||
- name: Publish to Docker
|
||||
run: yarn publish:docker
|
||||
- name: Run ./ci/steps/docker-buildx-push.sh
|
||||
run: ./ci/steps/docker-buildx-push.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
4
.github/workflows/installer.yml
vendored
4
.github/workflows/installer.yml
vendored
@@ -34,7 +34,7 @@ jobs:
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
run: yarn test:standalone-release code-server
|
||||
|
||||
alpine:
|
||||
name: Test installer on Alpine
|
||||
@@ -66,4 +66,4 @@ jobs:
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
run: yarn test:standalone-release code-server
|
||||
|
||||
4
.github/workflows/npm-brew.yaml
vendored
4
.github/workflows/npm-brew.yaml
vendored
@@ -60,8 +60,8 @@ jobs:
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global user.name cdrci
|
||||
git config --global user.email opensource@coder.com
|
||||
git config user.name cdrci
|
||||
git config user.email opensource@coder.com
|
||||
|
||||
- name: Bump code-server homebrew version
|
||||
env:
|
||||
|
||||
4
.github/workflows/trivy-docker.yaml
vendored
4
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
|
||||
uses: aquasecurity/trivy-action@40c4ca9e7421287d0c5576712fdff370978f9c3c
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
@@ -60,6 +60,6 @@ jobs:
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
sarif_file: "trivy-image-results.sarif"
|
||||
|
||||
@@ -1 +1 @@
|
||||
16
|
||||
14
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
{
|
||||
"file": "src/node/heart.ts",
|
||||
"line": 7,
|
||||
"description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file)"
|
||||
"description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/master/docs/FAQ.md#heartbeat-file)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/socket.ts",
|
||||
@@ -80,12 +80,12 @@
|
||||
{
|
||||
"file": "src/node/routes/domainProxy.ts",
|
||||
"line": 18,
|
||||
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/routes/pathProxy.ts",
|
||||
"line": 19,
|
||||
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/proxy.ts",
|
||||
@@ -95,7 +95,7 @@
|
||||
{
|
||||
"file": "src/node/routes/health.ts",
|
||||
"line": 5,
|
||||
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint)"
|
||||
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/routes/login.ts",
|
||||
@@ -145,7 +145,7 @@
|
||||
{
|
||||
"directory": "lib/vscode",
|
||||
"line": 1,
|
||||
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
|
||||
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"file": "package.json",
|
||||
"line": 31,
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
||||
},
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
"line": 62,
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\")\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/master/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
51
CHANGELOG.md
51
CHANGELOG.md
@@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
Code v99.99.999
|
||||
|
||||
### Changed
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
@@ -20,55 +20,6 @@ Code v99.99.999
|
||||
|
||||
-->
|
||||
|
||||
## [4.5.0](https://github.com/coder/code-server/releases/tag/v4.5.0) - 2022-06-29
|
||||
|
||||
Code v1.68.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated codecov to use codecov uploader
|
||||
- Moved integration tests to Jest
|
||||
- Fixed docker release to only download .deb
|
||||
- Upgraded to Code 1.68.1
|
||||
- Install `nfpm` from GitHub
|
||||
- Upgraded to TypeScript 4.6
|
||||
|
||||
### Added
|
||||
|
||||
- Added tests for `open`, `isWsl`, `handlePasswordValidation`
|
||||
- Provided alternate image registry to dockerhub
|
||||
- Allowed users to have scripts run on container with `ENTRYPOINTD` environment
|
||||
variable
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed open CLI command to work on macOS
|
||||
|
||||
## [4.4.0](https://github.com/coder/code-server/releases/tag/v4.4.0) - 2022-05-06
|
||||
|
||||
Code v1.66.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Refactored methods in `Heart` class and made `Heart.beat()` async to make
|
||||
testing easier.
|
||||
- Upgraded to Code 1.66.2.
|
||||
|
||||
### Added
|
||||
|
||||
- Added back telemetry patch which was removed in the Code reachitecture.
|
||||
- Added support to use `true` for `CS_DISABLE_FILE_DOWNLOADS` environment
|
||||
variable. This means you can disable file downloads by setting
|
||||
`CS_DISABLE_FILE_DOWNLOADS` to `true` or `1`.
|
||||
- Added tests for `Heart` class.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed installation issue in AUR after LICENSE rename.
|
||||
- Fixed issue with listening on IPv6 addresses.
|
||||
- Fixed issue with Docker publish action not being able to find artifacts. Now
|
||||
it downloads the release assets from the release.
|
||||
|
||||
## [4.3.0](https://github.com/coder/code-server/releases/tag/v4.3.0) - 2022-04-14
|
||||
|
||||
Code v1.65.2
|
||||
|
||||
@@ -45,6 +45,9 @@ You can disable minification by setting `MINIFY=`.
|
||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||
- [./ci/build/build-standalone-release.sh](./build/build-standalone-release.sh) (`yarn release:standalone`)
|
||||
- Requires a node module already built into `./release` with the above script.
|
||||
- Will build a standalone release with node and node_modules bundled into `./release-standalone`.
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
||||
- Removes all build artifacts.
|
||||
- Useful to do a clean build.
|
||||
@@ -94,8 +97,6 @@ Helps avoid clobbering the CI configuration.
|
||||
- Runs `yarn lint`.
|
||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||
- Runs `yarn test:unit`.
|
||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||
- Runs `yarn test:integration`.
|
||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||
- Runs `yarn test:e2e`.
|
||||
- [./steps/release.sh](./steps/release.sh)
|
||||
|
||||
@@ -98,6 +98,43 @@ bundle_vscode() {
|
||||
|
||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
||||
|
||||
# Add the commit, date, our name, links, and enable telemetry. This just makes
|
||||
# telemetry available; telemetry can still be disabled by flag or setting.
|
||||
jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <(
|
||||
cat << EOF
|
||||
{
|
||||
"enableTelemetry": true,
|
||||
"commit": "$(cd "$VSCODE_SRC_PATH" && git rev-parse HEAD)",
|
||||
"quality": "stable",
|
||||
"date": $(jq -n 'now | todate'),
|
||||
"codeServerVersion": "$VERSION",
|
||||
"nameShort": "code-server",
|
||||
"nameLong": "code-server",
|
||||
"applicationName": "code-server",
|
||||
"dataFolderName": ".code-server",
|
||||
"win32MutexName": "codeserver",
|
||||
"licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE",
|
||||
"win32DirName": "code-server",
|
||||
"win32NameVersion": "code-server",
|
||||
"win32AppUserModelId": "coder.code-server",
|
||||
"win32ShellNameShort": "c&ode-server",
|
||||
"darwinBundleIdentifier": "com.coder.code.server",
|
||||
"linuxIconName": "com.coder.code.server",
|
||||
"reportIssueUrl": "https://github.com/coder/code-server/issues/new",
|
||||
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
|
||||
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
|
||||
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
|
||||
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
|
||||
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
|
||||
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
|
||||
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
||||
"linkProtectionTrustedDomains": [
|
||||
"https://open-vsx.org"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
) > "$VSCODE_OUT_PATH/product.json"
|
||||
|
||||
# Use the package.json for the web/remote server. It does not have the right
|
||||
# version though so pull that from the main package.json.
|
||||
jq --slurp '.[0] * {version: .[1].version}' \
|
||||
@@ -109,7 +146,7 @@ bundle_vscode() {
|
||||
# Include global extension dependencies as well.
|
||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions/yarn.lock"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions/postinstall.js"
|
||||
|
||||
pushd "$VSCODE_OUT_PATH"
|
||||
symlink_asar
|
||||
|
||||
@@ -9,62 +9,10 @@ MINIFY=${MINIFY-true}
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
cd lib/vscode
|
||||
|
||||
# Set the commit Code will embed into the product.json. We need to do this
|
||||
# since Code tries to get the commit from the `.git` directory which will fail
|
||||
# as it is a submodule.
|
||||
export VSCODE_DISTRO_COMMIT
|
||||
VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
# Add the date, our name, links, and enable telemetry (this just makes
|
||||
# telemetry available; telemetry can still be disabled by flag or setting).
|
||||
# This needs to be done before building as Code will read this file and embed
|
||||
# it into the client-side code.
|
||||
git checkout product.json # Reset in case the script exited early.
|
||||
cp product.json product.original.json # Since jq has no inline edit.
|
||||
jq --slurp '.[0] * .[1]' product.original.json <(
|
||||
cat << EOF
|
||||
{
|
||||
"enableTelemetry": true,
|
||||
"quality": "stable",
|
||||
"codeServerVersion": "$VERSION",
|
||||
"nameShort": "code-server",
|
||||
"nameLong": "code-server",
|
||||
"applicationName": "code-server",
|
||||
"dataFolderName": ".code-server",
|
||||
"win32MutexName": "codeserver",
|
||||
"licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE",
|
||||
"win32DirName": "code-server",
|
||||
"win32NameVersion": "code-server",
|
||||
"win32AppUserModelId": "coder.code-server",
|
||||
"win32ShellNameShort": "c&ode-server",
|
||||
"darwinBundleIdentifier": "com.coder.code.server",
|
||||
"linuxIconName": "com.coder.code.server",
|
||||
"reportIssueUrl": "https://github.com/coder/code-server/issues/new",
|
||||
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
|
||||
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
|
||||
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
|
||||
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
|
||||
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
|
||||
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
|
||||
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
||||
"linkProtectionTrustedDomains": [
|
||||
"https://open-vsx.org"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
) > product.json
|
||||
|
||||
# Any platform works since we have our own packaging step (for now).
|
||||
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||
|
||||
# Reset so if you develop after building you will not be stuck with the wrong
|
||||
# commit (the dev client will use `oss-dev` but the dev server will still use
|
||||
# product.json which will have `stable-$commit`).
|
||||
git checkout product.json
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -33,8 +33,8 @@ main() {
|
||||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
|
||||
echo "ERROR: code-server currently requires node v16."
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-14}" ]; then
|
||||
echo "ERROR: code-server currently requires node v14."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
@@ -68,7 +68,7 @@ main() {
|
||||
|
||||
if ! vscode_yarn; then
|
||||
echo "You may not have the required dependencies to build the native modules."
|
||||
echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md"
|
||||
echo "Please see https://github.com/coder/code-server/blob/master/docs/npm.md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -92,7 +92,7 @@ symlink_asar() {
|
||||
vscode_yarn() {
|
||||
echo 'Installing Code dependencies...'
|
||||
cd lib/vscode
|
||||
yarn --production --frozen-lockfile --no-default-rc
|
||||
yarn --production --frozen-lockfile
|
||||
|
||||
symlink_asar
|
||||
|
||||
|
||||
33
ci/build/test-standalone-release.sh
Executable file
33
ci/build/test-standalone-release.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
# will use release-standalone in the current directory.
|
||||
#
|
||||
# This is to make sure we don't have Node version errors or any other
|
||||
# compilation-related errors.
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
local EXTENSIONS_DIR
|
||||
EXTENSIONS_DIR="$(mktemp -d)"
|
||||
|
||||
local path=${1:-./release-standalone/bin/code-server}
|
||||
|
||||
echo "Testing standalone release in $path."
|
||||
|
||||
# NOTE: using a basic theme extension because it doesn't update often and is more reliable for testing
|
||||
"$path" --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2
|
||||
local installed_extensions
|
||||
installed_extensions="$("$path" --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
|
||||
# We use grep as wesbos.theme-cobalt2 may have dependency extensions that change.
|
||||
if ! echo "$installed_extensions" | grep -q "wesbos.theme-cobalt2"; then
|
||||
echo "Unexpected output from listing extensions:"
|
||||
echo "$installed_extensions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Standalone release works correctly."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -7,9 +7,6 @@ install-deps() {
|
||||
if [[ ${CI-} ]]; then
|
||||
args+=(--frozen-lockfile)
|
||||
fi
|
||||
if [[ "$1" == "lib/vscode" ]]; then
|
||||
args+=(--no-default-rc)
|
||||
fi
|
||||
# If there is no package.json then yarn will look upward and end up installing
|
||||
# from the root resulting in an infinite loop (this can happen if you have not
|
||||
# checked out the submodule yet for example).
|
||||
@@ -29,11 +26,7 @@ main() {
|
||||
|
||||
install-deps test
|
||||
install-deps test/e2e/extensions/test-extension
|
||||
# We don't need these when running the integration tests
|
||||
# so you can pass SKIP_SUBMODULE_DEPS
|
||||
if [[ ! ${SKIP_SUBMODULE_DEPS-} ]]; then
|
||||
install-deps lib/vscode
|
||||
fi
|
||||
install-deps lib/vscode
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
||||
echo >&2 " Or you can pass in a custom path."
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||
}
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
# will look for release-standalone in the current directory.
|
||||
#
|
||||
# This is to make sure we don't have Node version errors or any other
|
||||
# compilation-related errors.
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
local path="$RELEASE_PATH-standalone/bin/code-server"
|
||||
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
||||
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
||||
else
|
||||
path="$CODE_SERVER_PATH"
|
||||
fi
|
||||
|
||||
echo "Running tests with code-server binary: '$path'"
|
||||
|
||||
if [[ ! -f $path ]]; then
|
||||
echo >&2 "No code-server build detected"
|
||||
echo >&2 "Looked in $path"
|
||||
help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -30,7 +30,7 @@ main() {
|
||||
# We must keep jest in a sub-directory. See ../../test/package.json for more
|
||||
# information. We must also run it from the root otherwise coverage will not
|
||||
# include our source files.
|
||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin"
|
||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -15,9 +15,9 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 2.6.0
|
||||
version: 2.4.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 4.5.0
|
||||
appVersion: 4.3.0
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.5.0'
|
||||
tag: '4.3.0'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
|
||||
@@ -42,10 +42,6 @@ RUN ARCH="$(dpkg --print-architecture)" && \
|
||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
||||
|
||||
# Allow users to have scripts run on container startup to prepare workspace.
|
||||
# https://github.com/coder/code-server/issues/5177
|
||||
ENV ENTRYPOINTD=${HOME}/entrypoint.d
|
||||
|
||||
EXPOSE 8080
|
||||
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
|
||||
# the uid will remain the same. note: only relevant if -u isn't passed to
|
||||
|
||||
@@ -15,8 +15,6 @@ target "code-server" {
|
||||
tags = [
|
||||
"docker.io/codercom/code-server:latest",
|
||||
notequal("latest",VERSION) ? "docker.io/codercom/code-server:${VERSION}" : "",
|
||||
"ghcr.io/coder/code-server:latest",
|
||||
notequal("latest",VERSION) ? "ghcr.io/coder/code-server:${VERSION}" : "",
|
||||
]
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
@@ -18,10 +18,4 @@ if [ "${DOCKER_USER-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allow users to have scripts run on container startup to prepare workspace.
|
||||
# https://github.com/coder/code-server/issues/5177
|
||||
if [ -d "${ENTRYPOINTD}" ]; then
|
||||
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
|
||||
fi
|
||||
|
||||
exec dumb-init /usr/bin/code-server "$@"
|
||||
|
||||
@@ -31,7 +31,7 @@ for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v16.x
|
||||
- `node` v14.x
|
||||
- `git` v2.x or greater
|
||||
- [`git-lfs`](https://git-lfs.github.com)
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
@@ -96,8 +96,6 @@ re-apply the patches.
|
||||
### Version updates to Code
|
||||
|
||||
1. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
|
||||
2. `git add lib && git commit -m "chore: update Code"`
|
||||
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
|
||||
stage you may need to resolve conflicts. For example use `quilt push -f`,
|
||||
manually apply the rejected portions, then `quilt refresh`.
|
||||
@@ -132,13 +130,11 @@ yarn build:vscode
|
||||
yarn release
|
||||
```
|
||||
|
||||
_NOTE: this does not keep `node_modules`. If you want them to be kept, use `KEEP_MODULES=1 yarn release` (if you're testing in Coder, you'll want to do this)_
|
||||
|
||||
Run your build:
|
||||
|
||||
```shell
|
||||
cd release
|
||||
yarn --production # Skip if you used KEEP_MODULES=1
|
||||
yarn --production
|
||||
# Runs the built JavaScript with Node.
|
||||
node .
|
||||
```
|
||||
@@ -147,7 +143,7 @@ Build the release packages (make sure that you run `yarn release` first):
|
||||
|
||||
```shell
|
||||
yarn release:standalone
|
||||
yarn test:integration
|
||||
yarn test:standalone-release
|
||||
yarn package
|
||||
```
|
||||
|
||||
@@ -188,8 +184,9 @@ We use these to test anything related to our scripts (most of which live under `
|
||||
|
||||
### Integration tests
|
||||
|
||||
These are a work in progress. We build code-server and run tests with `yarn test:integration`, which ensures that code-server builds work on their respective
|
||||
platforms.
|
||||
These are a work in progress. We build code-server and run a script called
|
||||
[test-standalone-release.sh](../ci/build/test-standalone-release.sh), which
|
||||
ensures that code-server's CLI is working.
|
||||
|
||||
Our integration tests look at components that rely on one another. For example,
|
||||
testing the CLI requires us to build and package code-server.
|
||||
|
||||
@@ -164,14 +164,13 @@ If you're the current release manager, follow these steps:
|
||||
|
||||
### Publishing a release
|
||||
|
||||
1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.5.0)
|
||||
1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.3.0)
|
||||
1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`)
|
||||
1. GitHub Actions will generate the `npm-package`, `release-packages` and
|
||||
`release-images` artifacts. You do not have to wait for this step to complete
|
||||
before proceeding.
|
||||
1. Run `yarn release:github-draft` to create a GitHub draft release from the
|
||||
template with the updated version. Make sure to update the `CHANGELOG.md`.
|
||||
1. Bump chart version in `Chart.yaml`.
|
||||
template with the updated version.
|
||||
1. Summarize the major changes in the release notes and link to the relevant
|
||||
issues.
|
||||
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: v3.9.0`
|
||||
|
||||
@@ -14,9 +14,8 @@ access it in the browser.
|
||||
- Preserve battery life when you're on the go; all intensive tasks run on your
|
||||
server
|
||||
|
||||
> **Note**
|
||||
> To manage multiple IDEs, workspaces, and teams, see
|
||||
> our new project: [coder/coder](http://cdr.co/coder-github)
|
||||
| 🔔 code-server is a free browser-based IDE while [Coder](https://coder.com/) is our enterprise developer workspace platform. For more information, visit [Coder.com](https://coder.com/docs/comparison)
|
||||
| ---
|
||||
|
||||
## Requirements
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||
```
|
||||
|
||||
6. Exit the terminal using `exit` and then reopen the terminal
|
||||
7. Install and use Node.js 16:
|
||||
7. Install and use Node.js 14:
|
||||
|
||||
```shell
|
||||
nvm install 16
|
||||
nvm use 16
|
||||
nvm install 14
|
||||
nvm use 14
|
||||
```
|
||||
|
||||
8. Install code-server globally on device with: `npm i -g code-server`
|
||||
|
||||
@@ -60,6 +60,6 @@ As `code-server` is based on VS Code, you can follow the steps described on Duck
|
||||
code-server --enable-proposed-api genuitecllc.codetogether
|
||||
```
|
||||
|
||||
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.5.0/FAQ#how-does-the-config-file-work).
|
||||
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.3.0/FAQ#how-does-the-config-file-work).
|
||||
|
||||
3. Refresh code-server and navigate to the CodeTogether icon in the sidebar to host or join a coding session.
|
||||
|
||||
@@ -126,8 +126,8 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
||||
|
||||
```console
|
||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add -
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key' | sudo apt-key add -
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/setup/config.deb.txt?distro=debian&version=any-version' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list
|
||||
sudo apt update
|
||||
sudo apt install caddy
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# code-server Helm Chart
|
||||
|
||||
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.5.0-informational?style=flat-square)
|
||||
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.3.0-informational?style=flat-square)
|
||||
|
||||
[code-server](https://github.com/coder/code-server) code-server is VS Code running
|
||||
on a remote server, accessible through the browser.
|
||||
@@ -73,7 +73,7 @@ and their default values.
|
||||
| hostnameOverride | string | `""` |
|
||||
| image.pullPolicy | string | `"Always"` |
|
||||
| image.repository | string | `"codercom/code-server"` |
|
||||
| image.tag | string | `"4.5.0"` |
|
||||
| image.tag | string | `"4.3.0"` |
|
||||
| imagePullSecrets | list | `[]` |
|
||||
| ingress.enabled | bool | `false` |
|
||||
| nameOverride | string | `""` |
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"versions": ["v4.5.0"],
|
||||
"versions": ["v4.3.0"],
|
||||
"routes": [
|
||||
{
|
||||
"title": "Home",
|
||||
@@ -73,7 +73,7 @@
|
||||
{
|
||||
"title": "Upgrade",
|
||||
"description": "How to upgrade code-server.",
|
||||
"icon": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.8049 2.19795C17.7385 2.1311 17.6587 2.07899 17.5708 2.04504C17.4829 2.01108 17.3889 1.99604 17.2948 2.00089C7.89216 2.49153 4.4188 10.8673 4.38528 10.9517C4.33624 11.0736 4.32406 11.2071 4.5.028 11.3358C4.3765 11.4645 4.43995 11.5827 4.53274 11.6756L8.32449 15.4674C8.41787 15.5606 8.53669 15.6242 8.66606 15.6502C8.79543 15.6762 8.92959 15.6634 9.05174 15.6135C9.13552 15.5793 17.4664 12.0671 17.9986 2.7087C18.0039 2.61474 17.9895 2.5207 17.9561 2.4327C17.9227 2.3447 17.8712 2.26471 17.8049 2.19795ZM12.3314 9.56427C12.1439 9.75179 11.9051 9.87951 11.645 9.93126C11.385 9.98302 11.1154 9.9565 10.8704 9.85505C10.6254 9.7536 10.4161 9.58178 10.2687 9.36131C10.1214 9.14085 10.0428 8.88166 10.0428 8.6165C10.0428 8.35135 10.1214 8.09215 10.2687 7.87169C10.4161 7.65123 10.6254 7.47941 10.8704 7.37796C11.1154 7.27651 11.385 7.24998 11.645 7.30174C11.9051 7.3535 12.1439 7.48121 12.3314 7.66873C12.5827 7.92012 12.7239 8.26104 12.7239 8.6165C12.7239 8.97197 12.5827 9.31288 12.3314 9.56427Z\"/><path d=\"M2.74602 14.5444C2.92281 14.3664 3.133 14.2251 3.36454 14.1285C3.59608 14.0319 3.8444 13.9819 4.09529 13.9815C4.34617 13.9811 4.59466 14.0.12 4.82653 14.126C5.05839 14.2218 5.26907 14.3624 5.44647 14.5398C5.62386 14.7172 5.7645 14.9279 5.86031 15.1598C5.95612 15.3916 6.00522 15.6401 6.00479 15.891C6.00437 16.1419 5.95442 16.3902 5.85782 16.6218C5.76122 16.8533 5.61987 17.0635 5.44186 17.2403C4.69719 17.985 2 18.0004 2 18.0004C2 18.0004 2 15.2884 2.74602 14.5444Z\"/><path d=\"M8.9416 3.48269C7.99688 3.31826 7.02645 3.38371 6.11237 3.67352C5.19828 3.96332 4.36741 4.46894 3.68999 5.14765C3.33153 5.50944.5.01988 5.91477 2.76233 6.35415C2.68692 6.4822 2.6562 6.63169 2.67501 6.77911C2.69381 6.92652 2.76108 7.06351 2.86623 7.16853L4.1994 8.50238C5.43822 6.53634 7.04911 4.83119 8.9416 3.48269Z\"/><path d=\"M16.5181 11.0585C16.6825 12.0033 16.6171 12.9737 16.3273 13.8878C16.0375 14.8019 15.5318 15.6327 14.8531 16.3101C14.4914 16.6686 14.086 16.9803 13.6466 17.2378C13.5186 17.3132 13.3691 17.3439 13.2217 17.3251C13.0743 17.3063 12.9373 17.2391 12.8323 17.1339L11.4984 15.8007C13.4645 14.5619 15.1696 12.951 16.5181 11.0585Z\"/></svg>",
|
||||
"icon": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.8049 2.19795C17.7385 2.1311 17.6587 2.07899 17.5708 2.04504C17.4829 2.01108 17.3889 1.99604 17.2948 2.00089C7.89216 2.49153 4.4188 10.8673 4.38528 10.9517C4.33624 11.0736 4.32406 11.2071 4.35028 11.3358C4.3765 11.4645 4.43995 11.5827 4.53274 11.6756L8.32449 15.4674C8.41787 15.5606 8.53669 15.6242 8.66606 15.6502C8.79543 15.6762 8.92959 15.6634 9.05174 15.6135C9.13552 15.5793 17.4664 12.0671 17.9986 2.7087C18.0039 2.61474 17.9895 2.5207 17.9561 2.4327C17.9227 2.3447 17.8712 2.26471 17.8049 2.19795ZM12.3314 9.56427C12.1439 9.75179 11.9051 9.87951 11.645 9.93126C11.385 9.98302 11.1154 9.9565 10.8704 9.85505C10.6254 9.7536 10.4161 9.58178 10.2687 9.36131C10.1214 9.14085 10.0428 8.88166 10.0428 8.6165C10.0428 8.35135 10.1214 8.09215 10.2687 7.87169C10.4161 7.65123 10.6254 7.47941 10.8704 7.37796C11.1154 7.27651 11.385 7.24998 11.645 7.30174C11.9051 7.3535 12.1439 7.48121 12.3314 7.66873C12.5827 7.92012 12.7239 8.26104 12.7239 8.6165C12.7239 8.97197 12.5827 9.31288 12.3314 9.56427Z\"/><path d=\"M2.74602 14.5444C2.92281 14.3664 3.133 14.2251 3.36454 14.1285C3.59608 14.0319 3.8444 13.9819 4.09529 13.9815C4.34617 13.9811 4.59466 14.0.12 4.82653 14.126C5.05839 14.2218 5.26907 14.3624 5.44647 14.5398C5.62386 14.7172 5.7645 14.9279 5.86031 15.1598C5.95612 15.3916 6.00522 15.6401 6.00479 15.891C6.00437 16.1419 5.95442 16.3902 5.85782 16.6218C5.76122 16.8533 5.61987 17.0635 5.44186 17.2403C4.69719 17.985 2 18.0004 2 18.0004C2 18.0004 2 15.2884 2.74602 14.5444Z\"/><path d=\"M8.9416 3.48269C7.99688 3.31826 7.02645 3.38371 6.11237 3.67352C5.19828 3.96332 4.36741 4.46894 3.68999 5.14765C3.33153 5.50944 3.01988 5.91477 2.76233 6.35415C2.68692 6.4822 2.6562 6.63169 2.67501 6.77911C2.69381 6.92652 2.76108 7.06351 2.86623 7.16853L4.1994 8.50238C5.43822 6.53634 7.04911 4.83119 8.9416 3.48269Z\"/><path d=\"M16.5181 11.0585C16.6825 12.0033 16.6171 12.9737 16.3273 13.8878C16.0375 14.8019 15.5318 15.6327 14.8531 16.3101C14.4914 16.6686 14.086 16.9803 13.6466 17.2378C13.5186 17.3132 13.3691 17.3439 13.2217 17.3251C13.0743 17.3063 12.9373 17.2391 12.8323 17.1339L11.4984 15.8007C13.4645 14.5619 15.1696 12.951 16.5181 11.0585Z\"/></svg>",
|
||||
"path": "./upgrade.md"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -22,8 +22,8 @@ includes installing instructions based on your operating system.
|
||||
|
||||
## Node.js version
|
||||
|
||||
We use the same major version of Node.js shipped with Code's remote, which is
|
||||
currently `16.x`. VS Code also [lists Node.js
|
||||
We use the same major version of Node.js shipped with VSCode's Electron,
|
||||
which is currently `14.x`. VS Code also [lists Node.js
|
||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
|
||||
Using other versions of Node.js [may lead to unexpected
|
||||
@@ -72,7 +72,7 @@ Proceed to [installing](#installing)
|
||||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node16 yarn-node16 pkgconf
|
||||
pkg install -y git python npm-node14 yarn-node14 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
|
||||
Submodule lib/vscode updated: 30d9c6cd94...c722ca6c7e
21
package.json
21
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-server",
|
||||
"license": "MIT",
|
||||
"version": "4.5.0",
|
||||
"version": "4.3.0",
|
||||
"description": "Run VS Code on a remote server.",
|
||||
"homepage": "https://github.com/coder/code-server",
|
||||
"bugs": {
|
||||
@@ -18,20 +18,20 @@
|
||||
"release:github-assets": "./ci/build/release-github-assets.sh",
|
||||
"release:prep": "./ci/build/release-prep.sh",
|
||||
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
||||
"test:standalone-release": "./ci/build/test-standalone-release.sh",
|
||||
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
|
||||
"test:integration": "./ci/dev/test-integration.sh",
|
||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||
"package": "./ci/build/build-packages.sh",
|
||||
"postinstall": "./ci/dev/postinstall.sh",
|
||||
"publish:npm": "./ci/steps/publish-npm.sh",
|
||||
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
||||
"_audit": "./ci/dev/audit.sh",
|
||||
"fmt": "./ci/dev/fmt.sh",
|
||||
"lint": "./ci/dev/lint.sh",
|
||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||
"ci": "./ci/dev/ci.sh",
|
||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||
"icons": "./ci/dev/gen_icons.sh"
|
||||
"icons": "./ci/dev/gen_icons.sh",
|
||||
"coverage": "codecov"
|
||||
},
|
||||
"main": "out/node/entry.js",
|
||||
"devDependencies": {
|
||||
@@ -49,9 +49,10 @@
|
||||
"@types/split2": "^3.2.0",
|
||||
"@types/trusted-types": "^2.0.2",
|
||||
"@types/ws": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||
"@typescript-eslint/parser": "^5.23.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
||||
"@typescript-eslint/parser": "^5.0.0",
|
||||
"audit-ci": "^6.0.0",
|
||||
"codecov": "^3.8.3",
|
||||
"doctoc": "^2.0.0",
|
||||
"eslint": "^7.7.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
@@ -60,13 +61,13 @@
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"json": "^11.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-plugin-sh": "^0.12.0",
|
||||
"prettier-plugin-sh": "^0.10.0",
|
||||
"shellcheck": "^1.0.0",
|
||||
"stylelint": "^13.0.0",
|
||||
"stylelint-config-recommended": "^5.0.0",
|
||||
"synp": "^1.9.10",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "^4.6.2"
|
||||
"typescript": "^4.4.0-dev.20210528"
|
||||
},
|
||||
"resolutions": {
|
||||
"ansi-regex": "^5.0.1",
|
||||
@@ -98,7 +99,7 @@
|
||||
"limiter": "^1.1.5",
|
||||
"pem": "^1.14.2",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"qs": "6.11.0",
|
||||
"qs": "6.10.3",
|
||||
"rotating-file-stream": "^3.0.0",
|
||||
"safe-buffer": "^5.1.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
@@ -120,7 +121,7 @@
|
||||
"browser-ide"
|
||||
],
|
||||
"engines": {
|
||||
"node": "16"
|
||||
"node": ">= 14"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
||||
@@ -10,14 +10,16 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
@@ -157,7 +157,9 @@ class RemoteAuthoritiesImpl {
|
||||
@@ -151,8 +151,10 @@ class RemoteAuthoritiesImpl {
|
||||
}
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
- path: this._remoteResourcesPath,
|
||||
- authority: `${host}:${port}`,
|
||||
- path: `/vscode-remote-resource`,
|
||||
+ authority: platform.isWeb ? window.location.host : `${host}:${port}`,
|
||||
+ path: platform.isWeb
|
||||
+ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/")
|
||||
+ : this._remoteResourcesPath,
|
||||
+ ? URI.joinPath(URI.parse(window.location.href), `/vscode-remote-resource`).path
|
||||
+ : `/vscode-remote-resource`,
|
||||
query
|
||||
});
|
||||
}
|
||||
@@ -36,28 +38,40 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -27,9 +27,9 @@
|
||||
@@ -27,23 +27,26 @@
|
||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
|
||||
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
|
||||
<body aria-label="">
|
||||
@@ -39,7 +39,7 @@
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||
</body>
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
- <script src="./static/out/vs/loader.js"></script>
|
||||
- <script src="./static/out/vs/webPackagePaths.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/loader.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/webPackagePaths.js"></script>
|
||||
<script>
|
||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
- self.webPackagePaths[key] = `${window.location.origin}/static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
+ self.webPackagePaths[key] = new URL(
|
||||
+ `{{VS_BASE}}/static/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`,
|
||||
+ window.location,
|
||||
+ ).toString();
|
||||
});
|
||||
require.config({
|
||||
- baseUrl: `${window.location.origin}/static/out`,
|
||||
+ baseUrl: new URL(`{{VS_BASE}}/static/out`, window.location).toString(),
|
||||
recordStats: true,
|
||||
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
|
||||
createScriptURL(value) {
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -73,32 +87,68 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -24,9 +24,9 @@
|
||||
@@ -24,10 +24,10 @@
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
|
||||
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
- <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="./static/out/vs/workbench/workbench.web.main.css">
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
+ <link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.css">
|
||||
|
||||
</head>
|
||||
|
||||
@@ -35,14 +35,17 @@
|
||||
</body>
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
- <script src="./static/out/vs/loader.js"></script>
|
||||
- <script src="./static/out/vs/webPackagePaths.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/loader.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/webPackagePaths.js"></script>
|
||||
<script>
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
- self.webPackagePaths[key] = `${window.location.origin}/static/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
+ self.webPackagePaths[key] = new URL(
|
||||
+ `{{VS_BASE}}/static/node_modules/${key}/${self.webPackagePaths[key]}`,
|
||||
+ window.location,
|
||||
+ ).toString();
|
||||
});
|
||||
require.config({
|
||||
- baseUrl: `${window.location.origin}/static/out`,
|
||||
+ baseUrl: new URL(`{{VS_BASE}}/static/out`, window.location).toString(),
|
||||
recordStats: true,
|
||||
trustedTypesPolicy: window.trustedTypes?.createPolicy('amdLoader', {
|
||||
createScriptURL(value) {
|
||||
@@ -55,7 +58,7 @@
|
||||
<script>
|
||||
performance.mark('code/willLoadWorkbenchMain');
|
||||
</script>
|
||||
- <script src="./static/out/vs/workbench/workbench.web.main.nls.js"></script>
|
||||
- <script src="./static/out/vs/workbench/workbench.web.main.js"></script>
|
||||
- <script src="./static/out/vs/code/browser/workbench/workbench.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.nls.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/workbench/workbench.web.main.js"></script>
|
||||
+ <script src="{{VS_BASE}}/static/out/vs/code/browser/workbench/workbench.js"></script>
|
||||
</html>
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
@@ -274,6 +274,7 @@ export class BrowserSocketFactory implem
|
||||
@@ -274,7 +274,7 @@ export class BrowserSocketFactory implem
|
||||
|
||||
connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void {
|
||||
connect(host: string, port: number, query: string, debugLabel: string, callback: IConnectCallback): void {
|
||||
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
|
||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||
- const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}/?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||
+ const socket = this._webSocketFactory.create(`${webSocketSchema}://${window.location.host}${window.location.pathname}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||
const errorListener = socket.onError((err) => callback(err, undefined));
|
||||
socket.onOpen(() => {
|
||||
@@ -282,6 +283,3 @@ export class BrowserSocketFactory implem
|
||||
errorListener.dispose();
|
||||
@@ -282,6 +282,3 @@ export class BrowserSocketFactory implem
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -109,56 +159,47 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -267,14 +267,10 @@ export class WebClientServer {
|
||||
@@ -252,7 +252,10 @@ export class WebClientServer {
|
||||
return res.end();
|
||||
}
|
||||
|
||||
- let originalHost = req.headers['x-original-host'];
|
||||
- if (Array.isArray(originalHost)) {
|
||||
- originalHost = originalHost[0];
|
||||
- }
|
||||
- const remoteAuthority = originalHost || req.headers.host;
|
||||
- if (!remoteAuthority) {
|
||||
- return serveError(req, res, 400, `Bad request.`);
|
||||
- }
|
||||
- const remoteAuthority = req.headers.host;
|
||||
+ // It is not possible to reliably detect the remote authority on the server
|
||||
+ // in all cases. Set this to something invalid to make sure we catch code
|
||||
+ // that is using this when it should not.
|
||||
+ const remoteAuthority = 'remote';
|
||||
|
||||
function asJSON(value: unknown): string {
|
||||
return JSON.stringify(value).replace(/"/g, '"');
|
||||
@@ -297,6 +293,8 @@ export class WebClientServer {
|
||||
function escapeAttribute(value: string): string {
|
||||
return value.replace(/"/g, '"');
|
||||
@@ -272,6 +275,8 @@ export class WebClientServer {
|
||||
accessToken: this._environmentService.args['github-auth'],
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
const data = (await util.promisify(fs.readFile)(filePath)).toString()
|
||||
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
|
||||
remoteAuthority,
|
||||
@@ -279,6 +284,7 @@ export class WebClientServer {
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
+ rootEndpoint: base,
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
@@ -291,7 +297,9 @@ export class WebClientServer {
|
||||
} : undefined
|
||||
}
|
||||
})))
|
||||
- .replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '');
|
||||
+ .replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|
||||
+ .replace(/{{BASE}}/g, base)
|
||||
+ .replace(/{{VS_BASE}}/g, vscodeBase);
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
@@ -308,6 +306,7 @@ export class WebClientServer {
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -328,8 +327,10 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : '',
|
||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
+ BASE: base,
|
||||
+ VS_BASE: vscodeBase,
|
||||
};
|
||||
|
||||
|
||||
@@ -419,3 +420,70 @@ export class WebClientServer {
|
||||
const cspDirectives = [
|
||||
'default-src \'self\';',
|
||||
@@ -370,3 +378,70 @@ export class WebClientServer {
|
||||
return res.end(data);
|
||||
}
|
||||
}
|
||||
@@ -245,7 +286,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -485,6 +485,7 @@ function doCreateUri(path: string, query
|
||||
@@ -482,6 +482,7 @@ function doCreateUri(path: string, query
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,12 +294,12 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
return URI.parse(window.location.href).with({ path, query });
|
||||
}
|
||||
|
||||
@@ -496,7 +497,7 @@ function doCreateUri(path: string, query
|
||||
@@ -493,7 +494,7 @@ function doCreateUri(path: string, query
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
|
||||
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
||||
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents } = JSON.parse(configElementAttribute);
|
||||
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents, workspaceUri?: UriComponents } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
||||
|
||||
// Create workbench
|
||||
create(document.body, {
|
||||
@@ -271,10 +312,10 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
|
||||
|
||||
@@ -72,7 +71,7 @@ export abstract class AbstractExtensionR
|
||||
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
|
||||
if (this._extensionGalleryResourceUrlTemplate) {
|
||||
const uri = URI.parse(format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' }));
|
||||
|
||||
@@ -4,23 +4,16 @@ This allows the backend to distinguish them. In our case we use them to count a
|
||||
single "open" of Code so we need to be able to distinguish between web sockets
|
||||
from two instances and two web sockets used in a single instance.
|
||||
|
||||
To test this,
|
||||
1. Run code-server
|
||||
2. Open Network tab in Browser DevTools and filter for websocket requests
|
||||
3. You should see the `type=<connection-type>` in the request url
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
@@ -233,7 +233,8 @@ async function connectToRemoteExtensionH
|
||||
@@ -231,7 +231,7 @@ async function connectToRemoteExtensionH
|
||||
|
||||
let socket: ISocket;
|
||||
try {
|
||||
- socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
+
|
||||
+ socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
- socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
+ socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
} catch (error) {
|
||||
options.logService.error(`${logPrefix} socketFactory.connect() failed or timed out. Error:`);
|
||||
options.logService.error(error);
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
Prevent builtin extensions from being updated
|
||||
|
||||
Updating builtin extensions from the marketplace prevents us from patching them
|
||||
(for example out GitHub authentication patches).
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
@@ -234,6 +234,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
+ // Do not update builtin extensions.
|
||||
+ if (this.type !== ExtensionType.User) {
|
||||
+ return false;
|
||||
+ }
|
||||
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
|
||||
return false;
|
||||
}
|
||||
@@ -1088,6 +1092,10 @@ export class ExtensionsWorkbenchService
|
||||
// Skip if check updates only for builtin extensions and current extension is not builtin.
|
||||
continue;
|
||||
}
|
||||
+ if (installed.type !== ExtensionType.User) {
|
||||
+ // Never update builtin extensions.
|
||||
+ continue;
|
||||
+ }
|
||||
if (installed.isBuiltin && (!installed.local?.identifier.uuid || (!isWeb && this.productService.quality === 'stable'))) {
|
||||
// Skip checking updates for a builtin extension if it does not has Marketplace identifier or the current product is VS Code Desktop stable.
|
||||
continue;
|
||||
@@ -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/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
@@ -250,6 +250,11 @@ export interface IWorkbenchConstructionO
|
||||
@@ -210,6 +210,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly userDataPath?: string
|
||||
|
||||
@@ -28,7 +28,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/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
@@ -31,6 +31,11 @@ export interface IBrowserWorkbenchEnviro
|
||||
@@ -30,6 +30,11 @@ export interface IBrowserWorkbenchEnviro
|
||||
* Options used to configure the workbench.
|
||||
*/
|
||||
readonly options?: IWorkbenchConstructionOptions;
|
||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
||||
}
|
||||
|
||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||
@@ -62,6 +67,13 @@ export class BrowserWorkbenchEnvironment
|
||||
@@ -61,6 +66,13 @@ export class BrowserWorkbenchEnvironment
|
||||
return this.options.userDataPath;
|
||||
}
|
||||
|
||||
@@ -58,18 +58,18 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -14,6 +14,7 @@ export const serverOptions: OptionDescri
|
||||
/* ----- code-server ----- */
|
||||
@@ -15,6 +15,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
'auth': { type: 'string' },
|
||||
'locale': { type: 'string' },
|
||||
+ 'disable-file-downloads': { type: 'boolean' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -94,6 +95,7 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
@@ -92,6 +93,7 @@ export interface ServerParsedArgs {
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
'locale'?: string
|
||||
+ 'disable-file-downloads'?: boolean;
|
||||
|
||||
/* ----- server setup ----- */
|
||||
@@ -78,14 +78,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -300,6 +300,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: {
|
||||
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||
@@ -290,6 +290,7 @@ export class WebClientServer {
|
||||
logLevel: this._logService.getLevel(),
|
||||
},
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
rootEndpoint: base,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -135,7 +135,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
@@ -22,7 +22,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||
@@ -21,7 +21,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
@@ -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 { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
@@ -477,13 +477,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
@@ -475,13 +475,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
id: DOWNLOAD_COMMAND_ID,
|
||||
title: DOWNLOAD_LABEL
|
||||
},
|
||||
|
||||
@@ -1,28 +1,17 @@
|
||||
Add display language support
|
||||
|
||||
We can remove this once upstream supports all language packs.
|
||||
|
||||
1. Proxies language packs to the service on the backend.
|
||||
2. NLS configuration is embedded into the HTML for the browser to pick up. This
|
||||
code to generate this configuration is copied from the native portion.
|
||||
3. Remove navigator.language default since that will prevent the argv file from
|
||||
being created if you are changing the language to whatever your browser
|
||||
default happens to be.
|
||||
4. Move the argv.json file to the server instead of in-browser storage. This is
|
||||
where the current locale is stored and currently the server needs to be able
|
||||
to read it.
|
||||
5. Add the locale flag.
|
||||
This likely needs tweaking if we want to upstream.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -202,6 +202,9 @@ export async function setupServerService
|
||||
@@ -188,6 +188,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
|
||||
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService));
|
||||
+ socketServer.registerChannel('languagePacks', languagePackChannel);
|
||||
+ const localizationsChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILocalizationsService));
|
||||
+ socketServer.registerChannel('localizations', localizationsChannel);
|
||||
+
|
||||
const encryptionChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(IEncryptionMainService));
|
||||
socketServer.registerChannel('encryption', encryptionChannel);
|
||||
@@ -31,12 +20,9 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/platform.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
@@ -80,8 +80,19 @@ if (typeof navigator === 'object' && !is
|
||||
_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
|
||||
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
||||
@@ -84,6 +84,17 @@ if (typeof navigator === 'object' && !is
|
||||
_isWeb = true;
|
||||
- _locale = navigator.language;
|
||||
+ _locale = LANGUAGE_DEFAULT;
|
||||
_locale = navigator.language;
|
||||
_language = _locale;
|
||||
+
|
||||
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
||||
@@ -65,33 +51,23 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
@@ -43,17 +46,27 @@
|
||||
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
|
||||
- // Set up nls if the user is not using the default language (English)
|
||||
const nlsConfig = {};
|
||||
- const locale = navigator.language;
|
||||
- if (!locale.startsWith('en')) {
|
||||
- nlsConfig['vs/nls'] = {
|
||||
- availableLanguages: {
|
||||
- '*': locale
|
||||
- },
|
||||
- baseUrl: '{{WORKBENCH_NLS_BASE_URL}}'
|
||||
- };
|
||||
- }
|
||||
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" />
|
||||
@@ -38,6 +41,27 @@
|
||||
<script src="{{VS_BASE}}/static/out/vs/loader.js"></script>
|
||||
<script src="{{VS_BASE}}/static/out/vs/webPackagePaths.js"></script>
|
||||
<script>
|
||||
+ let nlsConfig
|
||||
+ try {
|
||||
+ nlsConfig['vs/nls'] = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))
|
||||
+ if (nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation) {
|
||||
+ nlsConfig = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))
|
||||
+ if (nlsConfig._resolvedLanguagePackCoreLocation) {
|
||||
+ const bundles = Object.create(null)
|
||||
+ nlsConfig['vs/nls'].loadBundle = (bundle, _language, cb) => {
|
||||
+ nlsConfig.loadBundle = (bundle, _language, cb) => {
|
||||
+ const result = bundles[bundle]
|
||||
+ if (result) {
|
||||
+ return cb(undefined, result)
|
||||
+ }
|
||||
+ const path = nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation + "/" + bundle.replace(/\//g, "!") + ".nls.json"
|
||||
+ fetch(`{{WORKBENCH_WEB_BASE_URL}}/vscode-remote-resource?path=${encodeURIComponent(path)}`)
|
||||
+ const path = nlsConfig._resolvedLanguagePackCoreLocation + "/" + bundle.replace(/\//g, "!") + ".nls.json"
|
||||
+ fetch(`{{VS_BASE}}/vscode-remote-resource?path=${encodeURIComponent(path)}`)
|
||||
+ .then((response) => response.json())
|
||||
+ .then((json) => {
|
||||
+ bundles[bundle] = json
|
||||
@@ -101,14 +77,24 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (error) { /* Probably fine. */ }
|
||||
|
||||
require.config({
|
||||
baseUrl: `${baseUrl}/out`,
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = new URL(
|
||||
`{{VS_BASE}}/static/node_modules/${key}/${self.webPackagePaths[key]}`,
|
||||
@@ -52,7 +76,8 @@
|
||||
return value;
|
||||
}
|
||||
}),
|
||||
- paths: self.webPackagePaths
|
||||
+ paths: self.webPackagePaths,
|
||||
+ 'vs/nls': nlsConfig,
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
Index: code-server/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
|
||||
@@ -108,7 +108,7 @@ export abstract class AbstractNativeEnvi
|
||||
@@ -105,7 +105,7 @@ export abstract class AbstractNativeEnvi
|
||||
return URI.file(join(vscodePortable, 'argv.json'));
|
||||
}
|
||||
|
||||
@@ -187,83 +173,93 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
import { IProductConfiguration } from 'vs/base/common/product';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
||||
import { CharCode } from 'vs/base/common/charCode';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
@@ -295,6 +296,8 @@ export class WebClientServer {
|
||||
|
||||
const textMimeType = {
|
||||
'.html': 'text/html',
|
||||
@@ -277,6 +278,8 @@ export class WebClientServer {
|
||||
} : undefined;
|
||||
const base = relativeRoot(getOriginalUrl(req))
|
||||
const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
||||
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
||||
const data = (await util.promisify(fs.readFile)(filePath)).toString()
|
||||
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
|
||||
remoteAuthority,
|
||||
@@ -303,7 +306,8 @@ export class WebClientServer {
|
||||
})))
|
||||
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|
||||
.replace(/{{BASE}}/g, base)
|
||||
- .replace(/{{VS_BASE}}/g, vscodeBase);
|
||||
+ .replace(/{{VS_BASE}}/g, vscodeBase)
|
||||
+ .replace(/{{NLS_CONFIGURATION}}/g, () => escapeAttribute(JSON.stringify(nlsConfiguration)));
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
@@ -338,6 +341,7 @@ export class WebClientServer {
|
||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
BASE: base,
|
||||
VS_BASE: vscodeBase,
|
||||
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||
};
|
||||
|
||||
|
||||
const cspDirectives = [
|
||||
'default-src \'self\';',
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -15,6 +15,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -14,6 +14,7 @@ export const serverOptions: OptionDescri
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
'auth': { type: 'string' },
|
||||
'disable-file-downloads': { type: 'boolean' },
|
||||
+ 'locale': { type: 'string' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -96,6 +97,7 @@ export interface ServerParsedArgs {
|
||||
@@ -90,6 +91,7 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
'disable-file-downloads'?: boolean;
|
||||
+ 'locale'?: string
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
@@ -109,6 +109,12 @@ registerSingleton(IDiagnosticsService, N
|
||||
|
||||
//#region --- workbench contributions
|
||||
|
||||
+// Localization. These do not actually import anything specific to Electron so
|
||||
+// they should be safe.
|
||||
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
|
||||
+import 'vs/workbench/contrib/localization/electron-sandbox/localization.contribution';
|
||||
+import 'vs/platform/languagePacks/browser/languagePacks';
|
||||
+
|
||||
// Output
|
||||
import 'vs/workbench/contrib/output/common/outputChannelModelService';
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/localizations/browser/localizationsService.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
@@ -0,0 +1,18 @@
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/localizations/browser/localizationsService.ts
|
||||
@@ -0,0 +1,28 @@
|
||||
+/*---------------------------------------------------------------------------------------------
|
||||
+ * Copyright (c) Coder Technologies. All rights reserved.
|
||||
+ * Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
+ *--------------------------------------------------------------------------------------------*/
|
||||
+
|
||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
+import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
+import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
+import { ILocalizationsService } from 'vs/platform/localizations/common/localizations';
|
||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
+
|
||||
+/**
|
||||
+ * Add localizations service for the browser.
|
||||
+ * @author coder
|
||||
+ */
|
||||
+
|
||||
+// @ts-ignore: interface is implemented via proxy
|
||||
+export class LanguagePackService implements ILanguagePackService {
|
||||
+export class LocalizationsService implements ILocalizationsService {
|
||||
+
|
||||
+ declare readonly _serviceBrand: undefined;
|
||||
+
|
||||
+ constructor(
|
||||
+ @IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||
+ ) {
|
||||
+ return ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'));
|
||||
+ return ProxyChannel.toService<ILocalizationsService>(remoteAgentService.getConnection()!.getChannel('localizations'));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+registerSingleton(ILanguagePackService, LanguagePackService, true);
|
||||
+registerSingleton(ILocalizationsService, LocalizationsService, true);
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
@@ -111,6 +111,10 @@ registerSingleton(IDiagnosticsService, N
|
||||
|
||||
//#region --- workbench contributions
|
||||
|
||||
+// Localizations
|
||||
+import 'vs/workbench/contrib/localizations/browser/localizations.contribution';
|
||||
+import 'vs/workbench/services/localizations/browser/localizationsService';
|
||||
+
|
||||
// Output
|
||||
import 'vs/workbench/contrib/output/common/outputChannelModelService';
|
||||
|
||||
|
||||
@@ -1,106 +1,118 @@
|
||||
Add the ability to provide a GitHub token
|
||||
Use our own GitHub auth relay server
|
||||
|
||||
To test install the GitHub PR extension and start code-server with GITHUB_TOKEN
|
||||
or set github-auth in the config file. The extension should be authenticated.
|
||||
Microsoft's does not work with self-hosted instances so we run our own.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
Also add an extra set of scopes so that tokens provided via --github-auth will
|
||||
work for the PR extension.
|
||||
|
||||
Index: code-server/lib/vscode/extensions/github-authentication/src/githubServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
@@ -5,9 +5,18 @@
|
||||
--- code-server.orig/lib/vscode/extensions/github-authentication/src/githubServer.ts
|
||||
+++ code-server/lib/vscode/extensions/github-authentication/src/githubServer.ts
|
||||
@@ -17,7 +17,7 @@ const localize = nls.loadMessageBundle()
|
||||
const CLIENT_ID = '01ab8ac9400c4e429b23';
|
||||
|
||||
import { InMemoryCredentialsProvider } from 'vs/platform/credentials/common/credentials';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
-import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
+import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { BaseCredentialsMainService, KeytarModule } from 'vs/platform/credentials/common/credentialsMainService';
|
||||
+import { generateUuid } from 'vs/base/common/uuid';
|
||||
const NETWORK_ERROR = 'network error';
|
||||
-const AUTH_RELAY_SERVER = 'vscode-auth.github.com';
|
||||
+const AUTH_RELAY_SERVER = 'auth.code-server.dev';
|
||||
// const AUTH_RELAY_STAGING_SERVER = 'client-auth-staging-14a768b.herokuapp.com';
|
||||
|
||||
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -274,7 +274,7 @@ export class WebClientServer {
|
||||
id: generateUuid(),
|
||||
providerId: 'github',
|
||||
accessToken: this._environmentService.args['github-auth'],
|
||||
- scopes: [['user:email'], ['repo']]
|
||||
+ scopes: [['read:user', 'user:email', 'repo'], ['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
const base = relativeRoot(getOriginalUrl(req))
|
||||
const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -17,6 +17,7 @@ import { isFolderToOpen, isWorkspaceToOp
|
||||
import { create, ICredentialsProvider, IURLCallbackProvider, IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/workbench.web.main';
|
||||
import { posix } from 'vs/base/common/path';
|
||||
import { ltrim } from 'vs/base/common/strings';
|
||||
+import { equals as arrayEquals } from 'vs/base/common/arrays';
|
||||
+
|
||||
|
||||
interface ICredential {
|
||||
service: string;
|
||||
@@ -24,6 +25,13 @@ interface ICredential {
|
||||
password: string;
|
||||
}
|
||||
|
||||
+interface IToken {
|
||||
+ accessToken: string
|
||||
+ account?: { label: string }
|
||||
+ id: string
|
||||
+ scopes: string[]
|
||||
+}
|
||||
+
|
||||
class LocalStorageCredentialsProvider implements ICredentialsProvider {
|
||||
|
||||
export class CredentialsWebMainService extends BaseCredentialsMainService {
|
||||
// Since we fallback to the in-memory credentials provider, we do not need to surface any Keytar load errors
|
||||
@@ -16,10 +25,15 @@ export class CredentialsWebMainService e
|
||||
|
||||
constructor(
|
||||
@ILogService logService: ILogService,
|
||||
- @INativeEnvironmentService private readonly environmentMainService: INativeEnvironmentService,
|
||||
+ @IServerEnvironmentService private readonly environmentMainService: IServerEnvironmentService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super(logService);
|
||||
+ if (this.environmentMainService.args["github-auth"]) {
|
||||
+ this.storeGitHubToken(this.environmentMainService.args["github-auth"]).catch((error) => {
|
||||
+ this.logService.error('Failed to store provided GitHub token', error)
|
||||
private static readonly CREDENTIALS_STORAGE_KEY = 'credentials.provider';
|
||||
@@ -51,6 +59,58 @@ class LocalStorageCredentialsProvider im
|
||||
scopes,
|
||||
accessToken: authSessionInfo!.accessToken
|
||||
}))));
|
||||
+
|
||||
+ // Add tokens for extensions to use. This works for extensions like the
|
||||
+ // pull requests one or GitLens.
|
||||
+ const extensionId = `vscode.${authSessionInfo.providerId}-authentication`;
|
||||
+ const service = `${product.urlProtocol}${extensionId}`;
|
||||
+ const account = `${authSessionInfo.providerId}.auth`;
|
||||
+ // Oddly the scopes need to match exactly so we cannot just have one token
|
||||
+ // with all the scopes, instead we have to duplicate the token for each
|
||||
+ // expected set of scopes.
|
||||
+ const tokens: IToken[] = authSessionInfo.scopes.map((scopes) => ({
|
||||
+ id: authSessionInfo!.id,
|
||||
+ scopes: scopes.sort(), // Sort for comparing later.
|
||||
+ accessToken: authSessionInfo!.accessToken,
|
||||
+ }));
|
||||
+ this.getPassword(service, account).then((raw) => {
|
||||
+ let existing: {
|
||||
+ content: IToken[]
|
||||
+ } | undefined;
|
||||
+
|
||||
+ if (raw) {
|
||||
+ try {
|
||||
+ const json = JSON.parse(raw);
|
||||
+ json.content = JSON.parse(json.content);
|
||||
+ existing = json;
|
||||
+ } catch (error) {
|
||||
+ console.log(error);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Keep tokens for account and scope combinations we do not have in case
|
||||
+ // there is an extension that uses scopes we have not accounted for (in
|
||||
+ // these cases the user will need to manually authenticate the extension
|
||||
+ // through the UI) or the user has tokens for other accounts.
|
||||
+ if (existing?.content) {
|
||||
+ existing.content = existing.content.filter((existingToken) => {
|
||||
+ const scopes = existingToken.scopes.sort();
|
||||
+ return !(tokens.find((token) => {
|
||||
+ return arrayEquals(scopes, token.scopes)
|
||||
+ && token.account?.label === existingToken.account?.label;
|
||||
+ }))
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
+ return this.setPassword(service, account, JSON.stringify({
|
||||
+ extensionId,
|
||||
+ ...(existing || {}),
|
||||
+ content: JSON.stringify([
|
||||
+ ...tokens,
|
||||
+ ...(existing?.content || []),
|
||||
+ ])
|
||||
+ }));
|
||||
+ })
|
||||
+ }
|
||||
}
|
||||
|
||||
// If the credentials service is running on the server, we add a suffix -server to differentiate from the location that the
|
||||
@@ -48,4 +62,59 @@ export class CredentialsWebMainService e
|
||||
}
|
||||
return this._keytarCache;
|
||||
}
|
||||
+
|
||||
+ private async storeGitHubToken(githubToken: string): Promise<void> {
|
||||
+ const extensionId = 'vscode.github-authentication';
|
||||
+ const service = `${await this.getSecretStoragePrefix()}${extensionId}`;
|
||||
+ const account = 'github.auth';
|
||||
+ const scopes = [['read:user', 'user:email', 'repo']]
|
||||
+
|
||||
+ // Oddly the scopes need to match exactly so we cannot just have one token
|
||||
+ // with all the scopes, instead we have to duplicate the token for each
|
||||
+ // expected set of scopes.
|
||||
+ const tokens: IToken[] = scopes.map((scopes) => ({
|
||||
+ id: generateUuid(),
|
||||
+ scopes: scopes.sort(), // Sort for comparing later.
|
||||
+ accessToken: githubToken,
|
||||
+ }));
|
||||
+
|
||||
+ const raw = await this.getPassword(service, account)
|
||||
+
|
||||
+ let existing: {
|
||||
+ content: IToken[]
|
||||
+ } | undefined;
|
||||
+
|
||||
+ if (raw) {
|
||||
+ try {
|
||||
+ const json = JSON.parse(raw);
|
||||
+ json.content = JSON.parse(json.content);
|
||||
+ existing = json;
|
||||
+ } catch (error) {
|
||||
+ this.logService.error('Failed to parse existing GitHub credentials', error)
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Keep tokens for account and scope combinations we do not have in case
|
||||
+ // there is an extension that uses scopes we have not accounted for (in
|
||||
+ // these cases the user will need to manually authenticate the extension
|
||||
+ // through the UI) or the user has tokens for other accounts.
|
||||
+ if (existing?.content) {
|
||||
+ existing.content = existing.content.filter((existingToken) => {
|
||||
+ const scopes = existingToken.scopes.sort();
|
||||
+ return !(tokens.find((token) => {
|
||||
+ return arrayEquals(scopes, token.scopes)
|
||||
+ && token.account?.label === existingToken.account?.label;
|
||||
+ }))
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
+ return this.setPassword(service, account, JSON.stringify({
|
||||
+ extensionId,
|
||||
+ ...(existing || {}),
|
||||
+ content: JSON.stringify([
|
||||
+ ...tokens,
|
||||
+ ...(existing?.content || []),
|
||||
+ ])
|
||||
+ }));
|
||||
+ }
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,7 @@ may think code-server is broken. Ideally there would be a notification at the
|
||||
point where these things are used instead of this though.
|
||||
|
||||
To test access over something like an HTTP domain or an IP address (not
|
||||
localhost). For example:
|
||||
|
||||
1. run code-server
|
||||
2. use ngrok to expose code-server
|
||||
3. access via HTTP
|
||||
4. look for notification in bottom right
|
||||
localhost).
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
@@ -20,7 +15,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
+import { localize } from 'vs/nls';
|
||||
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
constructor (
|
||||
+ @INotificationService private notificationService: INotificationService,
|
||||
|
||||
@@ -7,7 +7,6 @@ Prepare Code for integration with code-server
|
||||
3. Add the code-server version to the help dialog.
|
||||
4. Add ready events for use in an iframe.
|
||||
5. Add our icons.
|
||||
6. Use our own manifest.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
===================================================================
|
||||
@@ -22,7 +21,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
|
||||
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = {
|
||||
@@ -33,37 +33,42 @@ const errorReporter: ErrorReporter = {
|
||||
}
|
||||
};
|
||||
|
||||
@@ -35,7 +34,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
-const USER_DATA_PATH = join(REMOTE_DATA_FOLDER, 'data');
|
||||
-const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
|
||||
-const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
|
||||
-const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
|
||||
-const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
|
||||
-args['user-data-dir'] = USER_DATA_PATH;
|
||||
-const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
|
||||
@@ -43,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
-args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
|
||||
-args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
|
||||
-
|
||||
-[REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME, LOCAL_HISTORY_HOME].forEach(f => {
|
||||
-[REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME].forEach(f => {
|
||||
- try {
|
||||
- if (!fs.existsSync(f)) {
|
||||
- fs.mkdirSync(f, { mode: 0o700 });
|
||||
@@ -55,7 +53,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
+ const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data');
|
||||
+ const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
|
||||
+ const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
|
||||
+ const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
|
||||
+ const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
|
||||
+ args['user-data-dir'] = USER_DATA_PATH;
|
||||
+ const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
|
||||
@@ -63,14 +60,14 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
+ args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
|
||||
+ args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
|
||||
+
|
||||
+ [REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME, LOCAL_HISTORY_HOME].forEach(f => {
|
||||
+ [REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME].forEach(f => {
|
||||
+ try {
|
||||
+ if (!fs.existsSync(f)) {
|
||||
+ fs.mkdirSync(f, { mode: 0o700 });
|
||||
+ }
|
||||
+ } catch (err) { console.error(err); }
|
||||
+ });
|
||||
+ return REMOTE_DATA_FOLDER;
|
||||
+ return REMOTE_DATA_FOLDER
|
||||
+}
|
||||
|
||||
/**
|
||||
@@ -107,7 +104,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/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
@@ -143,8 +143,11 @@ export class BrowserDialogHandler implem
|
||||
@@ -143,12 +143,15 @@ export class BrowserDialogHandler implem
|
||||
|
||||
async about(): Promise<void> {
|
||||
const detailString = (useAgo: boolean): string => {
|
||||
@@ -121,6 +118,11 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
|
||||
this.productService.version || 'Unknown',
|
||||
this.productService.commit || 'Unknown',
|
||||
this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
|
||||
- navigator.userAgent
|
||||
+ navigator.userAgent,
|
||||
);
|
||||
};
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
@@ -181,10 +183,10 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
import { IWorkspace } from 'vs/workbench/services/host/browser/browserHostService';
|
||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||
+import { CodeServerClient } from 'vs/workbench/browser/client';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||
@@ -109,6 +110,9 @@ export class BrowserMain extends Disposa
|
||||
|
||||
export class BrowserMain extends Disposable {
|
||||
|
||||
@@ -103,6 +104,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
|
||||
@@ -215,24 +217,22 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
|
||||
- <link rel="apple-touch-icon" href="/code-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -26,8 +27,9 @@
|
||||
@@ -26,7 +27,8 @@
|
||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||
- <link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
|
||||
<body aria-label="">
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -241,33 +241,31 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
|
||||
- <link rel="apple-touch-icon" href="/code-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -23,8 +24,9 @@
|
||||
@@ -23,7 +24,8 @@
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||
- <link rel="icon" href="/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" />
|
||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="./static/out/vs/workbench/workbench.web.main.css">
|
||||
|
||||
</head>
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -307,6 +307,7 @@ export class WebClientServer {
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -279,6 +279,7 @@ export class WebClientServer {
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
...this._productService.extensionsGallery,
|
||||
|
||||
8
patches/last-opened.diff
Normal file
8
patches/last-opened.diff
Normal file
@@ -0,0 +1,8 @@
|
||||
Remove last opened functionality
|
||||
|
||||
This conflicts with our own handling of the last opened workspace. If we wanted
|
||||
to switch to this we would need to pass through the disable-last-opened flag and
|
||||
respect it here then remove our own redirction code that handles this.
|
||||
|
||||
Our version might be better anyway since it puts the workspace in the URL.
|
||||
|
||||
@@ -20,19 +20,19 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -299,6 +299,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
+ userDataPath: this._environmentService.userDataPath,
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: {
|
||||
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||
@@ -289,6 +289,7 @@ export class WebClientServer {
|
||||
enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined,
|
||||
logLevel: this._logService.getLevel(),
|
||||
},
|
||||
+ userDataPath: this._environmentService.userDataPath,
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
rootEndpoint: base,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
@@ -245,6 +245,11 @@ export interface IWorkbenchConstructionO
|
||||
@@ -205,6 +205,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly configurationDefaults?: Record<string, any>;
|
||||
|
||||
@@ -48,11 +48,11 @@ 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/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
@@ -53,7 +53,14 @@ export class BrowserWorkbenchEnvironment
|
||||
@@ -52,7 +52,14 @@ export class BrowserWorkbenchEnvironment
|
||||
get logFile(): URI { return joinPath(this.logsHome, 'window.log'); }
|
||||
|
||||
@memoize
|
||||
- get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.vscodeUserData }); }
|
||||
- get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.userData }); }
|
||||
+ get userRoamingDataHome(): URI { return joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User'); }
|
||||
+
|
||||
+ get userDataPath(): string {
|
||||
|
||||
@@ -7,15 +7,15 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -300,7 +300,10 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined },
|
||||
+ 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,
|
||||
enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'],
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
@@ -285,7 +285,10 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + '/static/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
- developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
|
||||
+ developmentOptions: {
|
||||
+ enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined,
|
||||
+ logLevel: this._logService.getLevel(),
|
||||
+ },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
rootEndpoint: base,
|
||||
|
||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -92,6 +93,7 @@ export const serverOptions: OptionDescri
|
||||
@@ -88,6 +89,7 @@ export const serverOptions: OptionDescri
|
||||
export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
@@ -40,14 +40,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -309,6 +309,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
@@ -287,6 +287,7 @@ export class WebClientServer {
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: {
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
|
||||
@@ -3,13 +3,6 @@ Add Open VSX default and an env var for marketplace, fix old marketplace
|
||||
Our old marketplace only supports `serviceUrl` but this causes the marketplace
|
||||
to be disabled entirely so this moves the template var check to fix that.
|
||||
|
||||
This also removes serverRootPath from the web extension route because that will
|
||||
include the commit. When you update code-server (including this update) the web
|
||||
extension will continue using the old path since it is stored in the browser but
|
||||
the path will 404 because the commit no longer matches. This change is only to
|
||||
support current installations though because this patch also removes the
|
||||
in-between and has web extensions install directly from the marketplace.
|
||||
|
||||
This can be tested by setting EXTENSIONS_GALLERY set to:
|
||||
|
||||
'{"serviceUrl": "https://extensions.coder.com/api"}'
|
||||
@@ -39,49 +32,22 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -111,7 +111,7 @@ export class WebClientServer {
|
||||
const serverRootPath = getRemoteServerRootPath(_productService);
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
||||
+ this._webExtensionRoute = `/web-extension-resource`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,14 +308,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
- ...this._productService.extensionsGallery,
|
||||
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||
- scheme: 'http',
|
||||
- authority: remoteAuthority,
|
||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
callbackRoute: this._callbackRoute
|
||||
};
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||
|
||||
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
|
||||
private readonly _environmentService: IEnvironmentService,
|
||||
private readonly _configurationService: IConfigurationService,
|
||||
) {
|
||||
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
+ this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
if (_productService.extensionsGallery) {
|
||||
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
||||
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
|
||||
@@ -287,14 +287,14 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
+ extensionsGallery: {
|
||||
...this._productService.extensionsGallery,
|
||||
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||
+ 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
|
||||
scheme: 'http',
|
||||
authority: remoteAuthority,
|
||||
path: `web-extension-resource/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ }).toString(true) : undefined
|
||||
+ },
|
||||
}
|
||||
})))
|
||||
.replace('{{WORKBENCH_AUTH_SESSION}}', () => authSessionInfo ? escapeAttribute(JSON.stringify(authSessionInfo)) : '')
|
||||
|
||||
107
patches/node-version.diff
Normal file
107
patches/node-version.diff
Normal file
@@ -0,0 +1,107 @@
|
||||
Patch the Node version to use the current version of Node
|
||||
|
||||
Previously it would use the yarnrc which results in builds that cannot run with
|
||||
the version of Node they were built with because the native modules are
|
||||
targeting the wrong version.
|
||||
|
||||
One way test this is to build in a fresh Docker container, run the build, then
|
||||
try opening the built-in terminal.
|
||||
|
||||
Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||
@@ -124,9 +124,7 @@ const serverWithWebEntryPoints = [
|
||||
];
|
||||
|
||||
function getNodeVersion() {
|
||||
- const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
|
||||
- const target = /^target "(.*)"$/m.exec(yarnrc)[1];
|
||||
- return target;
|
||||
+ return process.versions.node;
|
||||
}
|
||||
|
||||
const nodeVersion = getNodeVersion();
|
||||
Index: code-server/lib/vscode/build/lib/node.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/node.js
|
||||
+++ code-server/lib/vscode/build/lib/node.js
|
||||
@@ -7,9 +7,7 @@ Object.defineProperty(exports, "__esModu
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
-const yarnrcPath = path.join(root, 'remote', '.yarnrc');
|
||||
-const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
|
||||
-const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)[1];
|
||||
+const version = process.versions.node;
|
||||
const platform = process.platform;
|
||||
const arch = platform === 'darwin' ? 'x64' : process.arch;
|
||||
const node = platform === 'win32' ? 'node.exe' : 'node';
|
||||
Index: code-server/lib/vscode/build/lib/node.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/node.ts
|
||||
+++ code-server/lib/vscode/build/lib/node.ts
|
||||
@@ -7,9 +7,7 @@ import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
-const yarnrcPath = path.join(root, 'remote', '.yarnrc');
|
||||
-const yarnrc = fs.readFileSync(yarnrcPath, 'utf8');
|
||||
-const version = /^target\s+"([^"]+)"$/m.exec(yarnrc)![1];
|
||||
+const version = process.versions.node;
|
||||
|
||||
const platform = process.platform;
|
||||
const arch = platform === 'darwin' ? 'x64' : process.arch;
|
||||
Index: code-server/lib/vscode/build/lib/util.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/util.js
|
||||
+++ code-server/lib/vscode/build/lib/util.js
|
||||
@@ -298,9 +298,7 @@ function streamToPromise(stream) {
|
||||
}
|
||||
exports.streamToPromise = streamToPromise;
|
||||
function getElectronVersion() {
|
||||
- const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
|
||||
- const target = /^target "(.*)"$/m.exec(yarnrc)[1];
|
||||
- return target;
|
||||
+ return process.versions.node;
|
||||
}
|
||||
exports.getElectronVersion = getElectronVersion;
|
||||
function acquireWebNodePaths() {
|
||||
Index: code-server/lib/vscode/build/lib/util.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/lib/util.ts
|
||||
+++ code-server/lib/vscode/build/lib/util.ts
|
||||
@@ -371,9 +371,7 @@ export function streamToPromise(stream:
|
||||
}
|
||||
|
||||
export function getElectronVersion(): string {
|
||||
- const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
|
||||
- const target = /^target "(.*)"$/m.exec(yarnrc)![1];
|
||||
- return target;
|
||||
+ return process.versions.node;
|
||||
}
|
||||
|
||||
export function acquireWebNodePaths() {
|
||||
@@ -455,4 +453,3 @@ export function buildWebNodePaths(outDir
|
||||
result.taskName = 'build-web-node-paths';
|
||||
return result;
|
||||
}
|
||||
-
|
||||
Index: code-server/lib/vscode/remote/.yarnrc
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/remote/.yarnrc
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-disturl "http://nodejs.org/dist"
|
||||
-target "14.16.0"
|
||||
-runtime "node"
|
||||
-build_from_source "true"
|
||||
Index: code-server/lib/vscode/.yarnrc
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/.yarnrc
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-disturl "https://electronjs.org/headers"
|
||||
-target "13.5.2"
|
||||
-runtime "electron"
|
||||
-build_from_source "true"
|
||||
@@ -1,24 +0,0 @@
|
||||
Remove parentOriginHash checko
|
||||
|
||||
This fixes webviews from not working properly due to a change upstream.
|
||||
Upstream added a check to ensure parent authority is encoded into the webview
|
||||
origin. Since our webview origin is the parent authority, we can bypass this
|
||||
check.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
@@ -317,6 +317,12 @@ const hostMessaging = new class HostMess
|
||||
const id = searchParams.get('id');
|
||||
|
||||
const hostname = location.hostname;
|
||||
+
|
||||
+ // It is safe to run if we are on the same host.
|
||||
+ const parent = new URL(parentOrigin)
|
||||
+ if (parent.hostname == location.hostname) {
|
||||
+ return start(parentOrigin)
|
||||
+ }
|
||||
|
||||
if (!crypto.subtle) {
|
||||
// cannot validate, not running in a secure context
|
||||
26
patches/post-install.diff
Normal file
26
patches/post-install.diff
Normal file
@@ -0,0 +1,26 @@
|
||||
Replace rimraf with fs.rmSync in postinstall
|
||||
|
||||
The postinstall gets ran when you install with npm but rimraf is a development
|
||||
dependency so it will not exist.
|
||||
|
||||
Index: code-server/lib/vscode/extensions/postinstall.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/extensions/postinstall.js
|
||||
+++ code-server/lib/vscode/extensions/postinstall.js
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
-const rimraf = require('rimraf');
|
||||
|
||||
const root = path.join(__dirname, 'node_modules', 'typescript');
|
||||
|
||||
@@ -21,7 +20,7 @@ function processRoot() {
|
||||
if (!toKeep.has(name)) {
|
||||
const filePath = path.join(root, name);
|
||||
console.log(`Removed ${filePath}`);
|
||||
- rimraf.sync(filePath);
|
||||
+ fs.rmSync(filePath, { recursive: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra
|
||||
===================================================================
|
||||
--- 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
|
||||
@@ -1451,7 +1451,7 @@ class ProposedApiController {
|
||||
@@ -1163,7 +1163,7 @@ class ProposedApiController {
|
||||
|
||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||
|
||||
@@ -22,7 +22,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
@@ -359,10 +359,7 @@ function extensionDescriptionArrayToMap(
|
||||
@@ -134,10 +134,7 @@ export interface IExtensionHost {
|
||||
}
|
||||
|
||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||
|
||||
@@ -26,25 +26,25 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityReso
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
@@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/comm
|
||||
@@ -7,7 +7,7 @@ import { Emitter } from 'vs/base/common/
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
-import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
+import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolvedOptions, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService {
|
||||
@@ -22,7 +22,7 @@ export class RemoteAuthorityResolverServ
|
||||
|
||||
@@ -20,7 +20,7 @@ export class RemoteAuthorityResolverServ
|
||||
private readonly _connectionToken: string | undefined;
|
||||
private readonly _connectionTokens: Map<string, string>;
|
||||
|
||||
- constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
|
||||
+ constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
|
||||
- constructor(connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
|
||||
+ constructor(connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
|
||||
super();
|
||||
this._cache = new Map<string, ResolverResult>();
|
||||
this._connectionToken = connectionToken;
|
||||
@@ -62,12 +62,17 @@ export class RemoteAuthorityResolverServ
|
||||
@@ -59,12 +59,17 @@ export class RemoteAuthorityResolverServ
|
||||
|
||||
private _doResolveAuthority(authority: string): ResolverResult {
|
||||
const connectionToken = this._connectionTokens.get(authority) || this._connectionToken;
|
||||
@@ -68,24 +68,24 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
@@ -288,6 +288,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: {
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -209,7 +209,7 @@ export class BrowserMain extends Disposa
|
||||
@@ -179,7 +179,7 @@ export class BrowserMain extends Disposa
|
||||
|
||||
// Remote
|
||||
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
|
||||
- const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider);
|
||||
+ const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider, this.configuration.productConfiguration?.proxyEndpointTemplate);
|
||||
- const remoteAuthorityResolverService = new RemoteAuthorityResolverService(connectionToken, this.configuration.resourceUriProvider);
|
||||
+ const remoteAuthorityResolverService = new RemoteAuthorityResolverService(connectionToken, this.configuration.resourceUriProvider, this.configuration.productConfiguration?.proxyEndpointTemplate);
|
||||
serviceCollection.set(IRemoteAuthorityResolverService, remoteAuthorityResolverService);
|
||||
|
||||
// Signing
|
||||
@@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
@@ -388,7 +388,7 @@ export async function createTerminalEnvi
|
||||
@@ -390,7 +390,7 @@ export function createTerminalEnvironmen
|
||||
|
||||
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
||||
// variables
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
integration.diff
|
||||
node-version.diff
|
||||
base-path.diff
|
||||
proposed-api.diff
|
||||
marketplace.diff
|
||||
webview.diff
|
||||
disable-builtin-ext-update.diff
|
||||
insecure-notification.diff
|
||||
update-check.diff
|
||||
logout.diff
|
||||
store-socket.diff
|
||||
proxy-uri.diff
|
||||
display-language.diff
|
||||
github-auth.diff
|
||||
unique-db.diff
|
||||
post-install.diff
|
||||
log-level.diff
|
||||
local-storage.diff
|
||||
service-worker.diff
|
||||
connection-type.diff
|
||||
sourcemaps.diff
|
||||
disable-downloads.diff
|
||||
telemetry.diff
|
||||
display-language.diff
|
||||
|
||||
@@ -21,17 +21,17 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -315,6 +315,10 @@ export class WebClientServer {
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||
+ serviceWorker: {
|
||||
+ scope: vscodeBase + '/',
|
||||
+ path: base + '/_static/out/browser/serviceWorker.js',
|
||||
+ },
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
@@ -298,6 +298,10 @@ export class WebClientServer {
|
||||
proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
+ serviceWorker: {
|
||||
+ scope: vscodeBase + '/',
|
||||
+ path: base + '/_static/out/browser/serviceWorker.js',
|
||||
+ },
|
||||
extensionsGallery: {
|
||||
...this._productService.extensionsGallery,
|
||||
'resourceUrlTemplate': this._webExtensionResourceUrlTemplate ? this._webExtensionResourceUrlTemplate.with({
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
|
||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||
@@ -194,8 +194,7 @@ function packageTask(type, platform, arc
|
||||
@@ -197,8 +197,7 @@ function packageTask(type, platform, arc
|
||||
|
||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||
.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 isUIExtension = (manifest) => {
|
||||
@@ -234,9 +233,9 @@ function packageTask(type, platform, arc
|
||||
@@ -237,9 +236,9 @@ function packageTask(type, platform, arc
|
||||
.map(name => `.build/extensions/${name}/**`);
|
||||
|
||||
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;
|
||||
const quality = product.quality;
|
||||
@@ -371,7 +370,7 @@ function tweakProductForServerWeb(produc
|
||||
@@ -374,7 +373,7 @@ function tweakProductForServerWeb(produc
|
||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||
optimizeTask,
|
||||
util.rimraf(`out-vscode-${type}-min`),
|
||||
|
||||
@@ -3,12 +3,6 @@ Store a static reference to the IPC socket
|
||||
This lets us use it to open files inside code-server from outside of
|
||||
code-server.
|
||||
|
||||
To test this:
|
||||
1. run code-server
|
||||
2. open file outside of code-server i.e. `code-server <path-to-file`
|
||||
|
||||
It should open in your existing code-server instance.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||
|
||||
@@ -1,212 +0,0 @@
|
||||
Add support for telemetry endpoint
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -70,6 +70,7 @@ import { REMOTE_FILE_SYSTEM_CHANNEL_NAME
|
||||
import { ExtensionHostStatusService, IExtensionHostStatusService } from 'vs/server/node/extensionHostStatusService';
|
||||
import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService';
|
||||
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
||||
+import { TelemetryClient } from "vs/server/node/telemetryClient";
|
||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||
|
||||
const eventPrefix = 'monacoworkbench';
|
||||
@@ -123,7 +124,11 @@ export async function setupServerService
|
||||
let appInsightsAppender: ITelemetryAppender = NullAppender;
|
||||
const machineId = await getMachineId();
|
||||
if (supportsTelemetry(productService, environmentService)) {
|
||||
- if (productService.aiConfig && productService.aiConfig.asimovKey) {
|
||||
+ const telemetryEndpoint = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
|
||||
+ if (telemetryEndpoint) {
|
||||
+ appInsightsAppender = new AppInsightsAppender(eventPrefix, null, () => new TelemetryClient(telemetryEndpoint) as any);
|
||||
+ disposables.add(toDisposable(() => appInsightsAppender!.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
||||
+ } else if (productService.aiConfig && productService.aiConfig.asimovKey) {
|
||||
appInsightsAppender = new AppInsightsAppender(eventPrefix, null, productService.aiConfig.asimovKey);
|
||||
disposables.add(toDisposable(() => appInsightsAppender!.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||
@@ -0,0 +1,135 @@
|
||||
+import * as appInsights from 'applicationinsights';
|
||||
+import * as https from 'https';
|
||||
+import * as http from 'http';
|
||||
+import * as os from 'os';
|
||||
+
|
||||
+class Channel {
|
||||
+ public get _sender() {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+ public get _buffer() {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public setUseDiskRetryCaching(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+ public send(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+ public triggerSend(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+// Unable to use implements because TypeScript tells you a private property is
|
||||
+// missing but if you add it then it complains they have different private
|
||||
+// properties. Uncommenting it during development can be helpful though to see
|
||||
+// if anything is missing.
|
||||
+export class TelemetryClient /* implements appInsights.TelemetryClient */ {
|
||||
+ private _telemetryProcessors: any = undefined;
|
||||
+ public context: any = undefined;
|
||||
+ public commonProperties: any = undefined;
|
||||
+ public config: any = {};
|
||||
+ public quickPulseClient: any = undefined;
|
||||
+
|
||||
+ public channel: any = new Channel();
|
||||
+
|
||||
+ public constructor(private readonly endpoint: string) {
|
||||
+ // Nothing to do.
|
||||
+ }
|
||||
+
|
||||
+ public addTelemetryProcessor(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public clearTelemetryProcessors(): void {
|
||||
+ if (this._telemetryProcessors) {
|
||||
+ this._telemetryProcessors = undefined;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public runTelemetryProcessors(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackTrace(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackMetric(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackException(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackRequest(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackDependency(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public track(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackNodeHttpRequestSync(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackNodeHttpRequest(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackNodeHttpDependency(): void {
|
||||
+ throw new Error('unimplemented');
|
||||
+ }
|
||||
+
|
||||
+ public trackEvent(options: appInsights.Contracts.EventTelemetry): void {
|
||||
+ if (!options.properties) {
|
||||
+ options.properties = {};
|
||||
+ }
|
||||
+ if (!options.measurements) {
|
||||
+ options.measurements = {};
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ const cpus = os.cpus();
|
||||
+ options.measurements.cores = cpus.length;
|
||||
+ options.properties['common.cpuModel'] = cpus[0].model;
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.measurements.memoryFree = os.freemem();
|
||||
+ options.measurements.memoryTotal = os.totalmem();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ options.properties['common.shell'] = os.userInfo().shell;
|
||||
+ options.properties['common.release'] = os.release();
|
||||
+ options.properties['common.arch'] = os.arch();
|
||||
+ } catch (error) {}
|
||||
+
|
||||
+ try {
|
||||
+ const request = (/^http:/.test(this.endpoint) ? http : https).request(this.endpoint, {
|
||||
+ method: 'POST',
|
||||
+ headers: {
|
||||
+ 'Content-Type': 'application/json',
|
||||
+ },
|
||||
+ });
|
||||
+ request.on('error', () => { /* We don't care. */ });
|
||||
+ request.write(JSON.stringify(options));
|
||||
+ request.end();
|
||||
+ } catch (error) {}
|
||||
+ }
|
||||
+
|
||||
+ public flush(options: { callback: (v: string) => void }): void {
|
||||
+ if (options.callback) {
|
||||
+ options.callback('');
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||
@@ -120,16 +120,19 @@ export class TelemetryService extends Di
|
||||
) {
|
||||
super();
|
||||
|
||||
- if (supportsTelemetry(productService, environmentService) && productService.aiConfig?.asimovKey) {
|
||||
+ if (supportsTelemetry(productService, environmentService)) {
|
||||
// If remote server is present send telemetry through that, else use the client side appender
|
||||
- const telemetryProvider: ITelemetryAppender = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : new WebAppInsightsAppender('monacoworkbench', productService.aiConfig?.asimovKey);
|
||||
- const config: ITelemetryServiceConfig = {
|
||||
- appenders: [new WebTelemetryAppender(telemetryProvider), new TelemetryLogAppender(loggerService, environmentService)],
|
||||
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
|
||||
- sendErrorTelemetry: this.sendErrorTelemetry,
|
||||
- };
|
||||
-
|
||||
- this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
|
||||
+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.asimovKey ? new WebAppInsightsAppender('monacoworkbench', productService.aiConfig?.asimovKey) : undefined;
|
||||
+ if (telemetryProvider) {
|
||||
+ const config: ITelemetryServiceConfig = {
|
||||
+ appenders: [new WebTelemetryAppender(telemetryProvider), new TelemetryLogAppender(loggerService, environmentService)],
|
||||
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
|
||||
+ sendErrorTelemetry: this.sendErrorTelemetry,
|
||||
+ };
|
||||
+ this.impl = this._register(new BaseTelemetryService(config, configurationService, productService));
|
||||
+ } else {
|
||||
+ this.impl = NullTelemetryService;
|
||||
+ }
|
||||
} else {
|
||||
this.impl = NullTelemetryService;
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -320,6 +320,7 @@ export class WebClientServer {
|
||||
scope: vscodeBase + '/',
|
||||
path: base + '/_static/out/browser/serviceWorker.js',
|
||||
},
|
||||
+ enableTelemetry: this._productService.enableTelemetry,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
@@ -3,11 +3,6 @@ Add a notification that lets you know when an update is out
|
||||
The easiest way to test this is probably to change the version in your
|
||||
package.json and delete the last notification storage item.
|
||||
|
||||
1. change version in root `package.json`
|
||||
2. Open DevTools > Application > Storage (top-level)
|
||||
3. Click "Clear site data"
|
||||
4. See update notification
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -105,14 +100,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
@@ -286,6 +286,7 @@ export class WebClientServer {
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
rootEndpoint: base,
|
||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: {
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -126,7 +121,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -88,6 +90,8 @@ export const serverOptions: OptionDescri
|
||||
@@ -84,6 +86,8 @@ export const serverOptions: OptionDescri
|
||||
};
|
||||
|
||||
export interface ServerParsedArgs {
|
||||
|
||||
@@ -15,103 +15,62 @@ Since this code exists only for the authentication case we can just skip it when
|
||||
it is served from the current host as authentication is not a problem if the
|
||||
request is not cross-origin.
|
||||
|
||||
There is also an origin check we bypass (this seems to be related to how the
|
||||
webview host is separate by default but we serve on the same host).
|
||||
|
||||
To test, open a few types of webviews (images, markdown, extension details, etc).
|
||||
|
||||
Index: code-server/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
|
||||
@@ -183,7 +183,7 @@ export class BrowserWorkbenchEnvironment
|
||||
@@ -176,7 +176,7 @@ export class BrowserWorkbenchEnvironment
|
||||
|
||||
@memoize
|
||||
get webviewExternalEndpoint(): string {
|
||||
- const endpoint = this.options.webviewEndpoint
|
||||
+ const endpoint = (this.options.webviewEndpoint && new URL(this.options.webviewEndpoint, window.location.toString()).toString())
|
||||
|| this.productService.webviewContentExternalBaseUrlTemplate
|
||||
|| 'https://{{uuid}}.vscode-cdn.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/';
|
||||
|| 'https://{{uuid}}.vscode-webview.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/';
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -298,6 +298,7 @@ export class WebClientServer {
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||
@@ -280,6 +280,7 @@ export class WebClientServer {
|
||||
const data = (await util.promisify(fs.readFile)(filePath)).toString()
|
||||
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
|
||||
remoteAuthority,
|
||||
+ webviewEndpoint: vscodeBase + '/static/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.driverHandle === 'web' ? true : undefined },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/common/webview.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/webview.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/common/webview.ts
|
||||
@@ -24,7 +24,7 @@ export const webviewResourceBaseHost = '
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
- content="default-src 'none'; script-src 'sha256-xgIcbQmGjpT42GEj54VFSNh6MI15PZ2D1+DdVehfYBI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
+ content="default-src 'none'; script-src 'sha256-aOCIU83V9nV+0ERJudbrKLqgIVOHqU71i4Lv5urjGTI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||
export const webviewRootResourceAuthority = `vscode-resource.${webviewResourceBaseHost}`;
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport"
|
||||
@@ -331,6 +331,12 @@
|
||||
-export const webviewGenericCspSource = `https://*.${webviewResourceBaseHost}`;
|
||||
+export const webviewGenericCspSource = `'self' https://*.${webviewResourceBaseHost}`;
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
+ // It is safe to run if we are on the same host.
|
||||
+ const parent = new URL(parentOrigin)
|
||||
+ if (parent.hostname === hostname) {
|
||||
+ return start(parentOrigin)
|
||||
+ }
|
||||
+
|
||||
if (!crypto.subtle) {
|
||||
// cannot validate, not running in a secure context
|
||||
throw new Error(`Cannot validate in current context!`);
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
||||
/**
|
||||
* Construct a uri that can load resources inside a webview
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/service-worker.js
|
||||
===================================================================
|
||||
--- 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
|
||||
@@ -330,6 +330,12 @@
|
||||
|
||||
const hostname = location.hostname;
|
||||
|
||||
+ // It is safe to run if we are on the same host.
|
||||
+ const parent = new URL(parentOrigin)
|
||||
+ if (parent.hostname === hostname) {
|
||||
+ return start(parentOrigin)
|
||||
+ }
|
||||
+
|
||||
if (!crypto.subtle) {
|
||||
// cannot validate, not running in a secure context
|
||||
throw new Error(`Cannot validate in current context!`);
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'none';
|
||||
child-src 'self' data: blob:;
|
||||
- script-src 'self' 'unsafe-eval' 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=' https:;
|
||||
+ script-src 'self' 'unsafe-eval' 'sha256-yHVIAbzODFRINjoLGID5qWPP45HzMtwhyVRC+7yiuXg=' https:;
|
||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||
</head>
|
||||
<body>
|
||||
@@ -23,6 +23,13 @@
|
||||
// validation not requested
|
||||
return start();
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/service-worker.js
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/service-worker.js
|
||||
@@ -188,9 +188,11 @@ sw.addEventListener('fetch', (event) =>
|
||||
}
|
||||
+
|
||||
+ // It is safe to run if we are on the same host.
|
||||
+ const parent = new URL(parentOrigin)
|
||||
+ if (parent.hostname === hostname) {
|
||||
+ return start()
|
||||
+ }
|
||||
+
|
||||
if (!crypto.subtle) {
|
||||
// cannot validate, not running in a secure context
|
||||
return sendError(new Error(`Cannot validate in current context!`));
|
||||
}
|
||||
|
||||
- // If we're making a request against the remote authority, we want to go
|
||||
- // back through VS Code itself so that we are authenticated properly
|
||||
- if (requestUrl.host === remoteAuthority) {
|
||||
+ // If we're making a request against the remote authority, we want to go back
|
||||
+ // through VS Code itself so that we are authenticated properly. If the
|
||||
+ // service worker is hosted on the same origin we will have cookies and
|
||||
+ // authentication will not be an issue.
|
||||
+ if (requestUrl.origin !== sw.origin && requestUrl.host === remoteAuthority) {
|
||||
switch (event.request.method) {
|
||||
case 'GET':
|
||||
case 'HEAD':
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
/**
|
||||
* Split a string up to the delimiter. If the delimiter doesn't exist the first
|
||||
* item will have all the text and the second item will be an empty string.
|
||||
*/
|
||||
export const split = (str: string, delimiter: string): [string, string] => {
|
||||
const index = str.indexOf(delimiter)
|
||||
return index !== -1 ? [str.substring(0, index).trim(), str.substring(index + 1)] : [str, ""]
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an 's' to the provided string if count is greater than one;
|
||||
* otherwise the string is returned
|
||||
@@ -25,6 +34,27 @@ export const normalize = (url: string, keepTrailing = false): string => {
|
||||
return url.replace(/\/\/+/g, "/").replace(/\/+$/, keepTrailing ? "/" : "")
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove leading and trailing slashes.
|
||||
*/
|
||||
export const trimSlashes = (url: string): string => {
|
||||
return url.replace(/^\/+|\/+$/g, "")
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap the value in an array if it's not already an array. If the value is
|
||||
* undefined return an empty array.
|
||||
*/
|
||||
export const arrayify = <T>(value?: T | T[]): T[] => {
|
||||
if (Array.isArray(value)) {
|
||||
return value
|
||||
}
|
||||
if (typeof value === "undefined") {
|
||||
return []
|
||||
}
|
||||
return [value]
|
||||
}
|
||||
|
||||
// TODO: Might make sense to add Error handling to the logger itself.
|
||||
export function logError(logger: { error: (msg: string) => void }, prefix: string, err: unknown): void {
|
||||
if (err instanceof Error) {
|
||||
|
||||
@@ -94,14 +94,36 @@ export const ensureAddress = (server: http.Server, protocol: string): URL | stri
|
||||
}
|
||||
|
||||
if (typeof addr !== "string") {
|
||||
const host = addr.family === "IPv6" ? `[${addr.address}]` : addr.address
|
||||
return new URL(`${protocol}://${host}:${addr.port}`)
|
||||
return new URL(`${protocol}://${addr.address}:${addr.port}`)
|
||||
}
|
||||
|
||||
// If this is a string then it is a pipe or Unix socket.
|
||||
return addr
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles error events from the server.
|
||||
*
|
||||
* If the outlying Promise didn't resolve
|
||||
* then we reject with the error.
|
||||
*
|
||||
* Otherwise, we log the error.
|
||||
*
|
||||
* We extracted into a function so that we could
|
||||
* test this logic more easily.
|
||||
*/
|
||||
export const handleServerError = (resolved: boolean, err: Error, reject: (err: Error) => void) => {
|
||||
// Promise didn't resolve earlier so this means it's an error
|
||||
// that occurs before the server can successfully listen.
|
||||
// Possibly triggered by listening on an invalid port or socket.
|
||||
if (!resolved) {
|
||||
reject(err)
|
||||
} else {
|
||||
// Promise resolved earlier so this is an unrelated error.
|
||||
util.logError(logger, "http server error", err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the error that occurs in the catch block
|
||||
* after we try fs.unlink(args.socket).
|
||||
|
||||
@@ -160,8 +160,7 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
||||
},
|
||||
"disable-file-downloads": {
|
||||
type: "boolean",
|
||||
description:
|
||||
"Disable file downloads from Code. This can also be set with CS_DISABLE_FILE_DOWNLOADS set to 'true' or '1'.",
|
||||
description: "Disable file downloads from Code.",
|
||||
},
|
||||
// --enable can be used to enable experimental features. These features
|
||||
// provide no guarantees.
|
||||
@@ -543,7 +542,7 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
||||
args.password = process.env.PASSWORD
|
||||
}
|
||||
|
||||
if (process.env.CS_DISABLE_FILE_DOWNLOADS?.match(/^(1|true)$/)) {
|
||||
if (process.env.CS_DISABLE_FILE_DOWNLOADS === "1") {
|
||||
args["disable-file-downloads"] = true
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ import type { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
|
||||
import * as os from "os"
|
||||
import * as path from "path"
|
||||
|
||||
export const WORKBENCH_WEB_CONFIG_ID = "vscode-workbench-web-configuration"
|
||||
|
||||
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles {
|
||||
let pkg = {}
|
||||
try {
|
||||
@@ -19,6 +21,7 @@ export const vsRootPath = path.join(rootPath, "lib/vscode")
|
||||
const PACKAGE_JSON = "package.json"
|
||||
const pkg = getPackageJson(`${rootPath}/${PACKAGE_JSON}`)
|
||||
const codePkg = getPackageJson(`${vsRootPath}/${PACKAGE_JSON}`) || { version: "0.0.0" }
|
||||
export const pkgName = pkg.name || "code-server"
|
||||
export const version = pkg.version || "development"
|
||||
export const commit = pkg.commit || "development"
|
||||
export const codeVersion = codePkg.version || "development"
|
||||
|
||||
@@ -9,10 +9,7 @@ export class Heart {
|
||||
private heartbeatInterval = 60000
|
||||
public lastHeartbeat = 0
|
||||
|
||||
public constructor(private readonly heartbeatPath: string, private readonly isActive: () => Promise<boolean>) {
|
||||
this.beat = this.beat.bind(this)
|
||||
this.alive = this.alive.bind(this)
|
||||
}
|
||||
public constructor(private readonly heartbeatPath: string, private readonly isActive: () => Promise<boolean>) {}
|
||||
|
||||
public alive(): boolean {
|
||||
const now = Date.now()
|
||||
@@ -23,22 +20,30 @@ export class Heart {
|
||||
* timeout and start or reset a timer that keeps running as long as there is
|
||||
* activity. Failures are logged as warnings.
|
||||
*/
|
||||
public async beat(): Promise<void> {
|
||||
public beat(): void {
|
||||
if (this.alive()) {
|
||||
return
|
||||
}
|
||||
|
||||
logger.trace("heartbeat")
|
||||
fs.writeFile(this.heartbeatPath, "").catch((error) => {
|
||||
logger.warn(error.message)
|
||||
})
|
||||
this.lastHeartbeat = Date.now()
|
||||
if (typeof this.heartbeatTimer !== "undefined") {
|
||||
clearTimeout(this.heartbeatTimer)
|
||||
}
|
||||
this.heartbeatTimer = setTimeout(() => heartbeatTimer(this.isActive, this.beat), this.heartbeatInterval)
|
||||
try {
|
||||
return await fs.writeFile(this.heartbeatPath, "")
|
||||
} catch (error: any) {
|
||||
logger.warn(error.message)
|
||||
}
|
||||
this.heartbeatTimer = setTimeout(() => {
|
||||
this.isActive()
|
||||
.then((active) => {
|
||||
if (active) {
|
||||
this.beat()
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.warn(error.message)
|
||||
})
|
||||
}, this.heartbeatInterval)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,20 +55,3 @@ export class Heart {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for the heartbeatTimer.
|
||||
*
|
||||
* If heartbeat is active, call beat. Otherwise do nothing.
|
||||
*
|
||||
* Extracted to make it easier to test.
|
||||
*/
|
||||
export async function heartbeatTimer(isActive: Heart["isActive"], beat: Heart["beat"]) {
|
||||
try {
|
||||
if (await isActive()) {
|
||||
beat()
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
logger.warn((error as Error).message)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,6 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
||||
// /healthz|/healthz/ needs to be excluded otherwise health checks will make
|
||||
// it look like code-server is always in use.
|
||||
if (!/^\/healthz\/?$/.test(req.url)) {
|
||||
// NOTE@jsjoeio - intentionally not awaiting the .beat() call here because
|
||||
// we don't want to slow down the request.
|
||||
heart.beat()
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ export class CodeServerRouteWrapper {
|
||||
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
|
||||
this.router.get(/manifest.json$/, this.manifest)
|
||||
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
|
||||
this._wsRouterWrapper.ws("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
|
||||
this._wsRouterWrapper.ws("/", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
||||
@@ -77,7 +77,7 @@ export class SocketProxyProvider {
|
||||
this.proxyPipe = pipe
|
||||
return Promise.all([
|
||||
fs.mkdir(path.dirname(this.proxyPipe), { recursive: true }),
|
||||
fs.rm(this.proxyPipe, { force: true, recursive: true }),
|
||||
fs.rmdir(this.proxyPipe, { recursive: true }),
|
||||
])
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
100
src/node/util.ts
100
src/node/util.ts
@@ -377,62 +377,11 @@ export const getMediaMime = (filePath?: string): string => {
|
||||
return (filePath && mimeTypes[path.extname(filePath)]) || "text/plain"
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper function that checks if the platform is Windows Subsystem for Linux
|
||||
* (WSL)
|
||||
*
|
||||
* @see https://github.com/sindresorhus/is-wsl/blob/main/index.js
|
||||
* @returns {Boolean} boolean if it is WSL
|
||||
*/
|
||||
export const isWsl = async (
|
||||
platform: NodeJS.Platform,
|
||||
osRelease: string,
|
||||
procVersionFilePath: string,
|
||||
): Promise<boolean> => {
|
||||
if (platform !== "linux") {
|
||||
return false
|
||||
}
|
||||
|
||||
if (osRelease.toLowerCase().includes("microsoft")) {
|
||||
return true
|
||||
}
|
||||
|
||||
try {
|
||||
return (await fs.readFile(procVersionFilePath, "utf8")).toLowerCase().includes("microsoft")
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
interface OpenOptions {
|
||||
args: string[]
|
||||
command: string
|
||||
urlSearch: string
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper function to construct options for `open` function.
|
||||
*
|
||||
* Extract to make it easier to test.
|
||||
*
|
||||
* @param platform - platform on machine
|
||||
* @param urlSearch - url.search
|
||||
* @returns an object with args, command, options and urlSearch
|
||||
*/
|
||||
export function constructOpenOptions(platform: NodeJS.Platform | "wsl", urlSearch: string): OpenOptions {
|
||||
const args: string[] = []
|
||||
let command = platform === "darwin" ? "open" : "xdg-open"
|
||||
if (platform === "win32" || platform === "wsl") {
|
||||
command = platform === "wsl" ? "cmd.exe" : "cmd"
|
||||
args.push("/c", "start", '""', "/b")
|
||||
urlSearch = urlSearch.replace(/&/g, "^&")
|
||||
}
|
||||
|
||||
return {
|
||||
args,
|
||||
command,
|
||||
urlSearch,
|
||||
}
|
||||
export const isWsl = async (): Promise<boolean> => {
|
||||
return (
|
||||
(process.platform === "linux" && os.release().toLowerCase().indexOf("microsoft") !== -1) ||
|
||||
(await fs.readFile("/proc/version", "utf8")).toLowerCase().indexOf("microsoft") !== -1
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -447,10 +396,16 @@ export const open = async (address: URL | string): Promise<void> => {
|
||||
if (url.hostname === "0.0.0.0") {
|
||||
url.hostname = "localhost"
|
||||
}
|
||||
const platform = (await isWsl(process.platform, os.release(), "/proc/version")) ? "wsl" : process.platform
|
||||
const { command, args, urlSearch } = constructOpenOptions(platform, url.search)
|
||||
url.search = urlSearch
|
||||
const proc = cp.spawn(command, [...args, url.toString()], {})
|
||||
const args = [] as string[]
|
||||
const options = {} as cp.SpawnOptions
|
||||
const platform = (await isWsl()) ? "wsl" : process.platform
|
||||
let command = platform === "darwin" ? "open" : "xdg-open"
|
||||
if (platform === "win32" || platform === "wsl") {
|
||||
command = platform === "wsl" ? "cmd.exe" : "cmd"
|
||||
args.push("/c", "start", '""', "/b")
|
||||
url.search = url.search.replace(/&/g, "^&")
|
||||
}
|
||||
const proc = cp.spawn(command, [...args, url.toString()], options)
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
proc.on("error", reject)
|
||||
proc.on("close", (code) => {
|
||||
@@ -459,6 +414,31 @@ export const open = async (address: URL | string): Promise<void> => {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* For iterating over an enum's values.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const enumToArray = (t: any): string[] => {
|
||||
const values = [] as string[]
|
||||
for (const k in t) {
|
||||
values.push(t[k])
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
/**
|
||||
* For displaying all allowed options in an enum.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const buildAllowedMessage = (t: any): string => {
|
||||
const values = enumToArray(t)
|
||||
return `Allowed value${values.length === 1 ? " is" : "s are"} ${values.map((t) => `'${t}'`).join(", ")}`
|
||||
}
|
||||
|
||||
export const isObject = <T extends object>(obj: T): obj is T => {
|
||||
return !Array.isArray(obj) && typeof obj === "object" && obj !== null
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a promise that resolves with whether the socket path is active.
|
||||
*/
|
||||
|
||||
@@ -203,9 +203,8 @@ class ChildProcess extends Process {
|
||||
|
||||
/**
|
||||
* Parent process wrapper that spawns the child process and performs a handshake
|
||||
* with it. Will relaunch the child if it receives a SIGUSR1 or SIGUSR2 or is
|
||||
* asked to by the child. If the child otherwise exits the parent will also
|
||||
* exit.
|
||||
* with it. Will relaunch the child if it receives a SIGUSR1 or is asked to by
|
||||
* the child. If the child otherwise exits the parent will also exit.
|
||||
*/
|
||||
export class ParentProcess extends Process {
|
||||
public logger = logger.named(`parent:${process.pid}`)
|
||||
@@ -228,11 +227,6 @@ export class ParentProcess extends Process {
|
||||
this.relaunch()
|
||||
})
|
||||
|
||||
process.on("SIGUSR2", async () => {
|
||||
this.logger.info("Received SIGUSR2; hotswapping")
|
||||
this.relaunch()
|
||||
})
|
||||
|
||||
const opts = {
|
||||
size: "10M",
|
||||
maxFiles: 10,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { promises as fs } from "fs"
|
||||
import * as path from "path"
|
||||
import { promises as fs } from "fs"
|
||||
import { clean } from "../utils/helpers"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
|
||||
@@ -81,9 +81,6 @@ export class CodeServer {
|
||||
path.join(dir, "User/settings.json"),
|
||||
JSON.stringify({
|
||||
"workbench.startupEditor": "none",
|
||||
// NOTE@jsjoeio - needed to prevent Trust Policy prompt
|
||||
// in end-to-end tests.
|
||||
"security.workspace.trust.enabled": false,
|
||||
}),
|
||||
"utf8",
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { version } from "../../src/node/constants"
|
||||
import { describe, test, expect } from "./baseFixture"
|
||||
|
||||
describe("Open Help > About", true, [], {}, () => {
|
||||
@@ -5,8 +6,12 @@ describe("Open Help > About", true, [], {}, () => {
|
||||
// Open using the menu.
|
||||
await codeServerPage.navigateMenus(["Help", "About"])
|
||||
|
||||
const isDevMode = process.env.VSCODE_DEV === "1"
|
||||
|
||||
// Look for code-server info div.
|
||||
const element = await codeServerPage.page.waitForSelector(`div[role="dialog"] >> text=code-server`)
|
||||
const element = await codeServerPage.page.waitForSelector(
|
||||
`div[role="dialog"] >> text=code-server: ${isDevMode ? "Unknown" : "v" + version}`,
|
||||
)
|
||||
expect(element).not.toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
Binary file not shown.
@@ -1,25 +0,0 @@
|
||||
import { stat } from "fs/promises"
|
||||
import path from "path"
|
||||
import { clean, tmpdir } from "../utils/helpers"
|
||||
import { runCodeServerCommand } from "../utils/runCodeServerCommand"
|
||||
|
||||
describe("--install-extension", () => {
|
||||
const testName = "installExtension"
|
||||
let tempDir: string
|
||||
let setupFlags: string[]
|
||||
|
||||
beforeEach(async () => {
|
||||
await clean(testName)
|
||||
tempDir = await tmpdir(testName)
|
||||
setupFlags = ["--extensions-dir", tempDir]
|
||||
})
|
||||
it("should install an extension", async () => {
|
||||
const extName = `wesbos.theme-cobalt2-2.1.6`
|
||||
const vsixFileName = "wesbos.theme-cobalt2-2.1.6.vsix"
|
||||
const extensionFixture = path.resolve(`./test/integration/fixtures/${vsixFileName}`)
|
||||
await runCodeServerCommand([...setupFlags, "--install-extension", extensionFixture])
|
||||
const pathToExtFolder = path.join(tempDir, extName)
|
||||
const statInfo = await stat(pathToExtFolder)
|
||||
expect(statInfo.isDirectory()).toBe(true)
|
||||
}, 20000)
|
||||
})
|
||||
@@ -1,30 +0,0 @@
|
||||
import extract from "extract-zip"
|
||||
import { rename } from "fs/promises"
|
||||
import path from "path"
|
||||
import { clean, tmpdir } from "../utils/helpers"
|
||||
import { runCodeServerCommand } from "../utils/runCodeServerCommand"
|
||||
|
||||
describe("--list-extensions", () => {
|
||||
const testName = "listExtensions"
|
||||
const extName = `wesbos.theme-cobalt2`
|
||||
const extVersion = "2.1.6"
|
||||
const vsixFileName = `${extName}-${extVersion}.vsix`
|
||||
let tempDir: string
|
||||
let setupFlags: string[]
|
||||
|
||||
beforeEach(async () => {
|
||||
await clean(testName)
|
||||
tempDir = await tmpdir(testName)
|
||||
setupFlags = ["--extensions-dir", tempDir]
|
||||
const extensionFixture = path.resolve(`./test/integration/fixtures/${vsixFileName}`)
|
||||
// Make folder because this is where we'll move the extension
|
||||
const pathToUnpackedExtension = path.join(tempDir, `${extName}-${extVersion}`)
|
||||
const tempPathToUnpackedExtension = path.join(tempDir, `${extName}-temp`)
|
||||
await extract(extensionFixture, { dir: tempPathToUnpackedExtension })
|
||||
await rename(path.join(tempPathToUnpackedExtension, "extension"), pathToUnpackedExtension)
|
||||
})
|
||||
it("should list installed extensions", async () => {
|
||||
const { stdout } = await runCodeServerCommand([...setupFlags, "--list-extensions"])
|
||||
expect(stdout).toMatch(extName)
|
||||
}, 20000)
|
||||
})
|
||||
@@ -10,7 +10,6 @@
|
||||
"@types/supertest": "^2.0.11",
|
||||
"@types/wtfnode": "^0.7.0",
|
||||
"argon2": "^0.28.0",
|
||||
"extract-zip": "^2.0.1",
|
||||
"jest": "^27.3.1",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"jsdom": "^16.4.0",
|
||||
|
||||
@@ -24,6 +24,16 @@ describe("util", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("split", () => {
|
||||
it("should split at a comma", () => {
|
||||
expect(util.split("Hello,world", ",")).toStrictEqual(["Hello", "world"])
|
||||
})
|
||||
|
||||
it("shouldn't split if the delimiter doesn't exist", () => {
|
||||
expect(util.split("Hello world", ",")).toStrictEqual(["Hello world", ""])
|
||||
})
|
||||
})
|
||||
|
||||
describe("plural", () => {
|
||||
it("should add an s if count is greater than 1", () => {
|
||||
expect(util.plural(2, "dog")).toBe("dogs")
|
||||
@@ -47,6 +57,43 @@ describe("util", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("trimSlashes", () => {
|
||||
it("should remove leading slashes", () => {
|
||||
expect(util.trimSlashes("/hello-world")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove trailing slashes", () => {
|
||||
expect(util.trimSlashes("hello-world/")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove both leading and trailing slashes", () => {
|
||||
expect(util.trimSlashes("/hello-world/")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove multiple leading and trailing slashes", () => {
|
||||
expect(util.trimSlashes("///hello-world////")).toBe("hello-world")
|
||||
})
|
||||
})
|
||||
|
||||
describe("arrayify", () => {
|
||||
it("should return value it's already an array", () => {
|
||||
expect(util.arrayify(["hello", "world"])).toStrictEqual(["hello", "world"])
|
||||
})
|
||||
|
||||
it("should wrap the value in an array if not an array", () => {
|
||||
expect(
|
||||
util.arrayify({
|
||||
name: "Coder",
|
||||
version: "3.8",
|
||||
}),
|
||||
).toStrictEqual([{ name: "Coder", version: "3.8" }])
|
||||
})
|
||||
|
||||
it("should return an empty array if the value is undefined", () => {
|
||||
expect(util.arrayify(undefined)).toStrictEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe("logError", () => {
|
||||
beforeAll(() => {
|
||||
mockLogger()
|
||||
|
||||
@@ -3,7 +3,7 @@ import { promises } from "fs"
|
||||
import * as http from "http"
|
||||
import * as https from "https"
|
||||
import * as path from "path"
|
||||
import { createApp, ensureAddress, handleArgsSocketCatchError, listen } from "../../../src/node/app"
|
||||
import { createApp, ensureAddress, handleArgsSocketCatchError, handleServerError, listen } from "../../../src/node/app"
|
||||
import { OptionalString, setDefaults } from "../../../src/node/cli"
|
||||
import { generateCertificate } from "../../../src/node/util"
|
||||
import { clean, mockLogger, getAvailablePort, tmpdir } from "../../utils/helpers"
|
||||
@@ -152,20 +152,42 @@ describe("ensureAddress", () => {
|
||||
it("should throw and error if no address", () => {
|
||||
expect(() => ensureAddress(mockServer, "http")).toThrow("Server has no address")
|
||||
})
|
||||
it("should return the address if it's a string", async () => {
|
||||
mockServer.address = () => "/path/to/unix.sock"
|
||||
it("should return the address if it exists", async () => {
|
||||
mockServer.address = () => "http://localhost:8080/"
|
||||
const address = ensureAddress(mockServer, "http")
|
||||
expect(address.toString()).toBe(`/path/to/unix.sock`)
|
||||
expect(address.toString()).toBe(`http://localhost:8080/`)
|
||||
})
|
||||
it("should construct URL with an IPv4 address", async () => {
|
||||
mockServer.address = () => ({ address: "1.2.3.4", port: 5678, family: "IPv4" })
|
||||
const address = ensureAddress(mockServer, "http")
|
||||
expect(address.toString()).toBe(`http://1.2.3.4:5678/`)
|
||||
})
|
||||
|
||||
describe("handleServerError", () => {
|
||||
beforeAll(() => {
|
||||
mockLogger()
|
||||
})
|
||||
it("should construct URL with an IPv6 address", async () => {
|
||||
mockServer.address = () => ({ address: "a:b:c:d::1234", port: 5678, family: "IPv6" })
|
||||
const address = ensureAddress(mockServer, "http")
|
||||
expect(address.toString()).toBe(`http://[a:b:c:d::1234]:5678/`)
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks()
|
||||
})
|
||||
|
||||
it("should call reject if resolved is false", async () => {
|
||||
const resolved = false
|
||||
const reject = jest.fn((err: Error) => undefined)
|
||||
const error = new Error("handleServerError Error")
|
||||
|
||||
handleServerError(resolved, error, reject)
|
||||
|
||||
expect(reject).toHaveBeenCalledTimes(1)
|
||||
expect(reject).toHaveBeenCalledWith(error)
|
||||
})
|
||||
|
||||
it("should log an error if resolved is true", async () => {
|
||||
const resolved = true
|
||||
const reject = jest.fn((err: Error) => undefined)
|
||||
const error = new Error("handleServerError Error")
|
||||
|
||||
handleServerError(resolved, error, reject)
|
||||
|
||||
expect(logger.error).toHaveBeenCalledTimes(1)
|
||||
expect(logger.error).toHaveBeenCalledWith(`http server error: ${error.message} ${error.stack}`)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -362,18 +362,6 @@ describe("parser", () => {
|
||||
})
|
||||
})
|
||||
|
||||
it("should use env var CS_DISABLE_FILE_DOWNLOADS set to true", async () => {
|
||||
process.env.CS_DISABLE_FILE_DOWNLOADS = "true"
|
||||
const args = parse([])
|
||||
expect(args).toEqual({})
|
||||
|
||||
const defaultArgs = await setDefaults(args)
|
||||
expect(defaultArgs).toEqual({
|
||||
...defaults,
|
||||
"disable-file-downloads": true,
|
||||
})
|
||||
})
|
||||
|
||||
it("should error if password passed in", () => {
|
||||
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
||||
"--password can only be set in the config file or passed in via $PASSWORD",
|
||||
@@ -458,7 +446,7 @@ describe("cli", () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
delete process.env.VSCODE_IPC_HOOK_CLI
|
||||
await fs.rm(vscodeIpcPath, { force: true, recursive: true })
|
||||
await fs.rmdir(vscodeIpcPath, { recursive: true })
|
||||
})
|
||||
|
||||
it("should use existing if inside code-server", async () => {
|
||||
|
||||
@@ -34,6 +34,10 @@ describe("constants", () => {
|
||||
jest.resetModules()
|
||||
})
|
||||
|
||||
it("should provide the package name", () => {
|
||||
expect(constants.pkgName).toBe(mockPackageJson.name)
|
||||
})
|
||||
|
||||
it("should provide the commit", () => {
|
||||
expect(constants.commit).toBe(mockPackageJson.commit)
|
||||
})
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
import { logger } from "@coder/logger"
|
||||
import { readFile, writeFile, stat, utimes } from "fs/promises"
|
||||
import { Heart, heartbeatTimer } from "../../../src/node/heart"
|
||||
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
|
||||
|
||||
const mockIsActive = (resolveTo: boolean) => jest.fn().mockResolvedValue(resolveTo)
|
||||
|
||||
describe("Heart", () => {
|
||||
const testName = "heartTests"
|
||||
let testDir = ""
|
||||
let heart: Heart
|
||||
|
||||
beforeAll(async () => {
|
||||
mockLogger()
|
||||
await clean(testName)
|
||||
testDir = await tmpdir(testName)
|
||||
})
|
||||
beforeEach(() => {
|
||||
heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive(true))
|
||||
})
|
||||
afterAll(() => {
|
||||
jest.restoreAllMocks()
|
||||
})
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks()
|
||||
jest.useRealTimers()
|
||||
if (heart) {
|
||||
heart.dispose()
|
||||
}
|
||||
})
|
||||
it("should write to a file when given a valid file path", async () => {
|
||||
// Set up heartbeat file with contents
|
||||
const text = "test"
|
||||
const pathToFile = `${testDir}/file.txt`
|
||||
await writeFile(pathToFile, text)
|
||||
const fileContents = await readFile(pathToFile, { encoding: "utf8" })
|
||||
// Explicitly set the modified time to 0 so that we can check
|
||||
// that the file was indeed modified after calling heart.beat().
|
||||
// This works around any potential race conditions.
|
||||
// Docs: https://nodejs.org/api/fs.html#fspromisesutimespath-atime-mtime
|
||||
await utimes(pathToFile, 0, 0)
|
||||
|
||||
expect(fileContents).toBe(text)
|
||||
|
||||
heart = new Heart(pathToFile, mockIsActive(true))
|
||||
await heart.beat()
|
||||
// Check that the heart wrote to the heartbeatFilePath and overwrote our text
|
||||
const fileContentsAfterBeat = await readFile(pathToFile, { encoding: "utf8" })
|
||||
expect(fileContentsAfterBeat).not.toBe(text)
|
||||
// Make sure the modified timestamp was updated.
|
||||
const fileStatusAfterEdit = await stat(pathToFile)
|
||||
expect(fileStatusAfterEdit.mtimeMs).toBeGreaterThan(0)
|
||||
})
|
||||
it("should log a warning when given an invalid file path", async () => {
|
||||
heart = new Heart(`fakeDir/fake.txt`, mockIsActive(false))
|
||||
await heart.beat()
|
||||
expect(logger.warn).toHaveBeenCalled()
|
||||
})
|
||||
it("should be active after calling beat", async () => {
|
||||
await heart.beat()
|
||||
|
||||
const isAlive = heart.alive()
|
||||
expect(isAlive).toBe(true)
|
||||
})
|
||||
it("should not be active after dispose is called", () => {
|
||||
heart.dispose()
|
||||
|
||||
const isAlive = heart.alive()
|
||||
expect(isAlive).toBe(false)
|
||||
})
|
||||
it("should beat twice without warnings", async () => {
|
||||
// Use fake timers so we can speed up setTimeout
|
||||
jest.useFakeTimers()
|
||||
heart = new Heart(`${testDir}/hello.txt`, mockIsActive(true))
|
||||
await heart.beat()
|
||||
// we need to speed up clocks, timeouts
|
||||
// call heartbeat again (and it won't be alive I think)
|
||||
// then assert no warnings were called
|
||||
jest.runAllTimers()
|
||||
expect(logger.warn).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
||||
describe("heartbeatTimer", () => {
|
||||
beforeAll(() => {
|
||||
mockLogger()
|
||||
})
|
||||
afterAll(() => {
|
||||
jest.restoreAllMocks()
|
||||
})
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks()
|
||||
})
|
||||
it("should call beat when isActive resolves to true", async () => {
|
||||
const isActive = true
|
||||
const mockIsActive = jest.fn().mockResolvedValue(isActive)
|
||||
const mockBeatFn = jest.fn()
|
||||
await heartbeatTimer(mockIsActive, mockBeatFn)
|
||||
expect(mockIsActive).toHaveBeenCalled()
|
||||
expect(mockBeatFn).toHaveBeenCalled()
|
||||
})
|
||||
it("should log a warning when isActive rejects", async () => {
|
||||
const errorMsg = "oh no"
|
||||
const error = new Error(errorMsg)
|
||||
const mockIsActive = jest.fn().mockRejectedValue(error)
|
||||
const mockBeatFn = jest.fn()
|
||||
await heartbeatTimer(mockIsActive, mockBeatFn)
|
||||
expect(mockIsActive).toHaveBeenCalled()
|
||||
expect(mockBeatFn).not.toHaveBeenCalled()
|
||||
expect(logger.warn).toHaveBeenCalledWith(errorMsg)
|
||||
})
|
||||
})
|
||||
@@ -33,10 +33,10 @@ describe("vscode", () => {
|
||||
switch (route) {
|
||||
case "/":
|
||||
case "/vscode/":
|
||||
expect(html).toMatch(/src="\.\/[a-z]+-[0-9a-z]+\/static\//)
|
||||
expect(html).toContain(`src="./static/`)
|
||||
break
|
||||
case "/vscode":
|
||||
expect(html).toMatch(/src="\.\/vscode\/[a-z]+-[0-9a-z]+\/static\//)
|
||||
expect(html).toContain(`src="./vscode/static/`)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ describe("SocketProxyProvider", () => {
|
||||
|
||||
await fs.mkdir(path.join(tmpdir, "tests"), { recursive: true })
|
||||
const socketPath = await provider.findFreeSocketPath(path.join(tmpdir, "tests/tls-socket-proxy"))
|
||||
await fs.rm(socketPath, { force: true, recursive: true })
|
||||
await fs.rmdir(socketPath, { recursive: true })
|
||||
|
||||
return new Promise<void>((_resolve) => {
|
||||
const resolved: { [key: string]: boolean } = { client: false, server: false }
|
||||
|
||||
@@ -131,8 +131,7 @@ describe("update", () => {
|
||||
|
||||
await expect(settings().read()).resolves.toEqual({ update })
|
||||
expect(isNaN(update.checked)).toEqual(false)
|
||||
expect(update.checked).toBeGreaterThanOrEqual(now)
|
||||
expect(update.checked).toBeLessThanOrEqual(Date.now())
|
||||
expect(update.checked < Date.now() && update.checked >= now).toEqual(true)
|
||||
expect(update.version).toStrictEqual("2.1.0")
|
||||
expect(spy).toEqual(["/latest"])
|
||||
})
|
||||
@@ -146,7 +145,7 @@ describe("update", () => {
|
||||
|
||||
await expect(settings().read()).resolves.toEqual({ update })
|
||||
expect(isNaN(update.checked)).toStrictEqual(false)
|
||||
expect(update.checked).toBeLessThanOrEqual(now)
|
||||
expect(update.checked < now).toBe(true)
|
||||
expect(update.version).toStrictEqual("2.1.0")
|
||||
expect(spy).toEqual([])
|
||||
})
|
||||
@@ -160,8 +159,7 @@ describe("update", () => {
|
||||
|
||||
await expect(settings().read()).resolves.toEqual({ update })
|
||||
expect(isNaN(update.checked)).toStrictEqual(false)
|
||||
expect(update.checked).toBeGreaterThanOrEqual(now)
|
||||
expect(update.checked).toBeLessThanOrEqual(Date.now())
|
||||
expect(update.checked < Date.now() && update.checked >= now).toStrictEqual(true)
|
||||
expect(update.version).toStrictEqual("4.1.1")
|
||||
expect(spy).toStrictEqual(["/latest"])
|
||||
})
|
||||
@@ -206,16 +204,14 @@ describe("update", () => {
|
||||
let now = Date.now()
|
||||
let update = await provider.getUpdate(true)
|
||||
expect(isNaN(update.checked)).toStrictEqual(false)
|
||||
expect(update.checked).toBeGreaterThanOrEqual(now)
|
||||
expect(update.checked).toBeLessThanOrEqual(Date.now())
|
||||
expect(update.checked < Date.now() && update.checked >= now).toEqual(true)
|
||||
expect(update.version).toStrictEqual("unknown")
|
||||
|
||||
provider = new UpdateProvider("http://probably.invalid.dev.localhost/latest", settings())
|
||||
now = Date.now()
|
||||
update = await provider.getUpdate(true)
|
||||
expect(isNaN(update.checked)).toStrictEqual(false)
|
||||
expect(update.checked).toBeGreaterThanOrEqual(now)
|
||||
expect(update.checked).toBeLessThanOrEqual(Date.now())
|
||||
expect(update.checked < Date.now() && update.checked >= now).toEqual(true)
|
||||
expect(update.version).toStrictEqual("unknown")
|
||||
})
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as path from "path"
|
||||
import { generateUuid } from "../../../src/common/util"
|
||||
import { tmpdir } from "../../../src/node/constants"
|
||||
import * as util from "../../../src/node/util"
|
||||
import { clean, tmpdir as tempDirHelper } from "../../utils/helpers"
|
||||
|
||||
describe("getEnvPaths", () => {
|
||||
describe("on darwin", () => {
|
||||
@@ -350,22 +349,6 @@ describe("isCookieValid", () => {
|
||||
})
|
||||
expect(isValid).toBe(false)
|
||||
})
|
||||
it("should return false and empty string as hashedPassword when passwordMethod is invalid", async () => {
|
||||
const p = "password1"
|
||||
const passwordValidation = await util.handlePasswordValidation({
|
||||
// @ts-expect-error although this shouldn't ever happen, it ensures the default case in this function
|
||||
// works as expected.
|
||||
passwordMethod: "INVALID",
|
||||
passwordFromRequestBody: p,
|
||||
passwordFromArgs: undefined,
|
||||
hashedPasswordFromArgs: undefined,
|
||||
})
|
||||
|
||||
const matchesHash = await util.isHashMatch(p, passwordValidation.hashedPassword)
|
||||
|
||||
expect(passwordValidation.isPasswordValid).toBe(false)
|
||||
expect(matchesHash).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe("sanitizeString", () => {
|
||||
@@ -463,9 +446,6 @@ describe("isFile", () => {
|
||||
it("should return true if is file", async () => {
|
||||
expect(await util.isFile(pathToFile)).toBe(true)
|
||||
})
|
||||
it("should return false if error", async () => {
|
||||
expect(await util.isFile("fakefile.txt")).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe("humanPath", () => {
|
||||
@@ -483,98 +463,3 @@ describe("humanPath", () => {
|
||||
expect(actual).toBe(expected)
|
||||
})
|
||||
})
|
||||
|
||||
describe("isWsl", () => {
|
||||
const testName = "wsl"
|
||||
|
||||
beforeAll(async () => {
|
||||
await clean(testName)
|
||||
})
|
||||
|
||||
describe("on Linux (microsoft)", () => {
|
||||
it("should return true", async () => {
|
||||
const fileName = "proc-version"
|
||||
const osRelease = "5.4.0-1066-gke"
|
||||
const pathToFile = path.join(await tempDirHelper(testName), fileName)
|
||||
await fs.writeFile(
|
||||
pathToFile,
|
||||
"Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014",
|
||||
)
|
||||
expect(await util.isWsl("linux", osRelease, pathToFile)).toBe(true)
|
||||
})
|
||||
})
|
||||
describe("on Linux (non-microsoft)", () => {
|
||||
it("should return false", async () => {
|
||||
const fileName = "proc-version2"
|
||||
const osRelease = "Linux"
|
||||
const pathToFile = path.join(await tempDirHelper(testName), fileName)
|
||||
await fs.writeFile(
|
||||
pathToFile,
|
||||
"Linux version 5.4.0-1066-gke (buildd@lcy02-amd64-039) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04)) #69-Ubuntu SMP Fri Mar 11 13:52:45 UTC 202",
|
||||
)
|
||||
expect(await util.isWsl("linux", osRelease, pathToFile)).toBe(false)
|
||||
})
|
||||
})
|
||||
describe("on Win32 with microsoft in /proc/version", () => {
|
||||
it("should return false", async () => {
|
||||
const fileName = "proc-version3"
|
||||
const osRelease = "3.4.0-Microsoft"
|
||||
const pathToFile = path.join(await tempDirHelper(testName), fileName)
|
||||
await fs.writeFile(
|
||||
pathToFile,
|
||||
"Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014",
|
||||
)
|
||||
expect(await util.isWsl("win32", osRelease, pathToFile)).toBe(false)
|
||||
})
|
||||
})
|
||||
describe("on Darwin", () => {
|
||||
it("should return false", async () => {
|
||||
const fileName = "proc-version4"
|
||||
const osRelease =
|
||||
"Darwin Roadrunner.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386"
|
||||
const pathToFile = path.join(await tempDirHelper(testName), fileName)
|
||||
expect(await util.isWsl("darwin", osRelease, pathToFile)).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe("open", () => {
|
||||
it("should throw an error if address is a string", async () => {
|
||||
const address = "localhost:3000"
|
||||
await expect(util.open(address)).rejects.toThrow("Cannot open socket paths")
|
||||
})
|
||||
})
|
||||
describe("constructOpenOptions", () => {
|
||||
it("should return options for darwin", () => {
|
||||
const platform: NodeJS.Platform | "wsl" = "darwin"
|
||||
const url = new URL("localhost:8080")
|
||||
const { args, command, urlSearch } = util.constructOpenOptions(platform, url.search)
|
||||
expect(args).toStrictEqual([])
|
||||
expect(command).toBe("open")
|
||||
expect(urlSearch).toBe("")
|
||||
})
|
||||
it("should return options for linux", () => {
|
||||
const platform: NodeJS.Platform | "wsl" = "linux"
|
||||
const url = new URL("localhost:8080")
|
||||
const { args, command, urlSearch } = util.constructOpenOptions(platform, url.search)
|
||||
expect(args).toStrictEqual([])
|
||||
expect(command).toBe("xdg-open")
|
||||
expect(urlSearch).toBe("")
|
||||
})
|
||||
it("should return options for win32", () => {
|
||||
const platform: NodeJS.Platform | "wsl" = "win32"
|
||||
const url = new URL("localhost:8080?q=&test")
|
||||
const { args, command, urlSearch } = util.constructOpenOptions(platform, url.search)
|
||||
expect(args).toStrictEqual(["/c", "start", '""', "/b"])
|
||||
expect(command).toBe("cmd")
|
||||
expect(urlSearch).toBe("?q=^&test")
|
||||
})
|
||||
it("should return options for wsl", () => {
|
||||
const platform: NodeJS.Platform | "wsl" = "wsl"
|
||||
const url = new URL("localhost:8080?q=&test")
|
||||
const { args, command, urlSearch } = util.constructOpenOptions(platform, url.search)
|
||||
expect(args).toStrictEqual(["/c", "start", '""', "/b"])
|
||||
expect(command).toBe("cmd.exe")
|
||||
expect(urlSearch).toBe("?q=^&test")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -29,7 +29,7 @@ export function mockLogger() {
|
||||
*/
|
||||
export async function clean(testName: string): Promise<void> {
|
||||
const dir = path.join(os.tmpdir(), `code-server/tests/${testName}`)
|
||||
await fs.rm(dir, { force: true, recursive: true })
|
||||
await fs.rmdir(dir, { recursive: true })
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { exec } from "child_process"
|
||||
import path from "path"
|
||||
import { promisify } from "util"
|
||||
|
||||
/**
|
||||
*
|
||||
* A helper function for integration tests to run code-server commands.
|
||||
*/
|
||||
export async function runCodeServerCommand(argv: string[]): Promise<{ stdout: string; stderr: string }> {
|
||||
const CODE_SERVER_COMMAND = process.env.CODE_SERVER_PATH || path.resolve("../../release-standalone/bin/code-server")
|
||||
const { stdout, stderr } = await promisify(exec)(`${CODE_SERVER_COMMAND} ${argv.join(" ")}`)
|
||||
|
||||
return { stdout, stderr }
|
||||
}
|
||||
@@ -1690,9 +1690,9 @@ globals@^11.1.0:
|
||||
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
|
||||
|
||||
graceful-fs@^4.2.4:
|
||||
version "4.2.10"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
|
||||
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
|
||||
version "4.2.9"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
|
||||
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
|
||||
|
||||
has-flag@^3.0.0:
|
||||
version "3.0.0"
|
||||
|
||||
291
yarn.lock
291
yarn.lock
@@ -276,6 +276,18 @@
|
||||
resolved "https://registry.yarnpkg.com/@phc/format/-/format-1.0.0.tgz#b5627003b3216dc4362125b13f48a4daa76680e4"
|
||||
integrity sha512-m7X9U6BG2+J+R1lSOdCiITLLrxm+cWlNI3HUFA92oLO77ObGNzaKdh8pMLqdZcshtkKuV84olNNXDfMc4FezBQ==
|
||||
|
||||
"@pkgr/utils@^2.0.3":
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.1.0.tgz#66a4be2df4fc8ae50d730666855f6a6df833a725"
|
||||
integrity sha512-Va5LTLVoPIH8CrV170zXLSDtCJ6eG6uVXYwwsDYOOeec0MdkhvJzKaxvA+hGJRWFl5I4VBQBs5pwljaI4TG5OA==
|
||||
dependencies:
|
||||
cross-spawn "^7.0.3"
|
||||
is-glob "^4.0.3"
|
||||
open "^8.4.0"
|
||||
picocolors "^1.0.0"
|
||||
tiny-glob "^0.2.9"
|
||||
tslib "^2.3.1"
|
||||
|
||||
"@schemastore/package@^0.0.6":
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@schemastore/package/-/package-0.0.6.tgz#9a76713da1c7551293b7e72e4f387f802bfd5d81"
|
||||
@@ -507,14 +519,13 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@typescript-eslint/eslint-plugin@^5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.23.0.tgz#bc4cbcf91fbbcc2e47e534774781b82ae25cc3d8"
|
||||
integrity sha512-hEcSmG4XodSLiAp1uxv/OQSGsDY6QN3TcRU32gANp+19wGE1QQZLRS8/GV58VRUoXhnkuJ3ZxNQ3T6Z6zM59DA==
|
||||
"@typescript-eslint/eslint-plugin@^5.0.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.2.0.tgz#2bdb247cc2e2afce7efbce09afb9a6f0a8a08434"
|
||||
integrity sha512-qQwg7sqYkBF4CIQSyRQyqsYvP+g/J0To9ZPVNJpfxfekl5RmdvQnFFTVVwpRtaUDFNvjfe/34TgY/dpc3MgNTw==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.23.0"
|
||||
"@typescript-eslint/type-utils" "5.23.0"
|
||||
"@typescript-eslint/utils" "5.23.0"
|
||||
"@typescript-eslint/experimental-utils" "5.2.0"
|
||||
"@typescript-eslint/scope-manager" "5.2.0"
|
||||
debug "^4.3.2"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
ignore "^5.1.8"
|
||||
@@ -522,69 +533,60 @@
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@^5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.23.0.tgz#443778e1afc9a8ff180f91b5e260ac3bec5e2de1"
|
||||
integrity sha512-V06cYUkqcGqpFjb8ttVgzNF53tgbB/KoQT/iB++DOIExKmzI9vBJKjZKt/6FuV9c+zrDsvJKbJ2DOCYwX91cbw==
|
||||
"@typescript-eslint/experimental-utils@5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.2.0.tgz#e3b2cb9cd0aff9b50f68d9a414c299fd26b067e6"
|
||||
integrity sha512-fWyT3Agf7n7HuZZRpvUYdFYbPk3iDCq6fgu3ulia4c7yxmPnwVBovdSOX7RL+k8u6hLbrXcdAehlWUVpGh6IEw==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.23.0"
|
||||
"@typescript-eslint/types" "5.23.0"
|
||||
"@typescript-eslint/typescript-estree" "5.23.0"
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.2.0"
|
||||
"@typescript-eslint/types" "5.2.0"
|
||||
"@typescript-eslint/typescript-estree" "5.2.0"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
|
||||
"@typescript-eslint/parser@^5.0.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.2.0.tgz#dc081aa89de16b5676b10215519af3aa7b58fb72"
|
||||
integrity sha512-Uyy4TjJBlh3NuA8/4yIQptyJb95Qz5PX//6p8n7zG0QnN4o3NF9Je3JHbVU7fxf5ncSXTmnvMtd/LDQWDk0YqA==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.2.0"
|
||||
"@typescript-eslint/types" "5.2.0"
|
||||
"@typescript-eslint/typescript-estree" "5.2.0"
|
||||
debug "^4.3.2"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.23.0.tgz#4305e61c2c8e3cfa3787d30f54e79430cc17ce1b"
|
||||
integrity sha512-EhjaFELQHCRb5wTwlGsNMvzK9b8Oco4aYNleeDlNuL6qXWDF47ch4EhVNPh8Rdhf9tmqbN4sWDk/8g+Z/J8JVw==
|
||||
"@typescript-eslint/scope-manager@5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.2.0.tgz#7ce8e4ab2baaa0ad5282913ea8e13ce03ec6a12a"
|
||||
integrity sha512-RW+wowZqPzQw8MUFltfKYZfKXqA2qgyi6oi/31J1zfXJRpOn6tCaZtd9b5u9ubnDG2n/EMvQLeZrsLNPpaUiFQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.23.0"
|
||||
"@typescript-eslint/visitor-keys" "5.23.0"
|
||||
"@typescript-eslint/types" "5.2.0"
|
||||
"@typescript-eslint/visitor-keys" "5.2.0"
|
||||
|
||||
"@typescript-eslint/type-utils@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.23.0.tgz#f852252f2fc27620d5bb279d8fed2a13d2e3685e"
|
||||
integrity sha512-iuI05JsJl/SUnOTXA9f4oI+/4qS/Zcgk+s2ir+lRmXI+80D8GaGwoUqs4p+X+4AxDolPpEpVUdlEH4ADxFy4gw==
|
||||
"@typescript-eslint/types@5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.2.0.tgz#7ad32d15abddb0ee968a330f0ea182ea544ef7cf"
|
||||
integrity sha512-cTk6x08qqosps6sPyP2j7NxyFPlCNsJwSDasqPNjEQ8JMD5xxj2NHxcLin5AJQ8pAVwpQ8BMI3bTxR0zxmK9qQ==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.2.0.tgz#c22e0ff6f8a4a3f78504a80ebd686fe2870a68ae"
|
||||
integrity sha512-RsdXq2XmVgKbm9nLsE3mjNUM7BTr/K4DYR9WfFVMUuozHWtH5gMpiNZmtrMG8GR385EOSQ3kC9HiEMJWimxd/g==
|
||||
dependencies:
|
||||
"@typescript-eslint/utils" "5.23.0"
|
||||
debug "^4.3.2"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.23.0.tgz#8733de0f58ae0ed318dbdd8f09868cdbf9f9ad09"
|
||||
integrity sha512-NfBsV/h4dir/8mJwdZz7JFibaKC3E/QdeMEDJhiAE3/eMkoniZ7MjbEMCGXw6MZnZDMN3G9S0mH/6WUIj91dmw==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.23.0.tgz#dca5f10a0a85226db0796e8ad86addc9aee52065"
|
||||
integrity sha512-xE9e0lrHhI647SlGMl+m+3E3CKPF1wzvvOEWnuE3CCjjT7UiRnDGJxmAcVKJIlFgK6DY9RB98eLr1OPigPEOGg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.23.0"
|
||||
"@typescript-eslint/visitor-keys" "5.23.0"
|
||||
"@typescript-eslint/types" "5.2.0"
|
||||
"@typescript-eslint/visitor-keys" "5.2.0"
|
||||
debug "^4.3.2"
|
||||
globby "^11.0.4"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.23.0.tgz#4691c3d1b414da2c53d8943310df36ab1c50648a"
|
||||
integrity sha512-dbgaKN21drqpkbbedGMNPCtRPZo1IOUr5EI9Jrrh99r5UW5Q0dz46RKXeSBoPV+56R6dFKpbrdhgUNSJsDDRZA==
|
||||
"@typescript-eslint/visitor-keys@5.2.0":
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.2.0.tgz#03522d35df98474f08e0357171a7d1b259a88f55"
|
||||
integrity sha512-Nk7HizaXWWCUBfLA/rPNKMzXzWS8Wg9qHMuGtT+v2/YpPij4nVXrVJc24N/r5WrrmqK31jCrZxeHqIgqRzs0Xg==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.23.0"
|
||||
"@typescript-eslint/types" "5.23.0"
|
||||
"@typescript-eslint/typescript-estree" "5.23.0"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.23.0":
|
||||
version "5.23.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.23.0.tgz#057c60a7ca64667a39f991473059377a8067c87b"
|
||||
integrity sha512-Vd4mFNchU62sJB8pX19ZSPog05B0Y0CE2UxAZPT5k4iqhRYjPnqyY3woMxCd0++t9OTqkgjST+1ydLBi7e2Fvg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.23.0"
|
||||
"@typescript-eslint/types" "5.2.0"
|
||||
eslint-visitor-keys "^3.0.0"
|
||||
|
||||
"@yarnpkg/lockfile@^1.1.0":
|
||||
@@ -731,6 +733,11 @@ argparse@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
||||
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
|
||||
|
||||
argv@0.0.2:
|
||||
version "0.0.2"
|
||||
resolved "https://registry.yarnpkg.com/argv/-/argv-0.0.2.tgz#ecbd16f8949b157183711b1bda334f37840185ab"
|
||||
integrity sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=
|
||||
|
||||
arr-union@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
|
||||
@@ -1026,6 +1033,17 @@ clone-regexp@^2.1.0:
|
||||
dependencies:
|
||||
is-regexp "^2.0.0"
|
||||
|
||||
codecov@^3.8.3:
|
||||
version "3.8.3"
|
||||
resolved "https://registry.yarnpkg.com/codecov/-/codecov-3.8.3.tgz#9c3e364b8a700c597346ae98418d09880a3fdbe7"
|
||||
integrity sha512-Y8Hw+V3HgR7V71xWH2vQ9lyS358CbGCldWlJFR0JirqoGtOoas3R3/OclRTvgUYFK29mmJICDPauVKmpqbwhOA==
|
||||
dependencies:
|
||||
argv "0.0.2"
|
||||
ignore-walk "3.0.4"
|
||||
js-yaml "3.14.1"
|
||||
teeny-request "7.1.1"
|
||||
urlgrey "1.0.0"
|
||||
|
||||
collapse-white-space@^1.0.2:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.6.tgz#e63629c0016665792060dbbeb79c42239d2c5287"
|
||||
@@ -1264,6 +1282,11 @@ deep-is@~0.1.3:
|
||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
|
||||
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
|
||||
|
||||
define-lazy-prop@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
|
||||
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
|
||||
|
||||
define-properties@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||
@@ -1838,6 +1861,13 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6:
|
||||
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
|
||||
integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=
|
||||
|
||||
fast-url-parser@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d"
|
||||
integrity sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=
|
||||
dependencies:
|
||||
punycode "^1.3.2"
|
||||
|
||||
fastest-levenshtein@^1.0.12:
|
||||
version "1.0.12"
|
||||
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2"
|
||||
@@ -2091,6 +2121,11 @@ globals@^13.6.0, globals@^13.9.0:
|
||||
dependencies:
|
||||
type-fest "^0.20.2"
|
||||
|
||||
globalyzer@0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465"
|
||||
integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==
|
||||
|
||||
globby@^11.0.3:
|
||||
version "11.0.3"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb"
|
||||
@@ -2120,6 +2155,11 @@ globjoin@^0.1.4:
|
||||
resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43"
|
||||
integrity sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=
|
||||
|
||||
globrex@^0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
|
||||
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
|
||||
|
||||
gonzales-pe@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.3.0.tgz#fe9dec5f3c557eead09ff868c65826be54d067b3"
|
||||
@@ -2279,6 +2319,13 @@ iconv-lite@0.4.24:
|
||||
dependencies:
|
||||
safer-buffer ">= 2.1.2 < 3"
|
||||
|
||||
ignore-walk@3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335"
|
||||
integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ==
|
||||
dependencies:
|
||||
minimatch "^3.0.4"
|
||||
|
||||
ignore@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
|
||||
@@ -2414,6 +2461,11 @@ is-decimal@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5"
|
||||
integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==
|
||||
|
||||
is-docker@^2.0.0, is-docker@^2.1.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
|
||||
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
|
||||
|
||||
is-extendable@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
|
||||
@@ -2523,6 +2575,13 @@ is-word-character@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230"
|
||||
integrity sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA==
|
||||
|
||||
is-wsl@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
|
||||
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
|
||||
dependencies:
|
||||
is-docker "^2.0.0"
|
||||
|
||||
isarray@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
|
||||
@@ -2543,7 +2602,7 @@ js-tokens@^4.0.0:
|
||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
|
||||
|
||||
js-yaml@^3.13.1:
|
||||
js-yaml@3.14.1, js-yaml@^3.13.1:
|
||||
version "3.14.1"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
|
||||
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
|
||||
@@ -2951,12 +3010,7 @@ ms@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
||||
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
|
||||
|
||||
mvdan-sh@^0.10.1:
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/mvdan-sh/-/mvdan-sh-0.10.1.tgz#5b3a4462a89cf20739b12d851589342c875f4d1f"
|
||||
integrity sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==
|
||||
|
||||
nanoid@^3.1.23, nanoid@^3.1.31:
|
||||
nanoid@^3.1.23, nanoid@^3.1.31, nanoid@^3.3.2:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
|
||||
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==
|
||||
@@ -2988,7 +3042,7 @@ node-addon-api@^4.3.0:
|
||||
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f"
|
||||
integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==
|
||||
|
||||
node-fetch@^2.6.5, node-fetch@^2.6.7:
|
||||
node-fetch@^2.6.1, node-fetch@^2.6.5, node-fetch@^2.6.7:
|
||||
version "2.6.7"
|
||||
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
|
||||
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
|
||||
@@ -3096,6 +3150,15 @@ once@^1.3.0:
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
open@^8.4.0:
|
||||
version "8.4.0"
|
||||
resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
|
||||
integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==
|
||||
dependencies:
|
||||
define-lazy-prop "^2.0.0"
|
||||
is-docker "^2.1.1"
|
||||
is-wsl "^2.2.0"
|
||||
|
||||
opencollective-postinstall@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
|
||||
@@ -3305,6 +3368,11 @@ pem@^1.14.2:
|
||||
os-tmpdir "^1.0.1"
|
||||
which "^2.0.2"
|
||||
|
||||
picocolors@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
|
||||
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
|
||||
|
||||
picomatch@^2.2.1:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
|
||||
@@ -3424,12 +3492,13 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier-plugin-sh@^0.12.0:
|
||||
version "0.12.4"
|
||||
resolved "https://registry.yarnpkg.com/prettier-plugin-sh/-/prettier-plugin-sh-0.12.4.tgz#39d57b2345111de8fc8a3f28975fa92369502f65"
|
||||
integrity sha512-s0SK0hdng0Qv44Gs5yjUyk/j+LEmgoCpvEZ4LS0GglkeTyCR4gqgCrJ/ksbK+1ZuHB6UJ8e2ReOoln0Qfu2T9w==
|
||||
prettier-plugin-sh@^0.10.0:
|
||||
version "0.10.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier-plugin-sh/-/prettier-plugin-sh-0.10.1.tgz#70951b933238803fa67a0d5752d6667963130057"
|
||||
integrity sha512-bEcEMvgivqNB/9r9UIN6CTPoux7pmZKFtzDkEb/hSwj/j/PlHfNpiOwLtDZ44D8RtUAZloMz7j1ucqdPqcTawQ==
|
||||
dependencies:
|
||||
mvdan-sh "^0.10.1"
|
||||
sh-syntax "^0.1.4"
|
||||
synckit "^0.7.0"
|
||||
|
||||
prettier@^2.2.1:
|
||||
version "2.3.2"
|
||||
@@ -3473,15 +3542,20 @@ pseudomap@^1.0.2:
|
||||
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
|
||||
|
||||
punycode@^1.3.2:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
|
||||
integrity sha1-wNWmOycYgArY4esPpSachN1BhF4=
|
||||
|
||||
punycode@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qs@6.11.0:
|
||||
version "6.11.0"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
|
||||
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
|
||||
qs@6.10.3:
|
||||
version "6.10.3"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.3.tgz#d6cde1b2ffca87b5aa57889816c5f81535e22e8e"
|
||||
integrity sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==
|
||||
dependencies:
|
||||
side-channel "^1.0.4"
|
||||
|
||||
@@ -3813,6 +3887,14 @@ setprototypeof@1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
|
||||
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
|
||||
|
||||
sh-syntax@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/sh-syntax/-/sh-syntax-0.1.4.tgz#a63eb87571161c89f4a027085be6745b0154429c"
|
||||
integrity sha512-PbReZBaylc3YSo+SbZQd5b8/I0jh8CQTdy5YRBNSVtIyuJ+l1dCygR8UhWBMz3p431ZDs2Wp59qUpIUvPCcssA==
|
||||
dependencies:
|
||||
nanoid "^3.3.2"
|
||||
tslib "^2.3.1"
|
||||
|
||||
shebang-command@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea"
|
||||
@@ -3986,6 +4068,13 @@ stream-combiner@^0.2.2:
|
||||
duplexer "~0.1.1"
|
||||
through "~2.3.4"
|
||||
|
||||
stream-events@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.5.tgz#bbc898ec4df33a4902d892333d47da9bf1c406d5"
|
||||
integrity sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==
|
||||
dependencies:
|
||||
stubs "^3.0.0"
|
||||
|
||||
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||
@@ -4070,6 +4159,11 @@ structured-source@^3.0.2:
|
||||
dependencies:
|
||||
boundary "^1.0.1"
|
||||
|
||||
stubs@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b"
|
||||
integrity sha1-6NK6H6nJBXAwPAMLaQD31fiavls=
|
||||
|
||||
style-search@^0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"
|
||||
@@ -4160,6 +4254,14 @@ svg-tags@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/svg-tags/-/svg-tags-1.0.0.tgz#58f71cee3bd519b59d4b2a843b6c7de64ac04764"
|
||||
integrity sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=
|
||||
|
||||
synckit@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.7.0.tgz#59abd4ec3ee4e7b645dbd1e6e188920c9494392c"
|
||||
integrity sha512-NbpamGIw1300xjPCLCVkhtSgGVfONitrmJA4CD54f2P47GxW5rlsCiajAYrqbz0H0PmVSPA2slZjEfJpUfap0Q==
|
||||
dependencies:
|
||||
"@pkgr/utils" "^2.0.3"
|
||||
tslib "^2.3.1"
|
||||
|
||||
synp@^1.9.10:
|
||||
version "1.9.10"
|
||||
resolved "https://registry.yarnpkg.com/synp/-/synp-1.9.10.tgz#53163321a600418c9b06af0db499939ffce12907"
|
||||
@@ -4199,6 +4301,17 @@ tar@^6.1.11, tar@^6.1.9:
|
||||
mkdirp "^1.0.3"
|
||||
yallist "^4.0.0"
|
||||
|
||||
teeny-request@7.1.1:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/teeny-request/-/teeny-request-7.1.1.tgz#2b0d156f4a8ad81de44303302ba8d7f1f05e20e6"
|
||||
integrity sha512-iwY6rkW5DDGq8hE2YgNQlKbptYpY5Nn2xecjQiNjOXWbKzPGUfmeUBCSQbbr306d7Z7U2N0TPl+/SwYRfua1Dg==
|
||||
dependencies:
|
||||
http-proxy-agent "^4.0.0"
|
||||
https-proxy-agent "^5.0.0"
|
||||
node-fetch "^2.6.1"
|
||||
stream-events "^1.0.5"
|
||||
uuid "^8.0.0"
|
||||
|
||||
text-table@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
|
||||
@@ -4209,6 +4322,14 @@ through@2, "through@>=2.2.7 <3", through@^2.3.8, through@~2.3, through@~2.3.4:
|
||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
|
||||
|
||||
tiny-glob@^0.2.9:
|
||||
version "0.2.9"
|
||||
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2"
|
||||
integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==
|
||||
dependencies:
|
||||
globalyzer "0.1.0"
|
||||
globrex "^0.1.2"
|
||||
|
||||
to-fast-properties@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
|
||||
@@ -4292,7 +4413,7 @@ tslib@^1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.1:
|
||||
tslib@^2.0.1, tslib@^2.3.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
|
||||
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
|
||||
@@ -4353,10 +4474,10 @@ typedarray-to-buffer@^3.1.5:
|
||||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@^4.6.2:
|
||||
version "4.6.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
|
||||
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
|
||||
typescript@^4.4.0-dev.20210528:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
|
||||
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
|
||||
|
||||
unbox-primitive@^1.0.0:
|
||||
version "1.0.1"
|
||||
@@ -4477,6 +4598,13 @@ uri-js@^4.2.2:
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
urlgrey@1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/urlgrey/-/urlgrey-1.0.0.tgz#72d2f904482d0b602e3c7fa599343d699bbe1017"
|
||||
integrity sha512-hJfIzMPJmI9IlLkby8QrsCykQ+SXDeO2W5Q9QTW3QpqZVTx4a/K7p8/5q+/isD8vsbVaFgql/gvAoQCRQ2Cb5w==
|
||||
dependencies:
|
||||
fast-url-parser "^1.1.3"
|
||||
|
||||
util-deprecate@^1.0.1, util-deprecate@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
@@ -4487,6 +4615,11 @@ utils-merge@1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
|
||||
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
|
||||
|
||||
uuid@^8.0.0:
|
||||
version "8.3.2"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
|
||||
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
|
||||
|
||||
v8-compile-cache@^2.0.3, v8-compile-cache@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee"
|
||||
|
||||
Reference in New Issue
Block a user