mirror of
https://github.com/coder/code-server.git
synced 2026-03-30 00:02:16 +08:00
Compare commits
93 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dcb1d7da0 | ||
|
|
840a9430cd | ||
|
|
9143a299a4 | ||
|
|
41b0e45f91 | ||
|
|
b5611efe1a | ||
|
|
a5c1b6a196 | ||
|
|
2743655ab5 | ||
|
|
8d9a44a024 | ||
|
|
ada3489acf | ||
|
|
4d615f18a9 | ||
|
|
d544846caa | ||
|
|
44fc46316f | ||
|
|
d7599ae360 | ||
|
|
13ca0e4731 | ||
|
|
b7c7a62049 | ||
|
|
24ea70ac88 | ||
|
|
a6d80dc434 | ||
|
|
b43e772707 | ||
|
|
1af5ce5ab6 | ||
|
|
62afaf261b | ||
|
|
b6e0c844a9 | ||
|
|
83d2935223 | ||
|
|
9e3794487f | ||
|
|
65b0f0e1bb | ||
|
|
841ec45573 | ||
|
|
3eada681d3 | ||
|
|
52f1542621 | ||
|
|
b5e2c42183 | ||
|
|
980e009b6d | ||
|
|
36b00d37ff | ||
|
|
355546d0a5 | ||
|
|
e9c577549f | ||
|
|
98a2a0064b | ||
|
|
d58aaa7b34 | ||
|
|
9184b645cc | ||
|
|
639c3202eb | ||
|
|
65299492b6 | ||
|
|
954ceae6e0 | ||
|
|
e90504b8cf | ||
|
|
3c0b449c6e | ||
|
|
7f2112c1c9 | ||
|
|
7ec0be6995 | ||
|
|
1dd0741c94 | ||
|
|
aa210cdad4 | ||
|
|
9e97cd1278 | ||
|
|
352636408c | ||
|
|
f223d301a2 | ||
|
|
809abfbbe0 | ||
|
|
f5dc5436da | ||
|
|
94a533e540 | ||
|
|
ba588b4709 | ||
|
|
3368ef91ef | ||
|
|
65d6b9a4c4 | ||
|
|
e352745c4c | ||
|
|
9233f04383 | ||
|
|
8c077bf605 | ||
|
|
41f7ba903f | ||
|
|
ac7322ce56 | ||
|
|
68ac95b84e | ||
|
|
0de7cf5679 | ||
|
|
ea9a3a5ab2 | ||
|
|
472bf8a5fa | ||
|
|
eccb1eb537 | ||
|
|
f128a7ac11 | ||
|
|
80996d2e08 | ||
|
|
9819b91c74 | ||
|
|
2ed1098c1e | ||
|
|
85042e2910 | ||
|
|
904942a194 | ||
|
|
9a24e467b2 | ||
|
|
24a777491b | ||
|
|
93c1f4f10c | ||
|
|
339c3926c2 | ||
|
|
897b5f13bc | ||
|
|
282f74d9f5 | ||
|
|
7a2a5eb055 | ||
|
|
af397f71e2 | ||
|
|
9d89b17fd7 | ||
|
|
35e7b09a85 | ||
|
|
7beb05d04f | ||
|
|
add51d5c5b | ||
|
|
db8a41bce1 | ||
|
|
811ec6c1d6 | ||
|
|
30321abfcd | ||
|
|
cd40509fbb | ||
|
|
9fd98d58e7 | ||
|
|
b0992ddb3e | ||
|
|
af19dedfa9 | ||
|
|
d1066af558 | ||
|
|
ba774d989b | ||
|
|
1a7b770f5b | ||
|
|
626145cf66 | ||
|
|
b59a4f7366 |
12
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
12
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@ -86,6 +86,18 @@ body:
|
|||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
- type: dropdown
|
||||||
|
attributes:
|
||||||
|
label: Does this bug reproduce in VS Code web?
|
||||||
|
description: If the bug reproduces in VS Code web, submit the issue upstream instead (https://github.com/microsoft/vscode). You can run VS Code web with `code serve-web` (this is not the same as vscode.dev).
|
||||||
|
options:
|
||||||
|
- Yes, this is also broken in VS Code web
|
||||||
|
- No, this works as expected in VS Code web
|
||||||
|
- This cannot be tested in VS Code web
|
||||||
|
- I did not test VS Code web
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
attributes:
|
attributes:
|
||||||
label: Does this bug reproduce in GitHub Codespaces?
|
label: Does this bug reproduce in GitHub Codespaces?
|
||||||
|
|||||||
164
.github/workflows/build.yaml
vendored
164
.github/workflows/build.yaml
vendored
@ -15,12 +15,6 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
# Note: if: success() is used in several jobs -
|
|
||||||
# this ensures that it only executes if all previous jobs succeeded.
|
|
||||||
|
|
||||||
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
# will skip running `npm install` if it successfully fetched from cache
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
changes:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -31,10 +25,8 @@ jobs:
|
|||||||
docs: ${{ steps.filter.outputs.docs }}
|
docs: ${{ steps.filter.outputs.docs }}
|
||||||
helm: ${{ steps.filter.outputs.helm }}
|
helm: ${{ steps.filter.outputs.helm }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v6
|
||||||
uses: actions/checkout@v4
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
|
||||||
- name: Check changed files
|
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
id: filter
|
id: filter
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
@ -62,10 +54,9 @@ jobs:
|
|||||||
prettier:
|
prettier:
|
||||||
name: Run prettier check
|
name: Run prettier check
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -78,12 +69,11 @@ jobs:
|
|||||||
doctoc:
|
doctoc:
|
||||||
name: Doctoc markdown files
|
name: Doctoc markdown files
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.docs == 'true'
|
if: needs.changes.outputs.docs == 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -96,12 +86,11 @@ jobs:
|
|||||||
lint-helm:
|
lint-helm:
|
||||||
name: Lint Helm chart
|
name: Lint Helm chart
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.helm == 'true'
|
if: needs.changes.outputs.helm == 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: azure/setup-helm@v4
|
- uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
- run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
||||||
@ -110,12 +99,11 @@ jobs:
|
|||||||
lint-ts:
|
lint-ts:
|
||||||
name: Lint TypeScript files
|
name: Lint TypeScript files
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.code == 'true'
|
if: needs.changes.outputs.code == 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -132,22 +120,21 @@ jobs:
|
|||||||
if: needs.changes.outputs.ci == 'true'
|
if: needs.changes.outputs.ci == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
- name: Check workflow files
|
- name: Check workflow files
|
||||||
run: |
|
run: |
|
||||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.1
|
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9
|
||||||
./actionlint -color -shellcheck= -ignore "set-output"
|
./actionlint -color -shellcheck= -ignore "softprops/action-gh-release"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.code == 'true'
|
if: needs.changes.outputs.code == 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -156,29 +143,33 @@ jobs:
|
|||||||
test/package-lock.json
|
test/package-lock.json
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
- run: npm run test:unit
|
- run: npm run test:unit
|
||||||
- uses: codecov/codecov-action@v5
|
- uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5
|
||||||
if: success()
|
if: success()
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build code-server
|
name: linux-x64
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 60
|
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
DISABLE_V8_COMPILE_CACHE: 1
|
DISABLE_V8_COMPILE_CACHE: 1
|
||||||
|
VERSION: 0.0.0
|
||||||
|
VSCODE_TARGET: linux-x64
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
- uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # latest
|
||||||
with:
|
with:
|
||||||
packages: quilt
|
packages: quilt
|
||||||
version: 1.0
|
version: 1.0
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
- run: quilt push -a
|
- run: quilt push -a
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -187,53 +178,44 @@ jobs:
|
|||||||
test/package-lock.json
|
test/package-lock.json
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# Get Code's git hash. When this changes it means the content is
|
# Get Code's git hash. When this changes it means the content is
|
||||||
# different and we need to rebuild.
|
# different and we need to rebuild.
|
||||||
- name: Get latest lib/vscode rev
|
- name: Get latest lib/vscode rev
|
||||||
id: vscode-rev
|
id: vscode-rev
|
||||||
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
|
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
|
||||||
# We need to rebuild when we have a new version of Code, when any of
|
# We need to rebuild when we have a new version of Code, when any of the
|
||||||
# the patches changed, or when the code-server version changes (since
|
# patches changed, or when the code-server version changes (since it gets
|
||||||
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
# embedded into the code). Use VSCODE_CACHE_VERSION to force a rebuild.
|
||||||
# force a rebuild.
|
- name: Fetch prebuilt linux-x64 Code package from cache
|
||||||
- name: Fetch prebuilt Code package from cache
|
|
||||||
id: cache-vscode
|
id: cache-vscode
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: lib/vscode-reh-web-*
|
path: lib/vscode-reh-web-linux-x64
|
||||||
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
key: vscode-linux-x64-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
||||||
- name: Build vscode
|
- name: Build vscode
|
||||||
env:
|
|
||||||
VERSION: "0.0.0"
|
|
||||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
pushd lib/vscode
|
pushd lib/vscode
|
||||||
npm ci
|
npm ci
|
||||||
popd
|
popd
|
||||||
npm run build:vscode
|
npm run build:vscode
|
||||||
# The release package does not contain any native modules
|
# Push up an artifact containing the linux-x64 release.
|
||||||
# and is neutral to architecture/os/libc version.
|
- run: KEEP_MODULES=1 npm run release
|
||||||
- run: npm run release
|
|
||||||
if: success()
|
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
|
||||||
- run: tar -czf package.tar.gz release
|
- run: tar -czf package.tar.gz release
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: linux-x64-package
|
||||||
path: ./package.tar.gz
|
path: ./package.tar.gz
|
||||||
|
|
||||||
test-e2e:
|
test-e2e:
|
||||||
name: Run e2e tests
|
name: Run e2e tests
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 25
|
|
||||||
needs: [changes, build]
|
needs: [changes, build]
|
||||||
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.ci == 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
- uses: actions/setup-node@v6
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@ -241,49 +223,32 @@ jobs:
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
test/package-lock.json
|
test/package-lock.json
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-package
|
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
|
||||||
- name: Install Playwright OS dependencies
|
- name: Install Playwright OS dependencies
|
||||||
run: |
|
run: |
|
||||||
./test/node_modules/.bin/playwright install-deps
|
./test/node_modules/.bin/playwright install-deps
|
||||||
./test/node_modules/.bin/playwright install
|
./test/node_modules/.bin/playwright install
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: linux-x64-package
|
||||||
|
- run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
|
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v7
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: failed-test-videos
|
name: failed-test-videos
|
||||||
path: ./test/test-results
|
path: ./test/test-results
|
||||||
- run: rm -rf ./release ./test/test-results
|
|
||||||
|
|
||||||
test-e2e-proxy:
|
test-e2e-proxy:
|
||||||
name: Run e2e tests behind proxy
|
name: Run e2e tests behind proxy
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 25
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
needs: [changes, build]
|
needs: [changes, build]
|
||||||
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.ci == 'true'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: .node-version
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-package
|
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
|
||||||
- name: Install Playwright OS dependencies
|
|
||||||
run: |
|
|
||||||
./test/node_modules/.bin/playwright install-deps
|
|
||||||
./test/node_modules/.bin/playwright install
|
|
||||||
- name: Cache Caddy
|
- name: Cache Caddy
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: caddy-cache
|
id: caddy-cache
|
||||||
@ -292,19 +257,36 @@ jobs:
|
|||||||
~/.cache/caddy
|
~/.cache/caddy
|
||||||
key: cache-caddy-2.5.2
|
key: cache-caddy-2.5.2
|
||||||
- name: Install Caddy
|
- name: Install Caddy
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
||||||
mkdir -p ~/.cache/caddy
|
mkdir -p ~/.cache/caddy
|
||||||
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: |
|
||||||
|
package-lock.json
|
||||||
|
test/package-lock.json
|
||||||
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
|
- name: Install Playwright OS dependencies
|
||||||
|
run: |
|
||||||
|
./test/node_modules/.bin/playwright install-deps
|
||||||
|
./test/node_modules/.bin/playwright install
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: linux-x64-package
|
||||||
|
- run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
- run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
- run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
||||||
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||||
if: always()
|
if: always()
|
||||||
|
- uses: actions/upload-artifact@v7
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: always()
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: failed-test-videos-proxy
|
name: failed-test-videos-proxy
|
||||||
|
|||||||
6
.github/workflows/installer.yaml
vendored
6
.github/workflows/installer.yaml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
@ -44,7 +44,7 @@ jobs:
|
|||||||
container: "alpine:3.17"
|
container: "alpine:3.17"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install curl
|
- name: Install curl
|
||||||
run: apk add curl
|
run: apk add curl
|
||||||
@ -67,7 +67,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
|
|||||||
141
.github/workflows/publish.yaml
vendored
141
.github/workflows/publish.yaml
vendored
@ -6,7 +6,6 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
@ -23,84 +22,49 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
npm:
|
npm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
env:
|
||||||
- name: Checkout code-server
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
uses: actions/checkout@v4
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
NPM_ENVIRONMENT: "production"
|
||||||
|
|
||||||
- name: Install Node.js
|
steps:
|
||||||
uses: actions/setup-node@v4
|
- name: Set version to tag without leading v
|
||||||
|
run: |
|
||||||
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
|
||||||
- name: Download npm package from release artifacts
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
||||||
uses: robinraju/release-downloader@v1.12
|
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
tag: ${{ inputs.version || github.ref_name }}
|
||||||
fileName: "package.tar.gz"
|
fileName: "package.tar.gz"
|
||||||
out-file-path: "release-npm-package"
|
out-file-path: "release-npm-package"
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
- run: tar -xzf release-npm-package/package.tar.gz
|
||||||
- name: Get and set VERSION
|
- run: |
|
||||||
run: |
|
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
pushd release
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
npm publish --tag latest --access public
|
||||||
|
|
||||||
- run: npm run publish:npm
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
NPM_ENVIRONMENT: "production"
|
|
||||||
|
|
||||||
homebrew:
|
|
||||||
needs: npm
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
# Ensure things are up to date
|
|
||||||
# Suggested by homebrew maintainers
|
|
||||||
# https://github.com/Homebrew/discussions/discussions/1532#discussioncomment-782633
|
|
||||||
- name: Set up Homebrew
|
|
||||||
id: set-up-homebrew
|
|
||||||
uses: Homebrew/actions/setup-homebrew@master
|
|
||||||
|
|
||||||
- name: Checkout code-server
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Configure git
|
|
||||||
run: |
|
|
||||||
git config --global user.name cdrci
|
|
||||||
git config --global user.email opensource@coder.com
|
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Bump code-server homebrew version
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
|
|
||||||
|
|
||||||
run: ./ci/steps/brew-bump.sh
|
|
||||||
|
|
||||||
aur:
|
aur:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# We need to checkout code-server so we can get the version
|
- name: Set version to tag without leading v
|
||||||
- name: Checkout code-server
|
run: |
|
||||||
uses: actions/checkout@v4
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
path: "./code-server"
|
|
||||||
|
|
||||||
- name: Checkout code-server-aur repo
|
- name: Checkout code-server-aur repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
repository: "cdrci/code-server-aur"
|
repository: "cdrci/code-server-aur"
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
@ -117,26 +81,14 @@ jobs:
|
|||||||
git config --global user.name cdrci
|
git config --global user.name cdrci
|
||||||
git config --global user.email opensource@coder.com
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Validate package
|
- name: Validate package
|
||||||
uses: heyhusen/archlinux-package-action@v2.4.0
|
uses: heyhusen/archlinux-package-action@c9f94059ccbebe8710d31d582f33ef4e84fe575c # v3.0.0
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
with:
|
with:
|
||||||
pkgver: ${{ env.VERSION }}
|
pkgver: ${{ env.VERSION }}
|
||||||
updpkgsums: true
|
updpkgsums: true
|
||||||
srcinfo: true
|
srcinfo: true
|
||||||
|
|
||||||
- name: Open PR
|
- name: Open PR
|
||||||
# We need to git push -u otherwise gh will prompt
|
|
||||||
# asking where to push the branch.
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: |
|
run: |
|
||||||
git checkout -b update-version-${{ env.VERSION }}
|
git checkout -b update-version-${{ env.VERSION }}
|
||||||
git add .
|
git add .
|
||||||
@ -146,53 +98,40 @@ jobs:
|
|||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code-server
|
- name: Set version to tag without leading v
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up QEMU
|
- uses: actions/checkout@v6
|
||||||
uses: docker/setup-qemu-action@v3
|
- uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
|
||||||
|
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
||||||
- name: Login to GHCR
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Download deb artifacts
|
|
||||||
uses: robinraju/release-downloader@v1.12
|
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ env.VERSION }}
|
||||||
fileName: "*.deb"
|
fileName: "*.deb"
|
||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
- uses: robinraju/release-downloader@daf26c55d821e836577a15f77d86ddc078948b05 # v1.12
|
||||||
- name: Download rpm artifacts
|
|
||||||
uses: robinraju/release-downloader@v1.12
|
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ env.VERSION }}
|
||||||
fileName: "*.rpm"
|
fileName: "*.rpm"
|
||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- name: Publish to Docker
|
- run: npm run publish:docker
|
||||||
run: ./ci/steps/docker-buildx-push.sh
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|||||||
286
.github/workflows/release.yaml
vendored
286
.github/workflows/release.yaml
vendored
@ -4,7 +4,6 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
|
||||||
type: string
|
type: string
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
@ -19,11 +18,9 @@ concurrency:
|
|||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package-linux-cross:
|
package-linux:
|
||||||
name: ${{ matrix.prefix }}
|
name: ${{ matrix.vscode_target }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
container: "python:3.8-slim-buster"
|
container: "python:3.8-slim-buster"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -32,14 +29,17 @@ jobs:
|
|||||||
npm_arch: x64
|
npm_arch: x64
|
||||||
apt_arch: amd64
|
apt_arch: amd64
|
||||||
package_arch: amd64
|
package_arch: amd64
|
||||||
|
vscode_target: linux-x64
|
||||||
- prefix: aarch64-linux-gnu
|
- prefix: aarch64-linux-gnu
|
||||||
npm_arch: arm64
|
npm_arch: arm64
|
||||||
apt_arch: arm64
|
apt_arch: arm64
|
||||||
package_arch: arm64
|
package_arch: arm64
|
||||||
|
vscode_target: linux-arm64
|
||||||
- prefix: arm-linux-gnueabihf
|
- prefix: arm-linux-gnueabihf
|
||||||
npm_arch: armv7l
|
npm_arch: armv7l
|
||||||
apt_arch: armhf
|
apt_arch: armhf
|
||||||
package_arch: armv7l
|
package_arch: armv7l
|
||||||
|
vscode_target: linux-armhf
|
||||||
|
|
||||||
env:
|
env:
|
||||||
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
||||||
@ -51,259 +51,137 @@ jobs:
|
|||||||
LD: ${{ format('{0}-ld', matrix.prefix) }}
|
LD: ${{ format('{0}-ld', matrix.prefix) }}
|
||||||
STRIP: ${{ format('{0}-strip', matrix.prefix) }}
|
STRIP: ${{ format('{0}-strip', matrix.prefix) }}
|
||||||
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
|
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
|
||||||
TARGET_ARCH: ${{ matrix.apt_arch }}
|
# Set cross-compiler package arch.
|
||||||
|
APT_ARCH: ${{ matrix.apt_arch }}
|
||||||
|
# For downloading the right Node.
|
||||||
npm_config_arch: ${{ matrix.npm_arch }}
|
npm_config_arch: ${{ matrix.npm_arch }}
|
||||||
PKG_ARCH: ${{ matrix.package_arch }}
|
# Overrides package architecture.
|
||||||
|
ARCH: ${{ matrix.package_arch }}
|
||||||
# Not building from source results in an x86_64 argon2, as if
|
# Not building from source results in an x86_64 argon2, as if
|
||||||
# npm_config_arch is being ignored.
|
# npm_config_arch is being ignored.
|
||||||
npm_config_build_from_source: true
|
npm_config_build_from_source: true
|
||||||
|
# Overrides VS Code gulp build target.
|
||||||
|
VSCODE_TARGET: ${{ matrix.vscode_target }}
|
||||||
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: .node-version
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
|
|
||||||
- name: Install cross-compiler and system dependencies
|
- name: Install cross-compiler and system dependencies
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
|
sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
|
||||||
dpkg --add-architecture $TARGET_ARCH
|
dpkg --add-architecture $APT_ARCH
|
||||||
apt update && apt install -y --no-install-recommends \
|
apt update && apt install -y --no-install-recommends \
|
||||||
crossbuild-essential-$TARGET_ARCH \
|
crossbuild-essential-$APT_ARCH \
|
||||||
libx11-dev:$TARGET_ARCH \
|
libx11-dev:$APT_ARCH \
|
||||||
libx11-xcb-dev:$TARGET_ARCH \
|
libx11-xcb-dev:$APT_ARCH \
|
||||||
libxkbfile-dev:$TARGET_ARCH \
|
libxkbfile-dev:$APT_ARCH \
|
||||||
libsecret-1-dev:$TARGET_ARCH \
|
libsecret-1-dev:$APT_ARCH \
|
||||||
libkrb5-dev:$TARGET_ARCH \
|
libkrb5-dev:$APT_ARCH \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl wget rsync gettext-base
|
curl wget rsync gettext-base quilt git
|
||||||
|
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.local/bin
|
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/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Download npm package
|
- name: Set version to tag without leading v
|
||||||
uses: actions/download-artifact@v4
|
run: |
|
||||||
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
submodules: true
|
||||||
|
- run: quilt push -a
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: |
|
||||||
|
package-lock.json
|
||||||
|
test/package-lock.json
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build
|
||||||
|
- run: npm run build:vscode
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
# Platform-agnostic NPM package.
|
||||||
- run: npm run release:standalone
|
- run: npm run release
|
||||||
|
if: ${{ matrix.vscode_target == 'linux-x64' }}
|
||||||
|
- run: tar -czf package.tar.gz release
|
||||||
|
if: ${{ matrix.vscode_target == 'linux-x64' }}
|
||||||
|
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
||||||
|
if: ${{ matrix.vscode_target == 'linux-x64' }}
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
discussion_category_name: "📣 Announcements"
|
||||||
|
files: package.tar.gz
|
||||||
|
|
||||||
|
# Platform-specific release.
|
||||||
|
- run: KEEP_MODULES=1 npm run release
|
||||||
- name: Replace node with cross-compile equivalent
|
- name: Replace node with cross-compile equivalent
|
||||||
run: |
|
run: |
|
||||||
node_version=$(node --version)
|
node_version=$(node --version)
|
||||||
wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
|
wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
|
||||||
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
|
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
|
||||||
mv ./node ./release-standalone/lib/node
|
mv ./node ./release/lib/node
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
- run: npm run package
|
||||||
- name: Get and set VERSION
|
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
||||||
run: |
|
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: npm run package $PKG_ARCH
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
|
||||||
package-macos-amd64:
|
package-macos:
|
||||||
name: x86-64 macOS build
|
name: ${{ matrix.vscode_target }}
|
||||||
runs-on: macos-13
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 15
|
strategy:
|
||||||
needs: npm-version
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: macos-15-intel
|
||||||
|
vscode_target: darwin-x64
|
||||||
|
- os: macos-latest
|
||||||
|
vscode_target: darwin-arm64
|
||||||
env:
|
env:
|
||||||
|
VSCODE_TARGET: ${{ matrix.vscode_target }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAG: ${{ inputs.version || github.ref_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
# The version of node-gyp we use depends on distutils but it was removed
|
||||||
uses: actions/checkout@v4
|
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
||||||
|
# next update Node we can probably remove this. For now, install
|
||||||
- name: Install Node.js
|
# setuptools since it contains distutils.
|
||||||
uses: actions/setup-node@v4
|
- run: brew install python-setuptools quilt
|
||||||
with:
|
|
||||||
node-version-file: .node-version
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
|
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.local/bin
|
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/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
# The version of node-gyp we use depends on distutils but it was removed
|
- name: Set version to tag without leading v
|
||||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
|
||||||
# next update Node we can probably remove this. For now, install
|
|
||||||
# setuptools since it contains distutils.
|
|
||||||
- run: brew install python-setuptools
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: npm run release:standalone
|
|
||||||
- run: npm run test:native
|
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build packages with nfpm
|
- uses: actions/checkout@v6
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: npm run package
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
with:
|
||||||
draft: true
|
submodules: true
|
||||||
discussion_category_name: "📣 Announcements"
|
- run: quilt push -a
|
||||||
files: ./release-packages/*
|
- uses: actions/setup-node@v6
|
||||||
|
|
||||||
package-macos-arm64:
|
|
||||||
name: arm64 macOS build
|
|
||||||
runs-on: macos-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
package-lock.json
|
package-lock.json
|
||||||
test/package-lock.json
|
test/package-lock.json
|
||||||
|
- run: npm ci
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
- run: npm run build
|
||||||
|
- run: npm run build:vscode
|
||||||
- name: Install nfpm
|
- run: KEEP_MODULES=1 npm run release
|
||||||
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
|
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
# The version of node-gyp we use depends on distutils but it was removed
|
|
||||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
|
||||||
# next update Node we can probably remove this. For now, install
|
|
||||||
# setuptools since it contains distutils.
|
|
||||||
- run: brew install python-setuptools
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: npm run release:standalone
|
|
||||||
- run: npm run test:native
|
- run: npm run test:native
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
- run: npm run package
|
||||||
- name: Get and set VERSION
|
- uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
|
||||||
run: |
|
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build packages with nfpm
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: npm run package
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
|
||||||
npm-package:
|
|
||||||
name: Upload npm package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
steps:
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
discussion_category_name: "📣 Announcements"
|
|
||||||
files: ./package.tar.gz
|
|
||||||
|
|
||||||
npm-version:
|
|
||||||
name: Modify package.json version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
steps:
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: dawidd6/action-download-artifact@v11
|
|
||||||
id: download
|
|
||||||
with:
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
workflow: build.yaml
|
|
||||||
workflow_conclusion: completed
|
|
||||||
name: npm-package
|
|
||||||
check_artifacts: false
|
|
||||||
if_no_artifact_found: fail
|
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Modify version
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: |
|
|
||||||
echo "Updating version in root package.json"
|
|
||||||
npm version --prefix release "$VERSION"
|
|
||||||
|
|
||||||
echo "Updating version in lib/vscode/product.json"
|
|
||||||
tmp=$(mktemp)
|
|
||||||
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
|
||||||
# Ensure it has the same permissions as before
|
|
||||||
chmod 644 release/lib/vscode/product.json
|
|
||||||
|
|
||||||
- run: tar -czf package.tar.gz release
|
|
||||||
|
|
||||||
- name: Upload npm package artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
path: ./package.tar.gz
|
|
||||||
|
|||||||
4
.github/workflows/scripts.yaml
vendored
4
.github/workflows/scripts.yaml
vendored
@ -41,7 +41,7 @@ jobs:
|
|||||||
container: "alpine:3.17"
|
container: "alpine:3.17"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install test utilities
|
- name: Install test utilities
|
||||||
run: apk add bats checkbashisms
|
run: apk add bats checkbashisms
|
||||||
@ -58,7 +58,7 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install lint utilities
|
- name: Install lint utilities
|
||||||
run: sudo apt install shellcheck
|
run: sudo apt install shellcheck
|
||||||
|
|||||||
18
.github/workflows/security.yaml
vendored
18
.github/workflows/security.yaml
vendored
@ -25,12 +25,12 @@ jobs:
|
|||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
|
||||||
@ -46,12 +46,12 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in repo mode
|
- name: Run Trivy vulnerability scanner in repo mode
|
||||||
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4
|
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478
|
||||||
with:
|
with:
|
||||||
scan-type: "fs"
|
scan-type: "fs"
|
||||||
scan-ref: "."
|
scan-ref: "."
|
||||||
@ -62,7 +62,7 @@ jobs:
|
|||||||
severity: "HIGH,CRITICAL"
|
severity: "HIGH,CRITICAL"
|
||||||
|
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v4
|
||||||
with:
|
with:
|
||||||
sarif_file: "trivy-repo-results.sarif"
|
sarif_file: "trivy-repo-results.sarif"
|
||||||
|
|
||||||
@ -76,17 +76,17 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v3
|
uses: github/codeql-action/init@v4
|
||||||
with:
|
with:
|
||||||
config-file: ./.github/codeql-config.yml
|
config-file: ./.github/codeql-config.yml
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v3
|
uses: github/codeql-action/autobuild@v4
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v3
|
uses: github/codeql-action/analyze@v4
|
||||||
|
|||||||
6
.github/workflows/trivy-docker.yaml
vendored
6
.github/workflows/trivy-docker.yaml
vendored
@ -48,10 +48,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in image mode
|
- name: Run Trivy vulnerability scanner in image mode
|
||||||
uses: aquasecurity/trivy-action@dc5a429b52fcf669ce959baa2c2dd26090d2a6c4
|
uses: aquasecurity/trivy-action@97e0b3872f55f89b95b2f65b3dbab56962816478
|
||||||
with:
|
with:
|
||||||
image-ref: "docker.io/codercom/code-server:latest"
|
image-ref: "docker.io/codercom/code-server:latest"
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
@ -60,6 +60,6 @@ jobs:
|
|||||||
severity: "HIGH,CRITICAL"
|
severity: "HIGH,CRITICAL"
|
||||||
|
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v4
|
||||||
with:
|
with:
|
||||||
sarif_file: "trivy-image-results.sarif"
|
sarif_file: "trivy-image-results.sarif"
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,8 +2,6 @@
|
|||||||
.cache
|
.cache
|
||||||
/out*/
|
/out*/
|
||||||
release/
|
release/
|
||||||
release-npm-package/
|
|
||||||
release-standalone/
|
|
||||||
release-packages/
|
release-packages/
|
||||||
release-gcp/
|
release-gcp/
|
||||||
release-images/
|
release-images/
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
22.17.0
|
22.22.1
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
lib/vscode
|
lib
|
||||||
lib/vscode-reh-web-linux-x64
|
|
||||||
release-standalone
|
|
||||||
release-packages
|
release-packages
|
||||||
release
|
release
|
||||||
helm-chart
|
helm-chart
|
||||||
|
|||||||
199
CHANGELOG.md
199
CHANGELOG.md
@ -22,6 +22,205 @@ Code v99.99.999
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## [4.112.0](https://github.com/coder/code-server/releases/tag/v4.112.0) - 2026-03-19
|
||||||
|
|
||||||
|
Code v1.112.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.112.0
|
||||||
|
|
||||||
|
## [4.111.0](https://github.com/coder/code-server/releases/tag/v4.111.0) - 2026-03-11
|
||||||
|
|
||||||
|
Code v1.111.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.111.0
|
||||||
|
- `--app-name` now affects the error page title.
|
||||||
|
|
||||||
|
## [4.110.1](https://github.com/coder/code-server/releases/tag/v4.110.1) - 2026-03-10
|
||||||
|
|
||||||
|
Code v1.110.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.110.1
|
||||||
|
|
||||||
|
## [4.110.0](https://github.com/coder/code-server/releases/tag/v4.110.0) - 2026-03-09
|
||||||
|
|
||||||
|
Code v1.110.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.110.0
|
||||||
|
|
||||||
|
## [4.109.5](https://github.com/coder/code-server/releases/tag/v4.109.5) - 2026-03-02
|
||||||
|
|
||||||
|
Code v1.109.5
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.109.5
|
||||||
|
|
||||||
|
## [4.109.2](https://github.com/coder/code-server/releases/tag/v4.109.2) - 2026-02-12
|
||||||
|
|
||||||
|
Code v1.109.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.109.2
|
||||||
|
|
||||||
|
## [4.109.0](https://github.com/coder/code-server/releases/tag/v4.109.0) - 2026-02-12
|
||||||
|
|
||||||
|
Code v1.109.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.109.0
|
||||||
|
|
||||||
|
## [4.108.2](https://github.com/coder/code-server/releases/tag/v4.108.2) - 2026-01-26
|
||||||
|
|
||||||
|
Code v1.108.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.108.2
|
||||||
|
|
||||||
|
## [4.108.1](https://github.com/coder/code-server/releases/tag/v4.108.1) - 2026-01-16
|
||||||
|
|
||||||
|
Code v1.108.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.108.1
|
||||||
|
|
||||||
|
## [4.108.0](https://github.com/coder/code-server/releases/tag/v4.108.0) - 2026-01-12
|
||||||
|
|
||||||
|
Code v1.108.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.108.0
|
||||||
|
|
||||||
|
## [4.107.1](https://github.com/coder/code-server/releases/tag/v4.107.1) - 2026-01-09
|
||||||
|
|
||||||
|
Code v1.107.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.107.1
|
||||||
|
|
||||||
|
## [4.107.0](https://github.com/coder/code-server/releases/tag/v4.107.0) - 2026-12-17
|
||||||
|
|
||||||
|
Code v1.107.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.107.0
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- New `--cookie-suffix` flag that can be used to add a suffix to the cookie when
|
||||||
|
using the built-in password authentication. You can use this to avoid
|
||||||
|
collisions with other instances of code-server.
|
||||||
|
- Support a new property `authorizationHeaderToken` on the extension gallery
|
||||||
|
configuration. This will be added to marketplace requests as a bearer token
|
||||||
|
using the `Authorization` header.
|
||||||
|
|
||||||
|
## [4.106.3](https://github.com/coder/code-server/releases/tag/v4.106.3) - 2025-12-01
|
||||||
|
|
||||||
|
Code v1.106.3
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.106.3
|
||||||
|
|
||||||
|
## [4.106.2](https://github.com/coder/code-server/releases/tag/v4.106.2) - 2025-11-19
|
||||||
|
|
||||||
|
Code v1.106.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.106.2
|
||||||
|
|
||||||
|
## [4.106.0](https://github.com/coder/code-server/releases/tag/v4.106.0) - 2025-11-19
|
||||||
|
|
||||||
|
Code v1.106.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.106.0
|
||||||
|
|
||||||
|
## [4.105.1](https://github.com/coder/code-server/releases/tag/v4.105.1) - 2025-10-20
|
||||||
|
|
||||||
|
Code v1.105.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.105.1
|
||||||
|
|
||||||
|
## [4.105.0](https://github.com/coder/code-server/releases/tag/v4.105.0) - 2025-10-17
|
||||||
|
|
||||||
|
Code v1.105.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.105.0
|
||||||
|
|
||||||
|
## [4.104.3](https://github.com/coder/code-server/releases/tag/v4.104.3) - 2025-10-07
|
||||||
|
|
||||||
|
Code v1.104.3
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.104.3.
|
||||||
|
|
||||||
|
## [4.104.2](https://github.com/coder/code-server/releases/tag/v4.104.2) - 2025-09-26
|
||||||
|
|
||||||
|
Code v1.104.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.104.2.
|
||||||
|
|
||||||
|
## [4.104.1](https://github.com/coder/code-server/releases/tag/v4.104.1) - 2025-09-19
|
||||||
|
|
||||||
|
Code v1.104.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.104.1.
|
||||||
|
|
||||||
|
## [4.104.0](https://github.com/coder/code-server/releases/tag/v4.104.0) - 2025-09-15
|
||||||
|
|
||||||
|
Code v1.104.0
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix "extension not found" errors from Open VSX when trying to install the
|
||||||
|
latest version of an extension.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.104.0.
|
||||||
|
|
||||||
|
## [4.103.2](https://github.com/coder/code-server/releases/tag/v4.103.2) - 2025-08-25
|
||||||
|
|
||||||
|
Code v1.103.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.103.2.
|
||||||
|
|
||||||
|
## [4.103.1](https://github.com/coder/code-server/releases/tag/v4.103.1) - 2025-08-15
|
||||||
|
|
||||||
|
Code v1.103.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.103.1.
|
||||||
|
|
||||||
## [4.103.0](https://github.com/coder/code-server/releases/tag/v4.103.0) - 2025-08-12
|
## [4.103.0](https://github.com/coder/code-server/releases/tag/v4.103.0) - 2025-08-12
|
||||||
|
|
||||||
Code v1.103.0
|
Code v1.103.0
|
||||||
|
|||||||
112
ci/README.md
112
ci/README.md
@ -1,112 +0,0 @@
|
|||||||
# ci
|
|
||||||
|
|
||||||
This directory contains scripts used for code-server's continuous integration infrastructure.
|
|
||||||
|
|
||||||
Some of these scripts contain more detailed documentation and options
|
|
||||||
in header comments.
|
|
||||||
|
|
||||||
Any file or directory in this subdirectory should be documented here.
|
|
||||||
|
|
||||||
- [./ci/lib.sh](./lib.sh)
|
|
||||||
- Contains code duplicated across these scripts.
|
|
||||||
|
|
||||||
## dev
|
|
||||||
|
|
||||||
This directory contains scripts used for the development of code-server.
|
|
||||||
|
|
||||||
- [./ci/dev/image](./dev/image)
|
|
||||||
- See [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md) for docs on the development container.
|
|
||||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`npm run fmt`)
|
|
||||||
- Runs formatters.
|
|
||||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`npm run lint`)
|
|
||||||
- Runs linters.
|
|
||||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`npm run test:unit`)
|
|
||||||
- Runs unit tests.
|
|
||||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`npm run test:e2e`)
|
|
||||||
- Runs end-to-end tests.
|
|
||||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`npm run watch`)
|
|
||||||
- Starts a process to build and launch code-server and restart on any code changes.
|
|
||||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
|
||||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`npm run icons`)
|
|
||||||
- Generates the various icons from a single `.svg` favicon in
|
|
||||||
`src/browser/media/favicon.svg`.
|
|
||||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
|
||||||
|
|
||||||
## build
|
|
||||||
|
|
||||||
This directory contains the scripts used to build and release code-server.
|
|
||||||
You can disable minification by setting `MINIFY=`.
|
|
||||||
|
|
||||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`npm run build`)
|
|
||||||
- Builds code-server into `./out` and bundles the frontend into `./dist`.
|
|
||||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`npm run build:vscode`)
|
|
||||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
|
||||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`npm run release`)
|
|
||||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
|
||||||
- [./ci/build/clean.sh](./build/clean.sh) (`npm run clean`)
|
|
||||||
- Removes all build artifacts.
|
|
||||||
- Useful to do a clean build.
|
|
||||||
- [./ci/build/code-server.sh](./build/code-server.sh)
|
|
||||||
- Copied into standalone releases to run code-server with the bundled node binary.
|
|
||||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`npm run test:standalone-release`)
|
|
||||||
- Ensures code-server in the `./release-standalone` directory works by installing an extension.
|
|
||||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`npm run package`)
|
|
||||||
- Packages `./release-standalone` into a `.tar.gz` archive in `./release-packages`.
|
|
||||||
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
|
||||||
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
|
||||||
- Used to configure [nfpm](https://github.com/goreleaser/nfpm) to generate `.deb` and `.rpm`.
|
|
||||||
- [./ci/build/code-server-nfpm.sh](./build/code-server-nfpm.sh)
|
|
||||||
- Entrypoint script for code-server for `.deb` and `.rpm`.
|
|
||||||
- [./ci/build/code-server.service](./build/code-server.service)
|
|
||||||
- systemd user service packaged into the `.deb` and `.rpm`.
|
|
||||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`npm run release:github-draft`)
|
|
||||||
- Uses [gh](https://github.com/cli/cli) to create a draft release with a template description.
|
|
||||||
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`npm run release:github-assets`)
|
|
||||||
- Downloads the release-package artifacts for the current commit from CI.
|
|
||||||
- Uses [gh](https://github.com/cli/cli) to upload the artifacts to the release
|
|
||||||
specified in `package.json`.
|
|
||||||
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
|
||||||
- Post install script for the npm package.
|
|
||||||
- Bundled by`npm run release`.
|
|
||||||
|
|
||||||
## release-image
|
|
||||||
|
|
||||||
This directory contains the release docker container image.
|
|
||||||
|
|
||||||
- [./ci/steps/build-docker-buildx-push.sh](./steps/docker-buildx-push.sh)
|
|
||||||
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx` and pushes them.
|
|
||||||
- Assumes debian releases are ready in `./release-packages`.
|
|
||||||
|
|
||||||
## images
|
|
||||||
|
|
||||||
This directory contains the images for CI.
|
|
||||||
|
|
||||||
## steps
|
|
||||||
|
|
||||||
This directory contains the scripts used in CI.
|
|
||||||
Helps avoid clobbering the CI configuration.
|
|
||||||
|
|
||||||
- [./steps/fmt.sh](./steps/fmt.sh)
|
|
||||||
- Runs `npm run fmt`.
|
|
||||||
- [./steps/lint.sh](./steps/lint.sh)
|
|
||||||
- Runs `npm run lint`.
|
|
||||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
|
||||||
- Runs `npm run test:unit`.
|
|
||||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
|
||||||
- Runs `npm run test:integration`.
|
|
||||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
|
||||||
- Runs `npm run test:e2e`.
|
|
||||||
- [./steps/release.sh](./steps/release.sh)
|
|
||||||
- Runs the release process.
|
|
||||||
- Generates the npm package at `./release`.
|
|
||||||
- [./steps/release-packages.sh](./steps/release-packages.sh)
|
|
||||||
- Takes the output of the previous script and generates a standalone release and
|
|
||||||
release packages into `./release-packages`.
|
|
||||||
- [./steps/publish-npm.sh](./steps/publish-npm.sh)
|
|
||||||
- Grabs the `npm-package` release artifact for the current commit and publishes it on npm.
|
|
||||||
- [./steps/docker-buildx-push.sh](./steps/docker-buildx-push.sh)
|
|
||||||
- Builds the docker image and then pushes it.
|
|
||||||
- [./steps/push-docker-manifest.sh](./steps/push-docker-manifest.sh)
|
|
||||||
- Loads all images in `./release-images` and then builds and pushes a multi architecture
|
|
||||||
docker manifest for the amd64 and arm64 images to `codercom/code-server:$VERSION` and
|
|
||||||
`codercom/code-server:latest`.
|
|
||||||
@ -1,21 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Given a platform-specific release found in ./release-standalone, generate an
|
# Given a release found in $RELEASE_PATH, generate a deb, rpm, and tarball each
|
||||||
# compressed archives and bundles (as appropriate for the platform) named after
|
# named after $ARCH (derived from uname -m but can be overridden for
|
||||||
# the platform's architecture and OS and place them in ./release-packages and
|
# cross-compilation) and $OS (derived from uname and cannot be overridden) and
|
||||||
# ./release-gcp.
|
# place them in ./release-packages and ./release-gcp.
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
source ./ci/lib.sh
|
source ./ci/lib.sh
|
||||||
source ./ci/build/build-lib.sh
|
source ./ci/build/build-lib.sh
|
||||||
|
|
||||||
# Allow us to override architecture
|
VERSION=$(jq -r .version "$RELEASE_PATH/package.json")
|
||||||
# we use this for our Linux ARM64 cross compile builds
|
export VERSION # for nfpm to use
|
||||||
if [ "$#" -eq 1 ] && [ "$1" ]; then
|
|
||||||
ARCH=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p release-packages
|
mkdir -p release-packages
|
||||||
|
|
||||||
@ -29,9 +26,9 @@ main() {
|
|||||||
release_archive() {
|
release_archive() {
|
||||||
local release_name="code-server-$VERSION-$OS-$ARCH"
|
local release_name="code-server-$VERSION-$OS-$ARCH"
|
||||||
if [[ $OS == "linux" ]]; then
|
if [[ $OS == "linux" ]]; then
|
||||||
tar -czf "release-packages/$release_name.tar.gz" --owner=0 --group=0 --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
|
tar -czf "release-packages/$release_name.tar.gz" --owner=0 --group=0 --transform "s/^\.\/$RELEASE_PATH/$release_name/" "$RELEASE_PATH"
|
||||||
else
|
else
|
||||||
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-standalone/$release_name/" release-standalone
|
tar -czf "release-packages/$release_name.tar.gz" -s "/^$RELEASE_PATH/$release_name/" "$RELEASE_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "done (release-packages/$release_name)"
|
echo "done (release-packages/$release_name)"
|
||||||
@ -52,15 +49,13 @@ release_nfpm() {
|
|||||||
|
|
||||||
export NFPM_ARCH
|
export NFPM_ARCH
|
||||||
|
|
||||||
PKG_FORMAT="deb"
|
NFPM_ARCH="$(get_nfpm_arch deb "$ARCH")"
|
||||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
|
||||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||||
echo "Building deb"
|
echo "Building deb"
|
||||||
echo "$nfpm_config" | head --lines=4
|
echo "$nfpm_config" | head --lines=4
|
||||||
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${NFPM_ARCH}.deb"
|
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${NFPM_ARCH}.deb"
|
||||||
|
|
||||||
PKG_FORMAT="rpm"
|
NFPM_ARCH="$(get_nfpm_arch rpm "$ARCH")"
|
||||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
|
||||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||||
echo "Building rpm"
|
echo "Building rpm"
|
||||||
echo "$nfpm_config" | head --lines=4
|
echo "$nfpm_config" | head --lines=4
|
||||||
|
|||||||
@ -4,13 +4,16 @@ set -euo pipefail
|
|||||||
# Once both code-server and VS Code have been built, use this script to copy
|
# Once both code-server and VS Code have been built, use this script to copy
|
||||||
# them into a single directory (./release), prepare the package.json and
|
# them into a single directory (./release), prepare the package.json and
|
||||||
# product.json, and add shrinkwraps. This results in a generic NPM package that
|
# product.json, and add shrinkwraps. This results in a generic NPM package that
|
||||||
# we published to NPM and also use to compile platform-specific packages.
|
# we can publish to NPM.
|
||||||
|
|
||||||
# MINIFY controls whether minified VS Code is bundled. It must match the value
|
# MINIFY controls whether minified VS Code is bundled. It must match the value
|
||||||
# used when VS Code was built.
|
# used when VS Code was built.
|
||||||
MINIFY="${MINIFY-true}"
|
MINIFY="${MINIFY-true}"
|
||||||
|
|
||||||
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
||||||
|
# Note these modules will be for the platform that built them, making the result
|
||||||
|
# no longer generic (it can still be published though as the modules will be
|
||||||
|
# ignored when pushing).
|
||||||
KEEP_MODULES="${KEEP_MODULES-0}"
|
KEEP_MODULES="${KEEP_MODULES-0}"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
@ -31,6 +34,30 @@ main() {
|
|||||||
rsync ./docs/README.md "$RELEASE_PATH"
|
rsync ./docs/README.md "$RELEASE_PATH"
|
||||||
rsync LICENSE "$RELEASE_PATH"
|
rsync LICENSE "$RELEASE_PATH"
|
||||||
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
|
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
|
||||||
|
|
||||||
|
if [ "$KEEP_MODULES" = 1 ]; then
|
||||||
|
# Copy Node. Package managers may shim their own "node" wrapper into the
|
||||||
|
# PATH, so run node and ask it for its true path.
|
||||||
|
local node_path
|
||||||
|
node_path="$(node -p process.execPath)"
|
||||||
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
||||||
|
chmod 755 "$RELEASE_PATH/lib/node"
|
||||||
|
|
||||||
|
# Copy the code-server launcher.
|
||||||
|
mkdir -p "$RELEASE_PATH/bin"
|
||||||
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
||||||
|
chmod 755 "$RELEASE_PATH/bin/code-server"
|
||||||
|
|
||||||
|
# Delete the extra bin scripts.
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code-darwin.sh"
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code-linux.sh"
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser-darwin.sh"
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser-linux.sh"
|
||||||
|
if [ "$OS" != windows ] ; then
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/remote-cli/code.cmd"
|
||||||
|
rm "$RELEASE_PATH/lib/vscode/bin/helpers/browser.cmd"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle_code_server() {
|
bundle_code_server() {
|
||||||
@ -48,6 +75,7 @@ bundle_code_server() {
|
|||||||
jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
{
|
{
|
||||||
|
"version": "$(jq -r .codeServerVersion "./lib/vscode-reh-web-$VSCODE_TARGET/product.json")",
|
||||||
"commit": "$(git rev-parse HEAD)",
|
"commit": "$(git rev-parse HEAD)",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "sh ./postinstall.sh"
|
"postinstall": "sh ./postinstall.sh"
|
||||||
@ -85,7 +113,7 @@ bundle_vscode() {
|
|||||||
rsync_opts+=(--exclude node_modules)
|
rsync_opts+=(--exclude node_modules)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
rsync "${rsync_opts[@]}" "./lib/vscode-reh-web-$VSCODE_TARGET/" "$VSCODE_OUT_PATH"
|
||||||
|
|
||||||
# Merge the package.json for the web/remote server so we can include
|
# Merge the package.json for the web/remote server so we can include
|
||||||
# dependencies, since we want to ship this via NPM.
|
# dependencies, since we want to ship this via NPM.
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Once we have an NPM package, use this script to copy it to a separate
|
|
||||||
# directory (./release-standalone) and install the dependencies. This new
|
|
||||||
# directory can then be packaged as a platform-specific release.
|
|
||||||
|
|
||||||
main() {
|
|
||||||
cd "$(dirname "${0}")/../.."
|
|
||||||
|
|
||||||
source ./ci/lib.sh
|
|
||||||
|
|
||||||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
|
||||||
RELEASE_PATH+=-standalone
|
|
||||||
|
|
||||||
# Package managers may shim their own "node" wrapper into the PATH, so run
|
|
||||||
# node and ask it for its true path.
|
|
||||||
local node_path
|
|
||||||
node_path="$(node -p process.execPath)"
|
|
||||||
|
|
||||||
mkdir -p "$RELEASE_PATH/bin"
|
|
||||||
mkdir -p "$RELEASE_PATH/lib"
|
|
||||||
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
|
||||||
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
|
||||||
|
|
||||||
chmod 755 "$RELEASE_PATH/lib/node"
|
|
||||||
|
|
||||||
pushd "$RELEASE_PATH"
|
|
||||||
npm install --unsafe-perm --omit=dev
|
|
||||||
# Code deletes some files from the extension node_modules directory which
|
|
||||||
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
|
||||||
# on these broken symlinks so clean them up.
|
|
||||||
rm -fr "./lib/vscode/extensions/node_modules/.bin"
|
|
||||||
popd
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@ -6,33 +6,32 @@ set -euo pipefail
|
|||||||
# MINIFY controls whether a minified version of vscode is built.
|
# MINIFY controls whether a minified version of vscode is built.
|
||||||
MINIFY=${MINIFY-true}
|
MINIFY=${MINIFY-true}
|
||||||
|
|
||||||
delete-bin-script() {
|
fix-bin-script() {
|
||||||
rm -f "lib/vscode-reh-web-linux-x64/bin/$1"
|
local script="lib/vscode-reh-web-$VSCODE_TARGET/bin/$1"
|
||||||
}
|
sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$script"
|
||||||
|
sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$script"
|
||||||
copy-bin-script() {
|
sed -i.bak "s/@@APPNAME@@/code-server/g" "$script"
|
||||||
local script="$1"
|
|
||||||
local dest="lib/vscode-reh-web-linux-x64/bin/$script"
|
|
||||||
cp "lib/vscode/resources/server/bin/$script" "$dest"
|
|
||||||
sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$dest"
|
|
||||||
sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$dest"
|
|
||||||
sed -i.bak "s/@@APPNAME@@/code-server/g" "$dest"
|
|
||||||
|
|
||||||
# Fix Node path on Darwin and Linux.
|
# Fix Node path on Darwin and Linux.
|
||||||
# We do not want expansion here; this text should make it to the file as-is.
|
# We do not want expansion here; this text should make it to the file as-is.
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest"
|
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$script"
|
||||||
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest"
|
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$script"
|
||||||
# We do not want expansion here; this text should make it to the file as-is.
|
# We do not want expansion here; this text should make it to the file as-is.
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest"
|
sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$script"
|
||||||
|
|
||||||
# Fix Node path on Windows.
|
# Fix Node path on Windows.
|
||||||
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest"
|
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$script"
|
||||||
sed -i.bak 's/%ROOT_DIR%\\out/%VSROOT_DIR%\\out/g' "$dest"
|
sed -i.bak 's/%ROOT_DIR%\\out/%VSROOT_DIR%\\out/g' "$script"
|
||||||
|
|
||||||
chmod +x "$dest"
|
chmod +x "$script"
|
||||||
rm "$dest.bak"
|
rm "$script.bak"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy-bin-script() {
|
||||||
|
cp "lib/vscode/resources/server/bin/$1" "lib/vscode-reh-web-$VSCODE_TARGET/bin/$1"
|
||||||
|
fix-bin-script "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
@ -108,13 +107,8 @@ main() {
|
|||||||
EOF
|
EOF
|
||||||
) > product.json
|
) > product.json
|
||||||
|
|
||||||
# Any platform here works since we will do our own packaging. We have to do
|
npm run gulp core-ci
|
||||||
# this because we have an NPM package that could be installed on any platform.
|
npm run gulp "vscode-reh-web-$VSCODE_TARGET${MINIFY:+-min}-ci"
|
||||||
# The correct platform dependencies and scripts will be installed as part of
|
|
||||||
# the post-install during `npm install` or when building a standalone release.
|
|
||||||
node --max-old-space-size=16384 --optimize-for-size \
|
|
||||||
./node_modules/gulp/bin/gulp.js \
|
|
||||||
"vscode-reh-web-linux-x64${MINIFY:+-min}"
|
|
||||||
|
|
||||||
# Reset so if you develop after building you will not be stuck with the wrong
|
# 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
|
# commit (the dev client will use `oss-dev` but the dev server will still use
|
||||||
@ -123,7 +117,7 @@ EOF
|
|||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd lib/vscode-reh-web-linux-x64
|
pushd "lib/vscode-reh-web-$VSCODE_TARGET"
|
||||||
# Make sure Code took the version we set in the environment variable. Not
|
# Make sure Code took the version we set in the environment variable. Not
|
||||||
# having a version will break display languages.
|
# having a version will break display languages.
|
||||||
if ! jq -e .commit product.json; then
|
if ! jq -e .commit product.json; then
|
||||||
@ -132,15 +126,28 @@ EOF
|
|||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
# Set vars and fix paths.
|
||||||
|
case $OS in
|
||||||
|
windows)
|
||||||
|
fix-bin-script remote-cli/code.cmd
|
||||||
|
fix-bin-script helpers/browser.cmd
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fix-bin-script remote-cli/code-server
|
||||||
|
fix-bin-script helpers/browser.sh
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Include bin scripts for other platforms so we can use the right one in the
|
||||||
|
# NPM post-install.
|
||||||
|
|
||||||
# These provide a `code-server` command in the integrated terminal to open
|
# These provide a `code-server` command in the integrated terminal to open
|
||||||
# files in the current instance.
|
# files in the current instance.
|
||||||
delete-bin-script remote-cli/code-server
|
|
||||||
copy-bin-script remote-cli/code-darwin.sh
|
copy-bin-script remote-cli/code-darwin.sh
|
||||||
copy-bin-script remote-cli/code-linux.sh
|
copy-bin-script remote-cli/code-linux.sh
|
||||||
copy-bin-script remote-cli/code.cmd
|
copy-bin-script remote-cli/code.cmd
|
||||||
|
|
||||||
# These provide a way for terminal applications to open browser windows.
|
# These provide a way for terminal applications to open browser windows.
|
||||||
delete-bin-script helpers/browser.sh
|
|
||||||
copy-bin-script helpers/browser-darwin.sh
|
copy-bin-script helpers/browser-darwin.sh
|
||||||
copy-bin-script helpers/browser-linux.sh
|
copy-bin-script helpers/browser-linux.sh
|
||||||
copy-bin-script helpers/browser.cmd
|
copy-bin-script helpers/browser.cmd
|
||||||
|
|||||||
@ -21,5 +21,5 @@ contents:
|
|||||||
- src: ./ci/build/code-server-user.service
|
- src: ./ci/build/code-server-user.service
|
||||||
dst: /usr/lib/systemd/user/code-server.service
|
dst: /usr/lib/systemd/user/code-server.service
|
||||||
|
|
||||||
- src: ./release-standalone/*
|
- src: ./release/*
|
||||||
dst: /usr/lib/code-server
|
dst: /usr/lib/code-server
|
||||||
|
|||||||
@ -23,17 +23,6 @@ symlink() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# VS Code bundles some modules into an asar which is an archive format that
|
|
||||||
# works like tar. It then seems to get unpacked into node_modules.asar.
|
|
||||||
#
|
|
||||||
# I don't know why they do this but all the dependencies they bundle already
|
|
||||||
# exist in node_modules so just symlink it. We have to do this since not only
|
|
||||||
# Code itself but also extensions will look specifically in this directory for
|
|
||||||
# files (like the ripgrep binary or the oniguruma wasm).
|
|
||||||
symlink_asar() {
|
|
||||||
symlink node_modules node_modules.asar
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make a symlink at bin/$1/$3 pointing to the platform-specific version of the
|
# Make a symlink at bin/$1/$3 pointing to the platform-specific version of the
|
||||||
# script in $2. The extension of the link will be .cmd for Windows otherwise it
|
# script in $2. The extension of the link will be .cmd for Windows otherwise it
|
||||||
# will be whatever is in $4 (or no extension if $4 is not set).
|
# will be whatever is in $4 (or no extension if $4 is not set).
|
||||||
@ -145,7 +134,6 @@ vscode_install() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
symlink_asar
|
|
||||||
symlink_bin_script remote-cli code code-server
|
symlink_bin_script remote-cli code code-server
|
||||||
symlink_bin_script helpers browser browser .sh
|
symlink_bin_script helpers browser browser .sh
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
echo >&2 " You can build the release with 'KEEP_MODULES=1 npm run release'"
|
||||||
echo >&2 " Or you can pass in a custom path."
|
echo >&2 " Or you can pass in a custom path."
|
||||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||||
# will look for release-standalone in the current directory.
|
# will look for $RELEASE_PATH in the current directory.
|
||||||
#
|
#
|
||||||
# This is to make sure we don't have Node version errors or any other
|
# This is to make sure we don't have Node version errors or any other
|
||||||
# compilation-related errors.
|
# compilation-related errors.
|
||||||
@ -17,7 +17,7 @@ main() {
|
|||||||
|
|
||||||
source ./ci/lib.sh
|
source ./ci/lib.sh
|
||||||
|
|
||||||
local path="$RELEASE_PATH-standalone/bin/code-server"
|
local path="$RELEASE_PATH/bin/code-server"
|
||||||
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
||||||
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2,13 +2,13 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
echo >&2 " You can build the release with 'KEEP_MODULES=1 npm run release'"
|
||||||
echo >&2 " Or you can pass in a custom path."
|
echo >&2 " Or you can pass in a custom path."
|
||||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||||
# will look for release-standalone in the current directory.
|
# will look for $RELEASE_PATH in the current directory.
|
||||||
#
|
#
|
||||||
# This is to make sure we don't have Node version errors or any other
|
# This is to make sure we don't have Node version errors or any other
|
||||||
# compilation-related errors.
|
# compilation-related errors.
|
||||||
@ -17,7 +17,7 @@ main() {
|
|||||||
|
|
||||||
source ./ci/lib.sh
|
source ./ci/lib.sh
|
||||||
|
|
||||||
local path="$RELEASE_PATH-standalone/bin/code-server"
|
local path="$RELEASE_PATH/bin/code-server"
|
||||||
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
||||||
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
||||||
else
|
else
|
||||||
|
|||||||
@ -15,9 +15,9 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 3.30.0
|
version: 3.33.0
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 4.103.0
|
appVersion: 4.109.5
|
||||||
|
|||||||
@ -3,23 +3,21 @@ kind: Deployment
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ include "code-server.fullname" . }}
|
name: {{ include "code-server.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
{{- if .Values.annotations }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
annotations: {{- toYaml .Values.annotations | nindent 4 }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.replicaCount | default 1 }}
|
replicas: {{ .Values.replicaCount | default 1 }}
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.selectorLabels" . | nindent 6 }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.selectorLabels" . | nindent 8 }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- if .Values.podAnnotations }}
|
{{- if .Values.podAnnotations }}
|
||||||
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@ -125,14 +123,18 @@ spec:
|
|||||||
containerPort: {{ .port }}
|
containerPort: {{ .port }}
|
||||||
protocol: {{ .protocol }}
|
protocol: {{ .protocol }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if ne .Values.livenessProbe.enabled false }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /healthz
|
||||||
port: http
|
port: http
|
||||||
|
{{- end }}
|
||||||
|
{{- if ne .Values.readinessProbe.enabled false }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /healthz
|
||||||
port: http
|
port: http
|
||||||
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
|
|||||||
@ -9,10 +9,7 @@ metadata:
|
|||||||
{{ toYaml . | indent 4 }}
|
{{ toYaml . | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- {{ .Values.persistence.accessMode | quote }}
|
- {{ .Values.persistence.accessMode | quote }}
|
||||||
|
|||||||
@ -6,10 +6,7 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
"helm.sh/hook": "pre-install"
|
"helm.sh/hook": "pre-install"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
{{- if .Values.password }}
|
{{- if .Values.password }}
|
||||||
|
|||||||
@ -3,10 +3,7 @@ kind: Service
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ include "code-server.fullname" . }}
|
name: {{ include "code-server.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
type: {{ .Values.service.type }}
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@ -3,9 +3,6 @@ apiVersion: v1
|
|||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
name: {{ template "code-server.serviceAccountName" . }}
|
name: {{ template "code-server.serviceAccountName" . }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@ -3,16 +3,13 @@ kind: Pod
|
|||||||
metadata:
|
metadata:
|
||||||
name: "{{ include "code-server.fullname" . }}-test-connection"
|
name: "{{ include "code-server.fullname" . }}-test-connection"
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
{{- include "code-server.labels" . | nindent 4 }}
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
||||||
annotations:
|
annotations:
|
||||||
"helm.sh/hook": test-success
|
"helm.sh/hook": test
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: wget
|
- name: wget
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ['wget']
|
command: ['wget']
|
||||||
args: ['{{ include "code-server.fullname" . }}:{{ .Values.service.port }}']
|
args: ['{{ include "code-server.fullname" . }}:{{ .Values.service.port }}/healthz']
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.103.0'
|
tag: '4.109.5'
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|
||||||
# Specifies one or more secrets to be used when pulling images from a
|
# Specifies one or more secrets to be used when pulling images from a
|
||||||
@ -31,6 +31,9 @@ serviceAccount:
|
|||||||
# If not set and create is true, a name is generated using the fullname template
|
# If not set and create is true, a name is generated using the fullname template
|
||||||
name: ""
|
name: ""
|
||||||
|
|
||||||
|
# Specifies annotations for deployment
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
||||||
podSecurityContext: {}
|
podSecurityContext: {}
|
||||||
@ -108,6 +111,12 @@ resources: {}
|
|||||||
# cpu: 100m
|
# cpu: 100m
|
||||||
# memory: 1000Mi
|
# memory: 1000Mi
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
enabled: true
|
||||||
|
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
tolerations: []
|
tolerations: []
|
||||||
|
|||||||
41
ci/lib.sh
41
ci/lib.sh
@ -44,11 +44,42 @@ rsync() {
|
|||||||
command rsync -a --del "$@"
|
command rsync -a --del "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
ARCH="$(arch)"
|
if [[ ! ${ARCH-} ]]; then
|
||||||
export ARCH
|
ARCH=$(arch)
|
||||||
OS=$(os)
|
export ARCH
|
||||||
export OS
|
fi
|
||||||
|
|
||||||
|
if [[ ! ${OS-} ]]; then
|
||||||
|
OS=$(os)
|
||||||
|
export OS
|
||||||
|
fi
|
||||||
|
|
||||||
# RELEASE_PATH is the destination directory for the release from the root.
|
# RELEASE_PATH is the destination directory for the release from the root.
|
||||||
# Defaults to release
|
# Defaults to release
|
||||||
RELEASE_PATH="${RELEASE_PATH-release}"
|
if [[ ! ${RELEASE_PATH-} ]]; then
|
||||||
|
RELEASE_PATH="release"
|
||||||
|
export RELEASE_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
nodeOS() {
|
||||||
|
osname=$OS
|
||||||
|
case $osname in
|
||||||
|
macos) osname=darwin ;;
|
||||||
|
windows) osname=win32 ;;
|
||||||
|
esac
|
||||||
|
echo "$osname"
|
||||||
|
}
|
||||||
|
|
||||||
|
nodeArch() {
|
||||||
|
cpu=$ARCH
|
||||||
|
case $cpu in
|
||||||
|
amd64) cpu=x64 ;;
|
||||||
|
esac
|
||||||
|
echo "$cpu"
|
||||||
|
}
|
||||||
|
|
||||||
|
# See gulpfile.reh.ts for available targets.
|
||||||
|
if [[ ! ${VSCODE_TARGET-} ]]; then
|
||||||
|
VSCODE_TARGET="$(nodeOS)-$(nodeArch)"
|
||||||
|
export VSCODE_TARGET
|
||||||
|
fi
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:experimental
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
ARG BASE=debian:12
|
ARG BASE=debian:13
|
||||||
FROM scratch AS packages
|
FROM scratch AS packages
|
||||||
COPY release-packages/code-server*.deb /tmp/
|
COPY release-packages/code-server*.deb /tmp/
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ variable "GITHUB_REGISTRY" {
|
|||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = [
|
targets = [
|
||||||
|
"code-server-debian-13",
|
||||||
"code-server-debian-12",
|
"code-server-debian-12",
|
||||||
"code-server-ubuntu-focal",
|
"code-server-ubuntu-focal",
|
||||||
"code-server-ubuntu-noble",
|
"code-server-ubuntu-noble",
|
||||||
@ -48,13 +49,24 @@ function "gen_tags_for_docker_and_ghcr" {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
target "code-server-debian-12" {
|
target "code-server-debian-13" {
|
||||||
dockerfile = "ci/release-image/Dockerfile"
|
dockerfile = "ci/release-image/Dockerfile"
|
||||||
tags = concat(
|
tags = concat(
|
||||||
gen_tags_for_docker_and_ghcr(""),
|
gen_tags_for_docker_and_ghcr(""),
|
||||||
gen_tags_for_docker_and_ghcr("debian"),
|
gen_tags_for_docker_and_ghcr("debian"),
|
||||||
|
gen_tags_for_docker_and_ghcr("trixie"),
|
||||||
|
)
|
||||||
|
platforms = ["linux/amd64", "linux/arm64"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "code-server-debian-12" {
|
||||||
|
dockerfile = "ci/release-image/Dockerfile"
|
||||||
|
tags = concat(
|
||||||
gen_tags_for_docker_and_ghcr("bookworm"),
|
gen_tags_for_docker_and_ghcr("bookworm"),
|
||||||
)
|
)
|
||||||
|
args = {
|
||||||
|
BASE = "debian:12"
|
||||||
|
}
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
platforms = ["linux/amd64", "linux/arm64"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
main() {
|
|
||||||
# Only sourcing this so we get access to $VERSION
|
|
||||||
source ./ci/lib.sh
|
|
||||||
source ./ci/steps/steps-lib.sh
|
|
||||||
|
|
||||||
echo "Checking environment variables"
|
|
||||||
|
|
||||||
# We need VERSION to bump the brew formula
|
|
||||||
if ! is_env_var_set "VERSION"; then
|
|
||||||
echo "VERSION is not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We need HOMEBREW_GITHUB_API_TOKEN to push up commits
|
|
||||||
if ! is_env_var_set "HOMEBREW_GITHUB_API_TOKEN"; then
|
|
||||||
echo "HOMEBREW_GITHUB_API_TOKEN is not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Find the docs for bump-formula-pr here
|
|
||||||
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
|
|
||||||
local output
|
|
||||||
if ! output=$(brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit --message="PR opened by @${GITHUB_ACTOR}" 2>&1); then
|
|
||||||
if [[ $output == *"Duplicate PRs should not be opened"* ]]; then
|
|
||||||
echo "$VERSION is already submitted"
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo "$output"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@ -1,149 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
main() {
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
source ./ci/lib.sh
|
|
||||||
source ./ci/steps/steps-lib.sh
|
|
||||||
|
|
||||||
## Authentication tokens
|
|
||||||
# Needed to publish on NPM
|
|
||||||
if ! is_env_var_set "NPM_TOKEN"; then
|
|
||||||
echo "NPM_TOKEN is not set. Cannot publish to npm without credentials."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Publishing Information
|
|
||||||
# All the variables below are used to determine how we should publish
|
|
||||||
# the npm package. We also use this information for bumping the version.
|
|
||||||
# This is because npm won't publish your package unless it's a new version.
|
|
||||||
# i.e. for development, we bump the version to <current version>-<pr number>-<commit sha>
|
|
||||||
# example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
|
||||||
# We use this to grab the PR_NUMBER
|
|
||||||
if ! is_env_var_set "GITHUB_REF"; then
|
|
||||||
echo "GITHUB_REF is not set. Are you running this locally? We rely on values provided by GitHub."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We use this when setting NPM_VERSION
|
|
||||||
if ! is_env_var_set "GITHUB_SHA"; then
|
|
||||||
echo "GITHUB_SHA is not set. Are you running this locally? We rely on values provided by GitHub."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We use this to determine the NPM_ENVIRONMENT
|
|
||||||
if ! is_env_var_set "GITHUB_EVENT_NAME"; then
|
|
||||||
echo "GITHUB_EVENT_NAME is not set. Are you running this locally? We rely on values provided by GitHub."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check that we're using at least v7 of npm CLI
|
|
||||||
if ! command -v jq &> /dev/null; then
|
|
||||||
echo "Couldn't find jq"
|
|
||||||
echo "We need this in order to modify the package.json for dev builds."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This allows us to publish to npm in CI workflows
|
|
||||||
if [[ ${CI-} ]]; then
|
|
||||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Environment
|
|
||||||
# This string is used to determine how we should tag the npm release.
|
|
||||||
# Environment can be one of three choices:
|
|
||||||
# "development" - this means we tag with the PR number, allowing
|
|
||||||
# a developer to install this version with `npm install code-server@<pr-number>`
|
|
||||||
# "staging" - this means we tag with `beta`, allowing
|
|
||||||
# a developer to install this version with `npm install code-server@beta`
|
|
||||||
# "production" - this means we tag with `latest` (default), allowing
|
|
||||||
# a developer to install this version with `npm install code-server@latest`
|
|
||||||
if ! is_env_var_set "NPM_ENVIRONMENT"; then
|
|
||||||
echo "NPM_ENVIRONMENT is not set."
|
|
||||||
echo "Determining in script based on GITHUB environment variables."
|
|
||||||
|
|
||||||
if [[ "$GITHUB_EVENT_NAME" == 'push' && "$GITHUB_REF" == 'refs/heads/main' ]]; then
|
|
||||||
NPM_ENVIRONMENT="staging"
|
|
||||||
else
|
|
||||||
NPM_ENVIRONMENT="development"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
# NOTE@jsjoeio - this script assumes we have the artifact downloaded on disk
|
|
||||||
# That happens in CI as a step before we run this.
|
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
|
||||||
tar -xzf release-npm-package/package.tar.gz
|
|
||||||
|
|
||||||
# We use this to set the name of the package in the
|
|
||||||
# package.json
|
|
||||||
PACKAGE_NAME="code-server"
|
|
||||||
|
|
||||||
# NOTES:@jsjoeio
|
|
||||||
# We only need to run npm version for "development" and "staging".
|
|
||||||
# This is because our release:prep script automatically bumps the version
|
|
||||||
# in the package.json and we commit it as part of the release PR.
|
|
||||||
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
|
|
||||||
NPM_VERSION="$VERSION"
|
|
||||||
# This means the npm version will be published as "stable"
|
|
||||||
# and installed when a user runs `npm install code-server`
|
|
||||||
NPM_TAG="latest"
|
|
||||||
else
|
|
||||||
COMMIT_SHA="$GITHUB_SHA"
|
|
||||||
|
|
||||||
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
|
|
||||||
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
|
|
||||||
# This means the npm version will be tagged with "beta"
|
|
||||||
# and installed when a user runs `npm install code-server@beta`
|
|
||||||
NPM_TAG="beta"
|
|
||||||
PACKAGE_NAME="@coder/code-server-pr"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$NPM_ENVIRONMENT" == "development" ]]; then
|
|
||||||
# Source: https://github.com/actions/checkout/issues/58#issuecomment-614041550
|
|
||||||
PR_NUMBER=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
|
|
||||||
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
|
|
||||||
PACKAGE_NAME="@coder/code-server-pr"
|
|
||||||
# This means the npm version will be tagged with "<pr number>"
|
|
||||||
# and installed when a user runs `npm install code-server@<pr number>`
|
|
||||||
NPM_TAG="$PR_NUMBER"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "- tag: $NPM_TAG"
|
|
||||||
echo "- version: $NPM_VERSION"
|
|
||||||
echo "- package name: $PACKAGE_NAME"
|
|
||||||
echo "- npm environment: $NPM_ENVIRONMENT"
|
|
||||||
|
|
||||||
# We modify the version in the package.json
|
|
||||||
# to be the current version + the PR number + commit SHA
|
|
||||||
# or we use current version + beta + commit SHA
|
|
||||||
# Example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
|
||||||
# Example: "version": "4.0.1-beta-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
|
||||||
pushd release
|
|
||||||
npm version "$NPM_VERSION"
|
|
||||||
# Use the development package name
|
|
||||||
# This is so we don't clutter the code-server versions on npm
|
|
||||||
# with development versions.
|
|
||||||
# jq can't edit in place so we must store in memory and echo
|
|
||||||
local contents
|
|
||||||
contents="$(jq ".name |= \"$PACKAGE_NAME\"" package.json)"
|
|
||||||
echo "${contents}" > package.json
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We need to make sure we haven't already published the version.
|
|
||||||
# If we get error, continue with script because we want to publish
|
|
||||||
# If version is valid, we check if we're publishing the same one
|
|
||||||
local hasVersion
|
|
||||||
if hasVersion=$(npm view "$PACKAGE_NAME@$NPM_VERSION" version 2> /dev/null) && [[ $hasVersion == "$NPM_VERSION" ]]; then
|
|
||||||
echo "$NPM_VERSION is already published under $PACKAGE_NAME"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Since the dev builds are scoped to @coder
|
|
||||||
# We pass --access public to ensure npm knows it's not private.
|
|
||||||
cd release
|
|
||||||
npm publish --tag "$NPM_TAG" --access public
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@ -9,7 +9,6 @@
|
|||||||
- [Version updates to Code](#version-updates-to-code)
|
- [Version updates to Code](#version-updates-to-code)
|
||||||
- [Patching Code](#patching-code)
|
- [Patching Code](#patching-code)
|
||||||
- [Build](#build)
|
- [Build](#build)
|
||||||
- [Creating a Standalone Release](#creating-a-standalone-release)
|
|
||||||
- [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
- [I see "Forbidden access" when I load code-server in the browser](#i-see-forbidden-access-when-i-load-code-server-in-the-browser)
|
- [I see "Forbidden access" when I load code-server in the browser](#i-see-forbidden-access-when-i-load-code-server-in-the-browser)
|
||||||
- ["Can only have one anonymous define call per script"](#can-only-have-one-anonymous-define-call-per-script)
|
- ["Can only have one anonymous define call per script"](#can-only-have-one-anonymous-define-call-per-script)
|
||||||
@ -122,7 +121,7 @@ commits first if you are doing this).
|
|||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
You can build a full production as follows:
|
You can build a full production release as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
@ -130,26 +129,32 @@ quilt push -a
|
|||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
VERSION=0.0.0 npm run build:vscode
|
VERSION=0.0.0 npm run build:vscode
|
||||||
npm run release
|
KEEP_MODULES=1 npm run release
|
||||||
```
|
```
|
||||||
|
|
||||||
This does not keep `node_modules`. If you want them to be kept, use
|
You can omit `KEEP_MODULES` if you intend to use this in a platform-agnostic way
|
||||||
`KEEP_MODULES=1 npm run release`
|
(like for publishing to NPM), but since the VS Code build process does
|
||||||
|
post-processing deletion of the modules, it is recommended to keep the modules
|
||||||
|
when possible, since if you install them later you will have more than is
|
||||||
|
required. `KEEP_MODULES` will also bundle Node and the code-server entry script.
|
||||||
|
|
||||||
Run your build:
|
Run your build:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./release/bin/code-server
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you omitted `KEEP_MODULES`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cd release
|
cd release
|
||||||
npm install --omit=dev # Skip if you used KEEP_MODULES=1
|
npm install --omit=dev
|
||||||
# Runs the built JavaScript with Node.
|
|
||||||
node .
|
node .
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, to build the release package:
|
Then, to package the release:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm run release:standalone
|
|
||||||
npm run test:integration
|
|
||||||
npm run package
|
npm run package
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -158,22 +163,6 @@ npm run package
|
|||||||
> If you need your builds to support older distros, run the build commands
|
> If you need your builds to support older distros, run the build commands
|
||||||
> inside a Docker container with all the build requirements installed.
|
> inside a Docker container with all the build requirements installed.
|
||||||
|
|
||||||
#### Creating a Standalone Release
|
|
||||||
|
|
||||||
Part of the build process involves creating standalone releases. At the time of
|
|
||||||
writing, we do this for the following platforms/architectures:
|
|
||||||
|
|
||||||
- Linux amd64 (.tar.gz, .deb, and .rpm)
|
|
||||||
- Linux arm64 (.tar.gz, .deb, and .rpm)
|
|
||||||
- Linux arm7l (.tar.gz)
|
|
||||||
- Linux armhf.deb
|
|
||||||
- Linux armhf.rpm
|
|
||||||
- macOS arm64.tar.gz
|
|
||||||
|
|
||||||
Currently, these are compiled in CI using the `npm run release:standalone`
|
|
||||||
command in the `release.yaml` workflow. We then upload them to the draft release
|
|
||||||
and distribute via GitHub Releases.
|
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
#### I see "Forbidden access" when I load code-server in the browser
|
#### I see "Forbidden access" when I load code-server in the browser
|
||||||
|
|||||||
26
docs/FAQ.md
26
docs/FAQ.md
@ -22,6 +22,7 @@
|
|||||||
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
|
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
|
||||||
- [What is the healthz endpoint?](#what-is-the-healthz-endpoint)
|
- [What is the healthz endpoint?](#what-is-the-healthz-endpoint)
|
||||||
- [What is the heartbeat file?](#what-is-the-heartbeat-file)
|
- [What is the heartbeat file?](#what-is-the-heartbeat-file)
|
||||||
|
- [How do I change the reconnection grace time?](#how-do-i-change-the-reconnection-grace-time)
|
||||||
- [How do I change the password?](#how-do-i-change-the-password)
|
- [How do I change the password?](#how-do-i-change-the-password)
|
||||||
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
|
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
|
||||||
- [Is multi-tenancy possible?](#is-multi-tenancy-possible)
|
- [Is multi-tenancy possible?](#is-multi-tenancy-possible)
|
||||||
@ -31,6 +32,7 @@
|
|||||||
- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia)
|
- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia)
|
||||||
- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server)
|
- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server)
|
||||||
- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces)
|
- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces)
|
||||||
|
- [What's the difference between code-server and VS Code web?](#whats-the-difference-between-code-server-and-vs-code-web)
|
||||||
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
||||||
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
||||||
- [How do I change the port?](#how-do-i-change-the-port)
|
- [How do I change the port?](#how-do-i-change-the-port)
|
||||||
@ -322,12 +324,18 @@ As long as there is an active browser connection, code-server touches
|
|||||||
`~/.local/share/code-server/heartbeat` once a minute.
|
`~/.local/share/code-server/heartbeat` once a minute.
|
||||||
|
|
||||||
If you want to shutdown code-server if there hasn't been an active connection
|
If you want to shutdown code-server if there hasn't been an active connection
|
||||||
after a predetermined amount of time, you can do so by checking continuously for
|
after a predetermined amount of time, you can use the --idle-timeout-seconds flag
|
||||||
the last modified time on the heartbeat file. If it is older than X minutes (or
|
or set an `CODE_SERVER_IDLE_TIMEOUT_SECONDS` environment variable.
|
||||||
whatever amount of time you'd like), you can kill code-server.
|
|
||||||
|
|
||||||
Eventually, [#1636](https://github.com/coder/code-server/issues/1636) will make
|
## How do I change the reconnection grace time?
|
||||||
this process better.
|
|
||||||
|
Pass `--reconnection-grace-time <seconds>` to `code-server`, set
|
||||||
|
`CODE_SERVER_RECONNECTION_GRACE_TIME=<seconds>`, or add
|
||||||
|
`reconnection-grace-time: <seconds>` to
|
||||||
|
`~/.config/code-server/config.yaml`.
|
||||||
|
|
||||||
|
The default is `10800` (3 hours). If a client stays disconnected longer than
|
||||||
|
this, it must reload the window.
|
||||||
|
|
||||||
## How do I change the password?
|
## How do I change the password?
|
||||||
|
|
||||||
@ -443,6 +451,8 @@ Specific changes include:
|
|||||||
- The ability to use your own marketplace and collect your own telemetry
|
- The ability to use your own marketplace and collect your own telemetry
|
||||||
- Built-in proxy for accessing ports on the remote machine integrated into
|
- Built-in proxy for accessing ports on the remote machine integrated into
|
||||||
VS Code's ports panel
|
VS Code's ports panel
|
||||||
|
- Settings are stored on disk like desktop VS Code, instead of in browser
|
||||||
|
storage (note that state is still stored in browser storage).
|
||||||
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
||||||
- Notification when updates are available
|
- Notification when updates are available
|
||||||
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
||||||
@ -451,6 +461,12 @@ Some of these changes appear very unlikely to ever be adopted by Microsoft.
|
|||||||
Some may make their way upstream, further closing the gap, but at the moment it
|
Some may make their way upstream, further closing the gap, but at the moment it
|
||||||
looks like there will always be some subtle differences.
|
looks like there will always be some subtle differences.
|
||||||
|
|
||||||
|
## What's the difference between code-server and VS Code web?
|
||||||
|
|
||||||
|
VS Code web (which can be ran using `code serve-web`) has the same differences
|
||||||
|
as the Codespaces section above. VS Code web can be a better choice if you need
|
||||||
|
access to the official Microsoft marketplace.
|
||||||
|
|
||||||
## Does code-server have any security login validation?
|
## Does code-server have any security login validation?
|
||||||
|
|
||||||
code-server supports setting a single password and limits logins to two per
|
code-server supports setting a single password and limits logins to two per
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
- [Release Candidates](#release-candidates)
|
- [Release Candidates](#release-candidates)
|
||||||
- [AUR](#aur)
|
- [AUR](#aur)
|
||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
- [Homebrew](#homebrew)
|
|
||||||
- [nixpkgs](#nixpkgs)
|
- [nixpkgs](#nixpkgs)
|
||||||
- [npm](#npm)
|
- [npm](#npm)
|
||||||
- [Testing](#testing)
|
- [Testing](#testing)
|
||||||
@ -27,20 +26,18 @@ Most of the work is keeping on top of issues and discussions.
|
|||||||
|
|
||||||
1. Check that the changelog lists all the important changes.
|
1. Check that the changelog lists all the important changes.
|
||||||
2. Make sure the changelog entry lists the current version of VS Code.
|
2. Make sure the changelog entry lists the current version of VS Code.
|
||||||
3. Update the changelog with the release date.
|
3. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
||||||
4. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
release. For the version we match VS Code's minor and patch version. The
|
||||||
release. Make sure CI has finished the build workflow on that commit or this
|
|
||||||
will fail. For the version we match VS Code's minor and patch version. The
|
|
||||||
patch number may become temporarily out of sync if we need to put out a
|
patch number may become temporarily out of sync if we need to put out a
|
||||||
patch, but if we make our own minor change then we will not release it until
|
patch, but if we make our own minor change then we will not release it until
|
||||||
the next minor VS Code release.
|
the next minor VS Code release.
|
||||||
5. CI will automatically grab the build artifact on that commit (which is why CI
|
4. CI will build an NPM package and platform-specific packages, and upload those
|
||||||
has to have completed), inject the provided version into the `package.json`,
|
to a draft release.
|
||||||
put together platform-specific packages, and upload those packages to a draft
|
5. Update the resulting draft release with the changelog contents.
|
||||||
release.
|
6. Publish the draft release after validating it.
|
||||||
6. Update the resulting draft release with the changelog contents.
|
7. Update the changelog with the release date and bump the Helm chart version
|
||||||
7. Publish the draft release after validating it.
|
once the Docker images have published.
|
||||||
8. Bump the Helm chart version once the Docker images have published.
|
8. Merge the PR submitted to coder/code-server-aur repo.
|
||||||
|
|
||||||
#### Release Candidates
|
#### Release Candidates
|
||||||
|
|
||||||
@ -55,38 +52,34 @@ full-blown release. To do this follow the same steps as above but:
|
|||||||
|
|
||||||
#### AUR
|
#### AUR
|
||||||
|
|
||||||
We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-server/). This process is manual and can be done by following the steps in [this repo](https://github.com/coder/code-server-aur).
|
We publish to AUR as a package
|
||||||
|
[here](https://aur.archlinux.org/packages/code-server/). This process is manual
|
||||||
|
and can be done by following the steps in [this
|
||||||
|
repo](https://github.com/coder/code-server-aur).
|
||||||
|
|
||||||
#### Docker
|
#### Docker
|
||||||
|
|
||||||
We publish code-server as a Docker image [here](https://hub.docker.com/r/codercom/code-server), tagging it both with the version and latest.
|
We publish code-server as a Docker image
|
||||||
|
[here](https://hub.docker.com/r/codercom/code-server), tagging it both with the
|
||||||
|
version and latest.
|
||||||
|
|
||||||
This is currently automated with the release process.
|
This is currently automated with the release process.
|
||||||
|
|
||||||
#### Homebrew
|
|
||||||
|
|
||||||
We publish code-server on Homebrew [here](https://github.com/Homebrew/homebrew-core/blob/master/Formula/code-server.rb).
|
|
||||||
|
|
||||||
This is currently automated with the release process (but may fail occasionally). If it does, run this locally:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# Replace VERSION with version
|
|
||||||
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
|
||||||
```
|
|
||||||
|
|
||||||
#### nixpkgs
|
#### nixpkgs
|
||||||
|
|
||||||
We publish code-server in nixpkgs but it must be updated manually.
|
We publish code-server in nixpkgs but it must be updated manually.
|
||||||
|
|
||||||
#### npm
|
#### npm
|
||||||
|
|
||||||
We publish code-server as a npm package [here](https://www.npmjs.com/package/code-server/v/latest).
|
We publish code-server as a npm package
|
||||||
|
[here](https://www.npmjs.com/package/code-server/v/latest).
|
||||||
|
|
||||||
This is currently automated with the release process.
|
This is currently automated with the release process.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Our testing structure is laid out under our [Contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
Our testing structure is laid out under our [Contributing
|
||||||
|
docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
||||||
|
|
||||||
If you're ever looking to add more tests, here are a few ways to get started:
|
If you're ever looking to add more tests, here are a few ways to get started:
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,8 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|||||||
7. Install and use Node.js 22:
|
7. Install and use Node.js 22:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nvm install 18
|
nvm install 22
|
||||||
nvm use 18
|
nvm use 22
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Install code-server globally on device with: `npm install --global code-server`
|
8. Install code-server globally on device with: `npm install --global code-server`
|
||||||
|
|||||||
@ -33,7 +33,7 @@ resource "coder_app" "code-server" {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use our official [`code-server`](https://registry.coder.com/modules/code-server) module from the Coder [module registry](htpps://registry.coder.com/modules):
|
Or use our official [`code-server`](https://registry.coder.com/modules/code-server) module from the Coder [module registry](https://registry.coder.com/modules):
|
||||||
|
|
||||||
```terraform
|
```terraform
|
||||||
module "code-server" {
|
module "code-server" {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 6f17636121051a53c88d3e605c491d22af2ba755
|
Subproject commit cfbea10c5ffb233ea9177d34726e6056e89913dc
|
||||||
3358
package-lock.json
generated
3358
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -14,7 +14,6 @@
|
|||||||
"build:vscode": "./ci/build/build-vscode.sh",
|
"build:vscode": "./ci/build/build-vscode.sh",
|
||||||
"doctoc": "./ci/dev/doctoc.sh",
|
"doctoc": "./ci/dev/doctoc.sh",
|
||||||
"release": "./ci/build/build-release.sh",
|
"release": "./ci/build/build-release.sh",
|
||||||
"release:standalone": "./ci/build/build-standalone-release.sh",
|
|
||||||
"release:prep": "./ci/build/release-prep.sh",
|
"release:prep": "./ci/build/release-prep.sh",
|
||||||
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
||||||
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
|
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
|
||||||
@ -56,32 +55,32 @@
|
|||||||
"@types/ws": "^8.5.5",
|
"@types/ws": "^8.5.5",
|
||||||
"doctoc": "^2.2.1",
|
"doctoc": "^2.2.1",
|
||||||
"eslint": "^9.12.0",
|
"eslint": "^9.12.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-import-resolver-typescript": "^4.4.4",
|
"eslint-import-resolver-typescript": "^4.4.4",
|
||||||
"eslint-plugin-import": "^2.28.1",
|
"eslint-plugin-import": "^2.28.1",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"globals": "^16.1.0",
|
"globals": "^16.1.0",
|
||||||
"prettier": "3.6.2",
|
"prettier": "3.6.2",
|
||||||
"prettier-plugin-sh": "^0.14.0",
|
"prettier-plugin-sh": "^0.18.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^5.6.2",
|
"typescript": "^5.6.2",
|
||||||
"typescript-eslint": "^8.8.0"
|
"typescript-eslint": "^8.8.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coder/logger": "^3.0.1",
|
"@coder/logger": "^3.0.1",
|
||||||
"argon2": "^0.31.1",
|
"argon2": "^0.44.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"env-paths": "^2.2.1",
|
"env-paths": "^2.2.1",
|
||||||
"express": "^5.0.1",
|
"express": "^5.0.1",
|
||||||
"http-proxy": "^1.18.1",
|
"http-proxy": "^1.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
"httpolyglot": "^0.1.2",
|
||||||
"i18next": "^25.3.0",
|
"i18next": "^25.8.3",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"limiter": "^2.1.0",
|
"limiter": "^2.1.0",
|
||||||
"pem": "^1.14.8",
|
"pem": "^1.14.8",
|
||||||
"proxy-agent": "^6.3.1",
|
"proxy-agent": "^6.3.1",
|
||||||
"qs": "6.14.0",
|
"qs": "^6.15.0",
|
||||||
"rotating-file-stream": "^3.1.1",
|
"rotating-file-stream": "^3.1.1",
|
||||||
"safe-compare": "^1.1.4",
|
"safe-compare": "^1.1.4",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
|
|||||||
@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
||||||
@@ -226,7 +226,9 @@ class RemoteAuthoritiesImpl {
|
@@ -245,7 +245,9 @@ class RemoteAuthoritiesImpl {
|
||||||
return URI.from({
|
return URI.from({
|
||||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||||
authority: `${host}:${port}`,
|
authority: `${host}:${port}`,
|
||||||
@ -99,19 +99,19 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactor
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/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
|
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||||
@@ -281,6 +281,7 @@ export class BrowserSocketFactory implem
|
@@ -282,6 +282,7 @@ export class BrowserSocketFactory implem
|
||||||
connect({ host, port }: WebSocketRemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
|
connect({ host, port }: WebSocketRemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
|
||||||
return new Promise<ISocket>((resolve, reject) => {
|
return new Promise<ISocket>((resolve, reject) => {
|
||||||
const webSocketSchema = (/^https:/.test(mainWindow.location.href) ? 'wss' : 'ws');
|
const webSocketSchema = (/^https:/.test(mainWindow.location.href) ? 'wss' : 'ws');
|
||||||
+ path = (mainWindow.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
+ path = (mainWindow.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||||
const errorListener = socket.onError(reject);
|
const disposables = new DisposableStore();
|
||||||
socket.onOpen(() => {
|
disposables.add(socket.onError(reject));
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -245,7 +245,9 @@ export class WebClientServer {
|
@@ -246,7 +246,9 @@ export class WebClientServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Prefix routes with basePath for clients
|
// Prefix routes with basePath for clients
|
||||||
@ -122,7 +122,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
|
|
||||||
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
|
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
|
||||||
if (typeof queryConnectionToken === 'string') {
|
if (typeof queryConnectionToken === 'string') {
|
||||||
@@ -284,10 +286,14 @@ export class WebClientServer {
|
@@ -285,10 +287,14 @@ export class WebClientServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
||||||
@ -138,7 +138,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
);
|
);
|
||||||
if (!remoteAuthority) {
|
if (!remoteAuthority) {
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
@@ -334,6 +340,7 @@ export class WebClientServer {
|
@@ -335,6 +341,7 @@ export class WebClientServer {
|
||||||
|
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -387,7 +394,9 @@ export class WebClientServer {
|
@@ -388,7 +395,9 @@ export class WebClientServer {
|
||||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||||
WORKBENCH_WEB_BASE_URL: staticRoute,
|
WORKBENCH_WEB_BASE_URL: staticRoute,
|
||||||
WORKBENCH_NLS_URL,
|
WORKBENCH_NLS_URL,
|
||||||
@ -157,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
};
|
};
|
||||||
|
|
||||||
// DEV ---------------------------------------------------------------------------------------
|
// DEV ---------------------------------------------------------------------------------------
|
||||||
@@ -424,7 +433,7 @@ export class WebClientServer {
|
@@ -425,7 +434,7 @@ export class WebClientServer {
|
||||||
'default-src \'self\';',
|
'default-src \'self\';',
|
||||||
'img-src \'self\' https: data: blob:;',
|
'img-src \'self\' https: data: blob:;',
|
||||||
'media-src \'self\';',
|
'media-src \'self\';',
|
||||||
@ -166,7 +166,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
'child-src \'self\';',
|
'child-src \'self\';',
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data: blob:;',
|
'worker-src \'self\' data: blob:;',
|
||||||
@@ -497,3 +506,70 @@ export class WebClientServer {
|
@@ -498,3 +507,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
@ -253,7 +253,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.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||||
@@ -338,7 +338,8 @@ class LocalStorageURLCallbackProvider ex
|
@@ -339,7 +339,8 @@ class LocalStorageURLCallbackProvider ex
|
||||||
this.startListening();
|
this.startListening();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
private startListening(): void {
|
private startListening(): void {
|
||||||
@@ -583,17 +584,6 @@ class WorkspaceProvider implements IWork
|
@@ -584,17 +585,6 @@ class WorkspaceProvider implements IWork
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
// Find config by checking for DOM
|
// Find config by checking for DOM
|
||||||
@@ -602,8 +592,8 @@ function readCookie(name: string): strin
|
@@ -604,8 +594,8 @@ function readCookie(name: string): strin
|
||||||
if (!configElement || !configElementAttribute) {
|
if (!configElement || !configElementAttribute) {
|
||||||
throw new Error('Missing web configuration element');
|
throw new Error('Missing web configuration element');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
@@ -106,10 +106,14 @@ class RemoteTerminalBackend extends Base
|
@@ -108,10 +108,14 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
const reqId = e.reqId;
|
const reqId = e.reqId;
|
||||||
const commandId = e.commandId;
|
const commandId = e.commandId;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands
|
|||||||
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
||||||
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
||||||
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
||||||
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot
|
@@ -96,6 +97,11 @@ CommandsRegistry.registerCommand('_remot
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -39,8 +39,8 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|||||||
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
||||||
|
|
||||||
export interface ICommandsExecuter {
|
export interface ICommandsExecuter {
|
||||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
executeCommand<T>(id: string, ...args: unknown[]): Promise<T>;
|
||||||
@@ -106,6 +111,9 @@ export class CLIServerBase {
|
@@ -110,6 +115,9 @@ export class CLIServerBase {
|
||||||
case 'extensionManagement':
|
case 'extensionManagement':
|
||||||
returnObj = await this.manageExtensions(data);
|
returnObj = await this.manageExtensions(data);
|
||||||
break;
|
break;
|
||||||
@ -50,7 +50,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|||||||
default:
|
default:
|
||||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
sendResponse(404, `Unknown message type: ${data.type}`);
|
||||||
break;
|
break;
|
||||||
@@ -173,6 +181,10 @@ export class CLIServerBase {
|
@@ -180,6 +188,10 @@ export class CLIServerBase {
|
||||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,26 +59,26 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
dispose(): void {
|
dispose(): void {
|
||||||
this._server.close();
|
this._disposed = true;
|
||||||
|
this._server?.close();
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
@@ -97,7 +97,7 @@ class RemoteTerminalBackend extends Base
|
@@ -99,7 +99,7 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
|
|
||||||
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
||||||
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
||||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
this._register(this._remoteTerminalChannel.onExecuteCommand(async e => {
|
||||||
// Ensure this request for for this window
|
// Ensure this request for for this window
|
||||||
const pty = this._ptys.get(e.persistentProcessId);
|
const pty = this._ptys.get(e.persistentProcessId);
|
||||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||||
@@ -135,6 +135,7 @@ export interface NativeParsedArgs {
|
@@ -143,6 +143,7 @@ export interface NativeParsedArgs {
|
||||||
'disable-chromium-sandbox'?: boolean;
|
'disable-chromium-sandbox'?: boolean;
|
||||||
sandbox?: boolean;
|
sandbox?: boolean;
|
||||||
'enable-coi'?: boolean;
|
'enable-coi'?: boolean;
|
||||||
@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||||
@@ -104,6 +104,7 @@ export const OPTIONS: OptionDescriptions
|
@@ -115,6 +115,7 @@ export const OPTIONS: OptionDescriptions
|
||||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
||||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||||
@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -295,6 +296,22 @@ export async function main(desc: Product
|
@@ -300,6 +301,22 @@ export async function main(desc: Product
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
@@ -341,6 +341,10 @@ export class Extension implements IExten
|
@@ -342,6 +342,10 @@ export class Extension implements IExten
|
||||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,14 +11,14 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
||||||
import { IURITransformer } from '../../base/common/uriIpc.js';
|
import { IURITransformer } from '../../base/common/uriIpc.js';
|
||||||
import { getMachineId, getSqmMachineId, getdevDeviceId } from '../../base/node/id.js';
|
import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js';
|
||||||
import { Promises } from '../../base/node/pfs.js';
|
import { Promises } from '../../base/node/pfs.js';
|
||||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
||||||
@@ -269,6 +269,9 @@ export async function setupServerService
|
@@ -297,6 +297,9 @@ export async function setupServerService
|
||||||
|
|
||||||
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
import { CharCode } from '../../base/common/charCode.js';
|
import { CharCode } from '../../base/common/charCode.js';
|
||||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||||
@@ -385,14 +386,22 @@ export class WebClientServer {
|
@@ -386,14 +387,22 @@ export class WebClientServer {
|
||||||
};
|
};
|
||||||
|
|
||||||
const cookies = cookie.parse(req.headers.cookie || '');
|
const cookies = cookie.parse(req.headers.cookie || '');
|
||||||
@ -190,7 +190,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -21,6 +21,7 @@ export const serverOptions: OptionDescri
|
@@ -22,6 +22,7 @@ export const serverOptions: OptionDescri
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
'disable-file-uploads': { type: 'boolean' },
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
'disable-getting-started-override': { type: 'boolean' },
|
'disable-getting-started-override': { type: 'boolean' },
|
||||||
@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ export interface ServerParsedArgs {
|
@@ -116,6 +117,7 @@ export interface ServerParsedArgs {
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
'disable-getting-started-override'?: boolean,
|
'disable-getting-started-override'?: boolean,
|
||||||
@ -272,7 +272,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
@@ -475,9 +475,6 @@ export class InstallAction extends Exten
|
@@ -474,9 +474,6 @@ export class InstallAction extends Exten
|
||||||
if (this.extension.isBuiltin) {
|
if (this.extension.isBuiltin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -782,7 +779,7 @@ export abstract class InstallInOtherServ
|
@@ -781,7 +778,7 @@ export abstract class InstallInOtherServ
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
@ -291,7 +291,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prefers to run on UI
|
// Prefers to run on UI
|
||||||
@@ -2073,17 +2070,6 @@ export class SetLanguageAction extends E
|
@@ -2072,17 +2069,6 @@ export class SetLanguageAction extends E
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = SetLanguageAction.DisabledClass;
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
@ -309,7 +309,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
@@ -2100,7 +2086,6 @@ export class ClearLanguageAction extends
|
@@ -2099,7 +2085,6 @@ export class ClearLanguageAction extends
|
||||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -317,7 +317,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
@ILocaleService private readonly localeService: ILocaleService,
|
@ILocaleService private readonly localeService: ILocaleService,
|
||||||
) {
|
) {
|
||||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||||
@@ -2110,17 +2095,6 @@ export class ClearLanguageAction extends
|
@@ -2109,17 +2094,6 @@ export class ClearLanguageAction extends
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = ClearLanguageAction.DisabledClass;
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
@ -335,12 +335,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
@@ -54,7 +54,7 @@ import './services/dialogs/browser/fileD
|
@@ -55,7 +55,7 @@ import './services/host/browser/browserH
|
||||||
import './services/host/browser/browserHostService.js';
|
import '../platform/meteredConnection/browser/meteredConnectionService.js';
|
||||||
import './services/lifecycle/browser/lifecycleService.js';
|
import './services/lifecycle/browser/lifecycleService.js';
|
||||||
import './services/clipboard/browser/clipboardService.js';
|
import './services/clipboard/browser/clipboardService.js';
|
||||||
-import './services/localization/browser/localeService.js';
|
-import './services/localization/browser/localeService.js';
|
||||||
|
|||||||
@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -18,6 +18,8 @@ export const serverOptions: OptionDescri
|
@@ -19,6 +19,8 @@ export const serverOptions: OptionDescri
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -104,6 +106,8 @@ export interface ServerParsedArgs {
|
@@ -110,6 +112,8 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string;
|
'auth'?: string;
|
||||||
@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -369,6 +369,8 @@ export class WebClientServer {
|
@@ -370,6 +370,8 @@ export class WebClientServer {
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
@ -125,13 +125,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,11 +7,11 @@ import { Event } from '../../base/common
|
@@ -6,10 +6,10 @@
|
||||||
import { Disposable, DisposableStore, MutableDisposable } from '../../base/common/lifecycle.js';
|
import { Disposable } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext } from '../common/contextkeys.js';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
-import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js';
|
-import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js';
|
||||||
@ -139,7 +138,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
||||||
import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js';
|
import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js';
|
||||||
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
||||||
@@ -71,7 +71,7 @@ export class WorkbenchContextKeysHandler
|
@@ -69,7 +69,7 @@ export class WorkbenchContextKeysHandler
|
||||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
@ -148,7 +147,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
@IProductService private readonly productService: IProductService,
|
@IProductService private readonly productService: IProductService,
|
||||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||||
@IEditorService private readonly editorService: IEditorService,
|
@IEditorService private readonly editorService: IEditorService,
|
||||||
@@ -200,6 +200,10 @@ export class WorkbenchContextKeysHandler
|
@@ -201,6 +201,10 @@ export class WorkbenchContextKeysHandler
|
||||||
this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService);
|
this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService);
|
||||||
this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized());
|
this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized());
|
||||||
|
|
||||||
@ -208,9 +207,9 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -37,6 +37,9 @@ export const HasWebFileSystemAccess = ne
|
@@ -41,6 +41,9 @@ export const EmbedderIdentifierContext =
|
||||||
|
|
||||||
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
export const InAutomationContext = new RawContextKey<boolean>('inAutomation', false, localize('inAutomation', "Whether VS Code is running under automation/smoke test"));
|
||||||
|
|
||||||
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
+export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
+export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
||||||
@ -231,7 +230,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
|||||||
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
||||||
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
||||||
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
|
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
|
||||||
@@ -144,7 +144,7 @@ export class SimpleFileDialog extends Di
|
@@ -152,7 +152,7 @@ export class SimpleFileDialog extends Di
|
||||||
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
||||||
@IModelService private readonly modelService: IModelService,
|
@IModelService private readonly modelService: IModelService,
|
||||||
@ILanguageService private readonly languageService: ILanguageService,
|
@ILanguageService private readonly languageService: ILanguageService,
|
||||||
@ -240,13 +239,14 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
|||||||
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
||||||
@IPathService protected readonly pathService: IPathService,
|
@IPathService protected readonly pathService: IPathService,
|
||||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||||
@@ -310,20 +310,22 @@ export class SimpleFileDialog extends Di
|
@@ -362,21 +362,23 @@ export class SimpleFileDialog extends Di
|
||||||
this.filePickBox.ignoreFocusOut = true;
|
this.filePickBox.placeholder = nls.localize('remoteFileDialog.placeholder', "Folder path");
|
||||||
this.filePickBox.ok = true;
|
this.filePickBox.ok = true;
|
||||||
this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic;
|
this.filePickBox.okLabel = typeof this.options.openLabel === 'string' ? this.options.openLabel : this.options.openLabel?.withoutMnemonic;
|
||||||
- if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
- if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
||||||
- this.filePickBox.customButton = true;
|
- this.filePickBox.customButton = true;
|
||||||
- this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
|
- this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
|
||||||
|
- this.filePickBox.customButtonSecondary = true;
|
||||||
- let action;
|
- let action;
|
||||||
- if (isSave) {
|
- if (isSave) {
|
||||||
- action = SaveLocalFileCommand;
|
- action = SaveLocalFileCommand;
|
||||||
@ -262,6 +262,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFi
|
|||||||
+ if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
+ if ((this.scheme !== Schemas.file) && this.options && this.options.availableFileSystems && (this.options.availableFileSystems.length > 1) && (this.options.availableFileSystems.indexOf(Schemas.file) > -1)) {
|
||||||
+ this.filePickBox.customButton = true;
|
+ this.filePickBox.customButton = true;
|
||||||
+ this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
|
+ this.filePickBox.customLabel = nls.localize('remoteFileDialog.local', 'Show Local');
|
||||||
|
+ this.filePickBox.customButtonSecondary = true;
|
||||||
+ let action;
|
+ let action;
|
||||||
+ if (isSave) {
|
+ if (isSave) {
|
||||||
+ action = SaveLocalFileCommand;
|
+ action = SaveLocalFileCommand;
|
||||||
@ -289,7 +290,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
|||||||
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
||||||
import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js';
|
import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js';
|
||||||
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
||||||
@@ -1601,7 +1602,8 @@ export class FileDragAndDrop implements
|
@@ -1587,7 +1588,8 @@ export class FileDragAndDrop implements
|
||||||
@IConfigurationService private configurationService: IConfigurationService,
|
@IConfigurationService private configurationService: IConfigurationService,
|
||||||
@IInstantiationService private instantiationService: IInstantiationService,
|
@IInstantiationService private instantiationService: IInstantiationService,
|
||||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
||||||
@ -299,7 +300,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
|||||||
) {
|
) {
|
||||||
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
||||||
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
||||||
@@ -1826,15 +1828,17 @@ export class FileDragAndDrop implements
|
@@ -1812,15 +1814,17 @@ export class FileDragAndDrop implements
|
||||||
|
|
||||||
// External file DND (Import/Upload file)
|
// External file DND (Import/Upload file)
|
||||||
if (data instanceof NativeDragAndDropData) {
|
if (data instanceof NativeDragAndDropData) {
|
||||||
|
|||||||
@ -17,8 +17,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from '../../../../base/browser/dom.js';
|
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from '../../../../base/browser/dom.js';
|
||||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js';
|
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js';
|
||||||
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
||||||
|
import { status } from '../../../../base/browser/ui/aria/aria.js';
|
||||||
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
||||||
import { Button } from '../../../../base/browser/ui/button/button.js';
|
|
||||||
@@ -54,7 +54,7 @@ import { IRecentFolder, IRecentWorkspace
|
@@ -54,7 +54,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||||
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
||||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
||||||
@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||||
import './gettingStartedColors.js';
|
import './gettingStartedColors.js';
|
||||||
@@ -876,6 +876,72 @@ export class GettingStartedPage extends
|
@@ -924,6 +924,72 @@ export class GettingStartedPage extends
|
||||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||||
|
|
||||||
@@ -911,6 +977,9 @@ export class GettingStartedPage extends
|
@@ -959,6 +1025,9 @@ export class GettingStartedPage extends
|
||||||
recentList.setLimit(5);
|
recentList.setLimit(5);
|
||||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
}
|
}
|
||||||
@ -181,7 +181,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -20,6 +20,7 @@ export const serverOptions: OptionDescri
|
@@ -21,6 +21,7 @@ export const serverOptions: OptionDescri
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
'disable-file-uploads': { type: 'boolean' },
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -108,6 +109,7 @@ export interface ServerParsedArgs {
|
@@ -114,6 +115,7 @@ export interface ServerParsedArgs {
|
||||||
'auth'?: string;
|
'auth'?: string;
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -373,6 +373,7 @@ export class WebClientServer {
|
@@ -374,6 +374,7 @@ export class WebClientServer {
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||||
@ -213,16 +213,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -7,7 +7,7 @@ import { Event } from '../../base/common
|
@@ -6,7 +6,7 @@
|
||||||
import { Disposable, DisposableStore, MutableDisposable } from '../../base/common/lifecycle.js';
|
import { Disposable } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from '../common/contextkeys.js';
|
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, AuxiliaryBarMaximizedContext, InAutomationContext, IsSessionsWindowContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from '../common/contextkeys.js';
|
||||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
@@ -203,6 +203,7 @@ export class WorkbenchContextKeysHandler
|
import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
|
||||||
|
@@ -204,6 +204,7 @@ export class WorkbenchContextKeysHandler
|
||||||
// code-server
|
// code-server
|
||||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
||||||
@ -234,7 +234,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -39,6 +39,7 @@ export const EmbedderIdentifierContext =
|
@@ -43,6 +43,7 @@ export const InAutomationContext = new R
|
||||||
|
|
||||||
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
|||||||
-[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, LOCAL_HISTORY_HOME].forEach(f => {
|
||||||
- try {
|
- try {
|
||||||
- if (!fs.existsSync(f)) {
|
- if (!fs.existsSync(f)) {
|
||||||
- fs.mkdirSync(f, { mode: 0o700 });
|
- fs.mkdirSync(f, { mode: 0o700, recursive: true });
|
||||||
- }
|
- }
|
||||||
- } catch (err) { console.error(err); }
|
- } catch (err) { console.error(err); }
|
||||||
-});
|
-});
|
||||||
@ -68,7 +68,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
|||||||
+ [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, LOCAL_HISTORY_HOME].forEach(f => {
|
||||||
+ try {
|
+ try {
|
||||||
+ if (!fs.existsSync(f)) {
|
+ if (!fs.existsSync(f)) {
|
||||||
+ fs.mkdirSync(f, { mode: 0o700 });
|
+ fs.mkdirSync(f, { mode: 0o700, recursive: true });
|
||||||
+ }
|
+ }
|
||||||
+ } catch (err) { console.error(err); }
|
+ } catch (err) { console.error(err); }
|
||||||
+ });
|
+ });
|
||||||
@ -109,24 +109,6 @@ Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
|||||||
];
|
];
|
||||||
const envKeys = Object.keys(env);
|
const envKeys = Object.keys(env);
|
||||||
envKeys
|
envKeys
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
|
||||||
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
|
|
||||||
|
|
||||||
async about(): Promise<void> {
|
|
||||||
const detailString = (useAgo: boolean): string => {
|
|
||||||
- return localize('aboutDetail',
|
|
||||||
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
|
||||||
+ return localize('aboutCodeServerDetail',
|
|
||||||
+ "code-server: {0}",
|
|
||||||
+ this.productService.codeServerVersion ? `v${this.productService.codeServerVersion}` : 'Unknown'
|
|
||||||
+ ) + '\n' + localize('aboutDetail',
|
|
||||||
+ "Code: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
|
||||||
this.productService.version || 'Unknown',
|
|
||||||
this.productService.commit || 'Unknown',
|
|
||||||
this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
@ -182,7 +164,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||||
@@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl
|
@@ -65,6 +65,7 @@ import { IOpenerService } from '../../pl
|
||||||
import { mixin, safeStringify } from '../../base/common/objects.js';
|
import { mixin, safeStringify } from '../../base/common/objects.js';
|
||||||
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
||||||
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
||||||
@ -190,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
|||||||
import { IProgressService } from '../../platform/progress/common/progress.js';
|
import { IProgressService } from '../../platform/progress/common/progress.js';
|
||||||
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
||||||
import { dirname, joinPath } from '../../base/common/resources.js';
|
import { dirname, joinPath } from '../../base/common/resources.js';
|
||||||
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa
|
@@ -140,6 +141,9 @@ export class BrowserMain extends Disposa
|
||||||
// Startup
|
// Startup
|
||||||
const instantiationService = workbench.startup();
|
const instantiationService = workbench.startup();
|
||||||
|
|
||||||
@ -204,7 +186,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -56,6 +56,8 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -65,6 +65,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
@ -269,7 +251,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -333,6 +333,7 @@ export class WebClientServer {
|
@@ -334,6 +334,7 @@ export class WebClientServer {
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
@ -281,9 +263,9 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/server-main.ts
|
--- code-server.orig/lib/vscode/src/server-main.ts
|
||||||
+++ code-server/lib/vscode/src/server-main.ts
|
+++ code-server/lib/vscode/src/server-main.ts
|
||||||
@@ -25,6 +25,9 @@ const __dirname = path.dirname(fileURLTo
|
@@ -22,6 +22,9 @@ import { IServerAPI } from './vs/server/
|
||||||
perf.mark('code/server/start');
|
perf.mark('code/server/start');
|
||||||
(globalThis as any).vscodeServerStartTime = performance.now();
|
(globalThis as { vscodeServerStartTime?: number }).vscodeServerStartTime = performance.now();
|
||||||
|
|
||||||
+// This is not indented to make the diff less noisy. We need to move this out
|
+// This is not indented to make the diff less noisy. We need to move this out
|
||||||
+// of the top-level so it will not run immediately and we can control the start.
|
+// of the top-level so it will not run immediately and we can control the start.
|
||||||
@ -291,15 +273,15 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
// Do a quick parse to determine if a server or the cli needs to be started
|
// Do a quick parse to determine if a server or the cli needs to be started
|
||||||
const parsedArgs = minimist(process.argv.slice(2), {
|
const parsedArgs = minimist(process.argv.slice(2), {
|
||||||
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
||||||
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
|
@@ -150,6 +153,7 @@ if (shouldSpawnCli) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
+}
|
+}
|
||||||
|
|
||||||
function sanitizeStringArg(val: any): string | undefined {
|
function sanitizeStringArg(val: unknown): string | undefined {
|
||||||
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
||||||
@@ -286,3 +290,22 @@ function prompt(question: string): Promi
|
@@ -283,3 +287,22 @@ function prompt(question: string): Promi
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -310,7 +292,7 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
+ osLocale: 'en',
|
+ osLocale: 'en',
|
||||||
+ commit: product.commit,
|
+ commit: product.commit,
|
||||||
+ userDataPath: '',
|
+ userDataPath: '',
|
||||||
+ nlsMetadataPath: __dirname,
|
+ nlsMetadataPath: import.meta.dirname,
|
||||||
+ });
|
+ });
|
||||||
+ return loadCode(nlsConfiguration);
|
+ return loadCode(nlsConfiguration);
|
||||||
+}
|
+}
|
||||||
@ -322,3 +304,21 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
+if (!process.env.CODE_SERVER_PARENT_PID) {
|
+if (!process.env.CODE_SERVER_PARENT_PID) {
|
||||||
+ start();
|
+ start();
|
||||||
+}
|
+}
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialog.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialog.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialog.ts
|
||||||
|
@@ -47,8 +47,11 @@ export function createWorkbenchDialogOpt
|
||||||
|
|
||||||
|
export function createBrowserAboutDialogDetails(productService: IProductService): { title: string; details: string; detailsToCopy: string } {
|
||||||
|
const detailString = (useAgo: boolean): string => {
|
||||||
|
- return localize('aboutDetail',
|
||||||
|
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||||
|
+ return localize('aboutCodeServerDetail',
|
||||||
|
+ "code-server: {0}",
|
||||||
|
+ productService.codeServerVersion ? `v${productService.codeServerVersion}` : 'Unknown'
|
||||||
|
+ ) + '\n' + localize('aboutDetail',
|
||||||
|
+ "Code: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||||
|
productService.version || 'Unknown',
|
||||||
|
productService.commit || 'Unknown',
|
||||||
|
productService.date ? `${productService.date}${useAgo ? ' (' + fromNow(new Date(productService.date), true) + ')' : ''}` : 'Unknown',
|
||||||
|
|||||||
@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -364,6 +364,7 @@ export class WebClientServer {
|
@@ -365,6 +365,7 @@ export class WebClientServer {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
@ -32,7 +32,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
|||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -298,6 +298,11 @@ export interface IWorkbenchConstructionO
|
@@ -298,6 +298,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly configurationDefaults?: Record<string, any>;
|
readonly configurationDefaults?: Record<string, unknown>;
|
||||||
|
|
||||||
+ /**
|
+ /**
|
||||||
+ * Path to the user data directory.
|
+ * Path to the user data directory.
|
||||||
@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -556,6 +558,12 @@ export class WorkspaceService extends Di
|
@@ -561,6 +563,12 @@ export class WorkspaceService extends Di
|
||||||
previousFolders = this.workspace.folders;
|
previousFolders = this.workspace.folders;
|
||||||
this.workspace.update(workspace);
|
this.workspace.update(workspace);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
@@ -68,6 +68,7 @@ export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -17,6 +17,7 @@ import { join } from '../../base/common/
|
@@ -18,6 +18,7 @@ import { ProtocolConstants } from '../..
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -102,6 +103,7 @@ export const serverOptions: OptionDescri
|
@@ -108,6 +109,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -341,6 +341,7 @@ export class WebClientServer {
|
@@ -342,6 +342,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
|
|||||||
@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
@@ -49,6 +49,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -49,6 +49,17 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||||
version: pkg.version
|
version: pkg.version
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -28,6 +28,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|||||||
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
||||||
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
||||||
+ itemUrl: "https://open-vsx.org/vscode/item",
|
+ itemUrl: "https://open-vsx.org/vscode/item",
|
||||||
|
+ extensionUrlTemplate: "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest",
|
||||||
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||||
+ controlUrl: "",
|
+ controlUrl: "",
|
||||||
+ recommendationsUrl: "",
|
+ recommendationsUrl: "",
|
||||||
@ -40,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -326,7 +326,6 @@ export class WebClientServer {
|
@@ -327,7 +327,6 @@ export class WebClientServer {
|
||||||
|
|
||||||
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
|
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
|
||||||
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
|
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
|
||||||
@ -48,7 +49,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
|
|
||||||
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
|
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
|
||||||
|
|
||||||
@@ -342,14 +341,7 @@ export class WebClientServer {
|
@@ -343,14 +342,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
@ -89,3 +90,18 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Index: code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
||||||
|
@@ -26,6 +26,10 @@ export async function resolveMarketplace
|
||||||
|
'User-Agent': `VSCode ${version} (${productService.nameShort})`
|
||||||
|
};
|
||||||
|
|
||||||
|
+ if (productService.extensionsGallery?.authorizationHeaderToken) {
|
||||||
|
+ headers['Authorization'] = `Bearer ${productService.extensionsGallery.authorizationHeaderToken}`;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (supportsTelemetry(productService, environmentService) && getTelemetryLevel(configurationService) === TelemetryLevel.USAGE) {
|
||||||
|
const serviceMachineId = await getServiceMachineId(environmentService, fileService, storageService);
|
||||||
|
headers['X-Market-User-Id'] = serviceMachineId;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
|||||||
- if (!extension.enabledApiProposals) {
|
- if (!extension.enabledApiProposals) {
|
||||||
- return false;
|
- return false;
|
||||||
- }
|
- }
|
||||||
- return extension.enabledApiProposals.includes(proposal);
|
- return true;// extension.enabledApiProposals.includes(proposal);
|
||||||
+ return true
|
+ return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -60,6 +60,7 @@ export interface IProductConfiguration {
|
@@ -69,6 +69,7 @@ export interface IProductConfiguration {
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
@ -71,7 +71,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -342,6 +342,7 @@ export class WebClientServer {
|
@@ -343,6 +343,7 @@ export class WebClientServer {
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
@ -83,7 +83,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.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
@@ -291,7 +291,7 @@ export async function createTerminalEnvi
|
@@ -292,7 +292,7 @@ export async function createTerminalEnvi
|
||||||
|
|
||||||
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
||||||
// variables
|
// variables
|
||||||
@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||||
|
|
||||||
@@ -604,6 +605,39 @@ class WorkspaceProvider implements IWork
|
@@ -606,6 +607,39 @@ class WorkspaceProvider implements IWork
|
||||||
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
||||||
workspaceProvider: WorkspaceProvider.create(config),
|
workspaceProvider: WorkspaceProvider.create(config),
|
||||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -61,6 +61,10 @@ export interface IProductConfiguration {
|
@@ -70,6 +70,10 @@ export interface IProductConfiguration {
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
readonly proxyEndpointTemplate?: string
|
readonly proxyEndpointTemplate?: string
|
||||||
@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -343,6 +343,10 @@ export class WebClientServer {
|
@@ -344,6 +344,10 @@ export class WebClientServer {
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||||
|
|||||||
@ -6,21 +6,21 @@ not host our source maps there and want them to be self-hosted even if we could.
|
|||||||
|
|
||||||
To test try debugging/browsing the source of a build in a browser.
|
To test try debugging/browsing the source of a build in a browser.
|
||||||
|
|
||||||
Index: code-server/lib/vscode/build/gulpfile.reh.js
|
Index: code-server/lib/vscode/build/gulpfile.reh.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.ts
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
+++ code-server/lib/vscode/build/gulpfile.reh.ts
|
||||||
@@ -257,8 +257,7 @@ function packageTask(type, platform, arc
|
@@ -263,8 +263,7 @@ function packageTask(type: string, platf
|
||||||
|
return () => {
|
||||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
.pipe(rename(function (path) { path.dirname = path.dirname!.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||||
- .pipe(util.setExecutableBit(['**/*.sh']))
|
- .pipe(util.setExecutableBit(['**/*.sh']))
|
||||||
- .pipe(filter(['**', '!**/*.{js,css}.map']));
|
- .pipe(filter(['**', '!**/*.{js,css}.map']));
|
||||||
+ .pipe(util.setExecutableBit(['**/*.sh']));
|
+ .pipe(util.setExecutableBit(['**/*.sh']));
|
||||||
|
|
||||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||||
const isUIExtension = (manifest) => {
|
const isUIExtension = (manifest: { extensionKind?: string; main?: string; contributes?: Record<string, unknown> }) => {
|
||||||
@@ -297,9 +296,9 @@ function packageTask(type, platform, arc
|
@@ -304,9 +303,9 @@ function packageTask(type: string, platf
|
||||||
.map(name => `.build/extensions/${name}/**`);
|
.map(name => `.build/extensions/${name}/**`);
|
||||||
|
|
||||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||||
@ -31,8 +31,8 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
+ const sources = es.merge(src, extensions, extensionsCommonDependencies);
|
+ const sources = es.merge(src, extensions, extensionsCommonDependencies);
|
||||||
|
|
||||||
let version = packageJson.version;
|
let version = packageJson.version;
|
||||||
const quality = product.quality;
|
const quality = (product as typeof product & { quality?: string }).quality;
|
||||||
@@ -452,7 +451,7 @@ function tweakProductForServerWeb(produc
|
@@ -501,7 +500,7 @@ function tweakProductForServerWeb(produc
|
||||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||||
bundleTask,
|
bundleTask,
|
||||||
util.rimraf(`out-vscode-${type}-min`),
|
util.rimraf(`out-vscode-${type}-min`),
|
||||||
|
|||||||
@ -94,9 +94,9 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
|||||||
|
|
||||||
+import * as _http from 'http';
|
+import * as _http from 'http';
|
||||||
import minimist from 'minimist';
|
import minimist from 'minimist';
|
||||||
import * as nativeWatchdog from 'native-watchdog';
|
import * as nativeWatchdog from '@vscode/native-watchdog';
|
||||||
import * as net from 'net';
|
import * as net from 'net';
|
||||||
@@ -436,7 +437,28 @@ async function startExtensionHostProcess
|
@@ -469,7 +470,28 @@ async function startExtensionHostProcess
|
||||||
);
|
);
|
||||||
|
|
||||||
// rewrite onTerminate-function to be a proper shutdown
|
// rewrite onTerminate-function to be a proper shutdown
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||||
@@ -164,11 +166,23 @@ export async function setupServerService
|
@@ -172,11 +174,23 @@ export async function setupServerService
|
||||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||||
services.set(IRequestService, requestService);
|
services.set(IRequestService, requestService);
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -347,6 +347,8 @@ export class WebClientServer {
|
@@ -348,6 +348,8 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: rootBase + '/_static/out/browser/serviceWorker.js',
|
path: rootBase + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
@ -147,7 +147,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -65,6 +65,7 @@ export interface IProductConfiguration {
|
@@ -74,6 +74,7 @@ export interface IProductConfiguration {
|
||||||
readonly path: string;
|
readonly path: string;
|
||||||
readonly scope: string;
|
readonly scope: string;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
@@ -57,7 +57,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -58,7 +58,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||||
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||||
controlUrl: "",
|
controlUrl: "",
|
||||||
recommendationsUrl: "",
|
recommendationsUrl: "",
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -22,6 +22,7 @@ export const serverOptions: OptionDescri
|
@@ -23,6 +23,7 @@ export const serverOptions: OptionDescri
|
||||||
'disable-file-uploads': { type: 'boolean' },
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
'disable-getting-started-override': { type: 'boolean' },
|
'disable-getting-started-override': { type: 'boolean' },
|
||||||
'locale': { type: 'string' },
|
'locale': { type: 'string' },
|
||||||
@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -112,6 +113,7 @@ export interface ServerParsedArgs {
|
@@ -118,6 +119,7 @@ export interface ServerParsedArgs {
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
'disable-getting-started-override'?: boolean,
|
'disable-getting-started-override'?: boolean,
|
||||||
'locale'?: string
|
'locale'?: string
|
||||||
@ -24,7 +24,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -338,6 +338,14 @@ export class WebClientServer {
|
@@ -339,6 +339,14 @@ export class WebClientServer {
|
||||||
scopes: [['user:email'], ['repo']]
|
scopes: [['user:email'], ['repo']]
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
@@ -352,6 +360,7 @@ export class WebClientServer {
|
@@ -353,6 +361,7 @@ export class WebClientServer {
|
||||||
telemetryEndpoint: this._productService.telemetryEndpoint,
|
telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
|
|||||||
@ -93,7 +93,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -58,6 +58,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -67,6 +67,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
@ -101,11 +101,19 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
|
|
||||||
readonly version: string;
|
readonly version: string;
|
||||||
readonly date?: string;
|
readonly date?: string;
|
||||||
|
@@ -115,6 +116,7 @@ export interface IProductConfiguration {
|
||||||
|
readonly resourceUrlTemplate: string;
|
||||||
|
readonly nlsBaseUrl: string;
|
||||||
|
readonly accessSKUs?: string[];
|
||||||
|
+ readonly authorizationHeaderToken?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
readonly mcpGallery?: {
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -340,6 +340,7 @@ export class WebClientServer {
|
@@ -341,6 +341,7 @@ export class WebClientServer {
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: rootBase,
|
||||||
@ -117,8 +125,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -15,6 +15,8 @@ import { joinPath } from '../../base/com
|
@@ -16,6 +16,8 @@ import { join } from '../../base/common/
|
||||||
import { join } from '../../base/common/path.js';
|
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||||
|
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
+ /* ----- code-server ----- */
|
+ /* ----- code-server ----- */
|
||||||
@ -126,7 +134,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -98,6 +100,8 @@ export const serverOptions: OptionDescri
|
@@ -104,6 +106,8 @@ export const serverOptions: OptionDescri
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -360,6 +360,7 @@ export class WebClientServer {
|
@@ -361,6 +361,7 @@ export class WebClientServer {
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: basePath,
|
serverBasePath: basePath,
|
||||||
@ -70,12 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<meta http-equiv="Content-Security-Policy"
|
<meta http-equiv="Content-Security-Policy"
|
||||||
- content="default-src 'none'; script-src 'sha256-qzQMf4WjRXHohkk4Hg1T0LJIElTDtjITLXbR/RuGA/Q=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-TaWGDzV7c9rUH2q/5ygOyYUHSyHIqBMYfucPh3lnKvU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-q8xbX8bFRtUAF+eVy0H2EWJWeyp3LsLyd7qwg1qndEg=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-nQZh+9dHKZP2cHbhYlCbWDtqxxJtGjRGBx57zNP2DZM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -238,7 +238,7 @@
|
@@ -256,7 +256,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
|
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
|
||||||
@ -84,7 +84,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
.then(async registration => {
|
.then(async registration => {
|
||||||
/**
|
/**
|
||||||
* @param {MessageEvent} event
|
* @param {MessageEvent} event
|
||||||
@@ -351,6 +351,12 @@
|
@@ -370,6 +370,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
||||||
/>
|
/>
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
<title>{{ERROR_TITLE}} - code-server</title>
|
<title>{{ERROR_TITLE}} - {{APP_NAME}}</title>
|
||||||
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
|
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
|
||||||
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
|
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
|
||||||
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
<link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||||
|
|||||||
@ -24,6 +24,6 @@ export class HttpError extends Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CookieKeys {
|
export function getCookieSessionName(suffix?: string): string {
|
||||||
Session = "code-server-session",
|
return suffix ? `code-server-session-${suffix.replace(/[^a-zA-Z0-9-]/g, "-")}` : "code-server-session"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,9 @@ export interface UserProvidedCodeArgs {
|
|||||||
"disable-workspace-trust"?: boolean
|
"disable-workspace-trust"?: boolean
|
||||||
"disable-getting-started-override"?: boolean
|
"disable-getting-started-override"?: boolean
|
||||||
"disable-proxy"?: boolean
|
"disable-proxy"?: boolean
|
||||||
|
"reconnection-grace-time"?: string
|
||||||
"session-socket"?: string
|
"session-socket"?: string
|
||||||
|
"cookie-suffix"?: string
|
||||||
"link-protection-trusted-domains"?: string[]
|
"link-protection-trusted-domains"?: string[]
|
||||||
// locale is used by both VS Code and code-server.
|
// locale is used by both VS Code and code-server.
|
||||||
locale?: string
|
locale?: string
|
||||||
@ -94,6 +96,7 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
"welcome-text"?: string
|
"welcome-text"?: string
|
||||||
"abs-proxy-base-path"?: string
|
"abs-proxy-base-path"?: string
|
||||||
i18n?: string
|
i18n?: string
|
||||||
|
"idle-timeout-seconds"?: number
|
||||||
/* Positional arguments. */
|
/* Positional arguments. */
|
||||||
_?: string[]
|
_?: string[]
|
||||||
}
|
}
|
||||||
@ -171,6 +174,12 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
"session-socket": {
|
"session-socket": {
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
|
"cookie-suffix": {
|
||||||
|
type: "string",
|
||||||
|
description:
|
||||||
|
"Adds a suffix to the cookie. This can prevent a collision of cookies for subdomains, making them explixit. \n" +
|
||||||
|
"Without this flag, no suffix is used. This can also be set with CODE_SERVER_COOKIE_SUFFIX set to any string.",
|
||||||
|
},
|
||||||
"disable-file-downloads": {
|
"disable-file-downloads": {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
description:
|
description:
|
||||||
@ -303,6 +312,16 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
path: true,
|
path: true,
|
||||||
description: "Path to JSON file with custom translations. Merges with default strings and supports all i18n keys.",
|
description: "Path to JSON file with custom translations. Merges with default strings and supports all i18n keys.",
|
||||||
},
|
},
|
||||||
|
"idle-timeout-seconds": {
|
||||||
|
type: "number",
|
||||||
|
description: "Timeout in seconds to wait before shutting down when idle.",
|
||||||
|
},
|
||||||
|
"reconnection-grace-time": {
|
||||||
|
type: "string",
|
||||||
|
description:
|
||||||
|
"Override the reconnection grace time in seconds. Clients who disconnect for longer than this duration will need to \n" +
|
||||||
|
"reload the window. Defaults to 10800 (3 hours).",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
|
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
|
||||||
@ -396,6 +415,10 @@ export const parse = (
|
|||||||
throw new Error("--github-auth can only be set in the config file or passed in via $GITHUB_TOKEN")
|
throw new Error("--github-auth can only be set in the config file or passed in via $GITHUB_TOKEN")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key === "idle-timeout-seconds" && Number(value) <= 60) {
|
||||||
|
throw new Error("--idle-timeout-seconds must be greater than 60 seconds.")
|
||||||
|
}
|
||||||
|
|
||||||
const option = options[key]
|
const option = options[key]
|
||||||
if (option.type === "boolean") {
|
if (option.type === "boolean") {
|
||||||
;(args[key] as boolean) = true
|
;(args[key] as boolean) = true
|
||||||
@ -503,6 +526,7 @@ export interface DefaultedArgs extends ConfigArgs {
|
|||||||
"extensions-dir": string
|
"extensions-dir": string
|
||||||
"user-data-dir": string
|
"user-data-dir": string
|
||||||
"session-socket": string
|
"session-socket": string
|
||||||
|
"app-name": string
|
||||||
/* Positional arguments. */
|
/* Positional arguments. */
|
||||||
_: string[]
|
_: string[]
|
||||||
}
|
}
|
||||||
@ -607,10 +631,28 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
|||||||
usingEnvPassword = false
|
usingEnvPassword = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.CODE_SERVER_COOKIE_SUFFIX) {
|
||||||
|
args["cookie-suffix"] = process.env.CODE_SERVER_COOKIE_SUFFIX
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.GITHUB_TOKEN) {
|
if (process.env.GITHUB_TOKEN) {
|
||||||
args["github-auth"] = process.env.GITHUB_TOKEN
|
args["github-auth"] = process.env.GITHUB_TOKEN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.CODE_SERVER_RECONNECTION_GRACE_TIME) {
|
||||||
|
args["reconnection-grace-time"] = process.env.CODE_SERVER_RECONNECTION_GRACE_TIME
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS) {
|
||||||
|
if (isNaN(Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS))) {
|
||||||
|
logger.info("CODE_SERVER_IDLE_TIMEOUT_SECONDS must be a number")
|
||||||
|
}
|
||||||
|
if (Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS) <= 60) {
|
||||||
|
throw new Error("--idle-timeout-seconds must be greater than 60 seconds.")
|
||||||
|
}
|
||||||
|
args["idle-timeout-seconds"] = Number(process.env.CODE_SERVER_IDLE_TIMEOUT_SECONDS)
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure they're not readable by child processes.
|
// Ensure they're not readable by child processes.
|
||||||
delete process.env.PASSWORD
|
delete process.env.PASSWORD
|
||||||
delete process.env.HASHED_PASSWORD
|
delete process.env.HASHED_PASSWORD
|
||||||
@ -635,6 +677,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
|||||||
}
|
}
|
||||||
args["proxy-domain"] = finalProxies
|
args["proxy-domain"] = finalProxies
|
||||||
|
|
||||||
|
if (!args["app-name"]) {
|
||||||
|
args["app-name"] = "code-server"
|
||||||
|
}
|
||||||
|
|
||||||
args._ = getResolvedPathsFromArgs(args)
|
args._ = getResolvedPathsFromArgs(args)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { logger } from "@coder/logger"
|
import { logger } from "@coder/logger"
|
||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
|
import { Emitter } from "../common/emitter"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a heartbeat using a local file to indicate activity.
|
* Provides a heartbeat using a local file to indicate activity.
|
||||||
@ -8,6 +9,9 @@ export class Heart {
|
|||||||
private heartbeatTimer?: NodeJS.Timeout
|
private heartbeatTimer?: NodeJS.Timeout
|
||||||
private heartbeatInterval = 60000
|
private heartbeatInterval = 60000
|
||||||
public lastHeartbeat = 0
|
public lastHeartbeat = 0
|
||||||
|
private readonly _onChange = new Emitter<"alive" | "expired" | "unknown">()
|
||||||
|
readonly onChange = this._onChange.event
|
||||||
|
private state: "alive" | "expired" | "unknown" = "expired"
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private readonly heartbeatPath: string,
|
private readonly heartbeatPath: string,
|
||||||
@ -17,6 +21,13 @@ export class Heart {
|
|||||||
this.alive = this.alive.bind(this)
|
this.alive = this.alive.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setState(state: typeof this.state) {
|
||||||
|
if (this.state !== state) {
|
||||||
|
this.state = state
|
||||||
|
this._onChange.emit(this.state)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public alive(): boolean {
|
public alive(): boolean {
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
return now - this.lastHeartbeat < this.heartbeatInterval
|
return now - this.lastHeartbeat < this.heartbeatInterval
|
||||||
@ -28,6 +39,7 @@ export class Heart {
|
|||||||
*/
|
*/
|
||||||
public async beat(): Promise<void> {
|
public async beat(): Promise<void> {
|
||||||
if (this.alive()) {
|
if (this.alive()) {
|
||||||
|
this.setState("alive")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +48,22 @@ export class Heart {
|
|||||||
if (typeof this.heartbeatTimer !== "undefined") {
|
if (typeof this.heartbeatTimer !== "undefined") {
|
||||||
clearTimeout(this.heartbeatTimer)
|
clearTimeout(this.heartbeatTimer)
|
||||||
}
|
}
|
||||||
this.heartbeatTimer = setTimeout(() => heartbeatTimer(this.isActive, this.beat), this.heartbeatInterval)
|
|
||||||
|
this.heartbeatTimer = setTimeout(async () => {
|
||||||
|
try {
|
||||||
|
if (await this.isActive()) {
|
||||||
|
this.beat()
|
||||||
|
} else {
|
||||||
|
this.setState("expired")
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
logger.warn((error as Error).message)
|
||||||
|
this.setState("unknown")
|
||||||
|
}
|
||||||
|
}, this.heartbeatInterval)
|
||||||
|
|
||||||
|
this.setState("alive")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await fs.writeFile(this.heartbeatPath, "")
|
return await fs.writeFile(this.heartbeatPath, "")
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
@ -53,20 +80,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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import * as http from "http"
|
|||||||
import * as net from "net"
|
import * as net from "net"
|
||||||
import qs from "qs"
|
import qs from "qs"
|
||||||
import { Disposable } from "../common/emitter"
|
import { Disposable } from "../common/emitter"
|
||||||
import { CookieKeys, HttpCode, HttpError } from "../common/http"
|
import { HttpCode, HttpError } from "../common/http"
|
||||||
import { normalize } from "../common/util"
|
import { normalize } from "../common/util"
|
||||||
import { AuthType, DefaultedArgs } from "./cli"
|
import { AuthType, DefaultedArgs } from "./cli"
|
||||||
import { version as codeServerVersion } from "./constants"
|
import { version as codeServerVersion } from "./constants"
|
||||||
@ -40,6 +40,7 @@ declare global {
|
|||||||
heart: Heart
|
heart: Heart
|
||||||
settings: SettingsProvider<CoderSettings>
|
settings: SettingsProvider<CoderSettings>
|
||||||
updater: UpdateProvider
|
updater: UpdateProvider
|
||||||
|
cookieSessionName: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,7 +125,7 @@ export const authenticated = async (req: express.Request): Promise<boolean> => {
|
|||||||
const passwordMethod = getPasswordMethod(hashedPasswordFromArgs)
|
const passwordMethod = getPasswordMethod(hashedPasswordFromArgs)
|
||||||
const isCookieValidArgs: IsCookieValidArgs = {
|
const isCookieValidArgs: IsCookieValidArgs = {
|
||||||
passwordMethod,
|
passwordMethod,
|
||||||
cookieKey: sanitizeString(req.cookies[CookieKeys.Session]),
|
cookieKey: sanitizeString(req.cookies[req.cookieSessionName]),
|
||||||
passwordFromArgs: req.args.password || "",
|
passwordFromArgs: req.args.password || "",
|
||||||
hashedPasswordFromArgs: req.args["hashed-password"],
|
hashedPasswordFromArgs: req.args["hashed-password"],
|
||||||
}
|
}
|
||||||
@ -350,6 +351,25 @@ export function ensureOrigin(req: express.Request, _?: express.Response, next?:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the origin matches any trusted origin. Entries are matched
|
||||||
|
* as exact strings, the special wildcard `"*"`, or `*.example.com`-style
|
||||||
|
* domain wildcards (same as --proxy-domain).
|
||||||
|
*/
|
||||||
|
export function isTrustedOrigin(origin: string, trustedOrigins: string[]): boolean {
|
||||||
|
return trustedOrigins.some((trusted) => {
|
||||||
|
if (trusted === "*" || trusted === origin) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// *.example.com style: match origin if it is the domain or a subdomain
|
||||||
|
if (trusted.startsWith("*.")) {
|
||||||
|
const domain = trusted.slice(2).toLowerCase()
|
||||||
|
return origin === domain || origin.endsWith("." + domain)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticate the request origin against the host. Throw if invalid.
|
* Authenticate the request origin against the host. Throw if invalid.
|
||||||
*/
|
*/
|
||||||
@ -369,7 +389,7 @@ export function authenticateOrigin(req: express.Request): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const trustedOrigins = req.args["trusted-origins"] || []
|
const trustedOrigins = req.args["trusted-origins"] || []
|
||||||
if (trustedOrigins.includes(origin) || trustedOrigins.includes("*")) {
|
if (isTrustedOrigin(origin, trustedOrigins)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@ init({
|
|||||||
lowerCaseLng: true,
|
lowerCaseLng: true,
|
||||||
debug: process.env.NODE_ENV === "development",
|
debug: process.env.NODE_ENV === "development",
|
||||||
resources: defaultResources,
|
resources: defaultResources,
|
||||||
|
showSupportNotice: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
export default i18next
|
export default i18next
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"LOGIN_TITLE": "{{app}} login",
|
"LOGIN_TITLE": "{{app}} login",
|
||||||
"LOGIN_BELOW": "Please log in below.",
|
"LOGIN_BELOW": "Please log in below.",
|
||||||
"WELCOME": "Welcome to {{app}}",
|
"WELCOME": "Welcome to {{app}}",
|
||||||
"LOGIN_PASSWORD": "Check the config file at {{configFile}} for the password.",
|
"LOGIN_PASSWORD": "Check the config file for the password.",
|
||||||
"LOGIN_USING_ENV_PASSWORD": "Password was set from $PASSWORD.",
|
"LOGIN_USING_ENV_PASSWORD": "Password was set from $PASSWORD.",
|
||||||
"LOGIN_USING_HASHED_PASSWORD": "Password was set from $HASHED_PASSWORD.",
|
"LOGIN_USING_HASHED_PASSWORD": "Password was set from $HASHED_PASSWORD.",
|
||||||
"SUBMIT": "SUBMIT",
|
"SUBMIT": "SUBMIT",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"LOGIN_TITLE": "{{app}} ログイン",
|
"LOGIN_TITLE": "{{app}} ログイン",
|
||||||
"LOGIN_BELOW": "以下によりログインしてください。",
|
"LOGIN_BELOW": "以下によりログインしてください。",
|
||||||
"WELCOME": "ようこそ {{app}} へ!",
|
"WELCOME": "ようこそ {{app}} へ!",
|
||||||
"LOGIN_PASSWORD": "パスワードは設定ファイル( {{configFile}} )を確認してください。",
|
"LOGIN_PASSWORD": "パスワードは設定ファイルを確認してください。",
|
||||||
"LOGIN_USING_ENV_PASSWORD": "パスワードは環境変数 $PASSWORD で設定されています。",
|
"LOGIN_USING_ENV_PASSWORD": "パスワードは環境変数 $PASSWORD で設定されています。",
|
||||||
"LOGIN_USING_HASHED_PASSWORD": "パスワードは環境変数 $HASHED_PASSWORD で設定されています。",
|
"LOGIN_USING_HASHED_PASSWORD": "パスワードは環境変数 $HASHED_PASSWORD で設定されています。",
|
||||||
"SUBMIT": "実行",
|
"SUBMIT": "実行",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"LOGIN_TITLE": "เข้าสู่ระบบ {{app}}",
|
"LOGIN_TITLE": "เข้าสู่ระบบ {{app}}",
|
||||||
"LOGIN_BELOW": "กรุณาเข้าสู่ระบบด้านล่าง",
|
"LOGIN_BELOW": "กรุณาเข้าสู่ระบบด้านล่าง",
|
||||||
"WELCOME": "ยินดีต้อนรับสู่ {{app}}",
|
"WELCOME": "ยินดีต้อนรับสู่ {{app}}",
|
||||||
"LOGIN_PASSWORD": "ตรวจสอบไฟล์กำหนดค่าที่ {{configFile}} เพื่อดูรหัสผ่าน",
|
"LOGIN_PASSWORD": "ตรวจสอบไฟล์กำหนดค่าเพื่อดูรหัสผ่าน",
|
||||||
"LOGIN_USING_ENV_PASSWORD": "รหัสผ่านถูกกำหนดเป็น $PASSWORD",
|
"LOGIN_USING_ENV_PASSWORD": "รหัสผ่านถูกกำหนดเป็น $PASSWORD",
|
||||||
"LOGIN_USING_HASHED_PASSWORD": "รรหัสผ่านถูกกำหนดเป็น $HASHED_PASSWORD",
|
"LOGIN_USING_HASHED_PASSWORD": "รรหัสผ่านถูกกำหนดเป็น $HASHED_PASSWORD",
|
||||||
"SUBMIT": "ส่ง",
|
"SUBMIT": "ส่ง",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"LOGIN_TITLE": "{{app}} لاگ ان کریں",
|
"LOGIN_TITLE": "{{app}} لاگ ان کریں",
|
||||||
"LOGIN_BELOW": "براہ کرم نیچے لاگ ان کریں۔",
|
"LOGIN_BELOW": "براہ کرم نیچے لاگ ان کریں۔",
|
||||||
"WELCOME": "میں خوش آمدید {{app}}",
|
"WELCOME": "میں خوش آمدید {{app}}",
|
||||||
"LOGIN_PASSWORD": "پاس ورڈ کے لیے {{configFile}} پر کنفگ فائل چیک کریں۔",
|
"LOGIN_PASSWORD": "پاس ورڈ کے لیے کنفگ فائل چیک کریں۔",
|
||||||
"LOGIN_USING_ENV_PASSWORD": "پاس ورڈ $PASSWORD سے سیٹ کیا گیا تھا۔",
|
"LOGIN_USING_ENV_PASSWORD": "پاس ورڈ $PASSWORD سے سیٹ کیا گیا تھا۔",
|
||||||
"LOGIN_USING_HASHED_PASSWORD": "پاس ورڈ $HASHED_PASSWORD سے سیٹ کیا گیا تھا۔",
|
"LOGIN_USING_HASHED_PASSWORD": "پاس ورڈ $HASHED_PASSWORD سے سیٹ کیا گیا تھا۔",
|
||||||
"SUBMIT": "جمع کرائیں",
|
"SUBMIT": "جمع کرائیں",
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"LOGIN_TITLE": "{{app}} 登录",
|
"LOGIN_TITLE": "{{app}} 登录",
|
||||||
"LOGIN_BELOW": "请在下面登录。",
|
"LOGIN_BELOW": "请在下面登录。",
|
||||||
"WELCOME": "欢迎来到 {{app}}",
|
"WELCOME": "欢迎来到 {{app}}",
|
||||||
"LOGIN_PASSWORD": "查看配置文件 {{configFile}} 中的密码。",
|
"LOGIN_PASSWORD": "查看配置文件中的密码。",
|
||||||
"LOGIN_USING_ENV_PASSWORD": "密码在 $PASSWORD 中设置。",
|
"LOGIN_USING_ENV_PASSWORD": "密码在 $PASSWORD 中设置。",
|
||||||
"LOGIN_USING_HASHED_PASSWORD": "密码在 $HASHED_PASSWORD 中设置。",
|
"LOGIN_USING_HASHED_PASSWORD": "密码在 $HASHED_PASSWORD 中设置。",
|
||||||
"SUBMIT": "提交",
|
"SUBMIT": "提交",
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { loadCustomStrings } from "./i18n"
|
|||||||
import { register } from "./routes"
|
import { register } from "./routes"
|
||||||
import { VSCodeModule } from "./routes/vscode"
|
import { VSCodeModule } from "./routes/vscode"
|
||||||
import { isDirectory, open } from "./util"
|
import { isDirectory, open } from "./util"
|
||||||
|
import { wrapper } from "./wrapper"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the user passed an extension-related VS Code flag.
|
* Return true if the user passed an extension-related VS Code flag.
|
||||||
@ -141,7 +142,7 @@ export const runCodeServer = async (
|
|||||||
const app = await createApp(args)
|
const app = await createApp(args)
|
||||||
const protocol = args.cert ? "https" : "http"
|
const protocol = args.cert ? "https" : "http"
|
||||||
const serverAddress = ensureAddress(app.server, protocol)
|
const serverAddress = ensureAddress(app.server, protocol)
|
||||||
const disposeRoutes = await register(app, args)
|
const { disposeRoutes, heart } = await register(app, args)
|
||||||
|
|
||||||
logger.info(`Using config file ${args.config}`)
|
logger.info(`Using config file ${args.config}`)
|
||||||
logger.info(`${protocol.toUpperCase()} server listening on ${serverAddress.toString()}`)
|
logger.info(`${protocol.toUpperCase()} server listening on ${serverAddress.toString()}`)
|
||||||
@ -166,6 +167,27 @@ export const runCodeServer = async (
|
|||||||
logger.info(" - Not serving HTTPS")
|
logger.info(" - Not serving HTTPS")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args["idle-timeout-seconds"]) {
|
||||||
|
logger.info(` - Idle timeout set to ${args["idle-timeout-seconds"]} seconds`)
|
||||||
|
|
||||||
|
let idleShutdownTimer: NodeJS.Timeout | undefined
|
||||||
|
const startIdleShutdownTimer = () => {
|
||||||
|
idleShutdownTimer = setTimeout(() => {
|
||||||
|
logger.warn(`Idle timeout of ${args["idle-timeout-seconds"]} seconds exceeded`)
|
||||||
|
wrapper.exit(0)
|
||||||
|
}, args["idle-timeout-seconds"]! * 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
startIdleShutdownTimer()
|
||||||
|
|
||||||
|
heart.onChange((state) => {
|
||||||
|
clearTimeout(idleShutdownTimer)
|
||||||
|
if (state === "expired") {
|
||||||
|
startIdleShutdownTimer()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (args["disable-proxy"]) {
|
if (args["disable-proxy"]) {
|
||||||
logger.info(" - Proxy disabled")
|
logger.info(" - Proxy disabled")
|
||||||
} else if (args["proxy-domain"].length > 0) {
|
} else if (args["proxy-domain"].length > 0) {
|
||||||
|
|||||||
@ -28,6 +28,12 @@ export const errorHasCode = (error: any): error is ErrorWithCode => {
|
|||||||
|
|
||||||
const notFoundCodes = [404, "ENOENT", "EISDIR"]
|
const notFoundCodes = [404, "ENOENT", "EISDIR"]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Final HTTP error handler.
|
||||||
|
*
|
||||||
|
* Note: This handler intentionally does not call `next()` even though it
|
||||||
|
* accepts it as an argument; it is expected to be mounted last.
|
||||||
|
*/
|
||||||
export const errorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
export const errorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
||||||
let statusCode = 500
|
let statusCode = 500
|
||||||
|
|
||||||
@ -51,7 +57,8 @@ export const errorHandler: express.ErrorRequestHandler = async (err, req, res, n
|
|||||||
replaceTemplates(req, content)
|
replaceTemplates(req, content)
|
||||||
.replace(/{{ERROR_TITLE}}/g, statusCode.toString())
|
.replace(/{{ERROR_TITLE}}/g, statusCode.toString())
|
||||||
.replace(/{{ERROR_HEADER}}/g, statusCode.toString())
|
.replace(/{{ERROR_HEADER}}/g, statusCode.toString())
|
||||||
.replace(/{{ERROR_BODY}}/g, escapeHtml(err.message)),
|
.replace(/{{ERROR_BODY}}/g, escapeHtml(err.message))
|
||||||
|
.replace(/{{APP_NAME}}/g, req.args["app-name"]),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
res.json({
|
res.json({
|
||||||
@ -61,6 +68,12 @@ export const errorHandler: express.ErrorRequestHandler = async (err, req, res, n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Final WebSocket error handler.
|
||||||
|
*
|
||||||
|
* Note: This handler intentionally does not call `next()` even though it
|
||||||
|
* accepts it as an argument; it is expected to be mounted last.
|
||||||
|
*/
|
||||||
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
export const wsErrorHandler: express.ErrorRequestHandler = async (err, req, res, next) => {
|
||||||
let statusCode = 500
|
let statusCode = 500
|
||||||
if (errorHasStatusCode(err)) {
|
if (errorHasStatusCode(err)) {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { promises as fs } from "fs"
|
|||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import * as tls from "tls"
|
import * as tls from "tls"
|
||||||
import { Disposable } from "../../common/emitter"
|
import { Disposable } from "../../common/emitter"
|
||||||
import { HttpCode, HttpError } from "../../common/http"
|
import { getCookieSessionName, HttpCode, HttpError } from "../../common/http"
|
||||||
import { plural } from "../../common/util"
|
import { plural } from "../../common/util"
|
||||||
import { App } from "../app"
|
import { App } from "../app"
|
||||||
import { AuthType, DefaultedArgs } from "../cli"
|
import { AuthType, DefaultedArgs } from "../cli"
|
||||||
@ -28,7 +28,10 @@ import * as vscode from "./vscode"
|
|||||||
/**
|
/**
|
||||||
* Register all routes and middleware.
|
* Register all routes and middleware.
|
||||||
*/
|
*/
|
||||||
export const register = async (app: App, args: DefaultedArgs): Promise<Disposable["dispose"]> => {
|
export const register = async (
|
||||||
|
app: App,
|
||||||
|
args: DefaultedArgs,
|
||||||
|
): Promise<{ disposeRoutes: Disposable["dispose"]; heart: Heart }> => {
|
||||||
const heart = new Heart(path.join(paths.data, "heartbeat"), async () => {
|
const heart = new Heart(path.join(paths.data, "heartbeat"), async () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// getConnections appears to not call the callback when there are no more
|
// getConnections appears to not call the callback when there are no more
|
||||||
@ -58,6 +61,8 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
const settings = new SettingsProvider<CoderSettings>(path.join(args["user-data-dir"], "coder.json"))
|
const settings = new SettingsProvider<CoderSettings>(path.join(args["user-data-dir"], "coder.json"))
|
||||||
const updater = new UpdateProvider("https://api.github.com/repos/coder/code-server/releases/latest", settings)
|
const updater = new UpdateProvider("https://api.github.com/repos/coder/code-server/releases/latest", settings)
|
||||||
|
|
||||||
|
const cookieSessionName = getCookieSessionName(args["cookie-suffix"])
|
||||||
|
|
||||||
const common: express.RequestHandler = (req, _, next) => {
|
const common: express.RequestHandler = (req, _, next) => {
|
||||||
// /healthz|/healthz/ needs to be excluded otherwise health checks will make
|
// /healthz|/healthz/ needs to be excluded otherwise health checks will make
|
||||||
// it look like code-server is always in use.
|
// it look like code-server is always in use.
|
||||||
@ -72,6 +77,7 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
req.heart = heart
|
req.heart = heart
|
||||||
req.settings = settings
|
req.settings = settings
|
||||||
req.updater = updater
|
req.updater = updater
|
||||||
|
req.cookieSessionName = cookieSessionName
|
||||||
|
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
@ -173,8 +179,11 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
app.router.use(errorHandler)
|
app.router.use(errorHandler)
|
||||||
app.wsRouter.use(wsErrorHandler)
|
app.wsRouter.use(wsErrorHandler)
|
||||||
|
|
||||||
return () => {
|
return {
|
||||||
heart.dispose()
|
disposeRoutes: () => {
|
||||||
vscode.dispose()
|
heart.dispose()
|
||||||
|
vscode.dispose()
|
||||||
|
},
|
||||||
|
heart,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import { Router, Request } from "express"
|
|||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
import { RateLimiter as Limiter } from "limiter"
|
import { RateLimiter as Limiter } from "limiter"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { CookieKeys } from "../../common/http"
|
|
||||||
import { rootPath } from "../constants"
|
import { rootPath } from "../constants"
|
||||||
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
|
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
|
||||||
import i18n from "../i18n"
|
import i18n from "../i18n"
|
||||||
@ -30,11 +29,10 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
|||||||
const content = await fs.readFile(path.join(rootPath, "src/browser/pages/login.html"), "utf8")
|
const content = await fs.readFile(path.join(rootPath, "src/browser/pages/login.html"), "utf8")
|
||||||
const locale = req.args["locale"] || "en"
|
const locale = req.args["locale"] || "en"
|
||||||
i18n.changeLanguage(locale)
|
i18n.changeLanguage(locale)
|
||||||
const appName = req.args["app-name"] || "code-server"
|
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: req.args["app-name"] }) as string)
|
||||||
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: appName }) as string)
|
|
||||||
|
|
||||||
// Determine password message using i18n
|
// Determine password message using i18n
|
||||||
let passwordMsg = i18n.t("LOGIN_PASSWORD", { configFile: req.args.config })
|
let passwordMsg = i18n.t("LOGIN_PASSWORD")
|
||||||
if (req.args.usingEnvPassword) {
|
if (req.args.usingEnvPassword) {
|
||||||
passwordMsg = i18n.t("LOGIN_USING_ENV_PASSWORD")
|
passwordMsg = i18n.t("LOGIN_USING_ENV_PASSWORD")
|
||||||
} else if (req.args.usingEnvHashedPassword) {
|
} else if (req.args.usingEnvHashedPassword) {
|
||||||
@ -44,7 +42,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
|||||||
return replaceTemplates(
|
return replaceTemplates(
|
||||||
req,
|
req,
|
||||||
content
|
content
|
||||||
.replace(/{{I18N_LOGIN_TITLE}}/g, i18n.t("LOGIN_TITLE", { app: appName }))
|
.replace(/{{I18N_LOGIN_TITLE}}/g, i18n.t("LOGIN_TITLE", { app: req.args["app-name"] }))
|
||||||
.replace(/{{WELCOME_TEXT}}/g, welcomeText)
|
.replace(/{{WELCOME_TEXT}}/g, welcomeText)
|
||||||
.replace(/{{PASSWORD_MSG}}/g, passwordMsg)
|
.replace(/{{PASSWORD_MSG}}/g, passwordMsg)
|
||||||
.replace(/{{I18N_LOGIN_BELOW}}/g, i18n.t("LOGIN_BELOW"))
|
.replace(/{{I18N_LOGIN_BELOW}}/g, i18n.t("LOGIN_BELOW"))
|
||||||
@ -95,7 +93,7 @@ router.post<{}, string, { password?: string; base?: string } | undefined, { to?:
|
|||||||
if (isPasswordValid) {
|
if (isPasswordValid) {
|
||||||
// The hash does not add any actual security but we do it for
|
// The hash does not add any actual security but we do it for
|
||||||
// obfuscation purposes (and as a side effect it handles escaping).
|
// obfuscation purposes (and as a side effect it handles escaping).
|
||||||
res.cookie(CookieKeys.Session, hashedPassword, getCookieOptions(req))
|
res.cookie(req.cookieSessionName, hashedPassword, getCookieOptions(req))
|
||||||
|
|
||||||
const to = (typeof req.query.to === "string" && req.query.to) || "/"
|
const to = (typeof req.query.to === "string" && req.query.to) || "/"
|
||||||
return redirect(req, res, to, { to: undefined })
|
return redirect(req, res, to, { to: undefined })
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { Router } from "express"
|
import { Router } from "express"
|
||||||
import { CookieKeys } from "../../common/http"
|
|
||||||
import { getCookieOptions, redirect } from "../http"
|
import { getCookieOptions, redirect } from "../http"
|
||||||
import { sanitizeString } from "../util"
|
import { sanitizeString } from "../util"
|
||||||
|
|
||||||
@ -7,7 +6,7 @@ export const router = Router()
|
|||||||
|
|
||||||
router.get<{}, undefined, undefined, { base?: string; to?: string }>("/", async (req, res) => {
|
router.get<{}, undefined, undefined, { base?: string; to?: string }>("/", async (req, res) => {
|
||||||
// Must use the *identical* properties used to set the cookie.
|
// Must use the *identical* properties used to set the cookie.
|
||||||
res.clearCookie(CookieKeys.Session, getCookieOptions(req))
|
res.clearCookie(req.cookieSessionName, getCookieOptions(req))
|
||||||
|
|
||||||
const to = sanitizeString(req.query.to) || "/"
|
const to = sanitizeString(req.query.to) || "/"
|
||||||
return redirect(req, res, to, { to: undefined, base: undefined, href: undefined })
|
return redirect(req, res, to, { to: undefined, base: undefined, href: undefined })
|
||||||
|
|||||||
@ -13,7 +13,8 @@ const getProxyTarget = (
|
|||||||
): string => {
|
): string => {
|
||||||
// If there is a base path, strip it out.
|
// If there is a base path, strip it out.
|
||||||
const base = (req as any).base || ""
|
const base = (req as any).base || ""
|
||||||
const port = parseInt(req.params.port, 10)
|
// Cast since we only have one port param.
|
||||||
|
const port = parseInt(req.params.port as string, 10)
|
||||||
if (isNaN(port)) {
|
if (isNaN(port)) {
|
||||||
throw new HttpError("Invalid port", HttpCode.BadRequest)
|
throw new HttpError("Invalid port", HttpCode.BadRequest)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -172,7 +172,6 @@ router.get("/", ensureVSCodeLoaded, async (req, res, next) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
router.get("/manifest.json", async (req, res) => {
|
router.get("/manifest.json", async (req, res) => {
|
||||||
const appName = req.args["app-name"] || "code-server"
|
|
||||||
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
||||||
|
|
||||||
res.end(
|
res.end(
|
||||||
@ -180,8 +179,8 @@ router.get("/manifest.json", async (req, res) => {
|
|||||||
req,
|
req,
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
{
|
{
|
||||||
name: appName,
|
name: req.args["app-name"],
|
||||||
short_name: appName,
|
short_name: req.args["app-name"],
|
||||||
start_url: ".",
|
start_url: ".",
|
||||||
display: "fullscreen",
|
display: "fullscreen",
|
||||||
display_override: ["window-controls-overlay"],
|
display_override: ["window-controls-overlay"],
|
||||||
|
|||||||
487
test/package-lock.json
generated
487
test/package-lock.json
generated
@ -7,18 +7,18 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@jest-mock/express": "^1.4.5",
|
"@jest-mock/express": "^1.4.5",
|
||||||
"@playwright/test": "^1.46.0",
|
"@playwright/test": "^1.56.1",
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/jsdom": "^16.2.13",
|
"@types/jsdom": "^16.2.13",
|
||||||
"@types/node-fetch": "^2.5.8",
|
"@types/node-fetch": "^2.5.8",
|
||||||
"@types/wtfnode": "^0.7.0",
|
"@types/wtfnode": "^0.7.0",
|
||||||
"argon2": "^0.28.0",
|
"argon2": "^0.44.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"jsdom": "^16.4.0",
|
"jsdom": "^16.4.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"playwright": "^1.46.0",
|
"playwright": "^1.56.1",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
"wtfnode": "^0.9.1"
|
"wtfnode": "^0.9.1"
|
||||||
}
|
}
|
||||||
@ -642,6 +642,13 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@epic-web/invariant": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@istanbuljs/load-nyc-config": {
|
"node_modules/@istanbuljs/load-nyc-config": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
||||||
@ -980,27 +987,6 @@
|
|||||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@mapbox/node-pre-gyp": {
|
|
||||||
"version": "1.0.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
|
|
||||||
"integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"dependencies": {
|
|
||||||
"detect-libc": "^2.0.0",
|
|
||||||
"https-proxy-agent": "^5.0.0",
|
|
||||||
"make-dir": "^3.1.0",
|
|
||||||
"node-fetch": "^2.6.7",
|
|
||||||
"nopt": "^5.0.0",
|
|
||||||
"npmlog": "^5.0.1",
|
|
||||||
"rimraf": "^3.0.2",
|
|
||||||
"semver": "^7.3.5",
|
|
||||||
"tar": "^6.1.11"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"node-pre-gyp": "bin/node-pre-gyp"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@phc/format": {
|
"node_modules/@phc/format": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@phc/format/-/format-1.0.0.tgz",
|
||||||
@ -1012,13 +998,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@playwright/test": {
|
"node_modules/@playwright/test": {
|
||||||
"version": "1.47.2",
|
"version": "1.56.1",
|
||||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.2.tgz",
|
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz",
|
||||||
"integrity": "sha512-jTXRsoSPONAs8Za9QEQdyjFn+0ZQFjCiIztAIF6bi1HqhBzG9Ma7g1WotyiGqFSBRZjIEqMdT8RUlbk1QVhzCQ==",
|
"integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright": "1.47.2"
|
"playwright": "1.56.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@ -1254,13 +1240,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-3-Clause"
|
"license": "BSD-3-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/abbrev": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/acorn": {
|
"node_modules/acorn": {
|
||||||
"version": "8.12.1",
|
"version": "8.12.1",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
||||||
@ -1377,42 +1356,21 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/aproba": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/are-we-there-yet": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
|
|
||||||
"deprecated": "This package is no longer supported.",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"delegates": "^1.0.0",
|
|
||||||
"readable-stream": "^3.6.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/argon2": {
|
"node_modules/argon2": {
|
||||||
"version": "0.28.7",
|
"version": "0.44.0",
|
||||||
"resolved": "https://registry.npmjs.org/argon2/-/argon2-0.28.7.tgz",
|
"resolved": "https://registry.npmjs.org/argon2/-/argon2-0.44.0.tgz",
|
||||||
"integrity": "sha512-pvsScM3Fq7b+jolXkZHh8nRQx0uD/WeelnwYPMRpn4pAydoa1gqeL/KRdWAag4Hnu1TJNBTAfqyTjV+ZHwNnYA==",
|
"integrity": "sha512-zHPGN3S55sihSQo0dBbK0A5qpi2R31z7HZDZnry3ifOyj8bZZnpZND2gpmhnRGO1V/d555RwBqIK5W4Mrmv3ig==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mapbox/node-pre-gyp": "^1.0.9",
|
|
||||||
"@phc/format": "^1.0.0",
|
"@phc/format": "^1.0.0",
|
||||||
"node-addon-api": "^5.0.0"
|
"cross-env": "^10.0.0",
|
||||||
|
"node-addon-api": "^8.5.0",
|
||||||
|
"node-gyp-build": "^4.8.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=16.17.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
@ -1725,16 +1683,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/chownr": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ci-info": {
|
"node_modules/ci-info": {
|
||||||
"version": "3.9.0",
|
"version": "3.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz",
|
||||||
@ -1808,16 +1756,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/color-support": {
|
|
||||||
"version": "1.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
|
|
||||||
"integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"bin": {
|
|
||||||
"color-support": "bin.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@ -1838,13 +1776,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/console-control-strings": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/convert-source-map": {
|
"node_modules/convert-source-map": {
|
||||||
"version": "1.9.0",
|
"version": "1.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
|
||||||
@ -1852,6 +1783,24 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/cross-env": {
|
||||||
|
"version": "10.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
|
||||||
|
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@epic-web/invariant": "^1.0.0",
|
||||||
|
"cross-spawn": "^7.0.6"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"cross-env": "dist/bin/cross-env.js",
|
||||||
|
"cross-env-shell": "dist/bin/cross-env-shell.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cross-fetch": {
|
"node_modules/cross-fetch": {
|
||||||
"version": "3.1.8",
|
"version": "3.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz",
|
||||||
@ -1863,9 +1812,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1971,23 +1920,6 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/delegates": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/detect-libc": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
|
|
||||||
"integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/detect-newline": {
|
"node_modules/detect-newline": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
|
||||||
@ -2373,39 +2305,6 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fs-minipass": {
|
|
||||||
"version": "2.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
|
|
||||||
"integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"minipass": "^3.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fs-minipass/node_modules/minipass": {
|
|
||||||
"version": "3.3.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
|
||||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"yallist": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fs-minipass/node_modules/yallist": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/fs.realpath": {
|
"node_modules/fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
@ -2438,28 +2337,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/gauge": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
|
|
||||||
"deprecated": "This package is no longer supported.",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"aproba": "^1.0.3 || ^2.0.0",
|
|
||||||
"color-support": "^1.1.2",
|
|
||||||
"console-control-strings": "^1.0.0",
|
|
||||||
"has-unicode": "^2.0.1",
|
|
||||||
"object-assign": "^4.1.1",
|
|
||||||
"signal-exit": "^3.0.0",
|
|
||||||
"string-width": "^4.2.3",
|
|
||||||
"strip-ansi": "^6.0.1",
|
|
||||||
"wide-align": "^1.1.2"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gensync": {
|
"node_modules/gensync": {
|
||||||
"version": "1.0.0-beta.2",
|
"version": "1.0.0-beta.2",
|
||||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||||
@ -2636,13 +2513,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/has-unicode": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/hasown": {
|
"node_modules/hasown": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||||
@ -3624,9 +3494,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "3.14.1",
|
"version": "3.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",
|
||||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
"integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -3775,9 +3645,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.23",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@ -3798,32 +3668,6 @@
|
|||||||
"yallist": "^3.0.2"
|
"yallist": "^3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/make-dir": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"semver": "^6.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/make-dir/node_modules/semver": {
|
|
||||||
"version": "6.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
|
|
||||||
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"bin": {
|
|
||||||
"semver": "bin/semver.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/make-error": {
|
"node_modules/make-error": {
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
@ -3906,9 +3750,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimatch": {
|
"node_modules/minimatch": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
|
||||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -3918,63 +3762,6 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minipass": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/minizlib": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"minipass": "^3.0.0",
|
|
||||||
"yallist": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/minizlib/node_modules/minipass": {
|
|
||||||
"version": "3.3.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
|
||||||
"integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"yallist": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/minizlib/node_modules/yallist": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/mkdirp": {
|
|
||||||
"version": "1.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
|
||||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"bin": {
|
|
||||||
"mkdirp": "bin/cmd.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ms": {
|
"node_modules/ms": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
@ -3990,11 +3777,14 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/node-addon-api": {
|
"node_modules/node-addon-api": {
|
||||||
"version": "5.1.0",
|
"version": "8.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.5.0.tgz",
|
||||||
"integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==",
|
"integrity": "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": "^18 || ^20 || >= 21"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.0",
|
||||||
@ -4042,6 +3832,18 @@
|
|||||||
"webidl-conversions": "^3.0.0"
|
"webidl-conversions": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/node-gyp-build": {
|
||||||
|
"version": "4.8.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz",
|
||||||
|
"integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"node-gyp-build": "bin.js",
|
||||||
|
"node-gyp-build-optional": "optional.js",
|
||||||
|
"node-gyp-build-test": "build-test.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/node-int64": {
|
"node_modules/node-int64": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
||||||
@ -4056,22 +3858,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/nopt": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"abbrev": "1"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"nopt": "bin/nopt.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/normalize-path": {
|
"node_modules/normalize-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
@ -4095,20 +3881,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/npmlog": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
|
|
||||||
"deprecated": "This package is no longer supported.",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"are-we-there-yet": "^2.0.0",
|
|
||||||
"console-control-strings": "^1.1.0",
|
|
||||||
"gauge": "^3.0.0",
|
|
||||||
"set-blocking": "^2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/nwsapi": {
|
"node_modules/nwsapi": {
|
||||||
"version": "2.2.13",
|
"version": "2.2.13",
|
||||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.13.tgz",
|
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.13.tgz",
|
||||||
@ -4116,16 +3888,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/object-assign": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
||||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/once": {
|
"node_modules/once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
@ -4305,13 +4067,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright": {
|
"node_modules/playwright": {
|
||||||
"version": "1.47.2",
|
"version": "1.56.1",
|
||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz",
|
||||||
"integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==",
|
"integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright-core": "1.47.2"
|
"playwright-core": "1.56.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"playwright": "cli.js"
|
"playwright": "cli.js"
|
||||||
@ -4324,9 +4086,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/playwright-core": {
|
"node_modules/playwright-core": {
|
||||||
"version": "1.47.2",
|
"version": "1.56.1",
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz",
|
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz",
|
||||||
"integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==",
|
"integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -4442,21 +4204,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/readable-stream": {
|
|
||||||
"version": "3.6.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
|
||||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"inherits": "^2.0.3",
|
|
||||||
"string_decoder": "^1.1.1",
|
|
||||||
"util-deprecate": "^1.0.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/require-directory": {
|
"node_modules/require-directory": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
@ -4542,27 +4289,6 @@
|
|||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/safe-buffer": {
|
|
||||||
"version": "5.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
|
||||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
|
||||||
"dev": true,
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/feross"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "patreon",
|
|
||||||
"url": "https://www.patreon.com/feross"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "consulting",
|
|
||||||
"url": "https://feross.org/support"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/safer-buffer": {
|
"node_modules/safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
@ -4596,13 +4322,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/set-blocking": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/shebang-command": {
|
"node_modules/shebang-command": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
@ -4691,16 +4410,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/string_decoder": {
|
|
||||||
"version": "1.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
|
||||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": "~5.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/string-length": {
|
"node_modules/string-length": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
|
||||||
@ -4823,31 +4532,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/tar": {
|
|
||||||
"version": "6.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
|
|
||||||
"integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"chownr": "^2.0.0",
|
|
||||||
"fs-minipass": "^2.0.0",
|
|
||||||
"minipass": "^5.0.0",
|
|
||||||
"minizlib": "^2.1.1",
|
|
||||||
"mkdirp": "^1.0.3",
|
|
||||||
"yallist": "^4.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/tar/node_modules/yallist": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/terminal-link": {
|
"node_modules/terminal-link": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz",
|
||||||
@ -5097,13 +4781,6 @@
|
|||||||
"requires-port": "^1.0.0"
|
"requires-port": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/util-deprecate": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/v8-to-istanbul": {
|
"node_modules/v8-to-istanbul": {
|
||||||
"version": "8.1.1",
|
"version": "8.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz",
|
||||||
@ -5221,16 +4898,6 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wide-align": {
|
|
||||||
"version": "1.1.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
|
|
||||||
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wrap-ansi": {
|
"node_modules/wrap-ansi": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
|||||||
@ -3,24 +3,23 @@
|
|||||||
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
|
"#": "We must put jest in a sub-directory otherwise VS Code somehow picks up the types and generates conflicts with mocha.",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@jest-mock/express": "^1.4.5",
|
"@jest-mock/express": "^1.4.5",
|
||||||
"@playwright/test": "^1.46.0",
|
"@playwright/test": "^1.56.1",
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/jsdom": "^16.2.13",
|
"@types/jsdom": "^16.2.13",
|
||||||
"@types/node-fetch": "^2.5.8",
|
"@types/node-fetch": "^2.5.8",
|
||||||
"@types/wtfnode": "^0.7.0",
|
"@types/wtfnode": "^0.7.0",
|
||||||
"argon2": "^0.28.0",
|
"argon2": "^0.44.0",
|
||||||
"extract-zip": "^2.0.1",
|
"extract-zip": "^2.0.1",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"jsdom": "^16.4.0",
|
"jsdom": "^16.4.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"playwright": "^1.46.0",
|
"playwright": "^1.56.1",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
"wtfnode": "^0.9.1"
|
"wtfnode": "^0.9.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"ansi-regex": "^5.0.1",
|
"ansi-regex": "^5.0.1",
|
||||||
"argon2/@mapbox/node-pre-gyp/tar": "^6.1.9",
|
|
||||||
"set-value": "^4.0.1",
|
"set-value": "^4.0.1",
|
||||||
"tmpl": "^1.0.5",
|
"tmpl": "^1.0.5",
|
||||||
"path-parse": "^1.0.7",
|
"path-parse": "^1.0.7",
|
||||||
|
|||||||
@ -38,6 +38,7 @@ const defaults = {
|
|||||||
"extensions-dir": path.join(paths.data, "extensions"),
|
"extensions-dir": path.join(paths.data, "extensions"),
|
||||||
"user-data-dir": paths.data,
|
"user-data-dir": paths.data,
|
||||||
"session-socket": path.join(paths.data, "code-server-ipc.sock"),
|
"session-socket": path.join(paths.data, "code-server-ipc.sock"),
|
||||||
|
"app-name": "code-server",
|
||||||
_: [],
|
_: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +48,7 @@ describe("parser", () => {
|
|||||||
delete process.env.PASSWORD
|
delete process.env.PASSWORD
|
||||||
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
||||||
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
||||||
|
delete process.env.CODE_SERVER_RECONNECTION_GRACE_TIME
|
||||||
delete process.env.VSCODE_PROXY_URI
|
delete process.env.VSCODE_PROXY_URI
|
||||||
delete process.env.CS_DISABLE_PROXY
|
delete process.env.CS_DISABLE_PROXY
|
||||||
console.log = jest.fn()
|
console.log = jest.fn()
|
||||||
@ -114,6 +116,8 @@ describe("parser", () => {
|
|||||||
|
|
||||||
["--session-socket", "/tmp/override-code-server-ipc-socket"],
|
["--session-socket", "/tmp/override-code-server-ipc-socket"],
|
||||||
|
|
||||||
|
["--reconnection-grace-time", "86400"],
|
||||||
|
|
||||||
["--host", "0.0.0.0"],
|
["--host", "0.0.0.0"],
|
||||||
"4",
|
"4",
|
||||||
"--",
|
"--",
|
||||||
@ -150,6 +154,7 @@ describe("parser", () => {
|
|||||||
version: true,
|
version: true,
|
||||||
"bind-addr": "192.169.0.1:8080",
|
"bind-addr": "192.169.0.1:8080",
|
||||||
"session-socket": "/tmp/override-code-server-ipc-socket",
|
"session-socket": "/tmp/override-code-server-ipc-socket",
|
||||||
|
"reconnection-grace-time": "86400",
|
||||||
"abs-proxy-base-path": "/codeserver/app1",
|
"abs-proxy-base-path": "/codeserver/app1",
|
||||||
"skip-auth-preflight": true,
|
"skip-auth-preflight": true,
|
||||||
})
|
})
|
||||||
@ -456,6 +461,19 @@ describe("parser", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should use env var CODE_SERVER_RECONNECTION_GRACE_TIME for reconnection grace time", async () => {
|
||||||
|
process.env.CODE_SERVER_RECONNECTION_GRACE_TIME = "86400"
|
||||||
|
const args = parse([])
|
||||||
|
expect(args).toEqual({})
|
||||||
|
|
||||||
|
const defaultArgs = await setDefaults(args)
|
||||||
|
expect(defaultArgs).toEqual({
|
||||||
|
...defaults,
|
||||||
|
"reconnection-grace-time": "86400",
|
||||||
|
})
|
||||||
|
delete process.env.CODE_SERVER_RECONNECTION_GRACE_TIME
|
||||||
|
})
|
||||||
|
|
||||||
it("should error if password passed in", () => {
|
it("should error if password passed in", () => {
|
||||||
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
||||||
"--password can only be set in the config file or passed in via $PASSWORD",
|
"--password can only be set in the config file or passed in via $PASSWORD",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { logger } from "@coder/logger"
|
import { logger } from "@coder/logger"
|
||||||
import { readFile, writeFile, stat, utimes } from "fs/promises"
|
import { readFile, writeFile, stat, utimes } from "fs/promises"
|
||||||
import { Heart, heartbeatTimer } from "../../../src/node/heart"
|
import { Heart } from "../../../src/node/heart"
|
||||||
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
|
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
|
||||||
|
|
||||||
const mockIsActive = (resolveTo: boolean) => jest.fn().mockResolvedValue(resolveTo)
|
const mockIsActive = (resolveTo: boolean) => jest.fn().mockResolvedValue(resolveTo)
|
||||||
@ -82,7 +82,52 @@ describe("Heart", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe("heartbeatTimer", () => {
|
describe("heartbeatTimer", () => {
|
||||||
beforeAll(() => {
|
const testName = "heartbeatTimer"
|
||||||
|
let testDir = ""
|
||||||
|
beforeAll(async () => {
|
||||||
|
await clean(testName)
|
||||||
|
testDir = await tmpdir(testName)
|
||||||
|
mockLogger()
|
||||||
|
})
|
||||||
|
afterAll(() => {
|
||||||
|
jest.restoreAllMocks()
|
||||||
|
})
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.useFakeTimers()
|
||||||
|
})
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks()
|
||||||
|
jest.clearAllTimers()
|
||||||
|
jest.useRealTimers()
|
||||||
|
})
|
||||||
|
it("should call isActive when timeout expires", async () => {
|
||||||
|
const isActive = true
|
||||||
|
const mockIsActive = jest.fn().mockResolvedValue(isActive)
|
||||||
|
const heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
|
||||||
|
await heart.beat()
|
||||||
|
jest.advanceTimersByTime(60 * 1000)
|
||||||
|
expect(mockIsActive).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 heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive)
|
||||||
|
await heart.beat()
|
||||||
|
jest.advanceTimersByTime(60 * 1000)
|
||||||
|
|
||||||
|
expect(mockIsActive).toHaveBeenCalled()
|
||||||
|
expect(logger.warn).toHaveBeenCalledWith(errorMsg)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe("stateChange", () => {
|
||||||
|
const testName = "stateChange"
|
||||||
|
let testDir = ""
|
||||||
|
let heart: Heart
|
||||||
|
beforeAll(async () => {
|
||||||
|
await clean(testName)
|
||||||
|
testDir = await tmpdir(testName)
|
||||||
mockLogger()
|
mockLogger()
|
||||||
})
|
})
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
@ -90,23 +135,28 @@ describe("heartbeatTimer", () => {
|
|||||||
})
|
})
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.resetAllMocks()
|
jest.resetAllMocks()
|
||||||
|
if (heart) {
|
||||||
|
heart.dispose()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
it("should call beat when isActive resolves to true", async () => {
|
it("should change to alive after a beat", async () => {
|
||||||
const isActive = true
|
heart = new Heart(`${testDir}/shutdown.txt`, mockIsActive(true))
|
||||||
const mockIsActive = jest.fn().mockResolvedValue(isActive)
|
const mockOnChange = jest.fn()
|
||||||
const mockBeatFn = jest.fn()
|
heart.onChange(mockOnChange)
|
||||||
await heartbeatTimer(mockIsActive, mockBeatFn)
|
await heart.beat()
|
||||||
expect(mockIsActive).toHaveBeenCalled()
|
|
||||||
expect(mockBeatFn).toHaveBeenCalled()
|
expect(mockOnChange.mock.calls[0][0]).toBe("alive")
|
||||||
})
|
})
|
||||||
it("should log a warning when isActive rejects", async () => {
|
it.only("should change to expired when not active", async () => {
|
||||||
const errorMsg = "oh no"
|
jest.useFakeTimers()
|
||||||
const error = new Error(errorMsg)
|
heart = new Heart(`${testDir}/shutdown.txt`, () => new Promise((resolve) => resolve(false)))
|
||||||
const mockIsActive = jest.fn().mockRejectedValue(error)
|
const mockOnChange = jest.fn()
|
||||||
const mockBeatFn = jest.fn()
|
heart.onChange(mockOnChange)
|
||||||
await heartbeatTimer(mockIsActive, mockBeatFn)
|
await heart.beat()
|
||||||
expect(mockIsActive).toHaveBeenCalled()
|
|
||||||
expect(mockBeatFn).not.toHaveBeenCalled()
|
await jest.advanceTimersByTime(60 * 1000)
|
||||||
expect(logger.warn).toHaveBeenCalledWith(errorMsg)
|
expect(mockOnChange.mock.calls[1][0]).toBe("expired")
|
||||||
|
jest.clearAllTimers()
|
||||||
|
jest.useRealTimers()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -19,6 +19,30 @@ describe("http", () => {
|
|||||||
expect(http.relativeRoot("/foo/bar/")).toStrictEqual("./../..")
|
expect(http.relativeRoot("/foo/bar/")).toStrictEqual("./../..")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("isTrustedOrigin", () => {
|
||||||
|
it("should match exact origins", () => {
|
||||||
|
expect(http.isTrustedOrigin("localhost:8080", ["localhost:8080"])).toBe(true)
|
||||||
|
expect(http.isTrustedOrigin("example.com", ["example.com"])).toBe(true)
|
||||||
|
expect(http.isTrustedOrigin("example.com", ["other.com"])).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should match the wildcard *", () => {
|
||||||
|
expect(http.isTrustedOrigin("anything.example.com", ["*"])).toBe(true)
|
||||||
|
expect(http.isTrustedOrigin("localhost:8080", ["*"])).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should match *.example.com wildcard (same style as --proxy-domain)", () => {
|
||||||
|
expect(http.isTrustedOrigin("sub.example.com", ["*.example.com"])).toBe(true)
|
||||||
|
expect(http.isTrustedOrigin("example.com", ["*.example.com"])).toBe(true)
|
||||||
|
expect(http.isTrustedOrigin("evil.com", ["*.example.com"])).toBe(false)
|
||||||
|
expect(http.isTrustedOrigin("example.com.evil.com", ["*.example.com"])).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should return false for an empty trusted origins list", () => {
|
||||||
|
expect(http.isTrustedOrigin("example.com", [])).toBe(false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe("origin", () => {
|
describe("origin", () => {
|
||||||
;[
|
;[
|
||||||
{
|
{
|
||||||
@ -54,6 +78,22 @@ describe("http", () => {
|
|||||||
host: "localhost:8080",
|
host: "localhost:8080",
|
||||||
expected: "malformed", // Parsing fails completely.
|
expected: "malformed", // Parsing fails completely.
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
origin: "http://sub.example.com",
|
||||||
|
host: "other.com",
|
||||||
|
trustedOrigins: ["*.example.com"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://evil.com",
|
||||||
|
host: "other.com",
|
||||||
|
trustedOrigins: ["*.example.com"],
|
||||||
|
expected: "does not match",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
origin: "http://sub.example.com",
|
||||||
|
host: "other.com",
|
||||||
|
trustedOrigins: ["*"],
|
||||||
|
},
|
||||||
].forEach((test) => {
|
].forEach((test) => {
|
||||||
;[
|
;[
|
||||||
["host", test.host],
|
["host", test.host],
|
||||||
@ -70,7 +110,9 @@ describe("http", () => {
|
|||||||
origin: test.origin,
|
origin: test.origin,
|
||||||
[key]: value,
|
[key]: value,
|
||||||
},
|
},
|
||||||
args: {},
|
args: {
|
||||||
|
"trusted-origins": (test as { trustedOrigins?: string[] }).trustedOrigins,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if (typeof test.expected === "string") {
|
if (typeof test.expected === "string") {
|
||||||
expect(() => http.authenticateOrigin(req)).toThrow(test.expected)
|
expect(() => http.authenticateOrigin(req)).toThrow(test.expected)
|
||||||
|
|||||||
@ -16,6 +16,7 @@ jest.mock("@coder/logger", () => ({
|
|||||||
debug: jest.fn(),
|
debug: jest.fn(),
|
||||||
warn: jest.fn(),
|
warn: jest.fn(),
|
||||||
error: jest.fn(),
|
error: jest.fn(),
|
||||||
|
named: jest.fn(),
|
||||||
level: 0,
|
level: 0,
|
||||||
},
|
},
|
||||||
field: jest.fn(),
|
field: jest.fn(),
|
||||||
@ -94,7 +95,7 @@ describe("main", () => {
|
|||||||
|
|
||||||
// Mock routes module
|
// Mock routes module
|
||||||
jest.doMock("../../../src/node/routes", () => ({
|
jest.doMock("../../../src/node/routes", () => ({
|
||||||
register: jest.fn().mockResolvedValue(jest.fn()),
|
register: jest.fn().mockResolvedValue({ disposeRoutes: jest.fn() }),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Mock loadCustomStrings to succeed
|
// Mock loadCustomStrings to succeed
|
||||||
@ -131,7 +132,7 @@ describe("main", () => {
|
|||||||
|
|
||||||
// Mock routes module
|
// Mock routes module
|
||||||
jest.doMock("../../../src/node/routes", () => ({
|
jest.doMock("../../../src/node/routes", () => ({
|
||||||
register: jest.fn().mockResolvedValue(jest.fn()),
|
register: jest.fn().mockResolvedValue({ disposeRoutes: jest.fn() }),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Import runCodeServer after mocking
|
// Import runCodeServer after mocking
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import express from "express"
|
import express from "express"
|
||||||
|
import { UserProvidedArgs, setDefaults } from "../../../../src/node/cli"
|
||||||
import { errorHandler } from "../../../../src/node/routes/errors"
|
import { errorHandler } from "../../../../src/node/routes/errors"
|
||||||
|
|
||||||
describe("error page is rendered for text/html requests", () => {
|
describe("error page is rendered for text/html requests", () => {
|
||||||
@ -9,7 +10,7 @@ describe("error page is rendered for text/html requests", () => {
|
|||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
message: ";>hello<script>alert(1)</script>",
|
message: ";>hello<script>alert(1)</script>",
|
||||||
}
|
}
|
||||||
const req = createRequest()
|
const req = await createRequest()
|
||||||
const res = {
|
const res = {
|
||||||
status: jest.fn().mockReturnValue(this),
|
status: jest.fn().mockReturnValue(this),
|
||||||
send: jest.fn().mockReturnValue(this),
|
send: jest.fn().mockReturnValue(this),
|
||||||
@ -20,9 +21,41 @@ describe("error page is rendered for text/html requests", () => {
|
|||||||
expect(res.status).toHaveBeenCalledWith(404)
|
expect(res.status).toHaveBeenCalledWith(404)
|
||||||
expect(res.send).toHaveBeenCalledWith(expect.not.stringContaining("<script>"))
|
expect(res.send).toHaveBeenCalledWith(expect.not.stringContaining("<script>"))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should use custom app-name in error page title", async () => {
|
||||||
|
const err = {
|
||||||
|
statusCode: 404,
|
||||||
|
message: "Not found",
|
||||||
|
}
|
||||||
|
const req = await createRequest({ "app-name": "MyCodeServer" })
|
||||||
|
const res = {
|
||||||
|
status: jest.fn().mockReturnValue(this),
|
||||||
|
send: jest.fn().mockReturnValue(this),
|
||||||
|
set: jest.fn().mockReturnValue(this),
|
||||||
|
} as unknown as express.Response
|
||||||
|
|
||||||
|
await errorHandler(err, req, res, jest.fn())
|
||||||
|
expect(res.send).toHaveBeenCalledWith(expect.stringContaining("<title>404 - MyCodeServer</title>"))
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should use default 'code-server' when app-name is not set", async () => {
|
||||||
|
const err = {
|
||||||
|
statusCode: 500,
|
||||||
|
message: "Internal error",
|
||||||
|
}
|
||||||
|
const req = await createRequest()
|
||||||
|
const res = {
|
||||||
|
status: jest.fn().mockReturnValue(this),
|
||||||
|
send: jest.fn().mockReturnValue(this),
|
||||||
|
set: jest.fn().mockReturnValue(this),
|
||||||
|
} as unknown as express.Response
|
||||||
|
|
||||||
|
await errorHandler(err, req, res, jest.fn())
|
||||||
|
expect(res.send).toHaveBeenCalledWith(expect.stringContaining("<title>500 - code-server</title>"))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
function createRequest(): express.Request {
|
async function createRequest(args: UserProvidedArgs = {}): Promise<express.Request> {
|
||||||
return {
|
return {
|
||||||
headers: {
|
headers: {
|
||||||
accept: ["text/html"],
|
accept: ["text/html"],
|
||||||
@ -31,5 +64,6 @@ function createRequest(): express.Request {
|
|||||||
query: {
|
query: {
|
||||||
to: "test",
|
to: "test",
|
||||||
},
|
},
|
||||||
|
args: await setDefaults(args),
|
||||||
} as unknown as express.Request
|
} as unknown as express.Request
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user