mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 20:41:59 +02:00
Compare commits
130 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27a112c3a7 | ||
|
|
74cc50d5e6 | ||
|
|
85ee441006 | ||
|
|
a56769b2c3 | ||
|
|
05d8904ec5 | ||
|
|
3669c96c9c | ||
|
|
37357b0142 | ||
|
|
405eb0f511 | ||
|
|
6e26dad1b1 | ||
|
|
1671bf1c18 | ||
|
|
1face85ad9 | ||
|
|
9ec786b62a | ||
|
|
409c64e0df | ||
|
|
35e78fe35b | ||
|
|
cade03e321 | ||
|
|
9dd999ba78 | ||
|
|
1aca01f8d8 | ||
|
|
e05219d9c0 | ||
|
|
d0e20d514d | ||
|
|
9bd3b83ef5 | ||
|
|
2c9b4e7fd5 | ||
|
|
7af90ea623 | ||
|
|
8b55b5003d | ||
|
|
e5b8d447e5 | ||
|
|
c8257a3074 | ||
|
|
0c72b20fa7 | ||
|
|
ea2caf00ac | ||
|
|
3f2e3340d8 | ||
|
|
47d6d3ada5 | ||
|
|
dded82bb47 | ||
|
|
5d5b7b1944 | ||
|
|
c36b2d3edd | ||
|
|
3b7634c578 | ||
|
|
ec0899a81b | ||
|
|
bbf2e24648 | ||
|
|
9045919d2b | ||
|
|
cb29e65982 | ||
|
|
7eb8f4be87 | ||
|
|
cd4d1b614d | ||
|
|
5051c0f9e4 | ||
|
|
b07335a0f1 | ||
|
|
e3c09efcbc | ||
|
|
e0c960b30e | ||
|
|
55b311a954 | ||
|
|
0a92b76304 | ||
|
|
400ac7b8d0 | ||
|
|
53722c5361 | ||
|
|
e2c489dd00 | ||
|
|
e1c84998d7 | ||
|
|
cc3c22deee | ||
|
|
727555b414 | ||
|
|
4b7bca38e2 | ||
|
|
50c3e4bb1b | ||
|
|
2809245dda | ||
|
|
949aed1cef | ||
|
|
db5f99dc78 | ||
|
|
fd761b4e8b | ||
|
|
611798650f | ||
|
|
0db3cbe4e7 | ||
|
|
31c211aded | ||
|
|
6f8493ebc6 | ||
|
|
34b8d2ed69 | ||
|
|
3172cb16b8 | ||
|
|
9b89774ff6 | ||
|
|
626d2cf1c3 | ||
|
|
ebf2df63f5 | ||
|
|
ac65db2c88 | ||
|
|
33aa21fd0f | ||
|
|
d23d1a9541 | ||
|
|
a6fad66e5e | ||
|
|
18cd97dc12 | ||
|
|
ef713bde58 | ||
|
|
1c3fcf2a83 | ||
|
|
96800cc521 | ||
|
|
0b7c044857 | ||
|
|
7cc61ab1f4 | ||
|
|
b7ef8f9bd7 | ||
|
|
b60985e53b | ||
|
|
b18a647d0a | ||
|
|
f4f02655a1 | ||
|
|
08cbdfbdf1 | ||
|
|
339a448471 | ||
|
|
272e28abc6 | ||
|
|
c187e5e782 | ||
|
|
318c582043 | ||
|
|
db311e6ff5 | ||
|
|
ccd2a30dfc | ||
|
|
99e1f63d76 | ||
|
|
25c2183be0 | ||
|
|
8f00c2e289 | ||
|
|
9b0340a092 | ||
|
|
ccded68cd4 | ||
|
|
4af06de4c3 | ||
|
|
b0c935a6e0 | ||
|
|
912a7a9d89 | ||
|
|
9a5726f250 | ||
|
|
fc97e248c3 | ||
|
|
fff3b896de | ||
|
|
578b5f22c4 | ||
|
|
2c1981bfb9 | ||
|
|
344df3875f | ||
|
|
952523f288 | ||
|
|
8789dec68b | ||
|
|
b7398bad11 | ||
|
|
8194dbf5bc | ||
|
|
2ade2afdc7 | ||
|
|
494a3e0c2b | ||
|
|
dd2e9fce27 | ||
|
|
bea906f90b | ||
|
|
15752526bd | ||
|
|
7c298653f1 | ||
|
|
fc6064dcd3 | ||
|
|
6b4b3e0c89 | ||
|
|
13d4cd6489 | ||
|
|
a0c2780c50 | ||
|
|
aea7ba2a51 | ||
|
|
69df01185c | ||
|
|
3542bd157b | ||
|
|
50c6abf3a8 | ||
|
|
9286e0002d | ||
|
|
90f8135c68 | ||
|
|
8dbfe2273b | ||
|
|
e05a3f4ce2 | ||
|
|
e05d88007f | ||
|
|
534a1866e5 | ||
|
|
907e583309 | ||
|
|
639a005867 | ||
|
|
4a703893b0 | ||
|
|
39ce82a44d | ||
|
|
7f893234ab |
@@ -1,43 +0,0 @@
|
|||||||
parser: "@typescript-eslint/parser"
|
|
||||||
env:
|
|
||||||
browser: true
|
|
||||||
es6: true # Map, etc.
|
|
||||||
jest: true
|
|
||||||
node: true
|
|
||||||
|
|
||||||
parserOptions:
|
|
||||||
ecmaVersion: 2018
|
|
||||||
sourceType: module
|
|
||||||
|
|
||||||
extends:
|
|
||||||
- eslint:recommended
|
|
||||||
- plugin:@typescript-eslint/recommended
|
|
||||||
- plugin:import/recommended
|
|
||||||
- plugin:import/typescript
|
|
||||||
- plugin:prettier/recommended
|
|
||||||
# Prettier should always be last
|
|
||||||
# Removes eslint rules that conflict with prettier.
|
|
||||||
- prettier
|
|
||||||
|
|
||||||
rules:
|
|
||||||
# Sometimes you need to add args to implement a function signature even
|
|
||||||
# if they are unused.
|
|
||||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }]
|
|
||||||
# For overloads.
|
|
||||||
no-dupe-class-members: off
|
|
||||||
"@typescript-eslint/no-use-before-define": off
|
|
||||||
"@typescript-eslint/no-non-null-assertion": off
|
|
||||||
"@typescript-eslint/ban-types": off
|
|
||||||
"@typescript-eslint/no-var-requires": off
|
|
||||||
"@typescript-eslint/explicit-module-boundary-types": off
|
|
||||||
"@typescript-eslint/no-explicit-any": off
|
|
||||||
"@typescript-eslint/no-extra-semi": off
|
|
||||||
eqeqeq: error
|
|
||||||
import/order:
|
|
||||||
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
|
|
||||||
no-async-promise-executor: off
|
|
||||||
|
|
||||||
settings:
|
|
||||||
import/resolver:
|
|
||||||
typescript:
|
|
||||||
alwaysTryTypes: true
|
|
||||||
2
.git-blame-ignore-revs
Normal file
2
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Prettier 3.4.2
|
||||||
|
9b0340a09276f93c054d705d1b9a5f24cc5dbc97
|
||||||
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
@@ -20,6 +20,8 @@ body:
|
|||||||
- **Remote OS**: Ubuntu
|
- **Remote OS**: Ubuntu
|
||||||
- **Remote Architecture**: amd64
|
- **Remote Architecture**: amd64
|
||||||
- **`code-server --version`**: 4.0.1
|
- **`code-server --version`**: 4.0.1
|
||||||
|
|
||||||
|
Please do not just put "latest" for the version.
|
||||||
value: |
|
value: |
|
||||||
- Web Browser:
|
- Web Browser:
|
||||||
- Local OS:
|
- Local OS:
|
||||||
@@ -62,7 +64,7 @@ body:
|
|||||||
id: logs
|
id: logs
|
||||||
attributes:
|
attributes:
|
||||||
label: Logs
|
label: Logs
|
||||||
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
|
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `npm install -g code-server`).
|
||||||
render: shell
|
render: shell
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<!-- Note: this variable $CODE_SERVER_VERSION_TO_UPDATE will be set when you run the release-prep.sh script with `yarn release:prep` -->
|
|
||||||
|
|
||||||
This PR is to generate a new release of `code-server` at `$CODE_SERVER_VERSION_TO_UPDATE`
|
|
||||||
|
|
||||||
## Screenshot
|
|
||||||
|
|
||||||
TODO
|
|
||||||
|
|
||||||
## TODOs
|
|
||||||
|
|
||||||
Follow "Publishing a release" steps in `ci/README.md`
|
|
||||||
|
|
||||||
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
|
|
||||||
|
|
||||||
- [ ] update `CHANGELOG.md`
|
|
||||||
- [ ] manually run "Draft release" workflow after merging this PR
|
|
||||||
- [ ] merge PR opened in [code-server-aur](https://github.com/coder/code-server-aur)
|
|
||||||
415
.github/workflows/build.yaml
vendored
415
.github/workflows/build.yaml
vendored
@@ -19,129 +19,117 @@ concurrency:
|
|||||||
# this ensures that it only executes if all previous jobs succeeded.
|
# this ensures that it only executes if all previous jobs succeeded.
|
||||||
|
|
||||||
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||||
# will skip running `yarn install` if it successfully fetched from cache
|
# will skip running `npm install` if it successfully fetched from cache
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prettier:
|
changes:
|
||||||
name: Format with Prettier
|
runs-on: ubuntu-latest
|
||||||
runs-on: ubuntu-20.04
|
outputs:
|
||||||
timeout-minutes: 5
|
ci: ${{ steps.filter.outputs.ci }}
|
||||||
|
code: ${{ steps.filter.outputs.code }}
|
||||||
|
deps: ${{ steps.filter.outputs.deps }}
|
||||||
|
docs: ${{ steps.filter.outputs.docs }}
|
||||||
|
helm: ${{ steps.filter.outputs.helm }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Check changed files
|
||||||
- name: Run prettier with actionsx/prettier
|
uses: dorny/paths-filter@v3
|
||||||
uses: actionsx/prettier@v3
|
id: filter
|
||||||
with:
|
with:
|
||||||
args: --check --loglevel=warn .
|
filters: |
|
||||||
|
ci:
|
||||||
|
- ".github/**"
|
||||||
|
- "ci/**"
|
||||||
|
docs:
|
||||||
|
- "docs/**"
|
||||||
|
- "README.md"
|
||||||
|
- "CHANGELOG.md"
|
||||||
|
helm:
|
||||||
|
- "ci/helm-chart/**"
|
||||||
|
code:
|
||||||
|
- "src/**"
|
||||||
|
- "test/**"
|
||||||
|
deps:
|
||||||
|
- "lib/**"
|
||||||
|
- "patches/**"
|
||||||
|
- "package-lock.json"
|
||||||
|
- "test/package-lock.json"
|
||||||
|
- id: debug
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.filter )}}"
|
||||||
|
|
||||||
|
prettier:
|
||||||
|
name: Run prettier check
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- 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
|
||||||
|
- run: npx prettier --check .
|
||||||
|
|
||||||
doctoc:
|
doctoc:
|
||||||
name: Doctoc markdown files
|
name: Doctoc markdown files
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.docs == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: actions/setup-node@v4
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v44
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
docs/**
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: "yarn"
|
cache: npm
|
||||||
|
cache-dependency-path: |
|
||||||
- name: Install doctoc
|
package-lock.json
|
||||||
run: yarn global add doctoc@2.2.1
|
test/package-lock.json
|
||||||
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
- name: Run doctoc
|
- run: npm run doctoc
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: yarn doctoc
|
|
||||||
|
|
||||||
lint-helm:
|
lint-helm:
|
||||||
name: Lint Helm chart
|
name: Lint Helm chart
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.helm == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: azure/setup-helm@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v44
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
ci/helm-chart/**
|
|
||||||
|
|
||||||
- name: Install helm
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: azure/setup-helm@v4
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
||||||
- name: Install helm kubeval plugin
|
- run: helm kubeval ci/helm-chart
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
|
||||||
|
|
||||||
- name: Lint Helm chart
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: helm kubeval ci/helm-chart
|
|
||||||
|
|
||||||
lint-ts:
|
lint-ts:
|
||||||
name: Lint TypeScript files
|
name: Lint TypeScript files
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.code == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v44
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
**/*.ts
|
|
||||||
**/*.js
|
|
||||||
files_ignore: |
|
|
||||||
lib/vscode/**
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
- name: Fetch dependencies from cache
|
cache-dependency-path: |
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
package-lock.json
|
||||||
id: cache-node-modules
|
test/package-lock.json
|
||||||
uses: actions/cache@v4
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
with:
|
- run: npm run lint:ts
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Lint TypeScript files
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: yarn lint:ts
|
|
||||||
|
|
||||||
lint-actions:
|
lint-actions:
|
||||||
name: Lint GitHub Actions
|
name: Lint GitHub Actions
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.ci == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -153,107 +141,59 @@ jobs:
|
|||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.code == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v44
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
**/*.ts
|
|
||||||
files_ignore: |
|
|
||||||
lib/vscode/**
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
- name: Fetch dependencies from cache
|
cache-dependency-path: |
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
package-lock.json
|
||||||
id: cache-node-modules
|
test/package-lock.json
|
||||||
uses: actions/cache@v4
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
with:
|
- run: npm run test:unit
|
||||||
path: "**/node_modules"
|
- uses: codecov/codecov-action@v5
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
if: success()
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Run unit tests
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: yarn test:unit
|
|
||||||
|
|
||||||
- name: Upload coverage report to Codecov
|
|
||||||
uses: codecov/codecov-action@v4
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
if: success()
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build code-server
|
name: Build code-server
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 60
|
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
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
- name: Install system dependencies
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||||
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
||||||
|
|
||||||
- name: Install quilt
|
|
||||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
||||||
with:
|
with:
|
||||||
packages: quilt
|
packages: quilt
|
||||||
version: 1.0
|
version: 1.0
|
||||||
|
- run: quilt push -a
|
||||||
- name: Patch Code
|
- uses: actions/setup-node@v4
|
||||||
run: quilt push -a
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
- name: Fetch dependencies from cache
|
cache-dependency-path: |
|
||||||
id: cache-node-modules
|
package-lock.json
|
||||||
uses: actions/cache@v4
|
test/package-lock.json
|
||||||
with:
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
path: "**/node_modules"
|
- run: npm run build
|
||||||
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-code-server-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build code-server
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
# 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 patches changed, or when the code-server version changes (since
|
# the patches changed, or when the code-server version changes (since
|
||||||
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
||||||
@@ -264,134 +204,86 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: lib/vscode-reh-web-*
|
path: lib/vscode-reh-web-*
|
||||||
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
key: vscode-reh-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:
|
env:
|
||||||
VERSION: "0.0.0"
|
VERSION: "0.0.0"
|
||||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||||
run: yarn build:vscode
|
run: |
|
||||||
|
pushd lib/vscode
|
||||||
|
npm ci
|
||||||
|
popd
|
||||||
|
npm run build:vscode
|
||||||
# The release package does not contain any native modules
|
# The release package does not contain any native modules
|
||||||
# and is neutral to architecture/os/libc version.
|
# and is neutral to architecture/os/libc version.
|
||||||
- name: Create release package
|
- run: npm run release
|
||||||
run: yarn release
|
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
- name: Compress release package
|
- run: tar -czf package.tar.gz release
|
||||||
run: tar -czf package.tar.gz release
|
- uses: actions/upload-artifact@v4
|
||||||
|
|
||||||
- name: Upload npm package artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
path: ./package.tar.gz
|
path: ./package.tar.gz
|
||||||
|
|
||||||
test-e2e:
|
test-e2e:
|
||||||
name: Run e2e tests
|
name: Run e2e tests
|
||||||
needs: build
|
runs-on: ubuntu-22.04
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
timeout-minutes: 25
|
timeout-minutes: 25
|
||||||
|
needs: [changes, build]
|
||||||
|
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Install system dependencies
|
|
||||||
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
- name: Fetch dependencies from cache
|
cache-dependency-path: |
|
||||||
id: cache-node-modules
|
package-lock.json
|
||||||
uses: actions/cache@v4
|
test/package-lock.json
|
||||||
with:
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
path: "**/node_modules"
|
- uses: actions/download-artifact@v4
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
|
- run: tar -xzf package.tar.gz
|
||||||
- name: Decompress npm package
|
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
- name: Install release package dependencies
|
|
||||||
run: cd release && npm install --unsafe-perm --omit=dev
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- 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
|
||||||
|
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
|
||||||
- name: Run end-to-end tests
|
- uses: actions/upload-artifact@v4
|
||||||
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
|
|
||||||
|
|
||||||
- name: Upload test artifacts
|
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
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
|
||||||
- name: Remove release packages and test artifacts
|
|
||||||
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
|
||||||
needs: build
|
runs-on: ubuntu-22.04
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
timeout-minutes: 25
|
timeout-minutes: 25
|
||||||
|
needs: [changes, build]
|
||||||
|
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v4
|
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
- name: Install system dependencies
|
|
||||||
run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
cache: npm
|
||||||
- name: Fetch dependencies from cache
|
cache-dependency-path: |
|
||||||
id: cache-node-modules
|
package-lock.json
|
||||||
uses: actions/cache@v4
|
test/package-lock.json
|
||||||
with:
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
path: "**/node_modules"
|
- uses: actions/download-artifact@v4
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
|
- run: tar -xzf package.tar.gz
|
||||||
- name: Decompress npm package
|
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
- name: Install release package dependencies
|
|
||||||
run: cd release && npm install --unsafe-perm --omit=dev
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- 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
|
||||||
|
|
||||||
- name: Cache Caddy
|
- name: Cache Caddy
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
id: caddy-cache
|
id: caddy-cache
|
||||||
@@ -399,7 +291,6 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cache/caddy
|
~/.cache/caddy
|
||||||
key: cache-caddy-2.5.2
|
key: cache-caddy-2.5.2
|
||||||
|
|
||||||
- name: Install Caddy
|
- name: Install Caddy
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -408,23 +299,13 @@ jobs:
|
|||||||
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
|
||||||
|
- run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||||
- name: Start Caddy
|
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
||||||
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||||
|
|
||||||
- name: Run end-to-end tests
|
|
||||||
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e:proxy --global-timeout 840000
|
|
||||||
|
|
||||||
- name: Stop Caddy
|
|
||||||
if: always()
|
if: always()
|
||||||
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
|
||||||
|
|
||||||
- name: Upload test artifacts
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: failed-test-videos-proxy
|
name: failed-test-videos-proxy
|
||||||
path: ./test/test-results
|
path: ./test/test-results
|
||||||
|
|
||||||
- name: Remove release packages and test artifacts
|
|
||||||
run: rm -rf ./release ./test/test-results
|
|
||||||
|
|||||||
30
.github/workflows/publish.yaml
vendored
30
.github/workflows/publish.yaml
vendored
@@ -21,8 +21,6 @@ concurrency:
|
|||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# NOTE: this job requires curl, jq and yarn
|
|
||||||
# All of them are included in ubuntu-latest.
|
|
||||||
npm:
|
npm:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -33,25 +31,22 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Download npm package from release artifacts
|
- name: Download npm package from release artifacts
|
||||||
uses: robinraju/release-downloader@v1.11
|
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: ${{ github.event.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"
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Publish npm package and tag with "latest"
|
- run: npm run publish:npm
|
||||||
run: yarn publish:npm
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -77,8 +72,7 @@ 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
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||||
@@ -92,7 +86,6 @@ jobs:
|
|||||||
run: ./ci/steps/brew-bump.sh
|
run: ./ci/steps/brew-bump.sh
|
||||||
|
|
||||||
aur:
|
aur:
|
||||||
needs: npm
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
@@ -124,15 +117,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
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Validate package
|
- name: Validate package
|
||||||
uses: heyhusen/archlinux-package-action@v2.2.1
|
uses: heyhusen/archlinux-package-action@v2.4.0
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
with:
|
with:
|
||||||
@@ -151,8 +143,9 @@ jobs:
|
|||||||
git commit -m "chore: updating version to ${{ env.VERSION }}"
|
git commit -m "chore: updating version to ${{ env.VERSION }}"
|
||||||
git push -u origin $(git branch --show)
|
git push -u origin $(git branch --show)
|
||||||
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -176,15 +169,14 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Download deb artifacts
|
- name: Download deb artifacts
|
||||||
uses: robinraju/release-downloader@v1.11
|
uses: robinraju/release-downloader@v1.12
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ env.VERSION }}
|
||||||
@@ -192,7 +184,7 @@ jobs:
|
|||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- name: Download rpm artifacts
|
- name: Download rpm artifacts
|
||||||
uses: robinraju/release-downloader@v1.11
|
uses: robinraju/release-downloader@v1.12
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ env.VERSION }}
|
||||||
|
|||||||
227
.github/workflows/release.yaml
vendored
227
.github/workflows/release.yaml
vendored
@@ -19,103 +19,27 @@ concurrency:
|
|||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# TODO: cache building yarn --production
|
|
||||||
# possibly 2m30s of savings(?)
|
|
||||||
# this requires refactoring our release scripts
|
|
||||||
package-linux-amd64:
|
|
||||||
name: x86-64 Linux build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
container: "centos:8"
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version-file: .node-version
|
|
||||||
|
|
||||||
- name: Install development tools
|
|
||||||
run: |
|
|
||||||
cd /etc/yum.repos.d/
|
|
||||||
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
|
|
||||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
|
||||||
yum install -y gcc-c++ make jq rsync python3 libsecret-devel krb5-devel
|
|
||||||
|
|
||||||
- name: Install nfpm and envsubst
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.22.2/nfpm_2.22.2_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
|
||||||
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
|
||||||
chmod +x envsubst
|
|
||||||
mv envsubst ~/.local/bin
|
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Install yarn
|
|
||||||
run: npm install -g yarn
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
|
|
||||||
- name: Decompress npm package
|
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
- name: Build standalone release
|
|
||||||
run: npm run release:standalone
|
|
||||||
|
|
||||||
- name: Install test dependencies
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Run integration tests on standalone release
|
|
||||||
run: yarn test:integration
|
|
||||||
|
|
||||||
- name: Upload coverage report to Codecov
|
|
||||||
uses: codecov/codecov-action@v4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
if: success()
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
|
||||||
run: |
|
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build packages with nfpm
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: yarn package
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
discussion_category_name: "📣 Announcements"
|
|
||||||
files: ./release-packages/*
|
|
||||||
|
|
||||||
package-linux-cross:
|
package-linux-cross:
|
||||||
name: Linux cross-compile builds
|
name: ${{ matrix.prefix }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
needs: npm-version
|
needs: npm-version
|
||||||
container: "debian:buster"
|
container: "python:3.8-slim-buster"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
- prefix: x86_64-linux-gnu
|
||||||
|
npm_arch: x64
|
||||||
|
apt_arch: amd64
|
||||||
|
package_arch: amd64
|
||||||
- prefix: aarch64-linux-gnu
|
- prefix: aarch64-linux-gnu
|
||||||
npm_arch: arm64
|
npm_arch: arm64
|
||||||
apt_arch: arm64
|
apt_arch: arm64
|
||||||
|
package_arch: arm64
|
||||||
- prefix: arm-linux-gnueabihf
|
- prefix: arm-linux-gnueabihf
|
||||||
npm_arch: armv7l
|
npm_arch: armv7l
|
||||||
apt_arch: armhf
|
apt_arch: armhf
|
||||||
|
package_arch: armv7l
|
||||||
|
|
||||||
env:
|
env:
|
||||||
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
||||||
@@ -129,6 +53,7 @@ jobs:
|
|||||||
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 }}
|
TARGET_ARCH: ${{ matrix.apt_arch }}
|
||||||
npm_config_arch: ${{ matrix.npm_arch }}
|
npm_config_arch: ${{ matrix.npm_arch }}
|
||||||
|
PKG_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
|
||||||
@@ -141,11 +66,15 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
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: |
|
||||||
dpkg --add-architecture $TARGET_ARCH
|
dpkg --add-architecture $TARGET_ARCH
|
||||||
apt-get update && apt-get install -y --no-install-recommends \
|
apt update && apt install -y --no-install-recommends \
|
||||||
crossbuild-essential-$TARGET_ARCH \
|
crossbuild-essential-$TARGET_ARCH \
|
||||||
libx11-dev:$TARGET_ARCH \
|
libx11-dev:$TARGET_ARCH \
|
||||||
libx11-xcb-dev:$TARGET_ARCH \
|
libx11-xcb-dev:$TARGET_ARCH \
|
||||||
@@ -155,6 +84,8 @@ jobs:
|
|||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl wget rsync gettext-base
|
curl wget rsync gettext-base
|
||||||
|
|
||||||
|
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.local/bin
|
mkdir -p ~/.local/bin
|
||||||
@@ -166,11 +97,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
- name: Decompress npm package
|
- run: tar -xzf package.tar.gz
|
||||||
run: tar -xzf package.tar.gz
|
- run: npm run release:standalone
|
||||||
|
|
||||||
- name: Build standalone release
|
|
||||||
run: npm run release:standalone
|
|
||||||
|
|
||||||
- name: Replace node with cross-compile equivalent
|
- name: Replace node with cross-compile equivalent
|
||||||
run: |
|
run: |
|
||||||
@@ -179,19 +107,17 @@ jobs:
|
|||||||
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-standalone/lib/node
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
TAG="${{ inputs.version || github.ref_name }}"
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build packages with nfpm
|
- env:
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: npm run package ${npm_config_arch}
|
run: npm run package $PKG_ARCH
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
@@ -199,9 +125,12 @@ jobs:
|
|||||||
|
|
||||||
package-macos-amd64:
|
package-macos-amd64:
|
||||||
name: x86-64 macOS build
|
name: x86-64 macOS build
|
||||||
runs-on: macos-latest
|
runs-on: macos-13
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
needs: npm-version
|
needs: npm-version
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -210,6 +139,12 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
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: |
|
||||||
@@ -221,28 +156,18 @@ jobs:
|
|||||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
# 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
|
# next update Node we can probably remove this. For now, install
|
||||||
# setuptools since it contains distutils.
|
# setuptools since it contains distutils.
|
||||||
- name: Install Python utilities
|
- run: brew install python-setuptools
|
||||||
run: brew install python-setuptools
|
|
||||||
|
|
||||||
- name: Download npm package
|
- name: Download npm package
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
- name: Decompress npm package
|
- run: tar -xzf package.tar.gz
|
||||||
run: tar -xzf package.tar.gz
|
- run: npm run release:standalone
|
||||||
|
- run: npm run test:native
|
||||||
|
|
||||||
- name: Build standalone release
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
run: npm run release:standalone
|
|
||||||
|
|
||||||
- name: Install test dependencies
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
|
||||||
|
|
||||||
- name: Run native module tests on standalone release
|
|
||||||
run: yarn test:native
|
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
TAG="${{ inputs.version || github.ref_name }}"
|
||||||
@@ -251,9 +176,70 @@ jobs:
|
|||||||
- name: Build packages with nfpm
|
- name: Build packages with nfpm
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: yarn package
|
run: npm run package
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
discussion_category_name: "📣 Announcements"
|
||||||
|
files: ./release-packages/*
|
||||||
|
|
||||||
|
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:
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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: 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"
|
||||||
@@ -270,7 +256,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
@@ -282,7 +268,7 @@ jobs:
|
|||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: dawidd6/action-download-artifact@v6
|
uses: dawidd6/action-download-artifact@v10
|
||||||
id: download
|
id: download
|
||||||
with:
|
with:
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
@@ -292,11 +278,9 @@ jobs:
|
|||||||
check_artifacts: false
|
check_artifacts: false
|
||||||
if_no_artifact_found: fail
|
if_no_artifact_found: fail
|
||||||
|
|
||||||
- name: Decompress npm package
|
- run: tar -xzf package.tar.gz
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
|
||||||
- name: Get and set VERSION
|
- name: Get and set VERSION
|
||||||
run: |
|
run: |
|
||||||
TAG="${{ inputs.version || github.ref_name }}"
|
TAG="${{ inputs.version || github.ref_name }}"
|
||||||
@@ -315,8 +299,7 @@ jobs:
|
|||||||
# Ensure it has the same permissions as before
|
# Ensure it has the same permissions as before
|
||||||
chmod 644 release/lib/vscode/product.json
|
chmod 644 release/lib/vscode/product.json
|
||||||
|
|
||||||
- name: Compress release package
|
- run: tar -czf package.tar.gz release
|
||||||
run: tar -czf package.tar.gz release
|
|
||||||
|
|
||||||
- name: Upload npm package artifact
|
- name: Upload npm package artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
12
.github/workflows/security.yaml
vendored
12
.github/workflows/security.yaml
vendored
@@ -34,12 +34,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
|
|
||||||
- name: Audit yarn for vulnerabilities
|
|
||||||
run: yarn audit
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
- name: Audit npm for vulnerabilities
|
- name: Audit npm for vulnerabilities
|
||||||
run: npm shrinkwrap && npm audit
|
run: npm audit
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
trivy-scan-repo:
|
trivy-scan-repo:
|
||||||
@@ -47,7 +43,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read # for actions/checkout to fetch code
|
contents: read # for actions/checkout to fetch code
|
||||||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -55,7 +51,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in repo mode
|
- name: Run Trivy vulnerability scanner in repo mode
|
||||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8
|
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5
|
||||||
with:
|
with:
|
||||||
scan-type: "fs"
|
scan-type: "fs"
|
||||||
scan-ref: "."
|
scan-ref: "."
|
||||||
@@ -76,7 +72,7 @@ jobs:
|
|||||||
contents: read # for actions/checkout to fetch code
|
contents: read # for actions/checkout to fetch code
|
||||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||||
name: Analyze with CodeQL
|
name: Analyze with CodeQL
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
4
.github/workflows/trivy-docker.yaml
vendored
4
.github/workflows/trivy-docker.yaml
vendored
@@ -44,14 +44,14 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trivy-scan-image:
|
trivy-scan-image:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in image mode
|
- name: Run Trivy vulnerability scanner in image mode
|
||||||
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8
|
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5
|
||||||
with:
|
with:
|
||||||
image-ref: "docker.io/codercom/code-server:latest"
|
image-ref: "docker.io/codercom/code-server:latest"
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
20.11.1
|
22.15.1
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ helm-chart
|
|||||||
test/scripts
|
test/scripts
|
||||||
test/e2e/extensions/test-extension
|
test/e2e/extensions/test-extension
|
||||||
.pc
|
.pc
|
||||||
|
package-lock.json
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
"file": "package.json",
|
"file": "package.json",
|
||||||
"line": 31,
|
"line": 31,
|
||||||
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> npm\n\n3. Start development mode (and watch for changes):\n>> npm run watch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"file": "src/node/app.ts",
|
"file": "src/node/app.ts",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
{
|
{
|
||||||
"file": "src/node/app.ts",
|
"file": "src/node/app.ts",
|
||||||
"line": 62,
|
"line": 62,
|
||||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `npm run watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
179
CHANGELOG.md
179
CHANGELOG.md
@@ -22,6 +22,185 @@ Code v99.99.999
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## [4.100.3](https://github.com/coder/code-server/releases/tag/v4.100.3) - 2025-06-03
|
||||||
|
|
||||||
|
Code v1.100.3
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.100.3.
|
||||||
|
|
||||||
|
## [4.100.2](https://github.com/coder/code-server/releases/tag/v4.100.2) - 2025-05-15
|
||||||
|
|
||||||
|
Code v1.100.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.100.2.
|
||||||
|
|
||||||
|
## [4.100.1](https://github.com/coder/code-server/releases/tag/v4.100.1) - 2025-05-13
|
||||||
|
|
||||||
|
Code v1.100.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.100.1.
|
||||||
|
|
||||||
|
## [4.100.0](https://github.com/coder/code-server/releases/tag/v4.100.0) - 2025-05-12
|
||||||
|
|
||||||
|
Code v1.100.0
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Trusted domains for links can now be set at run-time by configuring
|
||||||
|
`linkProtectionTrustedDomains` in the `lib/vscode/product.json` file or via
|
||||||
|
the `--link-protection-trusted-domains` flag.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.100.0.
|
||||||
|
- Disable extension signature verification, which previously was skipped by
|
||||||
|
default (the package used for verification is not available to OSS builds of
|
||||||
|
VS Code) but now reportedly throws hard errors making it impossible to install
|
||||||
|
extensions.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Flags with repeatable options now work via the config file.
|
||||||
|
|
||||||
|
## [4.99.4](https://github.com/coder/code-server/releases/tag/v4.99.4) - 2025-05-02
|
||||||
|
|
||||||
|
Code v1.99.3
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Validate that ports in the path proxy are numbers, to prevent proxying to
|
||||||
|
arbitrary domains.
|
||||||
|
|
||||||
|
## [4.99.3](https://github.com/coder/code-server/releases/tag/v4.99.3) - 2025-04-17
|
||||||
|
|
||||||
|
Code v1.99.3
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added `--skip-auth-preflight` flag to let preflight requests through the
|
||||||
|
proxy.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.99.3.
|
||||||
|
|
||||||
|
## [4.99.2](https://github.com/coder/code-server/releases/tag/v4.99.2) - 2025-04-10
|
||||||
|
|
||||||
|
Code v1.99.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.99.2.
|
||||||
|
|
||||||
|
## [4.99.1](https://github.com/coder/code-server/releases/tag/v4.99.1) - 2025-04-08
|
||||||
|
|
||||||
|
Code v1.99.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.99.1.
|
||||||
|
|
||||||
|
## [4.99.0](https://github.com/coder/code-server/releases/tag/v4.99.0) - 2025-04-07
|
||||||
|
|
||||||
|
Code v1.99.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.99.0.
|
||||||
|
|
||||||
|
## [4.98.0](https://github.com/coder/code-server/releases/tag/v4.98.0) - 2025-03-07
|
||||||
|
|
||||||
|
Code v1.98.0
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.98.0.
|
||||||
|
|
||||||
|
## [4.97.2](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-02-18
|
||||||
|
|
||||||
|
Code v1.97.2
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added back macOS amd64 builds.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.97.2.
|
||||||
|
- Softened dark mode login page colors.
|
||||||
|
|
||||||
|
## [4.96.4](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-01-20
|
||||||
|
|
||||||
|
Code v1.96.4
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.96.4.
|
||||||
|
|
||||||
|
## [4.96.2](https://github.com/coder/code-server/releases/tag/v4.96.2) - 2024-12-20
|
||||||
|
|
||||||
|
Code v1.96.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.96.2.
|
||||||
|
|
||||||
|
## [4.96.1](https://github.com/coder/code-server/releases/tag/v4.96.1) - 2024-12-18
|
||||||
|
|
||||||
|
Code v1.96.1
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Dark color scheme for login and error pages.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.96.1.
|
||||||
|
|
||||||
|
## [4.95.3](https://github.com/coder/code-server/releases/tag/v4.95.3) - 2024-11-18
|
||||||
|
|
||||||
|
Code v1.95.3
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.95.3.
|
||||||
|
|
||||||
|
## [4.95.2](https://github.com/coder/code-server/releases/tag/v4.95.2) - 2024-11-12
|
||||||
|
|
||||||
|
Code v1.95.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.95.2.
|
||||||
|
|
||||||
|
## [4.95.1](https://github.com/coder/code-server/releases/tag/v4.95.1) - 2024-11-06
|
||||||
|
|
||||||
|
Code v1.95.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update to Code 1.95.1.
|
||||||
|
|
||||||
|
## [4.93.1](https://github.com/coder/code-server/releases/tag/v4.93.1) - 2024-09-23
|
||||||
|
|
||||||
|
Code v1.93.1
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated to Code 1.93.1.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added `--abs-proxy-base-path` flag for when code-server is not at the root.
|
||||||
|
|
||||||
|
## [4.92.2](https://github.com/coder/code-server/releases/tag/v4.92.2) - 2024-08-19
|
||||||
|
|
||||||
Code v1.92.2
|
Code v1.92.2
|
||||||
|
|
||||||
### Breaking changes
|
### Breaking changes
|
||||||
|
|||||||
40
ci/README.md
40
ci/README.md
@@ -16,18 +16,18 @@ This directory contains scripts used for the development of code-server.
|
|||||||
|
|
||||||
- [./ci/dev/image](./dev/image)
|
- [./ci/dev/image](./dev/image)
|
||||||
- See [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md) for docs on the development container.
|
- See [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md) for docs on the development container.
|
||||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
|
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`npm run fmt`)
|
||||||
- Runs formatters.
|
- Runs formatters.
|
||||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
|
- [./ci/dev/lint.sh](./dev/lint.sh) (`npm run lint`)
|
||||||
- Runs linters.
|
- Runs linters.
|
||||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`yarn test:unit`)
|
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`npm run test:unit`)
|
||||||
- Runs unit tests.
|
- Runs unit tests.
|
||||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`yarn test:e2e`)
|
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`npm run test:e2e`)
|
||||||
- Runs end-to-end tests.
|
- Runs end-to-end tests.
|
||||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
- [./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.
|
- Starts a process to build and launch code-server and restart on any code changes.
|
||||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
||||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`yarn icons`)
|
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`npm run icons`)
|
||||||
- Generates the various icons from a single `.svg` favicon in
|
- Generates the various icons from a single `.svg` favicon in
|
||||||
`src/browser/media/favicon.svg`.
|
`src/browser/media/favicon.svg`.
|
||||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
- Requires [imagemagick](https://imagemagick.org/index.php)
|
||||||
@@ -37,20 +37,20 @@ This directory contains scripts used for the development of code-server.
|
|||||||
This directory contains the scripts used to build and release code-server.
|
This directory contains the scripts used to build and release code-server.
|
||||||
You can disable minification by setting `MINIFY=`.
|
You can disable minification by setting `MINIFY=`.
|
||||||
|
|
||||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`yarn build`)
|
- [./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`.
|
- Builds code-server into `./out` and bundles the frontend into `./dist`.
|
||||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`yarn build:vscode`)
|
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`npm run build:vscode`)
|
||||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
- [./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`.
|
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
- [./ci/build/clean.sh](./build/clean.sh) (`npm run clean`)
|
||||||
- Removes all build artifacts.
|
- Removes all build artifacts.
|
||||||
- Useful to do a clean build.
|
- Useful to do a clean build.
|
||||||
- [./ci/build/code-server.sh](./build/code-server.sh)
|
- [./ci/build/code-server.sh](./build/code-server.sh)
|
||||||
- Copied into standalone releases to run code-server with the bundled node binary.
|
- Copied into standalone releases to run code-server with the bundled node binary.
|
||||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`yarn test:standalone-release`)
|
- [./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.
|
- Ensures code-server in the `./release-standalone` directory works by installing an extension.
|
||||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
|
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`npm run package`)
|
||||||
- Packages `./release-standalone` into a `.tar.gz` archive in `./release-packages`.
|
- 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`.
|
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
||||||
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
||||||
@@ -59,15 +59,15 @@ You can disable minification by setting `MINIFY=`.
|
|||||||
- Entrypoint script for code-server for `.deb` and `.rpm`.
|
- Entrypoint script for code-server for `.deb` and `.rpm`.
|
||||||
- [./ci/build/code-server.service](./build/code-server.service)
|
- [./ci/build/code-server.service](./build/code-server.service)
|
||||||
- systemd user service packaged into the `.deb` and `.rpm`.
|
- systemd user service packaged into the `.deb` and `.rpm`.
|
||||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`yarn release:github-draft`)
|
- [./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.
|
- 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) (`yarn release:github-assets`)
|
- [./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.
|
- 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
|
- Uses [gh](https://github.com/cli/cli) to upload the artifacts to the release
|
||||||
specified in `package.json`.
|
specified in `package.json`.
|
||||||
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
||||||
- Post install script for the npm package.
|
- Post install script for the npm package.
|
||||||
- Bundled by`yarn release`.
|
- Bundled by`npm run release`.
|
||||||
|
|
||||||
## release-image
|
## release-image
|
||||||
|
|
||||||
@@ -87,15 +87,15 @@ This directory contains the scripts used in CI.
|
|||||||
Helps avoid clobbering the CI configuration.
|
Helps avoid clobbering the CI configuration.
|
||||||
|
|
||||||
- [./steps/fmt.sh](./steps/fmt.sh)
|
- [./steps/fmt.sh](./steps/fmt.sh)
|
||||||
- Runs `yarn fmt`.
|
- Runs `npm run fmt`.
|
||||||
- [./steps/lint.sh](./steps/lint.sh)
|
- [./steps/lint.sh](./steps/lint.sh)
|
||||||
- Runs `yarn lint`.
|
- Runs `npm run lint`.
|
||||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||||
- Runs `yarn test:unit`.
|
- Runs `npm run test:unit`.
|
||||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||||
- Runs `yarn test:integration`.
|
- Runs `npm run test:integration`.
|
||||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||||
- Runs `yarn test:e2e`.
|
- Runs `npm run test:e2e`.
|
||||||
- [./steps/release.sh](./steps/release.sh)
|
- [./steps/release.sh](./steps/release.sh)
|
||||||
- Runs the release process.
|
- Runs the release process.
|
||||||
- Generates the npm package at `./release`.
|
- Generates the npm package at `./release`.
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Packages code-server for the current OS and architecture into ./release-packages.
|
# Given a platform-specific release found in ./release-standalone, generate an
|
||||||
# This script assumes that a standalone release is built already into ./release-standalone
|
# compressed archives and bundles (as appropriate for the platform) named after
|
||||||
|
# the platform's architecture and OS and place them in ./release-packages and
|
||||||
|
# ./release-gcp.
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# This script requires vscode to be built with matching MINIFY.
|
# 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
|
||||||
|
# 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.
|
||||||
|
|
||||||
# MINIFY controls whether minified vscode is bundled.
|
# MINIFY controls whether minified VS Code is bundled. It must match the value
|
||||||
|
# used when VS Code was built.
|
||||||
MINIFY="${MINIFY-true}"
|
MINIFY="${MINIFY-true}"
|
||||||
|
|
||||||
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
|
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
||||||
# to run first.
|
|
||||||
KEEP_MODULES="${KEEP_MODULES-0}"
|
KEEP_MODULES="${KEEP_MODULES-0}"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
@@ -41,12 +44,8 @@ bundle_code_server() {
|
|||||||
rsync src/browser/pages/*.css "$RELEASE_PATH/src/browser/pages"
|
rsync src/browser/pages/*.css "$RELEASE_PATH/src/browser/pages"
|
||||||
rsync src/browser/robots.txt "$RELEASE_PATH/src/browser"
|
rsync src/browser/robots.txt "$RELEASE_PATH/src/browser"
|
||||||
|
|
||||||
# Add typings for plugins
|
|
||||||
mkdir -p "$RELEASE_PATH/typings"
|
|
||||||
rsync typings/pluginapi.d.ts "$RELEASE_PATH/typings"
|
|
||||||
|
|
||||||
# Adds the commit to package.json
|
# Adds the commit to package.json
|
||||||
jq --slurp '.[0] * .[1]' package.json <(
|
jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
{
|
{
|
||||||
"commit": "$(git rev-parse HEAD)",
|
"commit": "$(git rev-parse HEAD)",
|
||||||
@@ -88,49 +87,50 @@ bundle_vscode() {
|
|||||||
|
|
||||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
||||||
|
|
||||||
# Use the package.json for the web/remote server. It does not have the right
|
# Merge the package.json for the web/remote server so we can include
|
||||||
# version though so pull that from the main package.json.
|
# dependencies, since we want to ship this via NPM.
|
||||||
jq --slurp '.[0] * {version: .[1].version}' \
|
jq --slurp '.[0] * .[1]' \
|
||||||
"$VSCODE_SRC_PATH/remote/package.json" \
|
"$VSCODE_SRC_PATH/remote/package.json" \
|
||||||
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
"$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged"
|
||||||
|
mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json"
|
||||||
mv "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
cp "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
||||||
|
|
||||||
# Include global extension dependencies as well.
|
# Include global extension dependencies as well.
|
||||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
||||||
mv "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
cp "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
||||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||||
}
|
}
|
||||||
|
|
||||||
create_shrinkwraps() {
|
create_shrinkwraps() {
|
||||||
# yarn.lock or package-lock.json files (used to ensure deterministic versions of dependencies) are
|
# package-lock.json files (used to ensure deterministic versions of
|
||||||
# not packaged when publishing to the NPM registry.
|
# dependencies) are not packaged when publishing to the NPM registry.
|
||||||
# To ensure deterministic dependency versions (even when code-server is installed with NPM), we create
|
#
|
||||||
# an npm-shrinkwrap.json file from the currently installed node_modules. This ensures the versions used
|
# To ensure deterministic dependency versions (even when code-server is
|
||||||
# from development (that the yarn.lock guarantees) are also the ones installed by end-users.
|
# installed with NPM), we create an npm-shrinkwrap.json file from the
|
||||||
# These will include devDependencies, but those will be ignored when installing globally (for code-server), and
|
# currently installed node_modules. This ensures the versions used from
|
||||||
# because we use --omit=dev when installing vscode.
|
# development (that the package-lock.json guarantees) are also the ones
|
||||||
|
# installed by end-users. These will include devDependencies, but those will
|
||||||
|
# be ignored when installing globally (for code-server), and because we use
|
||||||
|
# --omit=dev (for VS Code).
|
||||||
|
|
||||||
# We first generate the shrinkwrap file for code-server itself - which is the current directory
|
# We first generate the shrinkwrap file for code-server itself - which is the
|
||||||
create_shrinkwrap_keeping_yarn_lock
|
# current directory.
|
||||||
|
cp package-lock.json package-lock.json.temp
|
||||||
|
npm shrinkwrap
|
||||||
|
mv package-lock.json.temp package-lock.json
|
||||||
|
|
||||||
# Then the shrinkwrap files for the bundled VSCode
|
# Then the shrinkwrap files for the bundled VS Code.
|
||||||
pushd "$VSCODE_SRC_PATH/remote/"
|
pushd "$VSCODE_SRC_PATH/remote/"
|
||||||
create_shrinkwrap_keeping_yarn_lock
|
cp package-lock.json package-lock.json.temp
|
||||||
|
npm shrinkwrap
|
||||||
|
mv package-lock.json.temp package-lock.json
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd "$VSCODE_SRC_PATH/extensions/"
|
pushd "$VSCODE_SRC_PATH/extensions/"
|
||||||
create_shrinkwrap_keeping_yarn_lock
|
cp package-lock.json package-lock.json.temp
|
||||||
|
npm shrinkwrap
|
||||||
|
mv package-lock.json.temp package-lock.json
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
create_shrinkwrap_keeping_yarn_lock() {
|
|
||||||
# HACK@edvincent: Generating a shrinkwrap alters the yarn.lock which we don't want (with NPM URLs rather than the Yarn URLs)
|
|
||||||
# But to generate a valid shrinkwrap, it has to exist... So we copy it to then restore it
|
|
||||||
cp yarn.lock yarn.lock.temp
|
|
||||||
npm shrinkwrap
|
|
||||||
cp yarn.lock.temp yarn.lock
|
|
||||||
rm yarn.lock.temp
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
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() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
|
|
||||||
@@ -9,9 +13,8 @@ main() {
|
|||||||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
||||||
RELEASE_PATH+=-standalone
|
RELEASE_PATH+=-standalone
|
||||||
|
|
||||||
# We cannot get the path to Node from $PATH (for example via `which node`)
|
# Package managers may shim their own "node" wrapper into the PATH, so run
|
||||||
# because Yarn shims a script called `node` and we would end up just copying
|
# node and ask it for its true path.
|
||||||
# that script. Instead we run Node and have it print its actual path.
|
|
||||||
local node_path
|
local node_path
|
||||||
node_path="$(node <<< 'console.info(process.execPath)')"
|
node_path="$(node <<< 'console.info(process.execPath)')"
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ main() {
|
|||||||
|
|
||||||
if [[ ! ${VERSION-} ]]; then
|
if [[ ! ${VERSION-} ]]; then
|
||||||
echo "VERSION not set. Please set before running this script:"
|
echo "VERSION not set. Please set before running this script:"
|
||||||
echo "VERSION='0.0.0' yarn build:vscode"
|
echo "VERSION='0.0.0' npm run build:vscode"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ EOF
|
|||||||
# this because we have an NPM package that could be installed on any platform.
|
# this because we have an NPM package that could be installed on any platform.
|
||||||
# The correct platform dependencies and scripts will be installed as part of
|
# The correct platform dependencies and scripts will be installed as part of
|
||||||
# the post-install during `npm install` or when building a standalone release.
|
# the post-install during `npm install` or when building a standalone release.
|
||||||
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
npm run gulp "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
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ main() {
|
|||||||
echo "USE AT YOUR OWN RISK!"
|
echo "USE AT YOUR OWN RISK!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-20}" ]; then
|
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-22}" ]; then
|
||||||
echo "ERROR: code-server currently requires node v20."
|
echo "ERROR: code-server currently requires node v22."
|
||||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||||
fi
|
fi
|
||||||
@@ -117,14 +117,11 @@ main() {
|
|||||||
|
|
||||||
install_with_yarn_or_npm() {
|
install_with_yarn_or_npm() {
|
||||||
echo "User agent: ${npm_config_user_agent-none}"
|
echo "User agent: ${npm_config_user_agent-none}"
|
||||||
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
|
# For development we enforce npm, but for installing the package as an
|
||||||
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
|
# end-user we want to keep using whatever package manager is in use.
|
||||||
case "${npm_config_user_agent-}" in
|
case "${npm_config_user_agent-}" in
|
||||||
npm*)
|
npm*)
|
||||||
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
|
if ! npm install --unsafe-perm --omit=dev; then
|
||||||
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
|
|
||||||
# See https://github.com//pull/5071
|
|
||||||
if ! npm install --unsafe-perm --legacy-peer-deps --omit=dev; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ main() {
|
|||||||
echo "Files need generation or are formatted incorrectly:"
|
echo "Files need generation or are formatted incorrectly:"
|
||||||
git -c color.ui=always status | grep --color=no '\[31m'
|
git -c color.ui=always status | grep --color=no '\[31m'
|
||||||
echo "Please run the following locally:"
|
echo "Please run the following locally:"
|
||||||
echo " yarn doctoc"
|
echo " npm run doctoc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,13 @@ set -euo pipefail
|
|||||||
|
|
||||||
# Install dependencies in $1.
|
# Install dependencies in $1.
|
||||||
install-deps() {
|
install-deps() {
|
||||||
local args=(install)
|
local args=()
|
||||||
if [[ ${CI-} ]]; then
|
if [[ ${CI-} ]]; then
|
||||||
args+=(--frozen-lockfile)
|
args+=(ci)
|
||||||
|
else
|
||||||
|
args+=(install)
|
||||||
fi
|
fi
|
||||||
if [[ "$1" == "lib/vscode" ]]; then
|
# If there is no package.json then npm will look upward and end up installing
|
||||||
args+=(--no-default-rc)
|
|
||||||
fi
|
|
||||||
# If there is no package.json then yarn will look upward and end up installing
|
|
||||||
# from the root resulting in an infinite loop (this can happen if you have not
|
# from the root resulting in an infinite loop (this can happen if you have not
|
||||||
# checked out the submodule yet for example).
|
# checked out the submodule yet for example).
|
||||||
if [[ ! -f "$1/package.json" ]]; then
|
if [[ ! -f "$1/package.json" ]]; then
|
||||||
@@ -19,7 +18,7 @@ install-deps() {
|
|||||||
fi
|
fi
|
||||||
pushd "$1"
|
pushd "$1"
|
||||||
echo "Installing dependencies for $PWD"
|
echo "Installing dependencies for $PWD"
|
||||||
yarn "${args[@]}"
|
npm "${args[@]}"
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
ci/dev/preinstall.js
Normal file
3
ci/dev/preinstall.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
if (process.env.npm_execpath.includes("yarn")) {
|
||||||
|
throw new Error("`yarn` is no longer supported; please use `npm install` instead")
|
||||||
|
}
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo >&2 " You can build with 'yarn watch' or you can build a release"
|
echo >&2 " You can build with 'npm run watch' or you can build a release"
|
||||||
echo >&2 " For example: 'yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release'"
|
echo >&2 " For example: 'npm run build && npm run build:vscode && KEEP_MODULES=1 npm run release'"
|
||||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release yarn test:e2e'"
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release npm run test:e2e'"
|
||||||
echo >&2 " You can manually run that release with 'node ./release'"
|
echo >&2 " You can manually run that release with 'node ./release'"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ main() {
|
|||||||
|
|
||||||
pushd test/e2e/extensions/test-extension
|
pushd test/e2e/extensions/test-extension
|
||||||
echo "Building test extension"
|
echo "Building test extension"
|
||||||
yarn build
|
npm run build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
local dir="$PWD"
|
local dir="$PWD"
|
||||||
@@ -44,7 +44,7 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd test
|
cd test
|
||||||
yarn playwright test "$@"
|
./node_modules/.bin/playwright test "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
||||||
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' yarn 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
|
||||||
@@ -33,7 +33,7 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
echo >&2 " You can build the standalone release with 'npm run release:standalone'"
|
||||||
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' yarn 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
|
||||||
|
|||||||
@@ -6,15 +6,10 @@ main() {
|
|||||||
|
|
||||||
source ./ci/lib.sh
|
source ./ci/lib.sh
|
||||||
|
|
||||||
echo "Building test plugin"
|
|
||||||
pushd test/unit/node/test-plugin
|
|
||||||
make -s out/index.js
|
|
||||||
popd
|
|
||||||
|
|
||||||
# We must keep jest in a sub-directory. See ../../test/package.json for more
|
# We must keep jest in a sub-directory. See ../../test/package.json for more
|
||||||
# information. We must also run it from the root otherwise coverage will not
|
# information. We must also run it from the root otherwise coverage will not
|
||||||
# include our source files.
|
# include our source files.
|
||||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin"
|
./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -45,9 +45,11 @@ class Watcher {
|
|||||||
|
|
||||||
private readonly compilers: DevelopmentCompilers = {
|
private readonly compilers: DevelopmentCompilers = {
|
||||||
codeServer: spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath }),
|
codeServer: spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath }),
|
||||||
vscode: spawn("yarn", ["watch"], { cwd: this.paths.vscodeDir }),
|
vscode: spawn("npm", ["run", "watch"], { cwd: this.paths.vscodeDir }),
|
||||||
vscodeWebExtensions: spawn("yarn", ["watch-web"], { cwd: this.paths.vscodeDir }),
|
vscodeWebExtensions: spawn("npm", ["run", "watch-web"], { cwd: this.paths.vscodeDir }),
|
||||||
plugins: this.paths.pluginDir ? spawn("yarn", ["build", "--watch"], { cwd: this.paths.pluginDir }) : undefined,
|
plugins: this.paths.pluginDir
|
||||||
|
? spawn("npm", ["run", "build", "--watch"], { cwd: this.paths.pluginDir })
|
||||||
|
: undefined,
|
||||||
}
|
}
|
||||||
|
|
||||||
public async initialize(): Promise<void> {
|
public async initialize(): Promise<void> {
|
||||||
|
|||||||
@@ -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.22.0
|
version: 3.27.3
|
||||||
|
|
||||||
# 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.91.0
|
appVersion: 4.100.3
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ metadata:
|
|||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: {{ .Values.replicaCount | default 1 }}
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
selector:
|
selector:
|
||||||
@@ -35,8 +35,9 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
{{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) .Values.extraInitContainers }}
|
||||||
initContainers:
|
initContainers:
|
||||||
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||||
- name: init-chmod-data
|
- name: init-chmod-data
|
||||||
image: busybox:latest
|
image: busybox:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
@@ -50,6 +51,7 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /home/coder
|
mountPath: /home/coder
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.extraInitContainers }}
|
{{- if .Values.extraInitContainers }}
|
||||||
{{ tpl .Values.extraInitContainers . | indent 6}}
|
{{ tpl .Values.extraInitContainers . | indent 6}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.91.0'
|
tag: '4.100.3'
|
||||||
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
|
||||||
@@ -19,6 +19,9 @@ nameOverride: ""
|
|||||||
fullnameOverride: ""
|
fullnameOverride: ""
|
||||||
hostnameOverride: ""
|
hostnameOverride: ""
|
||||||
|
|
||||||
|
# The existing secret to use for code-server authentication in the frontend. the password is stored in the secret under the key `password`
|
||||||
|
# existingSecret: ""
|
||||||
|
|
||||||
serviceAccount:
|
serviceAccount:
|
||||||
# Specifies whether a service account should be created
|
# Specifies whether a service account should be created
|
||||||
create: true
|
create: true
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
|
|||||||
&& locale-gen
|
&& locale-gen
|
||||||
ENV LANG=en_US.UTF-8
|
ENV LANG=en_US.UTF-8
|
||||||
|
|
||||||
RUN adduser --gecos '' --disabled-password coder \
|
RUN if grep -q 1000 /etc/passwd; then \
|
||||||
|
userdel -r "$(id -un 1000)"; \
|
||||||
|
fi \
|
||||||
|
&& adduser --gecos '' --disabled-password coder \
|
||||||
&& echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
&& echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||||
|
|
||||||
RUN ARCH="$(dpkg --print-architecture)" \
|
RUN ARCH="$(dpkg --print-architecture)" \
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ eval "$(fixuid -q)"
|
|||||||
|
|
||||||
if [ "${DOCKER_USER-}" ]; then
|
if [ "${DOCKER_USER-}" ]; then
|
||||||
USER="$DOCKER_USER"
|
USER="$DOCKER_USER"
|
||||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then
|
||||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||||
|
|||||||
@@ -53,11 +53,11 @@ main() {
|
|||||||
# This string is used to determine how we should tag the npm release.
|
# This string is used to determine how we should tag the npm release.
|
||||||
# Environment can be one of three choices:
|
# Environment can be one of three choices:
|
||||||
# "development" - this means we tag with the PR number, allowing
|
# "development" - this means we tag with the PR number, allowing
|
||||||
# a developer to install this version with `yarn add code-server@<pr-number>`
|
# a developer to install this version with `npm install code-server@<pr-number>`
|
||||||
# "staging" - this means we tag with `beta`, allowing
|
# "staging" - this means we tag with `beta`, allowing
|
||||||
# a developer to install this version with `yarn add code-server@beta`
|
# a developer to install this version with `npm install code-server@beta`
|
||||||
# "production" - this means we tag with `latest` (default), allowing
|
# "production" - this means we tag with `latest` (default), allowing
|
||||||
# a developer to install this version with `yarn add code-server@latest`
|
# a developer to install this version with `npm install code-server@latest`
|
||||||
if ! is_env_var_set "NPM_ENVIRONMENT"; then
|
if ! is_env_var_set "NPM_ENVIRONMENT"; then
|
||||||
echo "NPM_ENVIRONMENT is not set."
|
echo "NPM_ENVIRONMENT is not set."
|
||||||
echo "Determining in script based on GITHUB environment variables."
|
echo "Determining in script based on GITHUB environment variables."
|
||||||
@@ -86,7 +86,7 @@ main() {
|
|||||||
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
|
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
|
||||||
NPM_VERSION="$VERSION"
|
NPM_VERSION="$VERSION"
|
||||||
# This means the npm version will be published as "stable"
|
# This means the npm version will be published as "stable"
|
||||||
# and installed when a user runs `yarn install code-server`
|
# and installed when a user runs `npm install code-server`
|
||||||
NPM_TAG="latest"
|
NPM_TAG="latest"
|
||||||
else
|
else
|
||||||
COMMIT_SHA="$GITHUB_SHA"
|
COMMIT_SHA="$GITHUB_SHA"
|
||||||
@@ -94,7 +94,7 @@ main() {
|
|||||||
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
|
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
|
||||||
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
|
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
|
||||||
# This means the npm version will be tagged with "beta"
|
# This means the npm version will be tagged with "beta"
|
||||||
# and installed when a user runs `yarn install code-server@beta`
|
# and installed when a user runs `npm install code-server@beta`
|
||||||
NPM_TAG="beta"
|
NPM_TAG="beta"
|
||||||
PACKAGE_NAME="@coder/code-server-pr"
|
PACKAGE_NAME="@coder/code-server-pr"
|
||||||
fi
|
fi
|
||||||
@@ -105,7 +105,7 @@ main() {
|
|||||||
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
|
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
|
||||||
PACKAGE_NAME="@coder/code-server-pr"
|
PACKAGE_NAME="@coder/code-server-pr"
|
||||||
# This means the npm version will be tagged with "<pr number>"
|
# This means the npm version will be tagged with "<pr number>"
|
||||||
# and installed when a user runs `yarn install code-server@<pr number>`
|
# and installed when a user runs `npm install code-server@<pr number>`
|
||||||
NPM_TAG="$PR_NUMBER"
|
NPM_TAG="$PR_NUMBER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -120,10 +120,7 @@ main() {
|
|||||||
# Example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
# Example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||||
# Example: "version": "4.0.1-beta-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
# Example: "version": "4.0.1-beta-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||||
pushd release
|
pushd release
|
||||||
# NOTE@jsjoeio
|
|
||||||
# I originally tried to use `yarn version` but ran into issues and abandoned it.
|
|
||||||
npm version "$NPM_VERSION"
|
npm version "$NPM_VERSION"
|
||||||
# NOTE@jsjoeio
|
|
||||||
# Use the development package name
|
# Use the development package name
|
||||||
# This is so we don't clutter the code-server versions on npm
|
# This is so we don't clutter the code-server versions on npm
|
||||||
# with development versions.
|
# with development versions.
|
||||||
@@ -134,7 +131,6 @@ main() {
|
|||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE@jsjoeio
|
|
||||||
# We need to make sure we haven't already published the version.
|
# 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 we get error, continue with script because we want to publish
|
||||||
# If version is valid, we check if we're publishing the same one
|
# If version is valid, we check if we're publishing the same one
|
||||||
@@ -144,10 +140,10 @@ main() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE@jsjoeio
|
|
||||||
# Since the dev builds are scoped to @coder
|
# Since the dev builds are scoped to @coder
|
||||||
# We pass --access public to ensure npm knows it's not private.
|
# We pass --access public to ensure npm knows it's not private.
|
||||||
yarn publish --non-interactive release --tag "$NPM_TAG" --access public
|
cd release
|
||||||
|
npm publish --tag "$NPM_TAG" --access public
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ The prerequisites for contributing to code-server are almost the same as those
|
|||||||
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
Here is what is needed:
|
Here is what is needed:
|
||||||
|
|
||||||
- `node` v20.x
|
- `node` v22.x
|
||||||
- `git` v2.x or greater
|
- `git` v2.x or greater
|
||||||
- [`git-lfs`](https://git-lfs.github.com)
|
- [`git-lfs`](https://git-lfs.github.com)
|
||||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
- [`npm`](https://www.npmjs.com/)
|
||||||
- Used to install JS packages and run scripts
|
- Used to install JS packages and run scripts
|
||||||
- [`nfpm`](https://nfpm.goreleaser.com/)
|
- [`nfpm`](https://nfpm.goreleaser.com/)
|
||||||
- Used to build `.deb` and `.rpm` packages
|
- Used to build `.deb` and `.rpm` packages
|
||||||
@@ -70,8 +70,8 @@ for more information.
|
|||||||
1. `git clone https://github.com/coder/code-server.git` - Clone `code-server`
|
1. `git clone https://github.com/coder/code-server.git` - Clone `code-server`
|
||||||
2. `git submodule update --init` - Clone `vscode` submodule
|
2. `git submodule update --init` - Clone `vscode` submodule
|
||||||
3. `quilt push -a` - Apply patches to the `vscode` submodule.
|
3. `quilt push -a` - Apply patches to the `vscode` submodule.
|
||||||
4. `yarn` - Install dependencies
|
4. `npm install` - Install dependencies
|
||||||
5. `yarn watch` - Launch code-server localhost:8080. code-server will be live
|
5. `npm run watch` - Launch code-server localhost:8080. code-server will be live
|
||||||
reloaded when changes are made; the browser needs to be refreshed manually.
|
reloaded when changes are made; the browser needs to be refreshed manually.
|
||||||
|
|
||||||
When pulling down changes that include modifications to the patches you will
|
When pulling down changes that include modifications to the patches you will
|
||||||
@@ -102,7 +102,7 @@ commits first if you are doing this).
|
|||||||
but the lines changed, update the patch with `quilt refresh`. If there are
|
but the lines changed, update the patch with `quilt refresh`. If there are
|
||||||
conflicts, then force apply with `quilt push -f`, manually add back the
|
conflicts, then force apply with `quilt push -f`, manually add back the
|
||||||
rejected code, then run `quilt refresh`.
|
rejected code, then run `quilt refresh`.
|
||||||
4. From the code-server **project root**, run `yarn install`.
|
4. From the code-server **project root**, run `npm install`.
|
||||||
5. Check the Node.js version that's used by Electron (which is shipped with VS
|
5. Check the Node.js version that's used by Electron (which is shipped with VS
|
||||||
Code. If necessary, update our version of Node.js to match.
|
Code. If necessary, update our version of Node.js to match.
|
||||||
|
|
||||||
@@ -127,14 +127,14 @@ You can build a full production as follows:
|
|||||||
```shell
|
```shell
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
quilt push -a
|
quilt push -a
|
||||||
yarn install
|
npm install
|
||||||
yarn build
|
npm run build
|
||||||
VERSION=0.0.0 yarn build:vscode
|
VERSION=0.0.0 npm run build:vscode
|
||||||
yarn release
|
npm run release
|
||||||
```
|
```
|
||||||
|
|
||||||
This does not keep `node_modules`. If you want them to be kept, use
|
This does not keep `node_modules`. If you want them to be kept, use
|
||||||
`KEEP_MODULES=1 yarn release`
|
`KEEP_MODULES=1 npm run release`
|
||||||
|
|
||||||
Run your build:
|
Run your build:
|
||||||
|
|
||||||
@@ -148,9 +148,9 @@ node .
|
|||||||
Then, to build the release package:
|
Then, to build the release package:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn release:standalone
|
npm run release:standalone
|
||||||
yarn test:integration
|
npm run test:integration
|
||||||
yarn package
|
npm run package
|
||||||
```
|
```
|
||||||
|
|
||||||
> On Linux, the currently running distro will become the minimum supported
|
> On Linux, the currently running distro will become the minimum supported
|
||||||
@@ -170,9 +170,9 @@ writing, we do this for the following platforms/architectures:
|
|||||||
- Linux armhf.rpm
|
- Linux armhf.rpm
|
||||||
- macOS arm64.tar.gz
|
- macOS arm64.tar.gz
|
||||||
|
|
||||||
Currently, these are compiled in CI using the `yarn release:standalone` command
|
Currently, these are compiled in CI using the `npm run release:standalone`
|
||||||
in the `release.yaml` workflow. We then upload them to the draft release and
|
command in the `release.yaml` workflow. We then upload them to the draft release
|
||||||
distribute via GitHub Releases.
|
and distribute via GitHub Releases.
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ We use these to test anything related to our scripts (most of which live under
|
|||||||
|
|
||||||
### Integration tests
|
### Integration tests
|
||||||
|
|
||||||
These are a work in progress. We build code-server and run tests with `yarn
|
These are a work in progress. We build code-server and run tests with `npm run
|
||||||
test:integration`, which ensures that code-server builds work on their
|
test:integration`, which ensures that code-server builds work on their
|
||||||
respective platforms.
|
respective platforms.
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ Our testing structure is laid out under our [Contributing docs](https://coder.co
|
|||||||
|
|
||||||
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:
|
||||||
|
|
||||||
- run `yarn test:unit` and look at the coverage chart. You'll see all the
|
- run `npm run test:unit` and look at the coverage chart. You'll see all the
|
||||||
uncovered lines. This is a good place to start.
|
uncovered lines. This is a good place to start.
|
||||||
- look at `test/scripts` to see which scripts are tested. We can always use more
|
- look at `test/scripts` to see which scripts are tested. We can always use more
|
||||||
tests there.
|
tests there.
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ on how to set up a Google VM on which you can install code-server.
|
|||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
There are four ways to get started:
|
There are five ways to get started:
|
||||||
|
|
||||||
1. Using the [install
|
1. Using the [install
|
||||||
script](https://github.com/coder/code-server/blob/main/install.sh), which
|
script](https://github.com/coder/code-server/blob/main/install.sh), which
|
||||||
@@ -35,6 +35,9 @@ There are four ways to get started:
|
|||||||
3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github)
|
3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github)
|
||||||
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||||
provider](https://github.com/coder/deploy-code-server) ⚡
|
provider](https://github.com/coder/deploy-code-server) ⚡
|
||||||
|
5. Using the [code-server feature for
|
||||||
|
devcontainers](https://github.com/coder/devcontainer-features/blob/main/src/code-server/README.md),
|
||||||
|
if you already use devcontainers in your project.
|
||||||
|
|
||||||
If you use the install script, you can preview what occurs during the install
|
If you use the install script, you can preview what occurs during the install
|
||||||
process:
|
process:
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ We use the following tools to help us stay on top of vulnerability mitigation.
|
|||||||
- Comprehensive vulnerability scanner that runs on PRs into the default
|
- Comprehensive vulnerability scanner that runs on PRs into the default
|
||||||
branch and scans both our container image and repository code (see
|
branch and scans both our container image and repository code (see
|
||||||
`trivy-scan-repo` and `trivy-scan-image` jobs in `build.yaml`)
|
`trivy-scan-repo` and `trivy-scan-image` jobs in `build.yaml`)
|
||||||
- `yarn audit` and `npm audit`
|
- `npm audit`
|
||||||
- Audits Yarn/NPM dependencies.
|
- Audits NPM dependencies.
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|||||||
```
|
```
|
||||||
|
|
||||||
6. Exit the terminal using `exit` and then reopen the terminal
|
6. Exit the terminal using `exit` and then reopen the terminal
|
||||||
7. Install and use Node.js 20:
|
7. Install and use Node.js 22:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nvm install 18
|
nvm install 18
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
- [Proxying to a Vue app](#proxying-to-a-vue-app)
|
- [Proxying to a Vue app](#proxying-to-a-vue-app)
|
||||||
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
||||||
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
||||||
|
- [Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
|
||||||
|
- [Preflight requests](#preflight-requests)
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- prettier-ignore-end -->
|
<!-- prettier-ignore-end -->
|
||||||
@@ -118,22 +120,22 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
|||||||
|
|
||||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
||||||
|
|
||||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
2. You'll need a domain name (if you don't have one, you can purchase one from
|
||||||
[Google Domains](https://domains.google.com) or the domain service of your
|
[Google Domains](https://domains.google.com) or the domain service of your
|
||||||
choice)). Once you have a domain name, add an A record to your domain that contains your
|
choice). Once you have a domain name, add an A record to your domain that contains your
|
||||||
instance's IP address.
|
instance's IP address.
|
||||||
|
|
||||||
1. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
3. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install caddy
|
sudo apt install caddy
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
4. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
mydomain.com {
|
mydomain.com {
|
||||||
@@ -152,7 +154,7 @@ sudo apt install caddy
|
|||||||
|
|
||||||
Remember to replace `mydomain.com` with your domain name!
|
Remember to replace `mydomain.com` with your domain name!
|
||||||
|
|
||||||
1. Reload Caddy:
|
5. Reload Caddy:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo systemctl reload caddy
|
sudo systemctl reload caddy
|
||||||
@@ -163,21 +165,22 @@ At this point, you should be able to access code-server via
|
|||||||
|
|
||||||
### Using Let's Encrypt with NGINX
|
### Using Let's Encrypt with NGINX
|
||||||
|
|
||||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
1. This option requires that the remote machine be exposed to the internet. Make
|
||||||
|
sure that your instance allows HTTP/HTTPS traffic.
|
||||||
|
|
||||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
2. You'll need a domain name (if you don't have one, you can purchase one from
|
||||||
[Google Domains](https://domains.google.com) or the domain service of your
|
[Google Domains](https://domains.google.com) or the domain service of your
|
||||||
choice)). Once you have a domain name, add an A record to your domain that contains your
|
choice). Once you have a domain name, add an A record to your domain that contains your
|
||||||
instance's IP address.
|
instance's IP address.
|
||||||
|
|
||||||
1. Install NGINX:
|
3. Install NGINX:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y nginx certbot python3-certbot-nginx
|
sudo apt install -y nginx certbot python3-certbot-nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
4. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||||
configuration:
|
configuration:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@@ -198,13 +201,11 @@ At this point, you should be able to access code-server via
|
|||||||
|
|
||||||
Be sure to replace `mydomain.com` with your domain name!
|
Be sure to replace `mydomain.com` with your domain name!
|
||||||
|
|
||||||
1. Enable the config:
|
5. Enable the config:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
||||||
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Be sure to replace `me@example.com` with your actual email.
|
Be sure to replace `me@example.com` with your actual email.
|
||||||
|
|
||||||
At this point, you should be able to access code-server via
|
At this point, you should be able to access code-server via
|
||||||
@@ -270,9 +271,9 @@ should see OSSStatus: 9836 in the browser console.
|
|||||||
If you want to use external authentication mechanism (e.g., Sign in with
|
If you want to use external authentication mechanism (e.g., Sign in with
|
||||||
Google), you can do this with a reverse proxy such as:
|
Google), you can do this with a reverse proxy such as:
|
||||||
|
|
||||||
- [Pomerium](https://www.pomerium.io/guides/code-server.html)
|
- [Pomerium](https://www.pomerium.com/docs/guides/code-server.html)
|
||||||
- [oauth2_proxy](https://github.com/pusher/oauth2_proxy)
|
- [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/)
|
||||||
- [Cloudflare Access](https://teams.cloudflare.com/access)
|
- [Cloudflare Access](https://www.cloudflare.com/zero-trust/products/access/)
|
||||||
|
|
||||||
## HTTPS and self-signed certificates
|
## HTTPS and self-signed certificates
|
||||||
|
|
||||||
@@ -291,7 +292,9 @@ redirect all HTTP requests to HTTPS.
|
|||||||
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
||||||
> for free.
|
> for free.
|
||||||
|
|
||||||
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it will change the address displayed in the green section of code-server in the bottom left to show the correct address.
|
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it
|
||||||
|
will change the address displayed in the green section of code-server in the
|
||||||
|
bottom left to show the correct address.
|
||||||
|
|
||||||
## Accessing web services
|
## Accessing web services
|
||||||
|
|
||||||
@@ -377,14 +380,16 @@ PUBLIC_URL=/absproxy/3000 \
|
|||||||
BROWSER=none yarn start
|
BROWSER=none yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
You should then be able to visit
|
||||||
code-server!
|
`https://my-code-server-address.io/absproxy/3000` to see your app exposed
|
||||||
|
through code-server.
|
||||||
|
|
||||||
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
||||||
|
|
||||||
### Proxying to a Vue app
|
### Proxying to a Vue app
|
||||||
|
|
||||||
Similar to the situation with React apps, you have to make a few modifications to proxy a Vue app.
|
Similar to the situation with React apps, you have to make a few modifications
|
||||||
|
to proxy a Vue app.
|
||||||
|
|
||||||
1. add `vue.config.js`
|
1. add `vue.config.js`
|
||||||
2. update the values to match this (you can use any free port):
|
2. update the values to match this (you can use any free port):
|
||||||
@@ -405,7 +410,8 @@ Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#
|
|||||||
|
|
||||||
### Proxying to an Angular app
|
### Proxying to an Angular app
|
||||||
|
|
||||||
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
|
In order to use code-server's built-in proxy with Angular, you need to make the
|
||||||
|
following changes in your app:
|
||||||
|
|
||||||
1. use `<base href="./.">` in `src/index.html`
|
1. use `<base href="./.">` in `src/index.html`
|
||||||
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
|
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
|
||||||
@@ -414,7 +420,8 @@ For additional context, see [this GitHub Discussion](https://github.com/coder/co
|
|||||||
|
|
||||||
### Proxying to a Svelte app
|
### Proxying to a Svelte app
|
||||||
|
|
||||||
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
|
In order to use code-server's built-in proxy with Svelte, you need to make the
|
||||||
|
following changes in your app:
|
||||||
|
|
||||||
1. Add `svelte.config.js` if you don't already have one
|
1. Add `svelte.config.js` if you don't already have one
|
||||||
2. Update the values to match this (you can use any free port):
|
2. Update the values to match this (you can use any free port):
|
||||||
@@ -432,3 +439,22 @@ const config = {
|
|||||||
3. Access app at `<code-server-root>/absproxy/5173/` e.g. `http://localhost:8080/absproxy/5173/
|
3. Access app at `<code-server-root>/absproxy/5173/` e.g. `http://localhost:8080/absproxy/5173/
|
||||||
|
|
||||||
For additional context, see [this Github Issue](https://github.com/sveltejs/kit/issues/2958)
|
For additional context, see [this Github Issue](https://github.com/sveltejs/kit/issues/2958)
|
||||||
|
|
||||||
|
### Prefixing `/absproxy/<port>` with a path
|
||||||
|
|
||||||
|
This is a case where you need to serve an application via `absproxy` as
|
||||||
|
explained above while serving code-server itself from a path other than the root
|
||||||
|
in your domain.
|
||||||
|
|
||||||
|
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve
|
||||||
|
this result:
|
||||||
|
|
||||||
|
1. Start code-server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
||||||
|
2. Follow one of the instructions above for your framework.
|
||||||
|
|
||||||
|
### Preflight requests
|
||||||
|
|
||||||
|
By default, if you have auth enabled, code-server will authenticate all proxied
|
||||||
|
requests including preflight requests. This can cause issues because preflight
|
||||||
|
requests do not typically include credentials. To allow all preflight requests
|
||||||
|
through the proxy without authentication, use `--skip-auth-preflight`.
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
|
|||||||
## Node.js version
|
## Node.js version
|
||||||
|
|
||||||
We use the same major version of Node.js shipped with Code's remote, which is
|
We use the same major version of Node.js shipped with Code's remote, which is
|
||||||
currently `20.x`. VS Code also [lists Node.js
|
currently `22.x`. VS Code also [lists Node.js
|
||||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
|
|
||||||
Using other versions of Node.js [may lead to unexpected
|
Using other versions of Node.js [may lead to unexpected
|
||||||
@@ -62,8 +62,7 @@ Proceed to [installing](#installing)
|
|||||||
## Alpine
|
## Alpine
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
apk add alpine-sdk bash libstdc++ libc6-compat
|
apk add alpine-sdk bash libstdc++ libc6-compat python3 krb5-dev
|
||||||
npm config set python python3
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Proceed to [installing](#installing)
|
Proceed to [installing](#installing)
|
||||||
@@ -79,7 +78,7 @@ Proceed to [installing](#installing)
|
|||||||
## FreeBSD
|
## FreeBSD
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pkg install -y git python npm-node20 pkgconf
|
pkg install -y git python npm-node22 pkgconf
|
||||||
pkg install -y libinotify
|
pkg install -y libinotify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ npm config set python python3
|
|||||||
node -v
|
node -v
|
||||||
```
|
```
|
||||||
|
|
||||||
you will get Node version `v20`
|
you will get Node version `v22`
|
||||||
|
|
||||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||||
|
|
||||||
|
|||||||
84
eslint.config.mjs
Normal file
84
eslint.config.mjs
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
import { fixupConfigRules } from "@eslint/compat"
|
||||||
|
import globals from "globals"
|
||||||
|
import tsParser from "@typescript-eslint/parser"
|
||||||
|
import path from "node:path"
|
||||||
|
import { fileURLToPath } from "node:url"
|
||||||
|
import js from "@eslint/js"
|
||||||
|
import { FlatCompat } from "@eslint/eslintrc"
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
const __dirname = path.dirname(__filename)
|
||||||
|
const compat = new FlatCompat({
|
||||||
|
baseDirectory: __dirname,
|
||||||
|
recommendedConfig: js.configs.recommended,
|
||||||
|
allConfig: js.configs.all,
|
||||||
|
})
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...fixupConfigRules(
|
||||||
|
compat.extends(
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:import/recommended",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
|
"prettier",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.jest,
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
|
||||||
|
parser: tsParser,
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: "module",
|
||||||
|
},
|
||||||
|
|
||||||
|
settings: {
|
||||||
|
"import/resolver": {
|
||||||
|
typescript: {
|
||||||
|
alwaysTryTypes: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
args: "none",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
"no-dupe-class-members": "off",
|
||||||
|
"@typescript-eslint/no-use-before-define": "off",
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"@typescript-eslint/ban-types": "off",
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/no-extra-semi": "off",
|
||||||
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "off", // TODO: Fix these.
|
||||||
|
"@typescript-eslint/no-empty-object-type": "off",
|
||||||
|
eqeqeq: "error",
|
||||||
|
|
||||||
|
"import/order": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
alphabetize: {
|
||||||
|
order: "asc",
|
||||||
|
},
|
||||||
|
|
||||||
|
groups: [["builtin", "external", "internal"], "parent", "sibling"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
"no-async-promise-executor": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
23
flake.lock
generated
23
flake.lock
generated
@@ -5,11 +5,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1731533236,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -20,15 +20,18 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716137900,
|
"lastModified": 1739303263,
|
||||||
"narHash": "sha256-sowPU+tLQv8GlqtVtsXioTKeaQvlMz/pefcdwg8MvfM=",
|
"narHash": "sha256-c/Z/6gZLN8BIpYh1B3qMzEn0TArjf4F2lmy59lDLVBM=",
|
||||||
"path": "/nix/store/r8nhgnkxacbnf4kv8kdi8b6ks3k9b16i-source",
|
"owner": "nixos",
|
||||||
"rev": "6c0b7a92c30122196a761b440ac0d46d3d9954f1",
|
"repo": "nixpkgs",
|
||||||
"type": "path"
|
"rev": "6cc4213488e886db863878a1e3dc26cc932d38b8",
|
||||||
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"owner": "nixos",
|
||||||
"type": "indirect"
|
"ref": "nixos-unstable-small",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|||||||
19
flake.nix
19
flake.nix
@@ -1,18 +1,29 @@
|
|||||||
{
|
{
|
||||||
description = "code-server";
|
description = "code-server";
|
||||||
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
let pkgs = nixpkgs.legacyPackages.${system};
|
||||||
nodejs = pkgs.nodejs_20;
|
nodejs = pkgs.nodejs_22;
|
||||||
yarn' = pkgs.yarn.override { inherit nodejs; };
|
|
||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats openssl
|
nodejs
|
||||||
|
python3
|
||||||
|
pkg-config
|
||||||
|
git
|
||||||
|
rsync
|
||||||
|
jq
|
||||||
|
moreutils
|
||||||
|
quilt
|
||||||
|
bats
|
||||||
|
openssl
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
|
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
|
||||||
++ (with xorg; [ libX11 libxkbfile ])
|
++ (with xorg; [ libX11 libxkbfile ])
|
||||||
|
|||||||
@@ -461,9 +461,9 @@ npm_fallback() {
|
|||||||
# Determine if we have standalone releases on GitHub for the system's arch.
|
# Determine if we have standalone releases on GitHub for the system's arch.
|
||||||
has_standalone() {
|
has_standalone() {
|
||||||
case $ARCH in
|
case $ARCH in
|
||||||
amd64) return 0 ;;
|
arm64) return 0 ;;
|
||||||
# We only have amd64 for macOS.
|
# We only have arm64 for macOS.
|
||||||
arm64)
|
amd64)
|
||||||
[ "$(distro)" != macos ]
|
[ "$(distro)" != macos ]
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|||||||
Submodule lib/vscode updated: fee1edb8d6...dfaf44141e
6478
package-lock.json
generated
Normal file
6478
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@@ -23,44 +23,49 @@
|
|||||||
"test:native": "./ci/dev/test-native.sh",
|
"test:native": "./ci/dev/test-native.sh",
|
||||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||||
"package": "./ci/build/build-packages.sh",
|
"package": "./ci/build/build-packages.sh",
|
||||||
"prettier": "prettier --write --loglevel=warn --cache .",
|
"prettier": "prettier --write --log-level=warn --cache .",
|
||||||
|
"preinstall": "node ./ci/dev/preinstall.js",
|
||||||
"postinstall": "./ci/dev/postinstall.sh",
|
"postinstall": "./ci/dev/postinstall.sh",
|
||||||
"publish:npm": "./ci/steps/publish-npm.sh",
|
"publish:npm": "./ci/steps/publish-npm.sh",
|
||||||
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
||||||
"fmt": "yarn prettier && ./ci/dev/doctoc.sh",
|
"fmt": "npm run prettier && ./ci/dev/doctoc.sh",
|
||||||
"lint:scripts": "./ci/dev/lint-scripts.sh",
|
"lint:scripts": "./ci/dev/lint-scripts.sh",
|
||||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')",
|
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')",
|
||||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
"test": "echo 'Run npm run test:unit or npm run test:e2e' && exit 1",
|
||||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||||
"icons": "./ci/dev/gen_icons.sh"
|
"icons": "./ci/dev/gen_icons.sh"
|
||||||
},
|
},
|
||||||
"main": "out/node/entry.js",
|
"main": "out/node/entry.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/compat": "^1.2.0",
|
||||||
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
|
"@eslint/js": "^9.12.0",
|
||||||
"@schemastore/package": "^0.0.10",
|
"@schemastore/package": "^0.0.10",
|
||||||
"@types/compression": "^1.7.3",
|
"@types/compression": "^1.7.3",
|
||||||
"@types/cookie-parser": "^1.4.4",
|
"@types/cookie-parser": "^1.4.4",
|
||||||
"@types/express": "^4.17.17",
|
"@types/eslint__js": "^8.42.3",
|
||||||
|
"@types/express": "^5.0.0",
|
||||||
"@types/http-proxy": "1.17.7",
|
"@types/http-proxy": "1.17.7",
|
||||||
"@types/js-yaml": "^4.0.6",
|
"@types/js-yaml": "^4.0.6",
|
||||||
"@types/node": "20.x",
|
"@types/node": "22.x",
|
||||||
"@types/pem": "^1.14.1",
|
"@types/pem": "^1.14.1",
|
||||||
"@types/proxy-from-env": "^1.0.1",
|
"@types/proxy-from-env": "^1.0.1",
|
||||||
"@types/safe-compare": "^1.1.0",
|
"@types/safe-compare": "^1.1.0",
|
||||||
"@types/semver": "^7.5.2",
|
"@types/semver": "^7.5.2",
|
||||||
"@types/trusted-types": "^2.0.4",
|
"@types/trusted-types": "^2.0.4",
|
||||||
"@types/ws": "^8.5.5",
|
"@types/ws": "^8.5.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
||||||
"@typescript-eslint/parser": "^6.7.2",
|
|
||||||
"doctoc": "^2.2.1",
|
"doctoc": "^2.2.1",
|
||||||
"eslint": "^8.49.0",
|
"eslint": "^9.12.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-import-resolver-typescript": "^3.6.0",
|
"eslint-import-resolver-typescript": "^3.6.0",
|
||||||
"eslint-plugin-import": "^2.28.1",
|
"eslint-plugin-import": "^2.28.1",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"globals": "^16.1.0",
|
||||||
|
"prettier": "3.4.2",
|
||||||
"prettier-plugin-sh": "^0.14.0",
|
"prettier-plugin-sh": "^0.14.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.6.2",
|
||||||
|
"typescript-eslint": "^8.8.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coder/logger": "^3.0.1",
|
"@coder/logger": "^3.0.1",
|
||||||
@@ -68,7 +73,7 @@
|
|||||||
"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.0-beta.3",
|
"express": "^5.0.1",
|
||||||
"http-proxy": "^1.18.1",
|
"http-proxy": "^1.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
"httpolyglot": "^0.1.2",
|
||||||
"i18next": "^23.5.1",
|
"i18next": "^23.5.1",
|
||||||
@@ -76,7 +81,7 @@
|
|||||||
"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.12.1",
|
"qs": "6.14.0",
|
||||||
"rotating-file-stream": "^3.1.1",
|
"rotating-file-stream": "^3.1.1",
|
||||||
"safe-buffer": "^5.2.1",
|
"safe-buffer": "^5.2.1",
|
||||||
"safe-compare": "^1.1.4",
|
"safe-compare": "^1.1.4",
|
||||||
@@ -85,7 +90,7 @@
|
|||||||
"xdg-basedir": "^4.0.0"
|
"xdg-basedir": "^4.0.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/node": "20.x"
|
"@types/node": "22.x"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"code-server": "out/node/entry.js"
|
"code-server": "out/node/entry.js"
|
||||||
@@ -100,8 +105,7 @@
|
|||||||
"remote-development"
|
"remote-development"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "20",
|
"node": "22"
|
||||||
"yarn": "1"
|
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"transform": {
|
"transform": {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/base/common/network.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
--- code-server.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
|
||||||
@@ -212,7 +212,9 @@ class RemoteAuthoritiesImpl {
|
@@ -220,7 +220,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}`,
|
||||||
@@ -46,18 +46,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
|||||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||||
</head>
|
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||||
|
|
||||||
<body aria-label="">
|
</head>
|
||||||
@@ -39,7 +39,7 @@
|
@@ -39,7 +39,7 @@
|
||||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
|
||||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
<!-- Startup (do not modify order of script tags!) -->
|
||||||
<script>
|
<script>
|
||||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||||
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
</script>
|
||||||
});
|
<script>
|
||||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||||
@@ -83,18 +83,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
|||||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -40,7 +40,7 @@
|
@@ -36,7 +36,7 @@
|
||||||
<script>
|
|
||||||
|
|
||||||
// Packages
|
<!-- Startup (do not modify order of script tags!) -->
|
||||||
|
<script>
|
||||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||||
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
</script>
|
||||||
});
|
<script>
|
||||||
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||||
@@ -111,21 +111,26 @@ 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
|
||||||
@@ -269,16 +269,15 @@ export class WebClientServer {
|
@@ -245,7 +245,9 @@ export class WebClientServer {
|
||||||
return void res.end();
|
};
|
||||||
}
|
|
||||||
|
// Prefix routes with basePath for clients
|
||||||
|
- const basePath = getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||||
|
+ const rootBase = relativeRoot(getOriginalUrl(req))
|
||||||
|
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||||
|
+ const basePath = vscodeBase || getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||||
|
|
||||||
|
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
|
||||||
|
if (typeof queryConnectionToken === 'string') {
|
||||||
|
@@ -284,10 +286,14 @@ export class WebClientServer {
|
||||||
|
};
|
||||||
|
|
||||||
- const getFirstHeader = (headerName: string) => {
|
|
||||||
- const val = req.headers[headerName];
|
|
||||||
- return Array.isArray(val) ? val[0] : val;
|
|
||||||
- };
|
|
||||||
-
|
|
||||||
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
||||||
+ // For now we are getting the remote authority from the client to avoid
|
+ // For now we are getting the remote authority from the client to avoid
|
||||||
+ // needing specific configuration for reverse proxies to work. Set this to
|
+ // needing specific configuration for reverse proxies to work. Set this to
|
||||||
+ // something invalid to make sure we catch code that is using this value
|
+ // something invalid to make sure we catch code that is using this value
|
||||||
+ // from the backend when it should not.
|
+ // from the backend when it should not.
|
||||||
const remoteAuthority = (
|
let remoteAuthority = (
|
||||||
useTestResolver
|
useTestResolver
|
||||||
? 'test+test'
|
? 'test+test'
|
||||||
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
|
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
|
||||||
@@ -133,52 +138,35 @@ 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.`);
|
||||||
@@ -305,8 +304,12 @@ export class WebClientServer {
|
@@ -334,6 +340,7 @@ export class WebClientServer {
|
||||||
scopes: [['user:email'], ['repo']]
|
|
||||||
} : undefined;
|
|
||||||
|
|
||||||
+ const base = relativeRoot(getOriginalUrl(req))
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
|
||||||
+
|
|
||||||
const productConfiguration = {
|
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
+ rootEndpoint: base,
|
+ rootEndpoint: rootBase,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -335,7 +338,7 @@ export class WebClientServer {
|
@@ -387,7 +394,9 @@ export class WebClientServer {
|
||||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
|
||||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
|
||||||
productConfiguration,
|
|
||||||
- callbackRoute: this._callbackRoute
|
|
||||||
+ callbackRoute: vscodeBase + this._callbackRoute
|
|
||||||
};
|
|
||||||
|
|
||||||
const cookies = cookie.parse(req.headers.cookie || '');
|
|
||||||
@@ -352,9 +355,11 @@ export class WebClientServer {
|
|
||||||
const values: { [key: string]: string } = {
|
|
||||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
|
||||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
WORKBENCH_WEB_BASE_URL: staticRoute,
|
||||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
|
||||||
WORKBENCH_NLS_URL,
|
WORKBENCH_NLS_URL,
|
||||||
- WORKBENCH_NLS_FALLBACK_URL: `${this._staticRoute}/out/nls.messages.js`
|
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
|
||||||
+ WORKBENCH_NLS_FALLBACK_URL: `${vscodeBase}${this._staticRoute}/out/nls.messages.js`,
|
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
|
||||||
+ BASE: base,
|
+ BASE: rootBase,
|
||||||
+ VS_BASE: vscodeBase,
|
+ VS_BASE: basePath,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (useTestResolver) {
|
// DEV ---------------------------------------------------------------------------------------
|
||||||
@@ -381,7 +386,7 @@ export class WebClientServer {
|
@@ -424,7 +433,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\';',
|
||||||
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||||
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||||
'child-src \'self\';',
|
'child-src \'self\';',
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data: blob:;',
|
'worker-src \'self\' data: blob:;',
|
||||||
@@ -454,3 +459,70 @@ export class WebClientServer {
|
@@ -497,3 +506,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,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
|
||||||
@@ -56,6 +56,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
@@ -265,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
|
||||||
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
|
@@ -332,7 +332,8 @@ class LocalStorageURLCallbackProvider ex
|
||||||
this.startListening();
|
this.startListening();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +263,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
private startListening(): void {
|
private startListening(): void {
|
||||||
@@ -550,17 +551,6 @@ class WorkspaceProvider implements IWork
|
@@ -579,17 +580,6 @@ class WorkspaceProvider implements IWork
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,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
|
||||||
@@ -569,8 +559,8 @@ function readCookie(name: string): strin
|
@@ -598,8 +588,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');
|
||||||
}
|
}
|
||||||
@@ -308,7 +296,7 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
@@ -98,7 +98,7 @@ export abstract class AbstractExtensionR
|
@@ -120,7 +120,7 @@ export abstract class AbstractExtensionR
|
||||||
: version,
|
: version,
|
||||||
path: 'extension'
|
path: 'extension'
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||||
@@ -8,6 +8,7 @@ import { isWeb } from 'vs/base/common/pl
|
@@ -8,6 +8,7 @@ import { isWeb } from '../../../base/com
|
||||||
import { isString } from 'vs/base/common/types';
|
import { isString } from '../../../base/common/types.js';
|
||||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
import { URI, UriComponents } from '../../../base/common/uri.js';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from '../../../nls.js';
|
||||||
+import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
+import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js';
|
||||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
||||||
import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
||||||
import { ExtensionManagementCLI } from 'vs/platform/extensionManagement/common/extensionManagementCLI';
|
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
||||||
@@ -89,6 +90,11 @@ CommandsRegistry.registerCommand('_remot
|
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot
|
||||||
return lines.join('\n');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
||||||
@@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||||
@@ -43,7 +43,12 @@ export interface ExtensionManagementPipe
|
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
|
||||||
force?: boolean;
|
force?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|||||||
|
|
||||||
export interface ICommandsExecuter {
|
export interface ICommandsExecuter {
|
||||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||||
@@ -105,6 +110,9 @@ export class CLIServerBase {
|
@@ -106,6 +111,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;
|
||||||
@@ -172,6 +180,10 @@ export class CLIServerBase {
|
@@ -173,6 +181,10 @@ export class CLIServerBase {
|
||||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,19 +78,19 @@ 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
|
||||||
@@ -119,6 +119,7 @@ export interface NativeParsedArgs {
|
@@ -122,6 +122,7 @@ export interface NativeParsedArgs {
|
||||||
|
'disable-chromium-sandbox'?: boolean;
|
||||||
sandbox?: boolean;
|
sandbox?: boolean;
|
||||||
|
|
||||||
'enable-coi'?: boolean;
|
'enable-coi'?: boolean;
|
||||||
+ 'stdin-to-clipboard'?: boolean;
|
+ 'stdin-to-clipboard'?: boolean;
|
||||||
|
'unresponsive-sample-interval'?: string;
|
||||||
// chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches
|
'unresponsive-sample-period'?: string;
|
||||||
'no-proxy-server'?: boolean;
|
'enable-rdp-display-tracking'?: boolean;
|
||||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
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
|
||||||
@@ -90,6 +90,7 @@ export const OPTIONS: OptionDescriptions
|
@@ -91,6 +91,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.") },
|
||||||
@@ -102,7 +102,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||||
@@ -75,6 +75,7 @@ const isSupportedForPipe = (optionId: ke
|
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
|
||||||
case 'verbose':
|
case 'verbose':
|
||||||
case 'remote':
|
case 'remote':
|
||||||
case 'locate-shell-integration-path':
|
case 'locate-shell-integration-path':
|
||||||
@@ -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;
|
||||||
@@ -292,6 +293,23 @@ export async function main(desc: Product
|
@@ -295,6 +296,22 @@ export async function main(desc: Product
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -119,7 +119,6 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|||||||
+ console.error("stdin has a tty.");
|
+ console.error("stdin has a tty.");
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ const fs = require("fs");
|
|
||||||
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
||||||
+ const clipboardContent = stdinBuffer.toString();
|
+ const clipboardContent = stdinBuffer.toString();
|
||||||
+ sendToPipe({
|
+ sendToPipe({
|
||||||
@@ -132,5 +131,5 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
if (parsedArgs.status) {
|
if (parsedArgs.status) {
|
||||||
sendToPipe({
|
await sendToPipe({
|
||||||
type: 'status'
|
type: 'status'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
--- code-server.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
|
||||||
@@ -299,6 +299,10 @@ export class Extension implements IExten
|
@@ -340,6 +340,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,16 +9,16 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -12,7 +12,7 @@ import * as path from 'vs/base/common/pa
|
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
||||||
import { IURITransformer } from 'vs/base/common/uriIpc';
|
import { IURITransformer } from '../../base/common/uriIpc.js';
|
||||||
import { getMachineId, getSqmMachineId, getdevDeviceId } from 'vs/base/node/id';
|
import { getMachineId, getSqmMachineId, getdevDeviceId } from '../../base/node/id.js';
|
||||||
import { Promises } from 'vs/base/node/pfs';
|
import { Promises } from '../../base/node/pfs.js';
|
||||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||||
import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net';
|
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
|
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
||||||
@@ -239,6 +239,9 @@ export async function setupServerService
|
@@ -255,6 +255,9 @@ export async function setupServerService
|
||||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||||
socketServer.registerChannel('extensions', channel);
|
socketServer.registerChannel('extensions', channel);
|
||||||
|
|
||||||
@@ -51,9 +51,9 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
|||||||
|
|
||||||
+import { promises as fs } from 'fs';
|
+import { promises as fs } from 'fs';
|
||||||
+import * as path from 'path';
|
+import * as path from 'path';
|
||||||
import { FileAccess } from 'vs/base/common/network';
|
import { FileAccess } from '../../base/common/network.js';
|
||||||
import { join } from 'vs/base/common/path';
|
import { join } from '../../base/common/path.js';
|
||||||
import type { INLSConfiguration } from 'vs/nls';
|
import type { INLSConfiguration } from '../../nls.js';
|
||||||
@@ -33,7 +35,94 @@ export async function getNLSConfiguratio
|
@@ -33,7 +35,94 @@ export async function getNLSConfiguratio
|
||||||
if (!result) {
|
if (!result) {
|
||||||
result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath });
|
result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath });
|
||||||
@@ -153,31 +153,15 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.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
|
||||||
@@ -26,6 +26,7 @@ import { URI } from 'vs/base/common/uri'
|
@@ -25,6 +25,7 @@ import { URI } from '../../base/common/u
|
||||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
import { streamToBuffer } from '../../base/common/buffer.js';
|
||||||
import { IProductConfiguration } from 'vs/base/common/product';
|
import { IProductConfiguration } from '../../base/common/product.js';
|
||||||
import { isString } from 'vs/base/common/types';
|
import { isString, Mutable } from '../../base/common/types.js';
|
||||||
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
||||||
import { CharCode } from 'vs/base/common/charCode';
|
import { CharCode } from '../../base/common/charCode.js';
|
||||||
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||||
|
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||||
@@ -97,6 +98,7 @@ export class WebClientServer {
|
@@ -385,14 +386,22 @@ export class WebClientServer {
|
||||||
private readonly _webExtensionResourceUrlTemplate: URI | undefined;
|
|
||||||
|
|
||||||
private readonly _staticRoute: string;
|
|
||||||
+ private readonly _serverRoot: string;
|
|
||||||
private readonly _callbackRoute: string;
|
|
||||||
private readonly _webExtensionRoute: string;
|
|
||||||
|
|
||||||
@@ -111,6 +113,7 @@ export class WebClientServer {
|
|
||||||
) {
|
|
||||||
this._webExtensionResourceUrlTemplate = this._productService.extensionsGallery?.resourceUrlTemplate ? URI.parse(this._productService.extensionsGallery.resourceUrlTemplate) : undefined;
|
|
||||||
|
|
||||||
+ this._serverRoot = serverRootPath;
|
|
||||||
this._staticRoute = `${serverRootPath}/static`;
|
|
||||||
this._callbackRoute = `${serverRootPath}/callback`;
|
|
||||||
this._webExtensionRoute = `/web-extension-resource`;
|
|
||||||
@@ -349,14 +352,22 @@ export class WebClientServer {
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const cookies = cookie.parse(req.headers.cookie || '');
|
const cookies = cookie.parse(req.headers.cookie || '');
|
||||||
@@ -193,7 +177,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
+ try {
|
+ try {
|
||||||
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
||||||
+ WORKBENCH_NLS_URL = nlsFile
|
+ WORKBENCH_NLS_URL = nlsFile
|
||||||
+ ? `${vscodeBase}${this._serverRoot}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
||||||
+ : '';
|
+ : '';
|
||||||
+ } catch (error) {
|
+ } catch (error) {
|
||||||
+ console.error("Failed to generate translations", error);
|
+ console.error("Failed to generate translations", error);
|
||||||
@@ -214,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ export interface ServerParsedArgs {
|
@@ -107,6 +108,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,
|
||||||
@@ -222,46 +206,21 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
|
||||||
@@ -52,7 +52,7 @@ import 'vs/workbench/services/dialogs/br
|
|
||||||
import 'vs/workbench/services/host/browser/browserHostService';
|
|
||||||
import 'vs/workbench/services/lifecycle/browser/lifecycleService';
|
|
||||||
import 'vs/workbench/services/clipboard/browser/clipboardService';
|
|
||||||
-import 'vs/workbench/services/localization/browser/localeService';
|
|
||||||
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
|
|
||||||
import 'vs/workbench/services/path/browser/pathService';
|
|
||||||
import 'vs/workbench/services/themes/browser/browserHostColorSchemeService';
|
|
||||||
import 'vs/workbench/services/encryption/browser/encryptionService';
|
|
||||||
@@ -118,8 +118,9 @@ registerSingleton(ILanguagePackService,
|
|
||||||
// Logs
|
|
||||||
import 'vs/workbench/contrib/logs/browser/logs.contribution';
|
|
||||||
|
|
||||||
-// Localization
|
|
||||||
-import 'vs/workbench/contrib/localization/browser/localization.contribution';
|
|
||||||
+// Localization. This does not actually import anything specific to Electron so
|
|
||||||
+// it should be safe.
|
|
||||||
+import 'vs/workbench/contrib/localization/electron-sandbox/localization.contribution';
|
|
||||||
|
|
||||||
// Performance
|
|
||||||
import 'vs/workbench/contrib/performance/browser/performance.web.contribution';
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
@@ -5,18 +5,24 @@
|
@@ -5,18 +5,24 @@
|
||||||
|
|
||||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from '../../../base/common/uri.js';
|
||||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
+import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js';
|
||||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js';
|
||||||
import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.js';
|
||||||
-import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
-import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from '../../log/common/log.js';
|
||||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
+import { IRemoteAgentService } from '../../../workbench/services/remote/common/remoteAgentService.js';
|
||||||
|
|
||||||
export class WebLanguagePacksService extends LanguagePackBaseService {
|
export class WebLanguagePacksService extends LanguagePackBaseService {
|
||||||
+ private readonly languagePackService: ILanguagePackService;
|
+ private readonly languagePackService: ILanguagePackService;
|
||||||
@@ -313,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
|
||||||
@@ -411,9 +411,6 @@ export class InstallAction extends Exten
|
@@ -475,9 +475,6 @@ export class InstallAction extends Exten
|
||||||
if (this.extension.isBuiltin) {
|
if (this.extension.isBuiltin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -323,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;
|
||||||
}
|
}
|
||||||
@@ -695,7 +692,7 @@ export abstract class InstallInOtherServ
|
@@ -782,7 +779,7 @@ export abstract class InstallInOtherServ
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
@@ -332,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
|
||||||
@@ -1951,17 +1948,6 @@ export class SetLanguageAction extends E
|
@@ -2073,17 +2070,6 @@ export class SetLanguageAction extends E
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = SetLanguageAction.DisabledClass;
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
@@ -350,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> {
|
||||||
@@ -1978,7 +1964,6 @@ export class ClearLanguageAction extends
|
@@ -2100,7 +2086,6 @@ export class ClearLanguageAction extends
|
||||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -358,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);
|
||||||
@@ -1988,17 +1973,6 @@ export class ClearLanguageAction extends
|
@@ -2110,17 +2095,6 @@ export class ClearLanguageAction extends
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = ClearLanguageAction.DisabledClass;
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
@@ -380,7 +339,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
@@ -56,6 +56,7 @@ const serverResources = [
|
@@ -58,6 +58,7 @@ const serverResourceIncludes = [
|
||||||
|
|
||||||
// NLS
|
// NLS
|
||||||
'out-build/nls.messages.json',
|
'out-build/nls.messages.json',
|
||||||
@@ -388,3 +347,16 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
// Process monitor
|
// Process monitor
|
||||||
'out-build/vs/base/node/cpuUsage.sh',
|
'out-build/vs/base/node/cpuUsage.sh',
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||||
|
@@ -53,7 +53,7 @@ import './services/dialogs/browser/fileD
|
||||||
|
import './services/host/browser/browserHostService.js';
|
||||||
|
import './services/lifecycle/browser/lifecycleService.js';
|
||||||
|
import './services/clipboard/browser/clipboardService.js';
|
||||||
|
-import './services/localization/browser/localeService.js';
|
||||||
|
+import './services/localization/electron-sandbox/localeService.js';
|
||||||
|
import './services/path/browser/pathService.js';
|
||||||
|
import './services/themes/browser/browserHostColorSchemeService.js';
|
||||||
|
import './services/encryption/browser/encryptionService.js';
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -99,6 +101,8 @@ export interface ServerParsedArgs {
|
@@ -101,6 +103,8 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string;
|
'auth'?: string;
|
||||||
@@ -112,9 +112,9 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.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,8 @@ export class WebClientServer {
|
@@ -369,6 +369,8 @@ export class WebClientServer {
|
||||||
serverBasePath: this._basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: vscodeBase + this._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,
|
||||||
+ 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'],
|
||||||
@@ -125,20 +125,20 @@ 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 'vs/base/common/ev
|
@@ -7,11 +7,11 @@ import { Event } from '../../base/common
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable, DisposableStore } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../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 } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext } 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, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
||||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
-import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
|
||||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
||||||
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js';
|
||||||
import { getRemoteName } from 'vs/platform/remote/common/remoteHosts';
|
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
||||||
@@ -70,7 +70,7 @@ export class WorkbenchContextKeysHandler
|
@@ -70,7 +70,7 @@ export class WorkbenchContextKeysHandler
|
||||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||||
@@ -164,15 +164,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||||
@@ -20,7 +20,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
@@ -20,7 +20,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
import { AutoSaveAfterShortDelayContext } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
||||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
import { WorkbenchListDoubleSelection } from '../../../../platform/list/browser/listService.js';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from '../../../../base/common/network.js';
|
||||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from 'vs/workbench/common/contextkeys';
|
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js';
|
||||||
+import { IsEnabledFileDownloads, IsEnabledFileUploads, DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from 'vs/workbench/common/contextkeys';
|
+import { IsEnabledFileDownloads, IsEnabledFileUploads, DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js';
|
||||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js';
|
||||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';
|
||||||
import { ThemeIcon } from 'vs/base/common/themables';
|
import { ThemeIcon } from '../../../../base/common/themables.js';
|
||||||
@@ -561,13 +561,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -571,13 +571,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
id: DOWNLOAD_COMMAND_ID,
|
id: DOWNLOAD_COMMAND_ID,
|
||||||
title: DOWNLOAD_LABEL
|
title: DOWNLOAD_LABEL
|
||||||
},
|
},
|
||||||
@@ -196,7 +196,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
|||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -579,6 +582,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -589,6 +592,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
title: UPLOAD_LABEL,
|
title: UPLOAD_LABEL,
|
||||||
},
|
},
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
@@ -208,7 +208,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
|
||||||
@@ -40,6 +40,9 @@ export const HasWebFileSystemAccess = ne
|
@@ -36,6 +36,9 @@ export const HasWebFileSystemAccess = ne
|
||||||
|
|
||||||
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 EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
@@ -217,21 +217,21 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
+
|
+
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
//#region < --- Window --- >
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts
|
||||||
@@ -18,7 +18,7 @@ import { IModelService } from 'vs/editor
|
@@ -18,7 +18,7 @@ import { IModelService } from '../../../
|
||||||
import { ILanguageService } from 'vs/editor/common/languages/language';
|
import { ILanguageService } from '../../../../editor/common/languages/language.js';
|
||||||
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from '../../../../base/common/network.js';
|
||||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
-import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
+import { IBrowserWorkbenchEnvironmentService } from '../../environment/browser/environmentService.js';
|
||||||
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
||||||
import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
||||||
import { equalsIgnoreCase, format, startsWithIgnoreCase } from 'vs/base/common/strings';
|
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
|
||||||
@@ -143,7 +143,7 @@ export class SimpleFileDialog implements
|
@@ -144,7 +144,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,10 +240,10 @@ 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,
|
||||||
@@ -286,20 +286,22 @@ export class SimpleFileDialog implements
|
@@ -310,20 +310,22 @@ export class SimpleFileDialog extends Di
|
||||||
this.filePickBox.sortByLabel = false;
|
|
||||||
this.filePickBox.ignoreFocusOut = true;
|
this.filePickBox.ignoreFocusOut = true;
|
||||||
this.filePickBox.ok = true;
|
this.filePickBox.ok = true;
|
||||||
|
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');
|
||||||
@@ -281,15 +281,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts
|
||||||
@@ -65,6 +65,7 @@ import { timeout } from 'vs/base/common/
|
@@ -65,6 +65,7 @@ import { timeout } from '../../../../../
|
||||||
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
import { IFilesConfigurationService } from '../../../../services/filesConfiguration/common/filesConfigurationService.js';
|
||||||
import { mainWindow } from 'vs/base/browser/window';
|
import { mainWindow } from '../../../../../base/browser/window.js';
|
||||||
import { IExplorerFileContribution, explorerFileContribRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
|
import { IExplorerFileContribution, explorerFileContribRegistry } from '../explorerFileContrib.js';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
+import { IBrowserWorkbenchEnvironmentService } from '../../../../services/environment/browser/environmentService.js';
|
||||||
|
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
||||||
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js';
|
||||||
|
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
||||||
@@ -1001,7 +1002,8 @@ export class FileDragAndDrop implements
|
@@ -1601,7 +1602,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 +299,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')) {
|
||||||
@@ -1226,15 +1228,17 @@ export class FileDragAndDrop implements
|
@@ -1826,15 +1828,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) {
|
||||||
|
|||||||
@@ -14,21 +14,21 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from 'vs/base/browser/dom';
|
-import { $, Dimension, addDisposableListener, append, clearNode, reset } from '../../../../base/browser/dom.js';
|
||||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from 'vs/base/browser/dom';
|
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js';
|
||||||
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
||||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
||||||
import { Button } from 'vs/base/browser/ui/button/button';
|
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 'vs/workbench/browser/actions/windowActions';
|
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
||||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
||||||
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
import { EditorPane } from '../../../browser/parts/editor/editorPane.js';
|
||||||
-import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
-import { WorkbenchStateContext } from '../../../common/contextkeys.js';
|
||||||
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from '../../../common/contextkeys.js';
|
||||||
import { IEditorOpenContext, IEditorSerializer } from 'vs/workbench/common/editor';
|
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
||||||
import { IWebviewElement, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
|
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
||||||
import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedColors';
|
import './gettingStartedColors.js';
|
||||||
@@ -804,6 +804,72 @@ export class GettingStartedPage extends
|
@@ -876,6 +876,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', {},);
|
||||||
|
|
||||||
@@ -839,6 +905,9 @@ export class GettingStartedPage extends
|
@@ -911,6 +977,9 @@ export class GettingStartedPage extends
|
||||||
recentList.setLimit(5);
|
recentList.setLimit(5);
|
||||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
}
|
}
|
||||||
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
@@ -105,6 +106,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
|
||||||
@@ -337,6 +337,7 @@ export class WebClientServer {
|
@@ -373,6 +373,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,15 +213,15 @@ 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 'vs/base/common/ev
|
@@ -7,7 +7,7 @@ import { Event } from '../../base/common
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable, DisposableStore } from '../../base/common/lifecycle.js';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../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, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads } 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, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, TitleBarVisibleContext, TitleBarStyleContext, IsAuxiliaryWindowFocusedContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from '../common/contextkeys.js';
|
||||||
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow, isEditableElement } from '../../base/browser/dom.js';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
@@ -200,6 +200,7 @@ export class WorkbenchContextKeysHandler
|
@@ -200,6 +200,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)
|
||||||
@@ -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
|
||||||
@@ -42,6 +42,7 @@ export const EmbedderIdentifierContext =
|
@@ -38,6 +38,7 @@ export const EmbedderIdentifierContext =
|
||||||
|
|
||||||
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);
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
@@ -1,7 +1,10 @@
|
@@ -1,7 +1,10 @@
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from "../../base/common/lifecycle.js";
|
||||||
+import { localize } from 'vs/nls';
|
+import { localize } from '../../nls.js';
|
||||||
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
+import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||||
|
|
||||||
export class CodeServerClient extends Disposable {
|
export class CodeServerClient extends Disposable {
|
||||||
constructor (
|
constructor (
|
||||||
|
|||||||
@@ -3,26 +3,28 @@ Prepare Code for integration with code-server
|
|||||||
1. We already have the arguments so allow passing them in. There is also a
|
1. We already have the arguments so allow passing them in. There is also a
|
||||||
slight change in a few directories to preserve the directory structure we
|
slight change in a few directories to preserve the directory structure we
|
||||||
have been using and to not override passed-in arguments.
|
have been using and to not override passed-in arguments.
|
||||||
2. Modify the terminal environment to filter out code-server environment variables.
|
2. Modify the entry point to allow importing the code, instead of just running
|
||||||
3. Add the code-server version to the help dialog.
|
the server immediately.
|
||||||
4. Add ready events for use in an iframe.
|
3. Modify the terminal environment to filter out code-server environment variables.
|
||||||
5. Add our icons.
|
4. Add the code-server version to the help dialog.
|
||||||
6. Use our own manifest.
|
5. Add ready events for use in an iframe.
|
||||||
|
6. Add our icons and remove the existing ones.
|
||||||
|
7. Use our own manifest.
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.main.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/server.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/server.main.ts
|
+++ code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||||
@@ -12,7 +12,7 @@ import { createServer as doCreateServer,
|
@@ -12,7 +12,7 @@ import { createServer as doCreateServer,
|
||||||
import { parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv';
|
import { parseArgs, ErrorReporter } from '../../platform/environment/node/argv.js';
|
||||||
import { join, dirname } from 'vs/base/common/path';
|
import { join, dirname } from '../../base/common/path.js';
|
||||||
import { performance } from 'perf_hooks';
|
import { performance } from 'perf_hooks';
|
||||||
-import { serverOptions } from 'vs/server/node/serverEnvironmentService';
|
-import { serverOptions } from './serverEnvironmentService.js';
|
||||||
+import { serverOptions, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService';
|
+import { serverOptions, ServerParsedArgs } from './serverEnvironmentService.js';
|
||||||
import product from 'vs/platform/product/common/product';
|
import product from '../../platform/product/common/product.js';
|
||||||
import * as perf from 'vs/base/common/performance';
|
import * as perf from '../../base/common/performance.js';
|
||||||
|
|
||||||
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = {
|
@@ -34,38 +34,47 @@ const errorReporter: ErrorReporter = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
|||||||
*/
|
*/
|
||||||
-export function spawnCli() {
|
-export function spawnCli() {
|
||||||
- runCli(args, REMOTE_DATA_FOLDER, serverOptions);
|
- runCli(args, REMOTE_DATA_FOLDER, serverOptions);
|
||||||
+export function spawnCli(args = parse()): Promise<void> {
|
+function spawnCli(args = parse()): Promise<void> {
|
||||||
+ return runCli(args, createDirs(args), serverOptions);
|
+ return runCli(args, createDirs(args), serverOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,9 +89,13 @@ Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
|||||||
*/
|
*/
|
||||||
-export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> {
|
-export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> {
|
||||||
- return doCreateServer(address, args, REMOTE_DATA_FOLDER);
|
- return doCreateServer(address, args, REMOTE_DATA_FOLDER);
|
||||||
+export function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
+function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
||||||
+ return doCreateServer(address, args, createDirs(args));
|
+ return doCreateServer(address, args, createDirs(args));
|
||||||
}
|
}
|
||||||
|
+
|
||||||
|
+// The aliases prevent the names getting mangled during minification which would
|
||||||
|
+// make it difficult to import.
|
||||||
|
+export { spawnCli as spawnCli, createServer as createServer };
|
||||||
Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
||||||
@@ -107,7 +113,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandl
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend
|
@@ -78,8 +78,11 @@ export class BrowserDialogHandler extend
|
||||||
|
|
||||||
async about(): Promise<void> {
|
async about(): Promise<void> {
|
||||||
const detailString = (useAgo: boolean): string => {
|
const detailString = (useAgo: boolean): string => {
|
||||||
@@ -126,7 +132,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
@@ -0,0 +1,46 @@
|
@@ -0,0 +1,46 @@
|
||||||
+import { Disposable } from 'vs/base/common/lifecycle';
|
+import { Disposable } from "../../base/common/lifecycle.js";
|
||||||
+
|
+
|
||||||
+export class CodeServerClient extends Disposable {
|
+export class CodeServerClient extends Disposable {
|
||||||
+ constructor (
|
+ constructor (
|
||||||
@@ -176,15 +182,15 @@ 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 'vs/platf
|
@@ -64,6 +64,7 @@ import { IOpenerService } from '../../pl
|
||||||
import { mixin, safeStringify } from 'vs/base/common/objects';
|
import { mixin, safeStringify } from '../../base/common/objects.js';
|
||||||
import { IndexedDB } from 'vs/base/browser/indexedDB';
|
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
||||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
||||||
+import { CodeServerClient } from 'vs/workbench/browser/client';
|
+import { CodeServerClient } from '../../workbench/browser/client.js';
|
||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { IProgressService } from '../../platform/progress/common/progress.js';
|
||||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
||||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
import { dirname, joinPath } from '../../base/common/resources.js';
|
||||||
@@ -131,6 +132,9 @@ export class BrowserMain extends Disposa
|
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa
|
||||||
// Startup
|
// Startup
|
||||||
const instantiationService = workbench.startup();
|
const instantiationService = workbench.startup();
|
||||||
|
|
||||||
@@ -198,7 +204,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
|
||||||
@@ -55,6 +55,8 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -56,6 +56,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
@@ -221,19 +227,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
|||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||||
@@ -26,9 +27,9 @@
|
@@ -26,8 +27,9 @@
|
||||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||||
|
|
||||||
<!-- Workbench Icon/Manifest/CSS -->
|
<!-- Workbench Icon/Manifest/CSS -->
|
||||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||||
-
|
|
||||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||||
</head>
|
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||||
|
|
||||||
<body aria-label="">
|
</head>
|
||||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||||
@@ -257,33 +262,63 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
|||||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
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
|
||||||
@@ -306,6 +306,7 @@ export class WebClientServer {
|
@@ -333,6 +333,7 @@ export class WebClientServer {
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
+ codeServerVersion: this._productService.codeServerVersion,
|
+ codeServerVersion: this._productService.codeServerVersion,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
Index: code-server/lib/vscode/src/server-main.js
|
Index: code-server/lib/vscode/src/server-main.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/server-main.js
|
--- code-server.orig/lib/vscode/src/server-main.ts
|
||||||
+++ code-server/lib/vscode/src/server-main.js
|
+++ code-server/lib/vscode/src/server-main.ts
|
||||||
@@ -336,4 +336,9 @@ function prompt(question) {
|
@@ -25,6 +25,9 @@ const __dirname = path.dirname(fileURLTo
|
||||||
|
perf.mark('code/server/start');
|
||||||
|
(globalThis as any).vscodeServerStartTime = performance.now();
|
||||||
|
|
||||||
|
+// 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.
|
||||||
|
+async function start() {
|
||||||
|
// Do a quick parse to determine if a server or the cli needs to be started
|
||||||
|
const parsedArgs = minimist(process.argv.slice(2), {
|
||||||
|
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
||||||
|
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
+}
|
||||||
|
|
||||||
-start();
|
function sanitizeStringArg(val: any): string | undefined {
|
||||||
|
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
||||||
|
@@ -286,3 +290,22 @@ function prompt(question: string): Promi
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
+
|
||||||
+async function loadCodeWithNls() {
|
+async function loadCodeWithNls() {
|
||||||
+ const nlsConfiguration = await resolveNLSConfiguration({ userLocale: 'en', osLocale: 'en', commit: product.commit, userDataPath: '', nlsMetadataPath: __dirname });
|
+ const nlsConfiguration = await resolveNLSConfiguration({
|
||||||
|
+ userLocale: 'en',
|
||||||
|
+ osLocale: 'en',
|
||||||
|
+ commit: product.commit,
|
||||||
|
+ userDataPath: '',
|
||||||
|
+ nlsMetadataPath: __dirname,
|
||||||
|
+ });
|
||||||
+ return loadCode(nlsConfiguration);
|
+ return loadCode(nlsConfiguration);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+module.exports.loadCodeWithNls = loadCodeWithNls;
|
+// This alias prevents the name getting mangled during minification which would
|
||||||
|
+// make it difficult to import.
|
||||||
|
+export { loadCodeWithNls as loadCodeWithNls };
|
||||||
|
+
|
||||||
|
+if (!process.env.CODE_SERVER_PARENT_PID) {
|
||||||
|
+ start();
|
||||||
|
+}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -328,6 +328,7 @@ export class WebClientServer {
|
@@ -364,6 +364,7 @@ export class WebClientServer {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: this._basePath,
|
serverBasePath: basePath,
|
||||||
webviewEndpoint: vscodeBase + this._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,
|
||||||
_wrapWebWorkerExtHostInIframe,
|
_wrapWebWorkerExtHostInIframe,
|
||||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||||
@@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/configuration/browser/configurationService.ts
|
||||||
@@ -145,8 +145,10 @@ export class WorkspaceService extends Di
|
@@ -147,8 +147,10 @@ export class WorkspaceService extends Di
|
||||||
this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService));
|
this.workspaceConfiguration = this._register(new WorkspaceConfiguration(configurationCache, fileService, uriIdentityService, logService));
|
||||||
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
|
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(fromCache => {
|
||||||
this.onWorkspaceConfigurationChanged(fromCache).then(() => {
|
this.onWorkspaceConfigurationChanged(fromCache).then(() => {
|
||||||
@@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -552,6 +554,12 @@ export class WorkspaceService extends Di
|
@@ -555,6 +557,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
|
||||||
@@ -58,6 +58,7 @@ export interface IProductConfiguration {
|
@@ -59,6 +59,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
|
||||||
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri'
|
@@ -15,6 +15,7 @@ import { URI } from '../../base/common/u
|
||||||
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 ----- */
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ export const serverOptions: OptionDescri
|
@@ -99,6 +100,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
@@ -40,27 +40,27 @@ 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
|
||||||
@@ -311,6 +311,7 @@ export class WebClientServer {
|
@@ -341,6 +341,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: rootBase,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
@@ -1,11 +1,15 @@
|
@@ -1,11 +1,15 @@
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from "../../base/common/lifecycle.js";
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from '../../nls.js';
|
||||||
+import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
+import { MenuId, MenuRegistry } from '../../platform/actions/common/actions.js';
|
||||||
+import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
+import { CommandsRegistry } from '../../platform/commands/common/commands.js';
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
import { ILogService } from '../../platform/log/common/log.js';
|
||||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||||
import { IProductService } from 'vs/platform/product/common/productService';
|
import { IProductService } from '../../platform/product/common/productService.js';
|
||||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
||||||
|
|
||||||
export class CodeServerClient extends Disposable {
|
export class CodeServerClient extends Disposable {
|
||||||
+ static LOGOUT_COMMAND_ID = 'code-server.logout';
|
+ static LOGOUT_COMMAND_ID = 'code-server.logout';
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -47,6 +47,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -49,6 +49,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||||
version: pkg.version
|
version: pkg.version
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -40,44 +40,43 @@ 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
|
||||||
@@ -113,7 +113,7 @@ export class WebClientServer {
|
@@ -326,7 +326,6 @@ export class WebClientServer {
|
||||||
|
|
||||||
this._staticRoute = `${serverRootPath}/static`;
|
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
|
||||||
this._callbackRoute = `${serverRootPath}/callback`;
|
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
|
||||||
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
- const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
|
||||||
+ this._webExtensionRoute = `/web-extension-resource`;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
|
||||||
@@ -311,14 +311,7 @@ export class WebClientServer {
|
|
||||||
|
@@ -342,14 +341,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: rootBase,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||||
- ...this._productService.extensionsGallery,
|
- ...this._productService.extensionsGallery,
|
||||||
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
||||||
- scheme: 'http',
|
- scheme: 'http',
|
||||||
- authority: remoteAuthority,
|
- authority: remoteAuthority,
|
||||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
- path: `${webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||||
- }).toString(true)
|
- }).toString(true)
|
||||||
- } : undefined
|
- } : undefined
|
||||||
+ extensionsGallery: this._productService.extensionsGallery,
|
+ extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
|
|
||||||
if (!this._environmentService.isBuilt) {
|
const proposedApi = this._environmentService.args['enable-proposed-api'];
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
@@ -15,7 +15,6 @@ import { getServiceMachineId } from 'vs/
|
@@ -15,7 +15,6 @@ import { getServiceMachineId } from '../
|
||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
import { IStorageService } from '../../storage/common/storage.js';
|
||||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
import { TelemetryLevel } from '../../telemetry/common/telemetry.js';
|
||||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js';
|
||||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
-import { RemoteAuthorities } from '../../../base/common/network.js';
|
||||||
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
import { TargetPlatform } from '../../extensions/common/extensions.js';
|
||||||
|
import { ExtensionGalleryResourceType, getExtensionGalleryManifestResourceUri, IExtensionGalleryManifest, IExtensionGalleryManifestService } from '../../extensionManagement/common/extensionGalleryManifest.js';
|
||||||
const WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT = '/web-extension-resource/';
|
import { ILogService } from '../../log/common/log.js';
|
||||||
@@ -140,9 +139,9 @@ export abstract class AbstractExtensionR
|
@@ -163,9 +162,9 @@ export abstract class AbstractExtensionR
|
||||||
}
|
}
|
||||||
|
|
||||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
||||||
@@ -90,18 +89,3 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionDownloader.ts
|
|
||||||
@@ -114,7 +114,10 @@ export class ExtensionsDownloader extend
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ return false
|
|
||||||
+ // @ts-expect-error
|
|
||||||
const value = this.configurationService.getValue('extensions.verifySignature');
|
|
||||||
+ // @ts-expect-error
|
|
||||||
return isBoolean(value) ? value : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
@@ -312,10 +312,7 @@ function extensionDescriptionArrayToMap(
|
@@ -314,10 +314,7 @@ function extensionDescriptionArrayToMap(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
@@ -60,6 +60,7 @@ export interface IProductConfiguration {
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
@@ -71,14 +71,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -312,6 +312,7 @@ export class WebClientServer {
|
@@ -342,6 +342,7 @@ export class WebClientServer {
|
||||||
rootEndpoint: base,
|
rootEndpoint: rootBase,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
@@ -97,14 +97,14 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
--- code-server.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
|
||||||
@@ -19,6 +19,7 @@ import { ISecretStorageProvider } from '
|
@@ -19,6 +19,7 @@ import { ISecretStorageProvider } from '
|
||||||
import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window';
|
import { isFolderToOpen, isWorkspaceToOpen } from '../../../platform/window/common/window.js';
|
||||||
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/browser/web.api';
|
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from '../../../workbench/browser/web.api.js';
|
||||||
import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
|
import { AuthenticationSessionInfo } from '../../../workbench/services/authentication/browser/authenticationService.js';
|
||||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from '../../../platform/tunnel/common/tunnel.js';
|
||||||
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
||||||
import { create } from 'vs/workbench/workbench.web.main';
|
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
||||||
|
|
||||||
@@ -571,6 +572,39 @@ class WorkspaceProvider implements IWork
|
@@ -600,6 +601,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),
|
||||||
@@ -148,12 +148,14 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExpl
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||||
@@ -77,7 +77,7 @@ export class ForwardedPortsView extends
|
@@ -83,8 +83,8 @@ export class ForwardedPortsView extends
|
||||||
private async enableForwardedPortsView() {
|
private async enableForwardedPortsFeatures() {
|
||||||
this.contextKeyListener.clear();
|
this.contextKeyListener.clear();
|
||||||
|
|
||||||
|
- const featuresEnabled: boolean = !!forwardedPortsFeaturesEnabled.getValue(this.contextKeyService);
|
||||||
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
||||||
|
+ const featuresEnabled: boolean = true;
|
||||||
+ const viewEnabled: boolean = true;
|
+ const viewEnabled: boolean = true;
|
||||||
|
|
||||||
if (viewEnabled) {
|
if (featuresEnabled || viewEnabled) {
|
||||||
const viewContainer = await this.getViewContainer();
|
// Also enable the view if it isn't already.
|
||||||
|
|||||||
@@ -20,3 +20,5 @@ getting-started.diff
|
|||||||
keepalive.diff
|
keepalive.diff
|
||||||
clipboard.diff
|
clipboard.diff
|
||||||
display-language.diff
|
display-language.diff
|
||||||
|
trusted-domains.diff
|
||||||
|
signature-verification.diff
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -60,6 +60,10 @@ export interface IProductConfiguration {
|
@@ -61,6 +61,10 @@ export interface IProductConfiguration {
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
readonly proxyEndpointTemplate?: string
|
readonly proxyEndpointTemplate?: string
|
||||||
@@ -54,14 +54,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -313,6 +313,10 @@ export class WebClientServer {
|
@@ -343,6 +343,10 @@ export class WebClientServer {
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
||||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
||||||
+ serviceWorker: {
|
+ serviceWorker: {
|
||||||
+ scope: vscodeBase + '/',
|
+ scope: vscodeBase + '/',
|
||||||
+ path: base + '/_static/out/browser/serviceWorker.js',
|
+ path: rootBase + '/_static/out/browser/serviceWorker.js',
|
||||||
+ },
|
+ },
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
|
|||||||
34
patches/signature-verification.diff
Normal file
34
patches/signature-verification.diff
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
Disable signature verification.
|
||||||
|
|
||||||
|
Extension signature verification is now mandatory for all platforms and needs to be disabled.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/platform/extensionManagement/node/extensionManagementService.ts
|
||||||
|
@@ -34,6 +34,7 @@ import {
|
||||||
|
ExtensionSignatureVerificationCode,
|
||||||
|
computeSize,
|
||||||
|
IAllowedExtensionsService,
|
||||||
|
+ // @ts-expect-error no-unused-variable
|
||||||
|
VerifyExtensionSignatureConfigKey,
|
||||||
|
shouldRequireRepositorySignatureFor,
|
||||||
|
} from '../common/extensionManagement.js';
|
||||||
|
@@ -87,6 +88,7 @@ export class ExtensionManagementService
|
||||||
|
@IDownloadService private downloadService: IDownloadService,
|
||||||
|
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||||
|
@IFileService private readonly fileService: IFileService,
|
||||||
|
+ // @ts-expect-error no-unused-variable
|
||||||
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
|
@IExtensionGalleryManifestService protected readonly extensionGalleryManifestService: IExtensionGalleryManifestService,
|
||||||
|
@IProductService productService: IProductService,
|
||||||
|
@@ -339,8 +341,7 @@ export class ExtensionManagementService
|
||||||
|
|
||||||
|
private async downloadExtension(extension: IGalleryExtension, operation: InstallOperation, verifySignature: boolean, clientTargetPlatform?: TargetPlatform): Promise<{ readonly location: URI; readonly verificationStatus: ExtensionSignatureVerificationCode | undefined }> {
|
||||||
|
if (verifySignature) {
|
||||||
|
- const value = this.configurationService.getValue(VerifyExtensionSignatureConfigKey);
|
||||||
|
- verifySignature = isBoolean(value) ? value : true;
|
||||||
|
+ verifySignature = false;
|
||||||
|
}
|
||||||
|
const { location, verificationStatus } = await this.extensionsDownloader.download(extension, operation, verifySignature, clientTargetPlatform);
|
||||||
|
const shouldRequireSignature = shouldRequireRepositorySignatureFor(extension.private, await this.extensionGalleryManifestService.getExtensionGalleryManifest());
|
||||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
@@ -243,8 +243,7 @@ function packageTask(type, platform, arc
|
@@ -256,8 +256,7 @@ function packageTask(type, platform, arc
|
||||||
|
|
||||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||||
const isUIExtension = (manifest) => {
|
const isUIExtension = (manifest) => {
|
||||||
@@ -283,9 +282,9 @@ function packageTask(type, platform, arc
|
@@ -296,9 +295,9 @@ function packageTask(type, platform, arc
|
||||||
.map(name => `.build/extensions/${name}/**`);
|
.map(name => `.build/extensions/${name}/**`);
|
||||||
|
|
||||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||||
@@ -32,9 +32,9 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
let version = packageJson.version;
|
let version = packageJson.version;
|
||||||
const quality = product.quality;
|
const quality = product.quality;
|
||||||
@@ -459,7 +458,7 @@ function tweakProductForServerWeb(produc
|
@@ -451,7 +450,7 @@ function tweakProductForServerWeb(produc
|
||||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||||
optimizeTask,
|
bundleTask,
|
||||||
util.rimraf(`out-vscode-${type}-min`),
|
util.rimraf(`out-vscode-${type}-min`),
|
||||||
- optimize.minifyTask(`out-vscode-${type}`, `https://main.vscode-cdn.net/sourcemaps/${commit}/core`)
|
- optimize.minifyTask(`out-vscode-${type}`, `https://main.vscode-cdn.net/sourcemaps/${commit}/core`)
|
||||||
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
||||||
|
|||||||
@@ -15,25 +15,24 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.ts
|
||||||
@@ -2,7 +2,7 @@
|
@@ -3,6 +3,7 @@
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
-
|
|
||||||
+import * as _http from 'http';
|
+import * as _http from 'http';
|
||||||
import * as performance from 'vs/base/common/performance';
|
import * as performance from '../../../base/common/performance.js';
|
||||||
import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl';
|
import type * as vscode from 'vscode';
|
||||||
import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor';
|
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
||||||
@@ -17,6 +17,7 @@ import { ExtensionRuntime } from 'vs/wor
|
@@ -18,6 +19,7 @@ import { ExtensionRuntime } from '../com
|
||||||
import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
|
import { CLIServer } from './extHostCLIServer.js';
|
||||||
import { realpathSync } from 'vs/base/node/extpath';
|
import { realpathSync } from '../../../base/node/extpath.js';
|
||||||
import { ExtHostConsoleForwarder } from 'vs/workbench/api/node/extHostConsoleForwarder';
|
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
||||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace';
|
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
||||||
import { ExtHostDiskFileSystemProvider } from 'vs/workbench/api/node/extHostDiskFileSystemProvider';
|
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
||||||
// ESM-uncomment-begin
|
import nodeModule from 'node:module';
|
||||||
// import { createRequire } from 'node:module';
|
import { assertType } from '../../../base/common/types.js';
|
||||||
@@ -87,6 +88,52 @@ export class ExtHostExtensionService ext
|
@@ -226,6 +228,52 @@ export class ExtHostExtensionService ext
|
||||||
await interceptor.install();
|
|
||||||
performance.mark('code/extHost/didInitAPI');
|
performance.mark('code/extHost/didInitAPI');
|
||||||
|
|
||||||
+ (async () => {
|
+ (async () => {
|
||||||
@@ -84,7 +83,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostExtensionService.
|
|||||||
+
|
+
|
||||||
// Do this when extension service exists, but extensions are not being activated yet.
|
// Do this when extension service exists, but extensions are not being activated yet.
|
||||||
const configProvider = await this._extHostConfiguration.getConfigProvider();
|
const configProvider = await this._extHostConfiguration.getConfigProvider();
|
||||||
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy, this._initData);
|
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy, this._initData, this._store);
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||||
@@ -97,7 +96,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
|||||||
import minimist from 'minimist';
|
import minimist from 'minimist';
|
||||||
import * as nativeWatchdog from 'native-watchdog';
|
import * as nativeWatchdog from 'native-watchdog';
|
||||||
import * as net from 'net';
|
import * as net from 'net';
|
||||||
@@ -421,7 +422,28 @@ async function startExtensionHostProcess
|
@@ -437,7 +438,28 @@ async function startExtensionHostProcess
|
||||||
);
|
);
|
||||||
|
|
||||||
// rewrite onTerminate-function to be a proper shutdown
|
// rewrite onTerminate-function to be a proper shutdown
|
||||||
|
|||||||
@@ -17,19 +17,19 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
|
|
||||||
import { hostname, release } from 'os';
|
import { hostname, release } from 'os';
|
||||||
+import { promises as fs } from 'fs';
|
+import { promises as fs } from 'fs';
|
||||||
import { Emitter, Event } from 'vs/base/common/event';
|
import { Emitter, Event } from '../../base/common/event.js';
|
||||||
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
import { DisposableStore, toDisposable } from '../../base/common/lifecycle.js';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from '../../base/common/network.js';
|
||||||
@@ -65,6 +66,7 @@ import { IExtensionsScannerService } fro
|
@@ -65,6 +66,7 @@ import { IExtensionsScannerService } fro
|
||||||
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
import { ExtensionsScannerService } from './extensionsScannerService.js';
|
||||||
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js';
|
||||||
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js';
|
||||||
+import { TelemetryClient } from 'vs/server/node/telemetryClient';
|
+import { TelemetryClient } from './telemetryClient.js';
|
||||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||||
@@ -147,11 +149,23 @@ export async function setupServerService
|
@@ -158,11 +160,23 @@ export async function setupServerService
|
||||||
const requestService = new RequestService(configurationService, environmentService, logService, loggerService);
|
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||||
services.set(IRequestService, requestService);
|
services.set(IRequestService, requestService);
|
||||||
|
|
||||||
+ let isContainer = undefined;
|
+ let isContainer = undefined;
|
||||||
@@ -134,20 +134,20 @@ 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
|
||||||
@@ -317,6 +317,8 @@ export class WebClientServer {
|
@@ -347,6 +347,8 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: base + '/_static/out/browser/serviceWorker.js',
|
path: rootBase + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
+ enableTelemetry: this._productService.enableTelemetry,
|
+ enableTelemetry: this._productService.enableTelemetry,
|
||||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
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
|
||||||
@@ -64,6 +64,7 @@ export interface IProductConfiguration {
|
@@ -65,6 +65,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
|
||||||
@@ -55,7 +55,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -57,7 +57,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: "",
|
||||||
|
|||||||
49
patches/trusted-domains.diff
Normal file
49
patches/trusted-domains.diff
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
Allow configuring trusted domains via product.json or flag.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
@@ -20,6 +20,7 @@ export const serverOptions: OptionDescri
|
||||||
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
|
'disable-getting-started-override': { type: 'boolean' },
|
||||||
|
'locale': { type: 'string' },
|
||||||
|
+ 'link-protection-trusted-domains': { type: 'string[]' },
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
@@ -109,6 +110,7 @@ export interface ServerParsedArgs {
|
||||||
|
'disable-file-uploads'?: boolean;
|
||||||
|
'disable-getting-started-override'?: boolean,
|
||||||
|
'locale'?: string
|
||||||
|
+ 'link-protection-trusted-domains'?: string[],
|
||||||
|
|
||||||
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
@@ -338,6 +338,14 @@ export class WebClientServer {
|
||||||
|
scopes: [['user:email'], ['repo']]
|
||||||
|
} : undefined;
|
||||||
|
|
||||||
|
+ const linkProtectionTrustedDomains: string[] = [];
|
||||||
|
+ if (this._environmentService.args['link-protection-trusted-domains']) {
|
||||||
|
+ linkProtectionTrustedDomains.push(...this._environmentService.args['link-protection-trusted-domains']);
|
||||||
|
+ }
|
||||||
|
+ if (this._productService.linkProtectionTrustedDomains) {
|
||||||
|
+ linkProtectionTrustedDomains.push(...this._productService.linkProtectionTrustedDomains);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
|
rootEndpoint: rootBase,
|
||||||
|
@@ -352,6 +360,7 @@ export class WebClientServer {
|
||||||
|
telemetryEndpoint: this._productService.telemetryEndpoint,
|
||||||
|
embedderIdentifier: 'server-distro',
|
||||||
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
|
+ linkProtectionTrustedDomains,
|
||||||
|
};
|
||||||
|
|
||||||
|
const proposedApi = this._environmentService.args['enable-proposed-api'];
|
||||||
@@ -14,14 +14,14 @@ Index: code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageS
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/storage/browser/storageService.ts
|
||||||
@@ -18,6 +18,7 @@ import { AbstractStorageService, isProfi
|
@@ -18,6 +18,7 @@ import { AbstractStorageService, isProfi
|
||||||
import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
import { isUserDataProfile, IUserDataProfile } from '../../../../platform/userDataProfile/common/userDataProfile.js';
|
||||||
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
import { IAnyWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js';
|
||||||
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';
|
import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
|
||||||
+import { hash } from 'vs/base/common/hash';
|
+import { hash } from '../../../../base/common/hash.js';
|
||||||
|
|
||||||
export class BrowserStorageService extends AbstractStorageService {
|
export class BrowserStorageService extends AbstractStorageService {
|
||||||
|
|
||||||
@@ -298,7 +299,11 @@ export class IndexedDBStorageDatabase ex
|
@@ -300,7 +301,11 @@ export class IndexedDBStorageDatabase ex
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
@@ -1,10 +1,16 @@
|
@@ -1,10 +1,16 @@
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from "../../base/common/lifecycle.js";
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from '../../nls.js';
|
||||||
+import { ILogService } from 'vs/platform/log/common/log';
|
+import { ILogService } from '../../platform/log/common/log.js';
|
||||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
||||||
+import { IProductService } from 'vs/platform/product/common/productService';
|
+import { IProductService } from '../../platform/product/common/productService.js';
|
||||||
+import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
+import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
||||||
|
|
||||||
export class CodeServerClient extends Disposable {
|
export class CodeServerClient extends Disposable {
|
||||||
constructor (
|
constructor (
|
||||||
@@ -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
|
||||||
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -58,6 +58,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
@@ -105,20 +105,20 @@ 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
|
||||||
@@ -310,6 +310,7 @@ export class WebClientServer {
|
@@ -340,6 +340,7 @@ export class WebClientServer {
|
||||||
const productConfiguration = {
|
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: rootBase,
|
||||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
} satisfies Partial<IProductConfiguration>;
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -13,6 +13,8 @@ import { memoize } from 'vs/base/common/
|
@@ -13,6 +13,8 @@ import { memoize } from '../../base/comm
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { URI } from '../../base/common/uri.js';
|
||||||
|
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
+ /* ----- code-server ----- */
|
+ /* ----- code-server ----- */
|
||||||
@@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -93,6 +95,8 @@ export const serverOptions: OptionDescri
|
@@ -95,6 +97,8 @@ export const serverOptions: OptionDescri
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
@@ -225,7 +225,7 @@ export class BrowserWorkbenchEnvironment
|
@@ -220,7 +220,7 @@ export class BrowserWorkbenchEnvironment
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
get webviewExternalEndpoint(): string {
|
get webviewExternalEndpoint(): string {
|
||||||
@@ -54,24 +54,14 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -324,6 +324,7 @@ export class WebClientServer {
|
@@ -360,6 +360,7 @@ export class WebClientServer {
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
serverBasePath: this._basePath,
|
serverBasePath: basePath,
|
||||||
+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
+ webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
_wrapWebWorkerExtHostInIframe,
|
_wrapWebWorkerExtHostInIframe,
|
||||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
||||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||||
@@ -373,7 +374,8 @@ export class WebClientServer {
|
|
||||||
return void res.end('Not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
- const webWorkerExtensionHostIframeScriptSHA = 'sha256-V28GQnL3aYxbwgpV3yW1oJ+VKKe/PBSzWntNyH8zVXA=';
|
|
||||||
+ const webWorkerExtensionHostIframeScriptSHA = 'sha256-TMJESLUenkUgTCHw3qQlCngteoHhhRnn81kYP41UnCE=';
|
|
||||||
+
|
|
||||||
|
|
||||||
const cspDirectives = [
|
|
||||||
'default-src \'self\';',
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||||
@@ -80,29 +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-dvxt5dlghGbz8hrqqochfoKEaHIMZ+yJVRvjJnGopzs=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-gEAyFzmkyqMoTTnN+3KReFUYoHsK4RAJEb+6eiul+UY=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-gzcLnrLeKQp7L5f+d7tdtNmK8h1NxVu1TdCfnv9uU+o=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-1qYtPnTQa4VwKNJO61EOhs2agF9TvuQSYIJ27OgzZqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -348,6 +348,12 @@
|
@@ -351,6 +351,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
|
||||||
|
|
||||||
+ // It is safe to run if we are on the same host.
|
|
||||||
+ const parent = new URL(parentOrigin)
|
|
||||||
+ if (parent.hostname === hostname) {
|
|
||||||
+ return start(parentOrigin)
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (!crypto.subtle) {
|
|
||||||
// cannot validate, not running in a secure context
|
|
||||||
throw new Error(`'crypto.subtle' is not available so webviews will not work. This is likely because the editor is not running in a secure context (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).`);
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
|
||||||
@@ -343,6 +343,12 @@
|
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
@@ -123,12 +96,12 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWor
|
|||||||
<meta http-equiv="Content-Security-Policy" content="
|
<meta http-equiv="Content-Security-Policy" content="
|
||||||
default-src 'none';
|
default-src 'none';
|
||||||
child-src 'self' data: blob:;
|
child-src 'self' data: blob:;
|
||||||
- script-src 'self' 'unsafe-eval' 'sha256-V28GQnL3aYxbwgpV3yW1oJ+VKKe/PBSzWntNyH8zVXA=' https: http://localhost:* blob:;
|
- script-src 'self' 'unsafe-eval' 'sha256-cl8ijlOzEe+0GRCQNJQu2k6nUQ0fAYNYIuuKEm72JDs=' https: http://localhost:* blob:;
|
||||||
+ script-src 'self' 'unsafe-eval' 'sha256-TMJESLUenkUgTCHw3qQlCngteoHhhRnn81kYP41UnCE=' https: http://localhost:* blob:;
|
+ script-src 'self' 'unsafe-eval' 'sha256-yhZXuB8LS6t73dvNg6rtLX8y4PHLnqRm5+6DdOGkOcw=' https: http://localhost:* blob:;
|
||||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -23,6 +23,13 @@
|
@@ -25,6 +25,13 @@
|
||||||
// validation not requested
|
// validation not requested
|
||||||
return start();
|
return start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
.error-display > .body {
|
.error-display > .body {
|
||||||
color: #444;
|
color: #444;
|
||||||
|
color: light-dark(#444, #ccc);
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
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" />
|
||||||
<title>{{ERROR_TITLE}} - code-server</title>
|
<title>{{ERROR_TITLE}} - code-server</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" />
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
:root {
|
||||||
|
color-scheme: light dark;
|
||||||
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
#root {
|
#root {
|
||||||
@@ -7,7 +11,9 @@ body,
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
background: rgb(244, 247, 252);
|
background: rgb(244, 247, 252);
|
||||||
|
background: light-dark(rgb(244, 247, 252), #111827);
|
||||||
color: #111;
|
color: #111;
|
||||||
|
color: light-dark(#111, #ddd);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
|
||||||
"Segoe UI Emoji", "Segoe UI Symbol";
|
"Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
@@ -23,12 +29,15 @@ button {
|
|||||||
|
|
||||||
.-button {
|
.-button {
|
||||||
background-color: rgb(87, 114, 245);
|
background-color: rgb(87, 114, 245);
|
||||||
|
background-color: light-dark(rgb(87, 114, 245), rgb(26, 86, 219));
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: none;
|
border: none;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: white;
|
color: white;
|
||||||
|
color: light-dark(white, white);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding: 18px 20px;
|
padding: 18px 20px;
|
||||||
|
font-weight: 500;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,9 +54,10 @@ button {
|
|||||||
|
|
||||||
.card-box {
|
.card-box {
|
||||||
background-color: rgb(250, 253, 258);
|
background-color: rgb(250, 253, 258);
|
||||||
|
background-color: light-dark(rgb(250, 253, 258), #1f2937);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow:
|
box-shadow:
|
||||||
rgba(60, 66, 87, 0.117647) 0px 7px 14px 0px,
|
light-dark(rgba(60, 66, 87, 0.117647), rgba(10, 10, 10, 0.617647)) 0px 7px 14px 0px,
|
||||||
rgba(0, 0, 0, 0.117647) 0px 3px 6px 0px;
|
rgba(0, 0, 0, 0.117647) 0px 3px 6px 0px;
|
||||||
max-width: 650px;
|
max-width: 650px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -55,7 +65,9 @@ button {
|
|||||||
|
|
||||||
.card-box > .header {
|
.card-box > .header {
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid #ddd;
|
||||||
|
border-bottom: 1px solid light-dark(#ddd, #111827);
|
||||||
color: #444;
|
color: #444;
|
||||||
|
color: light-dark(#444, #fff);
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +78,7 @@ button {
|
|||||||
|
|
||||||
.card-box > .header > .sub {
|
.card-box > .header > .sub {
|
||||||
color: #555;
|
color: #555;
|
||||||
|
color: light-dark(#555, #9ca3af);
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,14 +30,23 @@ body {
|
|||||||
|
|
||||||
.login-form > .field > .password {
|
.login-form > .field > .password {
|
||||||
background-color: rgb(244, 247, 252);
|
background-color: rgb(244, 247, 252);
|
||||||
|
background-color: light-dark(rgb(244, 247, 252), #374151);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
|
border: 1px solid light-dark(#ddd, #4b5563);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: black;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.login-form > .field > .password::placeholder {
|
||||||
|
color: rgb(148 163 184);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-form > .field > .password:focus {
|
||||||
|
outline: 2px solid rgb(63, 131, 248);
|
||||||
|
}
|
||||||
|
|
||||||
.login-form > .user {
|
.login-form > .user {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
||||||
/>
|
/>
|
||||||
|
<meta name="color-scheme" content="light dark" />
|
||||||
<title>{{I18N_LOGIN_TITLE}}</title>
|
<title>{{I18N_LOGIN_TITLE}}</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" />
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
self.addEventListener("install", () => {
|
self.addEventListener("install", () => {
|
||||||
console.debug("[Service Worker] installed")
|
console.debug("[Service Worker] installed")
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export enum LogLevel {
|
|||||||
export class OptionalString extends Optional<string> {}
|
export class OptionalString extends Optional<string> {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Code flags provided by the user.
|
* (VS) Code flags provided by the user.
|
||||||
*/
|
*/
|
||||||
export interface UserProvidedCodeArgs {
|
export interface UserProvidedCodeArgs {
|
||||||
"disable-telemetry"?: boolean
|
"disable-telemetry"?: boolean
|
||||||
@@ -53,6 +53,9 @@ export interface UserProvidedCodeArgs {
|
|||||||
"disable-getting-started-override"?: boolean
|
"disable-getting-started-override"?: boolean
|
||||||
"disable-proxy"?: boolean
|
"disable-proxy"?: boolean
|
||||||
"session-socket"?: string
|
"session-socket"?: string
|
||||||
|
"link-protection-trusted-domains"?: string[]
|
||||||
|
// locale is used by both VS Code and code-server.
|
||||||
|
locale?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +75,6 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
enable?: string[]
|
enable?: string[]
|
||||||
help?: boolean
|
help?: boolean
|
||||||
host?: string
|
host?: string
|
||||||
locale?: string
|
|
||||||
port?: number
|
port?: number
|
||||||
json?: boolean
|
json?: boolean
|
||||||
log?: LogLevel
|
log?: LogLevel
|
||||||
@@ -83,12 +85,14 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
"trusted-origins"?: string[]
|
"trusted-origins"?: string[]
|
||||||
version?: boolean
|
version?: boolean
|
||||||
"proxy-domain"?: string[]
|
"proxy-domain"?: string[]
|
||||||
|
"skip-auth-preflight"?: boolean
|
||||||
"reuse-window"?: boolean
|
"reuse-window"?: boolean
|
||||||
"new-window"?: boolean
|
"new-window"?: boolean
|
||||||
"ignore-last-opened"?: boolean
|
"ignore-last-opened"?: boolean
|
||||||
verbose?: boolean
|
verbose?: boolean
|
||||||
"app-name"?: string
|
"app-name"?: string
|
||||||
"welcome-text"?: string
|
"welcome-text"?: string
|
||||||
|
"abs-proxy-base-path"?: string
|
||||||
/* Positional arguments. */
|
/* Positional arguments. */
|
||||||
_?: string[]
|
_?: string[]
|
||||||
}
|
}
|
||||||
@@ -117,18 +121,18 @@ interface Option<T> {
|
|||||||
type OptionType<T> = T extends boolean
|
type OptionType<T> = T extends boolean
|
||||||
? "boolean"
|
? "boolean"
|
||||||
: T extends OptionalString
|
: T extends OptionalString
|
||||||
? typeof OptionalString
|
? typeof OptionalString
|
||||||
: T extends LogLevel
|
: T extends LogLevel
|
||||||
? typeof LogLevel
|
? typeof LogLevel
|
||||||
: T extends AuthType
|
: T extends AuthType
|
||||||
? typeof AuthType
|
? typeof AuthType
|
||||||
: T extends number
|
: T extends number
|
||||||
? "number"
|
? "number"
|
||||||
: T extends string
|
: T extends string
|
||||||
? "string"
|
? "string"
|
||||||
: T extends string[]
|
: T extends string[]
|
||||||
? "string[]"
|
? "string[]"
|
||||||
: "unknown"
|
: "unknown"
|
||||||
|
|
||||||
export type Options<T> = {
|
export type Options<T> = {
|
||||||
[P in keyof T]: Option<OptionType<T[P]>>
|
[P in keyof T]: Option<OptionType<T[P]>>
|
||||||
@@ -192,6 +196,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
enable: { type: "string[]" },
|
enable: { type: "string[]" },
|
||||||
help: { type: "boolean", short: "h", description: "Show this output." },
|
help: { type: "boolean", short: "h", description: "Show this output." },
|
||||||
json: { type: "boolean" },
|
json: { type: "boolean" },
|
||||||
|
"link-protection-trusted-domains": {
|
||||||
|
type: "string[]",
|
||||||
|
description: "Links matching a trusted domain can be opened without link protection.",
|
||||||
|
},
|
||||||
locale: {
|
locale: {
|
||||||
// The preferred way to set the locale is via the UI.
|
// The preferred way to set the locale is via the UI.
|
||||||
type: "string",
|
type: "string",
|
||||||
@@ -251,6 +259,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
description: "GitHub authentication token (can only be passed in via $GITHUB_TOKEN or the config file).",
|
description: "GitHub authentication token (can only be passed in via $GITHUB_TOKEN or the config file).",
|
||||||
},
|
},
|
||||||
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
|
"proxy-domain": { type: "string[]", description: "Domain used for proxying ports." },
|
||||||
|
"skip-auth-preflight": {
|
||||||
|
type: "boolean",
|
||||||
|
description: "Allows preflight requests through proxy without authentication.",
|
||||||
|
},
|
||||||
"ignore-last-opened": {
|
"ignore-last-opened": {
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
short: "e",
|
short: "e",
|
||||||
@@ -279,6 +291,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
short: "w",
|
short: "w",
|
||||||
description: "Text to show on login page",
|
description: "Text to show on login page",
|
||||||
},
|
},
|
||||||
|
"abs-proxy-base-path": {
|
||||||
|
type: "string",
|
||||||
|
description: "The base path to prefix to all absproxy requests",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
|
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
|
||||||
@@ -697,12 +713,16 @@ export function parseConfigFile(configFile: string, configPath: string): ConfigA
|
|||||||
|
|
||||||
// We convert the config file into a set of flags.
|
// We convert the config file into a set of flags.
|
||||||
// This is a temporary measure until we add a proper CLI library.
|
// This is a temporary measure until we add a proper CLI library.
|
||||||
const configFileArgv = Object.entries(config).map(([optName, opt]) => {
|
const configFileArgv = Object.entries(config)
|
||||||
if (opt === true) {
|
.map(([optName, opt]) => {
|
||||||
return `--${optName}`
|
if (opt === true) {
|
||||||
}
|
return `--${optName}`
|
||||||
return `--${optName}=${opt}`
|
} else if (Array.isArray(opt)) {
|
||||||
})
|
return opt.map((o) => `--${optName}=${o}`)
|
||||||
|
}
|
||||||
|
return `--${optName}=${opt}`
|
||||||
|
})
|
||||||
|
.flat()
|
||||||
const args = parse(configFileArgv, {
|
const args = parse(configFileArgv, {
|
||||||
configFile: configPath,
|
configFile: configPath,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { field, logger } from "@coder/logger"
|
import { field, logger } from "@coder/logger"
|
||||||
import http from "http"
|
import http from "http"
|
||||||
|
import * as os from "os"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { Disposable } from "../common/emitter"
|
import { Disposable } from "../common/emitter"
|
||||||
import { plural } from "../common/util"
|
import { plural } from "../common/util"
|
||||||
@@ -49,7 +50,14 @@ export interface OpenCommandPipeArgs {
|
|||||||
export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
|
export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
|
||||||
logger.debug("Running Code CLI")
|
logger.debug("Running Code CLI")
|
||||||
try {
|
try {
|
||||||
const mod = require(path.join(vsRootPath, "out/server-main")) as VSCodeModule
|
// See vscode.loadVSCode for more on this jank.
|
||||||
|
process.env.CODE_SERVER_PARENT_PID = process.pid.toString()
|
||||||
|
let modPath = path.join(vsRootPath, "out/server-main.js")
|
||||||
|
if (os.platform() === "win32") {
|
||||||
|
// On Windows, absolute paths of ESM modules must be a valid file URI.
|
||||||
|
modPath = "file:///" + modPath.replace(/\\/g, "/")
|
||||||
|
}
|
||||||
|
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
|
||||||
const serverModule = await mod.loadCodeWithNls()
|
const serverModule = await mod.loadCodeWithNls()
|
||||||
await serverModule.spawnCli(await toCodeArgs(args))
|
await serverModule.spawnCli(await toCodeArgs(args))
|
||||||
// Rather than have the caller handle errors and exit, spawnCli will exit
|
// Rather than have the caller handle errors and exit, spawnCli will exit
|
||||||
@@ -155,6 +163,9 @@ export const runCodeServer = async (
|
|||||||
logger.info(` - ${plural(args["proxy-domain"].length, "Proxying the following domain")}:`)
|
logger.info(` - ${plural(args["proxy-domain"].length, "Proxying the following domain")}:`)
|
||||||
args["proxy-domain"].forEach((domain) => logger.info(` - ${domain}`))
|
args["proxy-domain"].forEach((domain) => logger.info(` - ${domain}`))
|
||||||
}
|
}
|
||||||
|
if (args["skip-auth-preflight"]) {
|
||||||
|
logger.info(" - Skipping authentication for preflight requests")
|
||||||
|
}
|
||||||
if (process.env.VSCODE_PROXY_URI) {
|
if (process.env.VSCODE_PROXY_URI) {
|
||||||
logger.info(`Using proxy URI in PORTS tab: ${process.env.VSCODE_PROXY_URI}`)
|
logger.info(`Using proxy URI in PORTS tab: ${process.env.VSCODE_PROXY_URI}`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,302 +0,0 @@
|
|||||||
import { field, Level, Logger } from "@coder/logger"
|
|
||||||
import * as express from "express"
|
|
||||||
import * as fs from "fs"
|
|
||||||
import * as path from "path"
|
|
||||||
import * as semver from "semver"
|
|
||||||
import * as pluginapi from "../../typings/pluginapi"
|
|
||||||
import { HttpCode, HttpError } from "../common/http"
|
|
||||||
import { version } from "./constants"
|
|
||||||
import { authenticated, ensureAuthenticated, replaceTemplates } from "./http"
|
|
||||||
import { proxy } from "./proxy"
|
|
||||||
import * as util from "./util"
|
|
||||||
import { Router as WsRouter, WebsocketRouter, wss } from "./wsRouter"
|
|
||||||
const fsp = fs.promises
|
|
||||||
|
|
||||||
// Represents a required module which could be anything.
|
|
||||||
type Module = any
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Inject code-server when `require`d. This is required because the API provides
|
|
||||||
* more than just types so these need to be provided at run-time.
|
|
||||||
*/
|
|
||||||
const originalLoad = require("module")._load
|
|
||||||
require("module")._load = function (request: string, parent: object, isMain: boolean): Module {
|
|
||||||
return request === "code-server" ? codeServer : originalLoad.apply(this, [request, parent, isMain])
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The module you get when importing "code-server".
|
|
||||||
*/
|
|
||||||
export const codeServer = {
|
|
||||||
HttpCode,
|
|
||||||
HttpError,
|
|
||||||
Level,
|
|
||||||
authenticated,
|
|
||||||
ensureAuthenticated,
|
|
||||||
express,
|
|
||||||
field,
|
|
||||||
proxy,
|
|
||||||
replaceTemplates,
|
|
||||||
WsRouter,
|
|
||||||
wss,
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Plugin extends pluginapi.Plugin {
|
|
||||||
/**
|
|
||||||
* These fields are populated from the plugin's package.json
|
|
||||||
* and now guaranteed to exist.
|
|
||||||
*/
|
|
||||||
name: string
|
|
||||||
version: string
|
|
||||||
|
|
||||||
/**
|
|
||||||
* path to the node module on the disk.
|
|
||||||
*/
|
|
||||||
modulePath: string
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Application extends pluginapi.Application {
|
|
||||||
/*
|
|
||||||
* Clone of the above without functions.
|
|
||||||
*/
|
|
||||||
plugin: Omit<Plugin, "init" | "deinit" | "router" | "applications">
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PluginAPI implements the plugin API described in typings/pluginapi.d.ts
|
|
||||||
* Please see that file for details.
|
|
||||||
*/
|
|
||||||
export class PluginAPI {
|
|
||||||
private readonly plugins = new Map<string, Plugin>()
|
|
||||||
private readonly logger: Logger
|
|
||||||
|
|
||||||
public constructor(
|
|
||||||
logger: Logger,
|
|
||||||
/**
|
|
||||||
* These correspond to $CS_PLUGIN_PATH and $CS_PLUGIN respectively.
|
|
||||||
*/
|
|
||||||
private readonly csPlugin = "",
|
|
||||||
private readonly csPluginPath = `${path.join(util.paths.data, "plugins")}:/usr/share/code-server/plugins`,
|
|
||||||
private readonly workingDirectory: string | undefined = undefined,
|
|
||||||
) {
|
|
||||||
this.logger = logger.named("pluginapi")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* applications grabs the full list of applications from
|
|
||||||
* all loaded plugins.
|
|
||||||
*/
|
|
||||||
public async applications(): Promise<Application[]> {
|
|
||||||
const apps = new Array<Application>()
|
|
||||||
for (const [, p] of this.plugins) {
|
|
||||||
if (!p.applications) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
const pluginApps = await p.applications()
|
|
||||||
|
|
||||||
// Add plugin key to each app.
|
|
||||||
apps.push(
|
|
||||||
...pluginApps.map((app) => {
|
|
||||||
app = { ...app, path: path.join(p.routerPath, app.path || "") }
|
|
||||||
app = { ...app, iconPath: path.join(app.path || "", app.iconPath) }
|
|
||||||
return {
|
|
||||||
...app,
|
|
||||||
plugin: {
|
|
||||||
name: p.name,
|
|
||||||
version: p.version,
|
|
||||||
modulePath: p.modulePath,
|
|
||||||
|
|
||||||
displayName: p.displayName,
|
|
||||||
description: p.description,
|
|
||||||
routerPath: p.routerPath,
|
|
||||||
homepageURL: p.homepageURL,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return apps
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* mount mounts all plugin routers onto r and websocket routers onto wr.
|
|
||||||
*/
|
|
||||||
public mount(r: express.Router, wr: express.Router): void {
|
|
||||||
for (const [, p] of this.plugins) {
|
|
||||||
if (p.router) {
|
|
||||||
r.use(`${p.routerPath}`, p.router())
|
|
||||||
}
|
|
||||||
if (p.wsRouter) {
|
|
||||||
wr.use(`${p.routerPath}`, (p.wsRouter() as WebsocketRouter).router)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* loadPlugins loads all plugins based on this.csPlugin,
|
|
||||||
* this.csPluginPath and the built in plugins.
|
|
||||||
*/
|
|
||||||
public async loadPlugins(loadBuiltin = true): Promise<void> {
|
|
||||||
for (const dir of this.csPlugin.split(":")) {
|
|
||||||
if (!dir) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
await this.loadPlugin(dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const dir of this.csPluginPath.split(":")) {
|
|
||||||
if (!dir) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
await this._loadPlugins(dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (loadBuiltin) {
|
|
||||||
await this._loadPlugins(path.join(__dirname, "../../plugins"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* _loadPlugins is the counterpart to loadPlugins.
|
|
||||||
*
|
|
||||||
* It differs in that it loads all plugins in a single
|
|
||||||
* directory whereas loadPlugins uses all available directories
|
|
||||||
* as documented.
|
|
||||||
*/
|
|
||||||
private async _loadPlugins(dir: string): Promise<void> {
|
|
||||||
try {
|
|
||||||
const entries = await fsp.readdir(dir, { withFileTypes: true })
|
|
||||||
for (const ent of entries) {
|
|
||||||
if (!ent.isDirectory()) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
await this.loadPlugin(path.join(dir, ent.name))
|
|
||||||
}
|
|
||||||
} catch (error: any) {
|
|
||||||
if (error.code !== "ENOENT") {
|
|
||||||
this.logger.warn(`failed to load plugins from ${q(dir)}: ${error.message}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async loadPlugin(dir: string): Promise<void> {
|
|
||||||
try {
|
|
||||||
const str = await fsp.readFile(path.join(dir, "package.json"), {
|
|
||||||
encoding: "utf8",
|
|
||||||
})
|
|
||||||
const packageJSON: PackageJSON = JSON.parse(str)
|
|
||||||
for (const [, p] of this.plugins) {
|
|
||||||
if (p.name === packageJSON.name) {
|
|
||||||
this.logger.warn(
|
|
||||||
`ignoring duplicate plugin ${q(p.name)} at ${q(dir)}, using previously loaded ${q(p.modulePath)}`,
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const p = this._loadPlugin(dir, packageJSON)
|
|
||||||
this.plugins.set(p.name, p)
|
|
||||||
} catch (error: any) {
|
|
||||||
if (error.code !== "ENOENT") {
|
|
||||||
this.logger.warn(`failed to load plugin: ${error.stack}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* _loadPlugin is the counterpart to loadPlugin and actually
|
|
||||||
* loads the plugin now that we know there is no duplicate
|
|
||||||
* and that the package.json has been read.
|
|
||||||
*/
|
|
||||||
private _loadPlugin(dir: string, packageJSON: PackageJSON): Plugin {
|
|
||||||
dir = path.resolve(dir)
|
|
||||||
|
|
||||||
const logger = this.logger.named(packageJSON.name)
|
|
||||||
logger.debug("loading plugin", field("plugin_dir", dir), field("package_json", packageJSON))
|
|
||||||
|
|
||||||
if (!packageJSON.name) {
|
|
||||||
throw new Error("plugin package.json missing name")
|
|
||||||
}
|
|
||||||
if (!packageJSON.version) {
|
|
||||||
throw new Error("plugin package.json missing version")
|
|
||||||
}
|
|
||||||
if (!packageJSON.engines || !packageJSON.engines["code-server"]) {
|
|
||||||
throw new Error(`plugin package.json missing code-server range like:
|
|
||||||
"engines": {
|
|
||||||
"code-server": "^3.7.0"
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
}
|
|
||||||
if (!semver.satisfies(version, packageJSON.engines["code-server"])) {
|
|
||||||
this.logger.warn(
|
|
||||||
`plugin range ${q(packageJSON.engines["code-server"])} incompatible` + ` with code-server version ${version}`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const pluginModule = require(dir)
|
|
||||||
if (!pluginModule.plugin) {
|
|
||||||
throw new Error("plugin module does not export a plugin")
|
|
||||||
}
|
|
||||||
|
|
||||||
const p = {
|
|
||||||
name: packageJSON.name,
|
|
||||||
version: packageJSON.version,
|
|
||||||
modulePath: dir,
|
|
||||||
...pluginModule.plugin,
|
|
||||||
} as Plugin
|
|
||||||
|
|
||||||
if (!p.displayName) {
|
|
||||||
throw new Error("plugin missing displayName")
|
|
||||||
}
|
|
||||||
if (!p.description) {
|
|
||||||
throw new Error("plugin missing description")
|
|
||||||
}
|
|
||||||
if (!p.routerPath) {
|
|
||||||
throw new Error("plugin missing router path")
|
|
||||||
}
|
|
||||||
if (!p.routerPath.startsWith("/")) {
|
|
||||||
throw new Error(`plugin router path ${q(p.routerPath)}: invalid`)
|
|
||||||
}
|
|
||||||
if (!p.homepageURL) {
|
|
||||||
throw new Error("plugin missing homepage")
|
|
||||||
}
|
|
||||||
|
|
||||||
p.init({
|
|
||||||
logger: logger,
|
|
||||||
workingDirectory: this.workingDirectory,
|
|
||||||
})
|
|
||||||
|
|
||||||
logger.debug("loaded")
|
|
||||||
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
public async dispose(): Promise<void> {
|
|
||||||
await Promise.all(
|
|
||||||
Array.from(this.plugins.values()).map(async (p) => {
|
|
||||||
if (!p.deinit) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await p.deinit()
|
|
||||||
} catch (error: any) {
|
|
||||||
this.logger.error("plugin failed to deinit", field("name", p.name), field("error", error.message))
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PackageJSON {
|
|
||||||
name: string
|
|
||||||
version: string
|
|
||||||
engines: {
|
|
||||||
"code-server": string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function q(s: string | undefined): string {
|
|
||||||
if (s === undefined) {
|
|
||||||
s = "undefined"
|
|
||||||
}
|
|
||||||
return JSON.stringify(s)
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import * as express from "express"
|
|
||||||
import { PluginAPI } from "../plugin"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implements the /api/applications endpoint
|
|
||||||
*
|
|
||||||
* See typings/pluginapi.d.ts for details.
|
|
||||||
*/
|
|
||||||
export function router(papi: PluginAPI): express.Router {
|
|
||||||
const router = express.Router()
|
|
||||||
|
|
||||||
router.get("/", async (req, res) => {
|
|
||||||
res.json(await papi.applications())
|
|
||||||
})
|
|
||||||
|
|
||||||
return router
|
|
||||||
}
|
|
||||||
@@ -61,6 +61,11 @@ router.all(/.*/, async (req, res, next) => {
|
|||||||
|
|
||||||
ensureProxyEnabled(req)
|
ensureProxyEnabled(req)
|
||||||
|
|
||||||
|
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||||
|
// Allow preflight requests with `skip-auth-preflight` flag
|
||||||
|
return next()
|
||||||
|
}
|
||||||
|
|
||||||
// Must be authenticated to use the proxy.
|
// Must be authenticated to use the proxy.
|
||||||
const isAuthenticated = await authenticated(req)
|
const isAuthenticated = await authenticated(req)
|
||||||
if (!isAuthenticated) {
|
if (!isAuthenticated) {
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import { logger } from "@coder/logger"
|
|||||||
import express from "express"
|
import express from "express"
|
||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { WebsocketRequest } from "../../../typings/pluginapi"
|
|
||||||
import { HttpCode } from "../../common/http"
|
import { HttpCode } from "../../common/http"
|
||||||
import { rootPath } from "../constants"
|
import { rootPath } from "../constants"
|
||||||
import { replaceTemplates } from "../http"
|
import { replaceTemplates } from "../http"
|
||||||
import { escapeHtml, getMediaMime } from "../util"
|
import { escapeHtml, getMediaMime } from "../util"
|
||||||
|
import type { WebsocketRequest } from "../wsRouter"
|
||||||
|
|
||||||
interface ErrorWithStatusCode {
|
interface ErrorWithStatusCode {
|
||||||
statusCode: number
|
statusCode: number
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import * as express from "express"
|
|||||||
import { promises as fs } from "fs"
|
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 * as pluginapi from "../../../typings/pluginapi"
|
|
||||||
import { Disposable } from "../../common/emitter"
|
import { Disposable } from "../../common/emitter"
|
||||||
import { HttpCode, HttpError } from "../../common/http"
|
import { HttpCode, HttpError } from "../../common/http"
|
||||||
import { plural } from "../../common/util"
|
import { plural } from "../../common/util"
|
||||||
@@ -12,12 +11,11 @@ import { App } from "../app"
|
|||||||
import { AuthType, DefaultedArgs } from "../cli"
|
import { AuthType, DefaultedArgs } from "../cli"
|
||||||
import { commit, rootPath } from "../constants"
|
import { commit, rootPath } from "../constants"
|
||||||
import { Heart } from "../heart"
|
import { Heart } from "../heart"
|
||||||
import { ensureAuthenticated, redirect } from "../http"
|
import { redirect } from "../http"
|
||||||
import { PluginAPI } from "../plugin"
|
|
||||||
import { CoderSettings, SettingsProvider } from "../settings"
|
import { CoderSettings, SettingsProvider } from "../settings"
|
||||||
import { UpdateProvider } from "../update"
|
import { UpdateProvider } from "../update"
|
||||||
import { getMediaMime, paths } from "../util"
|
import { getMediaMime, paths } from "../util"
|
||||||
import * as apps from "./apps"
|
import type { WebsocketRequest } from "../wsRouter"
|
||||||
import * as domainProxy from "./domainProxy"
|
import * as domainProxy from "./domainProxy"
|
||||||
import { errorHandler, wsErrorHandler } from "./errors"
|
import { errorHandler, wsErrorHandler } from "./errors"
|
||||||
import * as health from "./health"
|
import * as health from "./health"
|
||||||
@@ -81,63 +79,53 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
app.router.use(common)
|
app.router.use(common)
|
||||||
app.wsRouter.use(common)
|
app.wsRouter.use(common)
|
||||||
|
|
||||||
app.router.use(async (req, res, next) => {
|
app.router.use(/.*/, async (req, res, next) => {
|
||||||
// If we're handling TLS ensure all requests are redirected to HTTPS.
|
// If we're handling TLS ensure all requests are redirected to HTTPS.
|
||||||
// TODO: This does *NOT* work if you have a base path since to specify the
|
// TODO: This does *NOT* work if you have a base path since to specify the
|
||||||
// protocol we need to specify the whole path.
|
// protocol we need to specify the whole path.
|
||||||
if (args.cert && !(req.connection as tls.TLSSocket).encrypted) {
|
if (args.cert && !(req.connection as tls.TLSSocket).encrypted) {
|
||||||
return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
|
return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return security.txt.
|
|
||||||
if (req.originalUrl === "/security.txt" || req.originalUrl === "/.well-known/security.txt") {
|
|
||||||
const resourcePath = path.resolve(rootPath, "src/browser/security.txt")
|
|
||||||
res.set("Content-Type", getMediaMime(resourcePath))
|
|
||||||
return res.send(await fs.readFile(resourcePath))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return robots.txt.
|
|
||||||
if (req.originalUrl === "/robots.txt") {
|
|
||||||
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")
|
|
||||||
res.set("Content-Type", getMediaMime(resourcePath))
|
|
||||||
return res.send(await fs.readFile(resourcePath))
|
|
||||||
}
|
|
||||||
|
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
app.router.get(["/security.txt", "/.well-known/security.txt"], async (_, res) => {
|
||||||
|
const resourcePath = path.resolve(rootPath, "src/browser/security.txt")
|
||||||
|
res.set("Content-Type", getMediaMime(resourcePath))
|
||||||
|
res.send(await fs.readFile(resourcePath))
|
||||||
|
})
|
||||||
|
|
||||||
|
app.router.get("/robots.txt", async (_, res) => {
|
||||||
|
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")
|
||||||
|
res.set("Content-Type", getMediaMime(resourcePath))
|
||||||
|
res.send(await fs.readFile(resourcePath))
|
||||||
|
})
|
||||||
|
|
||||||
app.router.use("/", domainProxy.router)
|
app.router.use("/", domainProxy.router)
|
||||||
app.wsRouter.use("/", domainProxy.wsRouter.router)
|
app.wsRouter.use("/", domainProxy.wsRouter.router)
|
||||||
|
|
||||||
app.router.all("/proxy/:port/:path(.*)?", async (req, res) => {
|
app.router.all("/proxy/:port{/*path}", async (req, res) => {
|
||||||
await pathProxy.proxy(req, res)
|
await pathProxy.proxy(req, res)
|
||||||
})
|
})
|
||||||
app.wsRouter.get("/proxy/:port/:path(.*)?", async (req) => {
|
app.wsRouter.get("/proxy/:port{/*path}", async (req) => {
|
||||||
await pathProxy.wsProxy(req as pluginapi.WebsocketRequest)
|
await pathProxy.wsProxy(req as unknown as WebsocketRequest)
|
||||||
})
|
})
|
||||||
// These two routes pass through the path directly.
|
// These two routes pass through the path directly.
|
||||||
// So the proxied app must be aware it is running
|
// So the proxied app must be aware it is running
|
||||||
// under /absproxy/<someport>/
|
// under /absproxy/<someport>/
|
||||||
app.router.all("/absproxy/:port/:path(.*)?", async (req, res) => {
|
app.router.all("/absproxy/:port{/*path}", async (req, res) => {
|
||||||
await pathProxy.proxy(req, res, {
|
await pathProxy.proxy(req, res, {
|
||||||
passthroughPath: true,
|
passthroughPath: true,
|
||||||
|
proxyBasePath: args["abs-proxy-base-path"],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
app.wsRouter.get("/absproxy/:port/:path(.*)?", async (req) => {
|
app.wsRouter.get("/absproxy/:port{/*path}", async (req) => {
|
||||||
await pathProxy.wsProxy(req as pluginapi.WebsocketRequest, {
|
await pathProxy.wsProxy(req as unknown as WebsocketRequest, {
|
||||||
passthroughPath: true,
|
passthroughPath: true,
|
||||||
|
proxyBasePath: args["abs-proxy-base-path"],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
let pluginApi: PluginAPI
|
|
||||||
if (!process.env.CS_DISABLE_PLUGINS) {
|
|
||||||
const workingDir = args._ && args._.length > 0 ? path.resolve(args._[args._.length - 1]) : undefined
|
|
||||||
pluginApi = new PluginAPI(logger, process.env.CS_PLUGIN, process.env.CS_PLUGIN_PATH, workingDir)
|
|
||||||
await pluginApi.loadPlugins()
|
|
||||||
pluginApi.mount(app.router, app.wsRouter)
|
|
||||||
app.router.use("/api/applications", ensureAuthenticated, apps.router(pluginApi))
|
|
||||||
}
|
|
||||||
|
|
||||||
app.router.use(express.json())
|
app.router.use(express.json())
|
||||||
app.router.use(express.urlencoded({ extended: true }))
|
app.router.use(express.urlencoded({ extended: true }))
|
||||||
|
|
||||||
@@ -170,7 +158,9 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
|
|
||||||
app.router.use("/update", update.router)
|
app.router.use("/update", update.router)
|
||||||
|
|
||||||
// Note that the root route is replaced in Coder Enterprise by the plugin API.
|
// For historic reasons we also load at /vscode because the root was replaced
|
||||||
|
// by a plugin in v1 of Coder. The plugin system (which was for internal use
|
||||||
|
// only) has been removed, but leave the additional route for now.
|
||||||
for (const routePrefix of ["/vscode", "/"]) {
|
for (const routePrefix of ["/vscode", "/"]) {
|
||||||
app.router.use(routePrefix, vscode.router)
|
app.router.use(routePrefix, vscode.router)
|
||||||
app.wsRouter.use(routePrefix, vscode.wsRouter.router)
|
app.wsRouter.use(routePrefix, vscode.wsRouter.router)
|
||||||
@@ -185,7 +175,6 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
|
|||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
heart.dispose()
|
heart.dispose()
|
||||||
pluginApi?.dispose()
|
|
||||||
vscode.dispose()
|
vscode.dispose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
import { Request, Response } from "express"
|
import { Request, Response } from "express"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import * as pluginapi from "../../../typings/pluginapi"
|
|
||||||
import { HttpCode, HttpError } from "../../common/http"
|
import { HttpCode, HttpError } from "../../common/http"
|
||||||
import { ensureProxyEnabled, authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
|
import { ensureProxyEnabled, authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
|
||||||
import { proxy as _proxy } from "../proxy"
|
import { proxy as _proxy } from "../proxy"
|
||||||
|
import type { WebsocketRequest } from "../wsRouter"
|
||||||
|
|
||||||
const getProxyTarget = (req: Request): string => {
|
const getProxyTarget = (
|
||||||
|
req: Request,
|
||||||
|
opts?: {
|
||||||
|
proxyBasePath?: 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 || ""
|
||||||
return `http://0.0.0.0:${req.params.port}/${req.originalUrl.slice(base.length)}`
|
const port = parseInt(req.params.port, 10)
|
||||||
|
if (isNaN(port)) {
|
||||||
|
throw new HttpError("Invalid port", HttpCode.BadRequest)
|
||||||
|
}
|
||||||
|
return `http://0.0.0.0:${port}${opts?.proxyBasePath || ""}/${req.originalUrl.slice(base.length)}`
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function proxy(
|
export async function proxy(
|
||||||
@@ -16,11 +25,14 @@ export async function proxy(
|
|||||||
res: Response,
|
res: Response,
|
||||||
opts?: {
|
opts?: {
|
||||||
passthroughPath?: boolean
|
passthroughPath?: boolean
|
||||||
|
proxyBasePath?: string
|
||||||
},
|
},
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
ensureProxyEnabled(req)
|
ensureProxyEnabled(req)
|
||||||
|
|
||||||
if (!(await authenticated(req))) {
|
if (req.method === "OPTIONS" && req.args["skip-auth-preflight"]) {
|
||||||
|
// Allow preflight requests with `skip-auth-preflight` flag
|
||||||
|
} else if (!(await authenticated(req))) {
|
||||||
// If visiting the root (/:port only) redirect to the login page.
|
// If visiting the root (/:port only) redirect to the login page.
|
||||||
if (!req.params.path || req.params.path === "/") {
|
if (!req.params.path || req.params.path === "/") {
|
||||||
const to = self(req)
|
const to = self(req)
|
||||||
@@ -38,14 +50,15 @@ export async function proxy(
|
|||||||
|
|
||||||
_proxy.web(req, res, {
|
_proxy.web(req, res, {
|
||||||
ignorePath: true,
|
ignorePath: true,
|
||||||
target: getProxyTarget(req),
|
target: getProxyTarget(req, opts),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function wsProxy(
|
export async function wsProxy(
|
||||||
req: pluginapi.WebsocketRequest,
|
req: WebsocketRequest,
|
||||||
opts?: {
|
opts?: {
|
||||||
passthroughPath?: boolean
|
passthroughPath?: boolean
|
||||||
|
proxyBasePath?: string
|
||||||
},
|
},
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
ensureProxyEnabled(req)
|
ensureProxyEnabled(req)
|
||||||
@@ -59,6 +72,6 @@ export async function wsProxy(
|
|||||||
|
|
||||||
_proxy.ws(req, req.ws, req.head, {
|
_proxy.ws(req, req.ws, req.head, {
|
||||||
ignorePath: true,
|
ignorePath: true,
|
||||||
target: getProxyTarget(req),
|
target: getProxyTarget(req, opts),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,15 @@ import * as express from "express"
|
|||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
import * as http from "http"
|
import * as http from "http"
|
||||||
import * as net from "net"
|
import * as net from "net"
|
||||||
|
import * as os from "os"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { WebsocketRequest } from "../../../typings/pluginapi"
|
|
||||||
import { logError } from "../../common/util"
|
import { logError } from "../../common/util"
|
||||||
import { CodeArgs, toCodeArgs } from "../cli"
|
import { CodeArgs, toCodeArgs } from "../cli"
|
||||||
import { isDevMode, vsRootPath } from "../constants"
|
import { isDevMode, vsRootPath } from "../constants"
|
||||||
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, replaceTemplates, self } from "../http"
|
import { authenticated, ensureAuthenticated, ensureOrigin, redirect, replaceTemplates, self } from "../http"
|
||||||
import { SocketProxyProvider } from "../socket"
|
import { SocketProxyProvider } from "../socket"
|
||||||
import { isFile } from "../util"
|
import { isFile } from "../util"
|
||||||
import { Router as WsRouter } from "../wsRouter"
|
import { type WebsocketRequest, Router as WsRouter } from "../wsRouter"
|
||||||
|
|
||||||
export const router = express.Router()
|
export const router = express.Router()
|
||||||
|
|
||||||
@@ -41,19 +41,29 @@ export interface IVSCodeServerAPI {
|
|||||||
*/
|
*/
|
||||||
export type VSCodeModule = {
|
export type VSCodeModule = {
|
||||||
// See ../../../lib/vscode/src/server-main.js:339.
|
// See ../../../lib/vscode/src/server-main.js:339.
|
||||||
loadCodeWithNls(): {
|
loadCodeWithNls(): Promise<{
|
||||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:72.
|
||||||
createServer(address: string | net.AddressInfo | null, args: CodeArgs): Promise<IVSCodeServerAPI>
|
createServer(address: string | net.AddressInfo | null, args: CodeArgs): Promise<IVSCodeServerAPI>
|
||||||
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
// See ../../../lib/vscode/src/vs/server/node/server.main.ts:65.
|
||||||
spawnCli(args: CodeArgs): Promise<void>
|
spawnCli(args: CodeArgs): Promise<void>
|
||||||
}
|
}>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load then create the VS Code server.
|
* Load then create the VS Code server.
|
||||||
*/
|
*/
|
||||||
async function loadVSCode(req: express.Request): Promise<IVSCodeServerAPI> {
|
async function loadVSCode(req: express.Request): Promise<IVSCodeServerAPI> {
|
||||||
const mod = require(path.join(vsRootPath, "out/server-main")) as VSCodeModule
|
// Since server-main.js is an ES module, we have to use `import`. However,
|
||||||
|
// tsc will transpile this to `require` unless we change our module type,
|
||||||
|
// which will also require that we switch to ESM, since a hybrid approach
|
||||||
|
// breaks importing `rotating-file-stream` for some reason. To work around
|
||||||
|
// this, use `eval` for now, but we should consider switching to ESM.
|
||||||
|
let modPath = path.join(vsRootPath, "out/server-main.js")
|
||||||
|
if (os.platform() === "win32") {
|
||||||
|
// On Windows, absolute paths of ESM modules must be a valid file URI.
|
||||||
|
modPath = "file:///" + modPath.replace(/\\/g, "/")
|
||||||
|
}
|
||||||
|
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
|
||||||
const serverModule = await mod.loadCodeWithNls()
|
const serverModule = await mod.loadCodeWithNls()
|
||||||
return serverModule.createServer(null, {
|
return serverModule.createServer(null, {
|
||||||
...(await toCodeArgs(req.args)),
|
...(await toCodeArgs(req.args)),
|
||||||
@@ -165,7 +175,7 @@ router.get("/manifest.json", async (req, res) => {
|
|||||||
const appName = req.args["app-name"] || "code-server"
|
const appName = req.args["app-name"] || "code-server"
|
||||||
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
res.writeHead(200, { "Content-Type": "application/manifest+json" })
|
||||||
|
|
||||||
return res.end(
|
res.end(
|
||||||
replaceTemplates(
|
replaceTemplates(
|
||||||
req,
|
req,
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export class SettingsProvider<T> {
|
|||||||
public async read(): Promise<T> {
|
public async read(): Promise<T> {
|
||||||
try {
|
try {
|
||||||
const raw = (await fs.readFile(this.settingsPath, "utf8")).trim()
|
const raw = (await fs.readFile(this.settingsPath, "utf8")).trim()
|
||||||
return raw ? JSON.parse(raw) : {}
|
return raw ? JSON.parse(raw) : ({} as T)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
if (error.code !== "ENOENT") {
|
if (error.code !== "ENOENT") {
|
||||||
logger.warn(error.message)
|
logger.warn(error.message)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export class SocketProxyProvider {
|
|||||||
proxy.once("connect", () => proxy.write(id))
|
proxy.once("connect", () => proxy.write(id))
|
||||||
|
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
listener.dispose() // eslint-disable-line @typescript-eslint/no-use-before-define
|
listener.dispose()
|
||||||
socket.destroy()
|
socket.destroy()
|
||||||
proxy.destroy()
|
proxy.destroy()
|
||||||
reject(new Error("TLS socket proxy timed out"))
|
reject(new Error("TLS socket proxy timed out"))
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ export async function makeEditorSessionManagerServer(
|
|||||||
): Promise<http.Server> {
|
): Promise<http.Server> {
|
||||||
const router = express()
|
const router = express()
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-named-as-default-member
|
|
||||||
router.use(express.json())
|
router.use(express.json())
|
||||||
|
|
||||||
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
router.get<{}, GetSessionResponse | string | unknown, undefined, { filePath?: string }>(
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
import * as express from "express"
|
import * as express from "express"
|
||||||
import * as expressCore from "express-serve-static-core"
|
import * as expressCore from "express-serve-static-core"
|
||||||
import * as http from "http"
|
import * as http from "http"
|
||||||
|
import * as stream from "stream"
|
||||||
import Websocket from "ws"
|
import Websocket from "ws"
|
||||||
import * as pluginapi from "../../typings/pluginapi"
|
|
||||||
|
export interface WebsocketRequest extends express.Request {
|
||||||
|
ws: stream.Duplex
|
||||||
|
head: Buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InternalWebsocketRequest extends WebsocketRequest {
|
||||||
|
_ws_handled: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export const handleUpgrade = (app: express.Express, server: http.Server): void => {
|
export const handleUpgrade = (app: express.Express, server: http.Server): void => {
|
||||||
server.on("upgrade", (req, socket, head) => {
|
server.on("upgrade", (req, socket, head) => {
|
||||||
@@ -22,9 +31,11 @@ export const handleUpgrade = (app: express.Express, server: http.Server): void =
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
interface InternalWebsocketRequest extends pluginapi.WebsocketRequest {
|
export type WebSocketHandler = (
|
||||||
_ws_handled: boolean
|
req: WebsocketRequest,
|
||||||
}
|
res: express.Response,
|
||||||
|
next: express.NextFunction,
|
||||||
|
) => void | Promise<void>
|
||||||
|
|
||||||
export class WebsocketRouter {
|
export class WebsocketRouter {
|
||||||
public readonly router = express.Router()
|
public readonly router = express.Router()
|
||||||
@@ -36,13 +47,13 @@ export class WebsocketRouter {
|
|||||||
* If the origin header exists it must match the host or the connection will
|
* If the origin header exists it must match the host or the connection will
|
||||||
* be prevented.
|
* be prevented.
|
||||||
*/
|
*/
|
||||||
public ws(route: expressCore.PathParams, ...handlers: pluginapi.WebSocketHandler[]): void {
|
public ws(route: expressCore.PathParams, ...handlers: WebSocketHandler[]): void {
|
||||||
this.router.get(
|
this.router.get(
|
||||||
route,
|
route,
|
||||||
...handlers.map((handler) => {
|
...handlers.map((handler) => {
|
||||||
const wrapped: express.Handler = (req, res, next) => {
|
const wrapped: express.Handler = (req, res, next) => {
|
||||||
;(req as InternalWebsocketRequest)._ws_handled = true
|
;(req as InternalWebsocketRequest)._ws_handled = true
|
||||||
return handler(req as pluginapi.WebsocketRequest, res, next)
|
return handler(req as WebsocketRequest, res, next)
|
||||||
}
|
}
|
||||||
return wrapped
|
return wrapped
|
||||||
}),
|
}),
|
||||||
@@ -54,5 +65,4 @@ export function Router(): WebsocketRouter {
|
|||||||
return new WebsocketRouter()
|
return new WebsocketRouter()
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line import/no-named-as-default-member -- the typings are not updated correctly
|
|
||||||
export const wss = new Websocket.Server({ noServer: true })
|
export const wss = new Websocket.Server({ noServer: true })
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
await fs.writeFile(tmpFilePath, "hello world")
|
await fs.writeFile(tmpFilePath, "hello world")
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
|
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(true)
|
||||||
})
|
})
|
||||||
@@ -73,10 +70,7 @@ describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-d
|
|||||||
await fs.writeFile(tmpFilePath, "Hello World")
|
await fs.writeFile(tmpFilePath, "Hello World")
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector("text=unique-file.txt")
|
await codeServerPage.openContextMenu("text=unique-file.txt")
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
|
expect(await codeServerPage.page.isVisible("text=Download...")).toBe(false)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,11 +11,9 @@ function runTestExtensionTests() {
|
|||||||
await codeServerPage.waitForTestExtensionLoaded()
|
await codeServerPage.waitForTestExtensionLoaded()
|
||||||
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
|
await codeServerPage.executeCommandViaMenus("code-server: Get proxy URI")
|
||||||
|
|
||||||
await codeServerPage.page.waitForSelector("text=proxyUri", { timeout: 3000 })
|
// Remove end slash in address.
|
||||||
const text = await codeServerPage.page.locator("text=proxyUri").first().textContent()
|
|
||||||
// Remove end slash in address
|
|
||||||
const normalizedAddress = address.replace(/\/+$/, "")
|
const normalizedAddress = address.replace(/\/+$/, "")
|
||||||
expect(text).toBe(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
|
await codeServerPage.page.getByText(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
41
test/e2e/extensions/test-extension/package-lock.json
generated
Normal file
41
test/e2e/extensions/test-extension/package-lock.json
generated
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "code-server-extension",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "code-server-extension",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/vscode": "^1.56.0",
|
||||||
|
"typescript": "^5.6.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"vscode": "^1.56.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/vscode": {
|
||||||
|
"version": "1.94.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz",
|
||||||
|
"integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "5.6.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
|
||||||
|
"integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/vscode": "^1.56.0",
|
"@types/vscode": "^1.56.0",
|
||||||
"typescript": "^4.0.5"
|
"typescript": "^5.6.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc"
|
"build": "tsc"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@types/vscode@^1.56.0":
|
|
||||||
version "1.57.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/vscode/-/vscode-1.57.0.tgz#cc648e0573b92f725cd1baf2621f8da9f8bc689f"
|
|
||||||
integrity sha512-FeznBFtIDCWRluojTsi9c3LLcCHOXP5etQfBK42+ixo1CoEAchkw39tuui9zomjZuKfUVL33KZUDIwHZ/xvOkQ==
|
|
||||||
|
|
||||||
typescript@^4.0.5:
|
|
||||||
version "4.3.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
|
|
||||||
integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
|
|
||||||
@@ -555,6 +555,15 @@ export class CodeServerPage {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open context menu on the specified selector.
|
||||||
|
*/
|
||||||
|
async openContextMenu(selector: string): Promise<void> {
|
||||||
|
const el = await this.page.waitForSelector(selector)
|
||||||
|
await el.click({ button: "right" })
|
||||||
|
await this.page.waitForSelector(".context-view-block")
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute a command in the root of the instance's workspace directory.
|
* Execute a command in the root of the instance's workspace directory.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,26 @@
|
|||||||
import { clean, getMaybeProxiedPathname } from "../utils/helpers"
|
import { clean, getMaybeProxiedPathname } from "../utils/helpers"
|
||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
const routes = ["/", "/vscode", "/vscode/"]
|
const routes = {
|
||||||
|
"/": [
|
||||||
|
/\.\/manifest.json/,
|
||||||
|
/\.\/_static\//,
|
||||||
|
/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
/http:\/\/localhost:[0-9]+\/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
],
|
||||||
|
"/vscode": [
|
||||||
|
/\.\/vscode\/manifest.json/,
|
||||||
|
/\.\/_static\//,
|
||||||
|
/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
/http:\/\/localhost:[0-9]+\/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
],
|
||||||
|
"/vscode/": [
|
||||||
|
/\.\/manifest.json/,
|
||||||
|
/\.\/\.\.\/_static\//,
|
||||||
|
/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
/http:\/\/localhost:[0-9]+\/vscode\/[a-z]+-[0-9a-z]+\/static\//,
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
||||||
const testName = "vscode-routes-default"
|
const testName = "vscode-routes-default"
|
||||||
@@ -10,7 +29,7 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test("should load all route variations", async ({ codeServerPage }) => {
|
test("should load all route variations", async ({ codeServerPage }) => {
|
||||||
for (const route of routes) {
|
for (const [route, matchers] of Object.entries(routes)) {
|
||||||
await codeServerPage.navigate(route)
|
await codeServerPage.navigate(route)
|
||||||
|
|
||||||
// Check there were no redirections
|
// Check there were no redirections
|
||||||
@@ -18,21 +37,16 @@ describe("VS Code Routes", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
const pathname = getMaybeProxiedPathname(url)
|
const pathname = getMaybeProxiedPathname(url)
|
||||||
expect(pathname).toBe(route)
|
expect(pathname).toBe(route)
|
||||||
|
|
||||||
// TODO@jsjoeio
|
// Check that assets are pointing to the right spot. Some will be
|
||||||
// now that we are in a proper browser instead of scraping the HTML we
|
// relative, without a leading dot (VS Code's assets). Some will be
|
||||||
// could possibly intercept requests to make sure assets are loading from
|
// relative with a leading dot (our assets). Others will have been
|
||||||
// the right spot.
|
// resolved against the origin.
|
||||||
//
|
const elements = await codeServerPage.page.locator("[src]").all()
|
||||||
// Check that page loaded from correct route
|
for (const element of elements) {
|
||||||
const html = await codeServerPage.page.innerHTML("html")
|
const src = await element.getAttribute("src")
|
||||||
switch (route) {
|
if (src && !matchers.some((m) => m.test(src))) {
|
||||||
case "/":
|
throw new Error(`${src} did not match any validators for route ${route}`)
|
||||||
case "/vscode/":
|
}
|
||||||
expect(html).toMatch(/src="\.\/[a-z]+-[0-9a-z]+\/static\//)
|
|
||||||
break
|
|
||||||
case "/vscode":
|
|
||||||
expect(html).toMatch(/src="\.\/vscode\/[a-z]+-[0-9a-z]+\/static\//)
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -85,7 +99,7 @@ describe("VS Code Routes with no workspace or folder", ["--disable-workspace-tru
|
|||||||
|
|
||||||
// If you visit again without query parameters it will re-attach them by
|
// If you visit again without query parameters it will re-attach them by
|
||||||
// redirecting. It should always redirect to the same route.
|
// redirecting. It should always redirect to the same route.
|
||||||
for (const route of routes) {
|
for (const route of Object.keys(routes)) {
|
||||||
await codeServerPage.navigate(route)
|
await codeServerPage.navigate(route)
|
||||||
const url = new URL(codeServerPage.page.url())
|
const url = new URL(codeServerPage.page.url())
|
||||||
const pathname = getMaybeProxiedPathname(url)
|
const pathname = getMaybeProxiedPathname(url)
|
||||||
|
|||||||
@@ -16,10 +16,8 @@ describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
|
|||||||
await fs.mkdir(tmpDirPath)
|
await fs.mkdir(tmpDirPath)
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
|
await codeServerPage.openContextMenu('span:has-text("test-directory")')
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true)
|
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -44,10 +42,7 @@ describe("Uploads (disabled)", ["--disable-workspace-trust", "--disable-file-upl
|
|||||||
await fs.mkdir(tmpDirPath)
|
await fs.mkdir(tmpDirPath)
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
const fileInExplorer = await codeServerPage.page.waitForSelector('span:has-text("test-directory")')
|
await codeServerPage.openContextMenu('span:has-text("test-directory")')
|
||||||
await fileInExplorer.click({
|
|
||||||
button: "right",
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false)
|
expect(await codeServerPage.page.isVisible("text=Upload...")).toBe(false)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -18,11 +18,8 @@ describe("Webviews", ["--disable-workspace-trust"], {}, () => {
|
|||||||
|
|
||||||
// It's an iframe within an iframe
|
// It's an iframe within an iframe
|
||||||
// so we have to do .frameLocator twice
|
// so we have to do .frameLocator twice
|
||||||
const renderedText = await codeServerPage.page
|
await expect(
|
||||||
.frameLocator("iframe.webview.ready")
|
codeServerPage.page.frameLocator("iframe.webview.ready").frameLocator("#active-frame").getByText("Hello world"),
|
||||||
.frameLocator("#active-frame")
|
).toBeVisible()
|
||||||
.locator("text=Hello world")
|
|
||||||
|
|
||||||
expect(renderedText).toBeVisible
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
5569
test/package-lock.json
generated
Normal file
5569
test/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user