Compare commits
No commits in common. "main" and "v4.20.0" have entirely different histories.
43
.eslintrc.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
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
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
# Prettier 3.4.2
|
|
||||||
9b0340a09276f93c054d705d1b9a5f24cc5dbc97
|
|
||||||
66
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
|
@ -1,5 +1,6 @@
|
||||||
name: Bug report
|
name: Bug report
|
||||||
description: File a bug report
|
description: File a bug report
|
||||||
|
title: "[Bug]: "
|
||||||
labels: ["bug", "triage"]
|
labels: ["bug", "triage"]
|
||||||
body:
|
body:
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
|
|
@ -9,7 +10,6 @@ body:
|
||||||
options:
|
options:
|
||||||
- label: I have searched the existing issues
|
- label: I have searched the existing issues
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: OS/Web Information
|
label: OS/Web Information
|
||||||
|
|
@ -20,8 +20,6 @@ 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:
|
||||||
|
|
@ -30,86 +28,55 @@ body:
|
||||||
- `code-server --version`:
|
- `code-server --version`:
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Steps to Reproduce
|
label: Steps to Reproduce
|
||||||
description: |
|
description: |
|
||||||
Please describe exactly how to reproduce the bug. For example:
|
1. open code-server
|
||||||
1. Open code-server in Firefox
|
2. install extension
|
||||||
2. Install extension `foo.bar` from the extensions sidebar
|
3. run command
|
||||||
3. Run command `foo.bar.baz`
|
|
||||||
value: |
|
value: |
|
||||||
1.
|
1.
|
||||||
2.
|
2.
|
||||||
3.
|
3.
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Expected
|
label: Expected
|
||||||
description: What should happen?
|
description: What should happen?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Actual
|
label: Actual
|
||||||
description: What actually happens?
|
description: What actually happens?
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
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 `npm install -g 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 `yarn global add code-server`).
|
||||||
render: shell
|
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Screenshot/Video
|
label: Screenshot/Video
|
||||||
description: Please include a screenshot, gif or screen recording of your issue.
|
description: Please include a screenshot, gif or screen recording of your issue.
|
||||||
validations:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
|
- type: checkboxes
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
attributes:
|
||||||
label: Does this bug reproduce in native VS Code?
|
label: Does this issue happen in VS Code or GitHub Codespaces?
|
||||||
description: If the bug reproduces in native VS Code, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
description: Please try reproducing this issue in VS Code and GitHub Codespaces. If the bug reproduces in either VS Code or GitHub Codespaces, please submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||||
options:
|
options:
|
||||||
- Yes, this is also broken in native VS Code
|
- label: I tested this in native VS Code.
|
||||||
- No, this works as expected in native VS Code
|
required: false
|
||||||
- This cannot be tested in native VS Code
|
- label: This does not happen in native VS Code.
|
||||||
- I did not test native VS Code
|
required: false
|
||||||
validations:
|
- label: I tested this in GitHub Codespaces.
|
||||||
required: true
|
required: false
|
||||||
|
- label: This does not happen in GitHub Codespaces.
|
||||||
- type: dropdown
|
required: false
|
||||||
attributes:
|
|
||||||
label: Does this bug reproduce in VS Code web?
|
|
||||||
description: If the bug reproduces in VS Code web, submit the issue upstream instead (https://github.com/microsoft/vscode). You can run VS Code web with `code serve-web`.
|
|
||||||
options:
|
|
||||||
- Yes, this is also broken in VS Code web
|
|
||||||
- No, this works as expected in VS Code web
|
|
||||||
- This cannot be tested in VS Code web
|
|
||||||
- I did not test VS Code web
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: dropdown
|
|
||||||
attributes:
|
|
||||||
label: Does this bug reproduce in GitHub Codespaces?
|
|
||||||
description: If the bug reproduces in GitHub Codespaces, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
|
||||||
options:
|
|
||||||
- Yes, this is also broken in GitHub Codespaces
|
|
||||||
- No, this works as expected in GitHub Codespaces
|
|
||||||
- This cannot be tested in GitHub Codespaces
|
|
||||||
- I did not test GitHub Codespaces
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
- type: checkboxes
|
- type: checkboxes
|
||||||
attributes:
|
attributes:
|
||||||
label: Are you accessing code-server over a secure context?
|
label: Are you accessing code-server over a secure context?
|
||||||
|
|
@ -117,7 +84,6 @@ body:
|
||||||
options:
|
options:
|
||||||
- label: I am using a secure context.
|
- label: I am using a secure context.
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Notes
|
label: Notes
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/doc.md
vendored
|
|
@ -1,7 +1,9 @@
|
||||||
---
|
---
|
||||||
name: Documentation improvement
|
name: Documentation improvement
|
||||||
about: Suggest a documentation improvement
|
about: Suggest a documentation improvement
|
||||||
|
title: "[Docs]: "
|
||||||
labels: "docs"
|
labels: "docs"
|
||||||
|
assignees: "@jsjoeio"
|
||||||
---
|
---
|
||||||
|
|
||||||
## What is your suggestion?
|
## What is your suggestion?
|
||||||
|
|
|
||||||
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
|
|
@ -1,7 +1,9 @@
|
||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea to improve code-server
|
about: Suggest an idea to improve code-server
|
||||||
|
title: "[Feat]: "
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
|
assignees: ""
|
||||||
---
|
---
|
||||||
|
|
||||||
## What is your suggestion?
|
## What is your suggestion?
|
||||||
|
|
|
||||||
17
.github/PULL_REQUEST_TEMPLATE/release_template.md
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<!-- 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)
|
||||||
29
.github/ranger.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Configuration for the repo ranger bot
|
||||||
|
# See docs: https://www.notion.so/Documentation-8d7627bb1f3c42b7b1820e8d6f157a57#9879d1374fab4d1f9c607c230fd5123d
|
||||||
|
default:
|
||||||
|
close:
|
||||||
|
# Default time to wait before closing the label. Can either be a number in milliseconds
|
||||||
|
# or a string specified by the `ms` package (https://www.npmjs.com/package/ms)
|
||||||
|
delay: "2 days"
|
||||||
|
|
||||||
|
# Default comment to post when an issue is first marked with a closing label
|
||||||
|
comment: "⚠️ This issue has been marked $LABEL and will be closed in $DELAY."
|
||||||
|
|
||||||
|
labels:
|
||||||
|
duplicate: close
|
||||||
|
wontfix: close
|
||||||
|
"squash when passing": merge
|
||||||
|
"rebase when passing": merge
|
||||||
|
"merge when passing": merge
|
||||||
|
"new contributor":
|
||||||
|
action: comment
|
||||||
|
delay: 5s
|
||||||
|
message: "Thanks for making your first contribution! :slightly_smiling_face:"
|
||||||
|
"upstream:vscode":
|
||||||
|
action: close
|
||||||
|
delay: 5s
|
||||||
|
comment: >
|
||||||
|
This issue has been marked as 'upstream:vscode'.
|
||||||
|
Please file this upstream: [link to open issue](https://github.com/microsoft/vscode/issues/new/choose)
|
||||||
|
|
||||||
|
This issue will automatically close in $DELAY.
|
||||||
430
.github/workflows/build.yaml
vendored
|
|
@ -19,278 +19,386 @@ 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 `npm install` if it successfully fetched from cache
|
# will skip running `yarn install` if it successfully fetched from cache
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
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:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Check changed files
|
|
||||||
uses: dorny/paths-filter@v3
|
|
||||||
id: filter
|
|
||||||
with:
|
|
||||||
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:
|
prettier:
|
||||||
name: Run prettier check
|
name: Format with Prettier
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- uses: actions/setup-node@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run prettier with actionsx/prettier
|
||||||
|
uses: actionsx/prettier@v3
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
args: --check --loglevel=warn .
|
||||||
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-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
needs: changes
|
|
||||||
if: needs.changes.outputs.docs == 'true'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- uses: actions/setup-node@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v40
|
||||||
|
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: npm
|
cache: "yarn"
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
- name: Install doctoc
|
||||||
test/package-lock.json
|
run: yarn global add doctoc@2.2.1
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
- run: npm run doctoc
|
- name: 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-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
needs: changes
|
|
||||||
if: needs.changes.outputs.helm == 'true'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- uses: azure/setup-helm@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v40
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
ci/helm-chart/**
|
||||||
|
|
||||||
|
- name: Install helm
|
||||||
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
|
uses: azure/setup-helm@v3.5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
|
||||||
- run: helm kubeval ci/helm-chart
|
- name: Install helm kubeval plugin
|
||||||
|
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-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
needs: changes
|
|
||||||
if: needs.changes.outputs.code == 'true'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- uses: actions/setup-node@v6
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v40
|
||||||
|
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
|
|
||||||
cache-dependency-path: |
|
- name: Fetch dependencies from cache
|
||||||
package-lock.json
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
test/package-lock.json
|
id: cache-node-modules
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
uses: actions/cache@v3
|
||||||
- run: npm run lint:ts
|
with:
|
||||||
|
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@v6
|
uses: actions/checkout@v4
|
||||||
- name: Check workflow files
|
- name: Check workflow files
|
||||||
run: |
|
run: |
|
||||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9
|
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
|
||||||
./actionlint -color -shellcheck= -ignore "softprops/action-gh-release"
|
./actionlint -color -shellcheck= -ignore "set-output"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
test-unit:
|
test-unit:
|
||||||
name: Run unit tests
|
name: Run unit tests
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
needs: changes
|
|
||||||
if: needs.changes.outputs.code == 'true'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- uses: actions/setup-node@v6
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v40
|
||||||
|
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
|
|
||||||
cache-dependency-path: |
|
- name: Fetch dependencies from cache
|
||||||
package-lock.json
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
test/package-lock.json
|
id: cache-node-modules
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
uses: actions/cache@v3
|
||||||
- run: npm run test:unit
|
with:
|
||||||
- uses: codecov/codecov-action@v5
|
path: "**/node_modules"
|
||||||
if: success()
|
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: 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@v3
|
||||||
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-22.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 70
|
timeout-minutes: 60
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
DISABLE_V8_COMPILE_CACHE: 1
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
|
||||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
- name: Install system dependencies
|
||||||
|
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
|
|
||||||
- uses: actions/setup-node@v6
|
- name: Patch Code
|
||||||
|
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
|
|
||||||
cache-dependency-path: |
|
- name: Fetch dependencies from cache
|
||||||
package-lock.json
|
id: cache-node-modules
|
||||||
test/package-lock.json
|
uses: actions/cache@v3
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
with:
|
||||||
- run: npm run build
|
path: "**/node_modules"
|
||||||
|
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
|
||||||
# force a rebuild.
|
# force a rebuild.
|
||||||
- name: Fetch prebuilt Code package from cache
|
- name: Fetch prebuilt Code package from cache
|
||||||
id: cache-vscode
|
id: cache-vscode
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
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: |
|
run: yarn build:vscode
|
||||||
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.
|
||||||
- run: npm run release
|
- name: Create release package
|
||||||
|
run: yarn release
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
- run: tar -czf package.tar.gz release
|
- name: Compress release package
|
||||||
- uses: actions/upload-artifact@v4
|
run: tar -czf package.tar.gz release
|
||||||
|
|
||||||
|
- name: Upload npm package artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
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
|
||||||
runs-on: ubuntu-22.04
|
needs: build
|
||||||
|
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:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v6
|
|
||||||
|
- 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
|
|
||||||
cache-dependency-path: |
|
- name: Fetch dependencies from cache
|
||||||
package-lock.json
|
id: cache-node-modules
|
||||||
test/package-lock.json
|
uses: actions/cache@v3
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
with:
|
||||||
- uses: actions/download-artifact@v5
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Download npm package
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
- name: Decompress npm package
|
||||||
|
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
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Run end-to-end tests
|
||||||
|
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
|
||||||
|
|
||||||
|
- name: Upload test artifacts
|
||||||
if: always()
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
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
|
||||||
runs-on: ubuntu-22.04
|
needs: build
|
||||||
|
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:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout repo
|
||||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v6
|
|
||||||
|
- 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
|
|
||||||
cache-dependency-path: |
|
- name: Fetch dependencies from cache
|
||||||
package-lock.json
|
id: cache-node-modules
|
||||||
test/package-lock.json
|
uses: actions/cache@v3
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
with:
|
||||||
- uses: actions/download-artifact@v5
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Download npm package
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
- run: tar -xzf package.tar.gz
|
|
||||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
- name: Decompress npm package
|
||||||
|
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@v3
|
||||||
id: caddy-cache
|
id: caddy-cache
|
||||||
with:
|
with:
|
||||||
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 }}
|
||||||
|
|
@ -299,13 +407,23 @@ 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
|
|
||||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
|
||||||
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
|
||||||
if: always()
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- name: Start Caddy
|
||||||
|
run: sudo ~/.cache/caddy/caddy start --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
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
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
|
||||||
|
|
|
||||||
6
.github/workflows/installer.yaml
vendored
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
|
|
@ -44,7 +44,7 @@ jobs:
|
||||||
container: "alpine:3.17"
|
container: "alpine:3.17"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install curl
|
- name: Install curl
|
||||||
run: apk add curl
|
run: apk add curl
|
||||||
|
|
@ -67,7 +67,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
|
|
|
||||||
78
.github/workflows/publish.yaml
vendored
|
|
@ -21,39 +21,78 @@ 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:
|
||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
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.12
|
uses: robinraju/release-downloader@v1.8
|
||||||
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"
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
# 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="${{ 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
|
||||||
|
|
||||||
- run: npm run publish:npm
|
- name: Publish npm package and tag with "latest"
|
||||||
|
run: yarn publish:npm
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
NPM_ENVIRONMENT: "production"
|
NPM_ENVIRONMENT: "production"
|
||||||
|
|
||||||
|
homebrew:
|
||||||
|
needs: npm
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Ensure things are up to date
|
||||||
|
# Suggested by homebrew maintainers
|
||||||
|
# https://github.com/Homebrew/discussions/discussions/1532#discussioncomment-782633
|
||||||
|
- name: Set up Homebrew
|
||||||
|
id: set-up-homebrew
|
||||||
|
uses: Homebrew/actions/setup-homebrew@master
|
||||||
|
|
||||||
|
- name: Checkout code-server
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config --global user.name cdrci
|
||||||
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
|
# 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="${{ github.event.inputs.version || github.ref_name }}"
|
||||||
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Bump code-server homebrew version
|
||||||
|
env:
|
||||||
|
VERSION: ${{ env.VERSION }}
|
||||||
|
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
|
||||||
|
|
||||||
|
run: ./ci/steps/brew-bump.sh
|
||||||
|
|
||||||
aur:
|
aur:
|
||||||
|
needs: npm
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
|
|
@ -62,13 +101,13 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
# We need to checkout code-server so we can get the version
|
# We need to checkout code-server so we can get the version
|
||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: "./code-server"
|
path: "./code-server"
|
||||||
|
|
||||||
- name: Checkout code-server-aur repo
|
- name: Checkout code-server-aur repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: "cdrci/code-server-aur"
|
repository: "cdrci/code-server-aur"
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
|
|
@ -85,14 +124,15 @@ jobs:
|
||||||
git config --global user.name cdrci
|
git config --global user.name cdrci
|
||||||
git config --global user.email opensource@coder.com
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
# 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="${{ 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.4.0
|
uses: hapakaien/archlinux-package-action@v2
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
with:
|
with:
|
||||||
|
|
@ -111,12 +151,11 @@ 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-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
@ -137,28 +176,21 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
# 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="${{ 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 release artifacts
|
||||||
uses: robinraju/release-downloader@v1.12
|
uses: robinraju/release-downloader@v1.8
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ env.VERSION }}
|
||||||
fileName: "*.deb"
|
fileName: "*.deb"
|
||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- name: Download rpm artifacts
|
|
||||||
uses: robinraju/release-downloader@v1.12
|
|
||||||
with:
|
|
||||||
repository: "coder/code-server"
|
|
||||||
tag: v${{ env.VERSION }}
|
|
||||||
fileName: "*.rpm"
|
|
||||||
out-file-path: "release-packages"
|
|
||||||
|
|
||||||
- name: Publish to Docker
|
- name: Publish to Docker
|
||||||
run: ./ci/steps/docker-buildx-push.sh
|
run: ./ci/steps/docker-buildx-push.sh
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
237
.github/workflows/release.yaml
vendored
|
|
@ -19,27 +19,102 @@ concurrency:
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
package-linux-cross:
|
# TODO: cache building yarn --production
|
||||||
name: ${{ matrix.prefix }}
|
# possibly 2m30s of savings(?)
|
||||||
|
# this requires refactoring our release scripts
|
||||||
|
package-linux-amd64:
|
||||||
|
name: x86-64 Linux build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
needs: npm-version
|
needs: npm-version
|
||||||
container: "python:3.8-slim-buster"
|
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@v3
|
||||||
|
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@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
# 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@v1
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
discussion_category_name: "📣 Announcements"
|
||||||
|
files: ./release-packages/*
|
||||||
|
|
||||||
|
package-linux-cross:
|
||||||
|
name: Linux cross-compile builds
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
needs: npm-version
|
||||||
|
container: "debian: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) }}
|
||||||
|
|
@ -53,29 +128,23 @@ 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
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
|
|
||||||
- name: Install cross-compiler and system dependencies
|
- name: Install cross-compiler and system dependencies
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
|
|
||||||
dpkg --add-architecture $TARGET_ARCH
|
dpkg --add-architecture $TARGET_ARCH
|
||||||
apt update && apt install -y --no-install-recommends \
|
apt-get update && apt-get 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 \
|
||||||
|
|
@ -85,8 +154,6 @@ 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
|
||||||
|
|
@ -94,12 +161,15 @@ jobs:
|
||||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Download npm package
|
- name: Download npm package
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
- name: Decompress npm package
|
||||||
- run: npm run release:standalone
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
|
- 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: |
|
||||||
|
|
@ -108,15 +178,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
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
# 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 }}"
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- env:
|
- name: Build packages with nfpm
|
||||||
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: npm run package $PKG_ARCH
|
run: npm run package ${npm_config_arch}
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
- uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -126,87 +198,17 @@ jobs:
|
||||||
|
|
||||||
package-macos-amd64:
|
package-macos-amd64:
|
||||||
name: x86-64 macOS build
|
name: x86-64 macOS build
|
||||||
runs-on: macos-15-intel
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- name: Install Node.js
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version-file: .node-version
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
|
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
|
|
||||||
- name: Install 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@v5
|
|
||||||
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:
|
|
||||||
draft: true
|
|
||||||
discussion_category_name: "📣 Announcements"
|
|
||||||
files: ./release-packages/*
|
|
||||||
|
|
||||||
package-macos-arm64:
|
|
||||||
name: arm64 macOS build
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
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@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: |
|
|
||||||
package-lock.json
|
|
||||||
test/package-lock.json
|
|
||||||
|
|
||||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -218,18 +220,28 @@ 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.
|
||||||
- run: brew install python-setuptools
|
- name: Install Python utilities
|
||||||
|
run: python3 -m pip install setuptools
|
||||||
|
|
||||||
- name: Download npm package
|
- name: Download npm package
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
- name: Decompress npm package
|
||||||
- run: npm run release:standalone
|
run: tar -xzf package.tar.gz
|
||||||
- run: npm run test:native
|
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
- name: Build standalone release
|
||||||
|
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 }}"
|
||||||
|
|
@ -238,7 +250,7 @@ jobs:
|
||||||
- name: Build packages with nfpm
|
- name: Build packages with nfpm
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: npm run package
|
run: yarn package
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
- uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -253,7 +265,7 @@ jobs:
|
||||||
needs: npm-version
|
needs: npm-version
|
||||||
steps:
|
steps:
|
||||||
- name: Download npm package
|
- name: Download npm package
|
||||||
uses: actions/download-artifact@v5
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
|
|
||||||
|
|
@ -269,7 +281,7 @@ jobs:
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: dawidd6/action-download-artifact@v11
|
uses: dawidd6/action-download-artifact@v2
|
||||||
id: download
|
id: download
|
||||||
with:
|
with:
|
||||||
branch: ${{ github.ref }}
|
branch: ${{ github.ref }}
|
||||||
|
|
@ -279,9 +291,11 @@ jobs:
|
||||||
check_artifacts: false
|
check_artifacts: false
|
||||||
if_no_artifact_found: fail
|
if_no_artifact_found: fail
|
||||||
|
|
||||||
- run: tar -xzf package.tar.gz
|
- name: Decompress npm package
|
||||||
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
# 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 }}"
|
||||||
|
|
@ -300,10 +314,11 @@ 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
|
||||||
|
|
||||||
- run: tar -czf package.tar.gz release
|
- name: Compress release package
|
||||||
|
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@v3
|
||||||
with:
|
with:
|
||||||
name: npm-release-package
|
name: npm-release-package
|
||||||
path: ./package.tar.gz
|
path: ./package.tar.gz
|
||||||
|
|
|
||||||
4
.github/workflows/scripts.yaml
vendored
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
container: "alpine:3.17"
|
container: "alpine:3.17"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install test utilities
|
- name: Install test utilities
|
||||||
run: apk add bats checkbashisms
|
run: apk add bats checkbashisms
|
||||||
|
|
@ -58,7 +58,7 @@ jobs:
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install lint utilities
|
- name: Install lint utilities
|
||||||
run: sudo apt install shellcheck
|
run: sudo apt install shellcheck
|
||||||
|
|
|
||||||
30
.github/workflows/security.yaml
vendored
|
|
@ -19,23 +19,27 @@ concurrency:
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
audit:
|
audit-ci:
|
||||||
name: Audit node modules
|
name: Audit node modules
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v4
|
||||||
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 audit
|
run: npm shrinkwrap && npm audit
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
trivy-scan-repo:
|
trivy-scan-repo:
|
||||||
|
|
@ -43,15 +47,15 @@ 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-22.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in repo mode
|
- name: Run Trivy vulnerability scanner in repo mode
|
||||||
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
|
uses: aquasecurity/trivy-action@2b6a709cf9c4025c5438138008beaddbb02086f0
|
||||||
with:
|
with:
|
||||||
scan-type: "fs"
|
scan-type: "fs"
|
||||||
scan-ref: "."
|
scan-ref: "."
|
||||||
|
|
@ -62,7 +66,7 @@ jobs:
|
||||||
severity: "HIGH,CRITICAL"
|
severity: "HIGH,CRITICAL"
|
||||||
|
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
with:
|
with:
|
||||||
sarif_file: "trivy-repo-results.sarif"
|
sarif_file: "trivy-repo-results.sarif"
|
||||||
|
|
||||||
|
|
@ -72,21 +76,21 @@ 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-22.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v3
|
uses: github/codeql-action/init@v2
|
||||||
with:
|
with:
|
||||||
config-file: ./.github/codeql-config.yml
|
config-file: ./.github/codeql-config.yml
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v3
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v3
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|
|
||||||
8
.github/workflows/trivy-docker.yaml
vendored
|
|
@ -44,14 +44,14 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
trivy-scan-image:
|
trivy-scan-image:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in image mode
|
- name: Run Trivy vulnerability scanner in image mode
|
||||||
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
|
uses: aquasecurity/trivy-action@2b6a709cf9c4025c5438138008beaddbb02086f0
|
||||||
with:
|
with:
|
||||||
image-ref: "docker.io/codercom/code-server:latest"
|
image-ref: "docker.io/codercom/code-server:latest"
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
|
|
@ -60,6 +60,6 @@ jobs:
|
||||||
severity: "HIGH,CRITICAL"
|
severity: "HIGH,CRITICAL"
|
||||||
|
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
uses: github/codeql-action/upload-sarif@v3
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
with:
|
with:
|
||||||
sarif_file: "trivy-image-results.sarif"
|
sarif_file: "trivy-image-results.sarif"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
22.21.1
|
18.15.0
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,3 @@ 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>> npm\n\n3. Start development mode (and watch for changes):\n>> npm run 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>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn 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 `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)"
|
"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)"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
546
CHANGELOG.md
|
|
@ -22,551 +22,6 @@ Code v99.99.999
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
Code v1.107.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.107.0
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- New `--cookie-suffix` flag that can be used to add a suffix to the cookie when
|
|
||||||
using the built-in password authentication. You can use this to avoid
|
|
||||||
collisions with other instances of code-server.
|
|
||||||
- Support a new property `authorizationHeaderToken` on the extension gallery
|
|
||||||
configuration. This will be added to marketplace requests as a bearer token
|
|
||||||
using the `Authorization` header.
|
|
||||||
|
|
||||||
## [4.106.3](https://github.com/coder/code-server/releases/tag/v4.106.3) - 2025-12-01
|
|
||||||
|
|
||||||
Code v1.106.3
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.106.3
|
|
||||||
|
|
||||||
## [4.106.2](https://github.com/coder/code-server/releases/tag/v4.106.2) - 2025-11-19
|
|
||||||
|
|
||||||
Code v1.106.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.106.2
|
|
||||||
|
|
||||||
## [4.106.0](https://github.com/coder/code-server/releases/tag/v4.106.0) - 2025-11-19
|
|
||||||
|
|
||||||
Code v1.106.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.106.0
|
|
||||||
|
|
||||||
## [4.105.1](https://github.com/coder/code-server/releases/tag/v4.105.1) - 2025-10-20
|
|
||||||
|
|
||||||
Code v1.105.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.105.1
|
|
||||||
|
|
||||||
## [4.105.0](https://github.com/coder/code-server/releases/tag/v4.105.0) - 2025-10-17
|
|
||||||
|
|
||||||
Code v1.105.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.105.0
|
|
||||||
|
|
||||||
## [4.104.3](https://github.com/coder/code-server/releases/tag/v4.104.3) - 2025-10-07
|
|
||||||
|
|
||||||
Code v1.104.3
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.104.3.
|
|
||||||
|
|
||||||
## [4.104.2](https://github.com/coder/code-server/releases/tag/v4.104.2) - 2025-09-26
|
|
||||||
|
|
||||||
Code v1.104.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.104.2.
|
|
||||||
|
|
||||||
## [4.104.1](https://github.com/coder/code-server/releases/tag/v4.104.1) - 2025-09-19
|
|
||||||
|
|
||||||
Code v1.104.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.104.1.
|
|
||||||
|
|
||||||
## [4.104.0](https://github.com/coder/code-server/releases/tag/v4.104.0) - 2025-09-15
|
|
||||||
|
|
||||||
Code v1.104.0
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix "extension not found" errors from Open VSX when trying to install the
|
|
||||||
latest version of an extension.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.104.0.
|
|
||||||
|
|
||||||
## [4.103.2](https://github.com/coder/code-server/releases/tag/v4.103.2) - 2025-08-25
|
|
||||||
|
|
||||||
Code v1.103.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.103.2.
|
|
||||||
|
|
||||||
## [4.103.1](https://github.com/coder/code-server/releases/tag/v4.103.1) - 2025-08-15
|
|
||||||
|
|
||||||
Code v1.103.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.103.1.
|
|
||||||
|
|
||||||
## [4.103.0](https://github.com/coder/code-server/releases/tag/v4.103.0) - 2025-08-12
|
|
||||||
|
|
||||||
Code v1.103.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.103.0.
|
|
||||||
|
|
||||||
## [4.102.2](https://github.com/coder/code-server/releases/tag/v4.102.2) - 2025-07-24
|
|
||||||
|
|
||||||
Code v1.102.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.102.2.
|
|
||||||
|
|
||||||
## [4.102.1](https://github.com/coder/code-server/releases/tag/v4.102.1) - 2025-07-17
|
|
||||||
|
|
||||||
Code v1.102.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.102.1.
|
|
||||||
|
|
||||||
## [4.102.0](https://github.com/coder/code-server/releases/tag/v4.102.0) - 2025-07-16
|
|
||||||
|
|
||||||
Code v1.102.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.102.0.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Custom strings can be configured using the `--i18n` flag set to a JSON
|
|
||||||
file. This can be used for either translation (and can be used alongside
|
|
||||||
`--locale`) or for customizing the strings. See
|
|
||||||
[./src/node/i18n/locales/en.json](./src/node/i18n/locales/en.json) for the
|
|
||||||
available keys.
|
|
||||||
|
|
||||||
## [4.101.2](https://github.com/coder/code-server/releases/tag/v4.101.2) - 2025-06-25
|
|
||||||
|
|
||||||
Code v1.101.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.101.2.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix web views not loading due to 401 when requesting the service worker.
|
|
||||||
|
|
||||||
## [4.101.1](https://github.com/coder/code-server/releases/tag/v4.101.1) - 2025-06-20
|
|
||||||
|
|
||||||
Code v1.101.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.101.1.
|
|
||||||
|
|
||||||
## [4.101.0](https://github.com/coder/code-server/releases/tag/v4.101.0) - 2025-06-20
|
|
||||||
|
|
||||||
Code v1.101.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Update to Code 1.101.0.
|
|
||||||
|
|
||||||
## [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
|
|
||||||
|
|
||||||
### Breaking changes
|
|
||||||
|
|
||||||
- Dropped a patch that changed the compile target from es2022 to es2020 because
|
|
||||||
it no longer works with the way VS Code uses static properties. This may break
|
|
||||||
older browsers, so those browsers will either have to be updated or use an
|
|
||||||
older version of code-server.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.92.2.
|
|
||||||
|
|
||||||
## [4.91.0](https://github.com/coder/code-server/releases/tag/v4.91.0) - 2024-07-10
|
|
||||||
|
|
||||||
Code v1.91.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.91.0.
|
|
||||||
|
|
||||||
## [4.90.3](https://github.com/coder/code-server/releases/tag/v4.90.3) - 2024-06-21
|
|
||||||
|
|
||||||
Code v1.90.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.90.2.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- When the log gets rotated it will no longer incorrectly be moved to a new
|
|
||||||
directory created in the current working directory named with a date.
|
|
||||||
Instead, the file itself is prepended with the date and kept in the same
|
|
||||||
directory, as originally intended.
|
|
||||||
|
|
||||||
## [4.90.2](https://github.com/coder/code-server/releases/tag/v4.90.2) - 2024-06-14
|
|
||||||
|
|
||||||
Code v1.90.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.90.1.
|
|
||||||
|
|
||||||
## [4.90.1](https://github.com/coder/code-server/releases/tag/v4.90.1) - 2024-06-12
|
|
||||||
|
|
||||||
Code v1.90.0
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Cache a call to get CPU information used in telemetry that could result in a
|
|
||||||
lack responsiveness if it was particularly slow.
|
|
||||||
|
|
||||||
## [4.90.0](https://github.com/coder/code-server/releases/tag/v4.90.0) - 2024-06-11
|
|
||||||
|
|
||||||
Code v1.90.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.90.0.
|
|
||||||
- Updated Node to 20.11.1.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Send contents to the clipboard in the integrated terminal by piping to
|
|
||||||
`code-server --stdin-to-clipboard` or `code-server -c`.
|
|
||||||
|
|
||||||
You may want to make this an alias:
|
|
||||||
|
|
||||||
```
|
|
||||||
alias xclip="code-server --stdin-to-clipboard"
|
|
||||||
echo -n "hello world" | xclip
|
|
||||||
```
|
|
||||||
|
|
||||||
## [4.89.1](https://github.com/coder/code-server/releases/tag/v4.89.1) - 2024-04-14
|
|
||||||
|
|
||||||
Code v1.89.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.89.1.
|
|
||||||
|
|
||||||
## [4.89.0](https://github.com/coder/code-server/releases/tag/v4.89.0) - 2024-04-08
|
|
||||||
|
|
||||||
Code v1.89.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.89.0.
|
|
||||||
|
|
||||||
## [4.23.1](https://github.com/coder/code-server/releases/tag/v4.23.1) - 2024-04-15
|
|
||||||
|
|
||||||
Code v1.88.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.88.1.
|
|
||||||
|
|
||||||
## [4.23.0](https://github.com/coder/code-server/releases/tag/v4.23.0) - 2024-04-08
|
|
||||||
|
|
||||||
Code v1.88.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.88.0.
|
|
||||||
- Updated Node to 18.18.2.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix masking the exit code when failing to install extensions on the command
|
|
||||||
line outside the integrated terminal. Installing extensions inside the
|
|
||||||
integrated terminal still masks the exit code and is an upstream bug.
|
|
||||||
|
|
||||||
## [4.22.1](https://github.com/coder/code-server/releases/tag/v4.22.1) - 2024-03-14
|
|
||||||
|
|
||||||
Code v1.87.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.87.2.
|
|
||||||
- Enable keep-alive for proxy agent.
|
|
||||||
|
|
||||||
## [4.22.0](https://github.com/coder/code-server/releases/tag/v4.22.0) - 2024-03-03
|
|
||||||
|
|
||||||
Code v1.87.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.87.0.
|
|
||||||
|
|
||||||
## [4.21.2](https://github.com/coder/code-server/releases/tag/v4.21.2) - 2024-02-28
|
|
||||||
|
|
||||||
Code v1.86.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.86.2.
|
|
||||||
|
|
||||||
## [4.21.1](https://github.com/coder/code-server/releases/tag/v4.21.1) - 2024-02-09
|
|
||||||
|
|
||||||
Code v1.86.1
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.86.1.
|
|
||||||
- Updated to Node 18.17.1.
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Docker images for Fedora and openSUSE.
|
|
||||||
|
|
||||||
## [4.21.0](https://github.com/coder/code-server/releases/tag/v4.21.0) - 2024-02-05
|
|
||||||
|
|
||||||
Code v1.86.0
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.86.0.
|
|
||||||
|
|
||||||
## [4.20.1](https://github.com/coder/code-server/releases/tag/v4.20.1) - 2024-01-22
|
|
||||||
|
|
||||||
Code v1.85.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.85.2.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Query variables are no longer double-encoded when going over the path proxy.
|
|
||||||
|
|
||||||
## [4.20.0](https://github.com/coder/code-server/releases/tag/v4.20.0) - 2023-12-21
|
|
||||||
|
|
||||||
Code v1.85.1
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- New flag `--disable-file-uploads` to disable uploading files to the remote by
|
|
||||||
drag and drop and to disable opening local files via the "show local" button
|
|
||||||
in the file open prompt. Note that you can still open local files by drag and
|
|
||||||
dropping the file onto the editor pane.
|
|
||||||
- Added `wget` to the release image.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated to Code 1.85.1.
|
|
||||||
- The `--disable-file-downloads` flag will now disable the "show local" button
|
|
||||||
in the file save prompt as well.
|
|
||||||
- Debian release image updated to use Bookworm.
|
|
||||||
|
|
||||||
## [4.19.1](https://github.com/coder/code-server/releases/tag/v4.19.1) - 2023-11-29
|
## [4.19.1](https://github.com/coder/code-server/releases/tag/v4.19.1) - 2023-11-29
|
||||||
|
|
||||||
Code v1.84.2
|
Code v1.84.2
|
||||||
|
|
@ -926,6 +381,7 @@ Code v1.68.1
|
||||||
would be accessible at `my.domain/proxy/8000/` without any authentication.
|
would be accessible at `my.domain/proxy/8000/` without any authentication.
|
||||||
|
|
||||||
If all of the following apply to you please update as soon as possible:
|
If all of the following apply to you please update as soon as possible:
|
||||||
|
|
||||||
- You run code-server with the built-in password authentication.
|
- You run code-server with the built-in password authentication.
|
||||||
- You run unprotected HTTP services on ports accessible by code-server.
|
- You run unprotected HTTP services on ports accessible by code-server.
|
||||||
|
|
||||||
|
|
|
||||||
42
ci/README.md
|
|
@ -16,18 +16,20 @@ 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) (`npm run fmt`)
|
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
|
||||||
- Runs formatters.
|
- Runs formatters.
|
||||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`npm run lint`)
|
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
|
||||||
- Runs linters.
|
- Runs linters.
|
||||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`npm run test:unit`)
|
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`yarn test:unit`)
|
||||||
- Runs unit tests.
|
- Runs unit tests.
|
||||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`npm run test:e2e`)
|
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`yarn test:e2e`)
|
||||||
- Runs end-to-end tests.
|
- Runs end-to-end tests.
|
||||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`npm run watch`)
|
- [./ci/dev/ci.sh](./dev/ci.sh) (`yarn ci`)
|
||||||
|
- Runs `yarn fmt`, `yarn lint` and `yarn test`.
|
||||||
|
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
||||||
- Starts a process to build and launch code-server and restart on any code changes.
|
- Starts a process to build and launch code-server and restart on any code changes.
|
||||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
||||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`npm run icons`)
|
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`yarn icons`)
|
||||||
- Generates the various icons from a single `.svg` favicon in
|
- Generates the various icons from a single `.svg` favicon in
|
||||||
`src/browser/media/favicon.svg`.
|
`src/browser/media/favicon.svg`.
|
||||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
- Requires [imagemagick](https://imagemagick.org/index.php)
|
||||||
|
|
@ -37,20 +39,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) (`npm run build`)
|
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`yarn 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) (`npm run build:vscode`)
|
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`yarn 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) (`npm run release`)
|
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||||
- [./ci/build/clean.sh](./build/clean.sh) (`npm run clean`)
|
- [./ci/build/clean.sh](./build/clean.sh) (`yarn 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) (`npm run test:standalone-release`)
|
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`yarn 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) (`npm run package`)
|
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn 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 +61,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) (`npm run release:github-draft`)
|
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`yarn 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) (`npm run release:github-assets`)
|
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`yarn 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`npm run release`.
|
- Bundled by`yarn release`.
|
||||||
|
|
||||||
## release-image
|
## release-image
|
||||||
|
|
||||||
|
|
@ -87,15 +89,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 `npm run fmt`.
|
- Runs `yarn fmt`.
|
||||||
- [./steps/lint.sh](./steps/lint.sh)
|
- [./steps/lint.sh](./steps/lint.sh)
|
||||||
- Runs `npm run lint`.
|
- Runs `yarn lint`.
|
||||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||||
- Runs `npm run test:unit`.
|
- Runs `yarn test:unit`.
|
||||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||||
- Runs `npm run test:integration`.
|
- Runs `yarn test:integration`.
|
||||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||||
- Runs `npm run test:e2e`.
|
- Runs `yarn 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,10 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Given a platform-specific release found in ./release-standalone, generate an
|
# Packages code-server for the current OS and architecture into ./release-packages.
|
||||||
# compressed archives and bundles (as appropriate for the platform) named after
|
# This script assumes that a standalone release is built already into ./release-standalone
|
||||||
# the platform's architecture and OS and place them in ./release-packages and
|
|
||||||
# ./release-gcp.
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
|
|
@ -52,6 +50,11 @@ release_nfpm() {
|
||||||
|
|
||||||
export NFPM_ARCH
|
export NFPM_ARCH
|
||||||
|
|
||||||
|
# Code deletes some files from the extension node_modules directory which
|
||||||
|
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
||||||
|
# on these broken symlinks so clean them up.
|
||||||
|
rm -fr "./release-standalone/lib/vscode/extensions/node_modules/.bin"
|
||||||
|
|
||||||
PKG_FORMAT="deb"
|
PKG_FORMAT="deb"
|
||||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
||||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Once both code-server and VS Code have been built, use this script to copy
|
# This script requires vscode to be built with matching MINIFY.
|
||||||
# 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 VS Code is bundled. It must match the value
|
# MINIFY controls whether minified vscode is bundled.
|
||||||
# used when VS Code was built.
|
|
||||||
MINIFY="${MINIFY-true}"
|
MINIFY="${MINIFY-true}"
|
||||||
|
|
||||||
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
|
||||||
|
# to run first.
|
||||||
KEEP_MODULES="${KEEP_MODULES-0}"
|
KEEP_MODULES="${KEEP_MODULES-0}"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
@ -44,8 +41,12 @@ 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] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
jq --slurp '.[0] * .[1]' package.json <(
|
||||||
cat << EOF
|
cat << EOF
|
||||||
{
|
{
|
||||||
"commit": "$(git rev-parse HEAD)",
|
"commit": "$(git rev-parse HEAD)",
|
||||||
|
|
@ -87,50 +88,49 @@ bundle_vscode() {
|
||||||
|
|
||||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
||||||
|
|
||||||
# Merge the package.json for the web/remote server so we can include
|
# Use the package.json for the web/remote server. It does not have the right
|
||||||
# dependencies, since we want to ship this via NPM.
|
# version though so pull that from the main package.json.
|
||||||
jq --slurp '.[0] * .[1]' \
|
jq --slurp '.[0] * {version: .[1].version}' \
|
||||||
"$VSCODE_SRC_PATH/remote/package.json" \
|
"$VSCODE_SRC_PATH/remote/package.json" \
|
||||||
"$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged"
|
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
||||||
mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json"
|
|
||||||
cp "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
mv "$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"
|
||||||
cp "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
mv "$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() {
|
||||||
# package-lock.json files (used to ensure deterministic versions of
|
# yarn.lock or package-lock.json files (used to ensure deterministic versions of dependencies) are
|
||||||
# dependencies) are not packaged when publishing to the NPM registry.
|
# not packaged when publishing to the NPM registry.
|
||||||
#
|
# To ensure deterministic dependency versions (even when code-server is installed with NPM), we create
|
||||||
# To ensure deterministic dependency versions (even when code-server is
|
# an npm-shrinkwrap.json file from the currently installed node_modules. This ensures the versions used
|
||||||
# installed with NPM), we create an npm-shrinkwrap.json file from the
|
# from development (that the yarn.lock guarantees) are also the ones installed by end-users.
|
||||||
# currently installed node_modules. This ensures the versions used from
|
# These will include devDependencies, but those will be ignored when installing globally (for code-server), and
|
||||||
# development (that the package-lock.json guarantees) are also the ones
|
# because we use --omit=dev when installing vscode.
|
||||||
# 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
|
# We first generate the shrinkwrap file for code-server itself - which is the current directory
|
||||||
# current directory.
|
create_shrinkwrap_keeping_yarn_lock
|
||||||
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 VS Code.
|
# Then the shrinkwrap files for the bundled VSCode
|
||||||
pushd "$VSCODE_SRC_PATH/remote/"
|
pushd "$VSCODE_SRC_PATH/remote/"
|
||||||
cp package-lock.json package-lock.json.temp
|
create_shrinkwrap_keeping_yarn_lock
|
||||||
npm shrinkwrap
|
|
||||||
mv package-lock.json.temp package-lock.json
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd "$VSCODE_SRC_PATH/extensions/"
|
pushd "$VSCODE_SRC_PATH/extensions/"
|
||||||
cp package-lock.json package-lock.json.temp
|
create_shrinkwrap_keeping_yarn_lock
|
||||||
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,10 +1,6 @@
|
||||||
#!/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}")/../.."
|
||||||
|
|
||||||
|
|
@ -13,10 +9,11 @@ main() {
|
||||||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
||||||
RELEASE_PATH+=-standalone
|
RELEASE_PATH+=-standalone
|
||||||
|
|
||||||
# Package managers may shim their own "node" wrapper into the PATH, so run
|
# We cannot get the path to Node from $PATH (for example via `which node`)
|
||||||
# node and ask it for its true path.
|
# because Yarn shims a script called `node` and we would end up just copying
|
||||||
|
# that script. Instead we run Node and have it print its actual path.
|
||||||
local node_path
|
local node_path
|
||||||
node_path="$(node -p process.execPath)"
|
node_path="$(node <<< 'console.info(process.execPath)')"
|
||||||
|
|
||||||
mkdir -p "$RELEASE_PATH/bin"
|
mkdir -p "$RELEASE_PATH/bin"
|
||||||
mkdir -p "$RELEASE_PATH/lib"
|
mkdir -p "$RELEASE_PATH/lib"
|
||||||
|
|
@ -27,10 +24,6 @@ main() {
|
||||||
|
|
||||||
pushd "$RELEASE_PATH"
|
pushd "$RELEASE_PATH"
|
||||||
npm install --unsafe-perm --omit=dev
|
npm install --unsafe-perm --omit=dev
|
||||||
# Code deletes some files from the extension node_modules directory which
|
|
||||||
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
|
||||||
# on these broken symlinks so clean them up.
|
|
||||||
rm -fr "./lib/vscode/extensions/node_modules/.bin"
|
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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' npm run build:vscode"
|
echo "VERSION='0.0.0' yarn build:vscode"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -112,9 +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.
|
||||||
node --max-old-space-size=16384 --optimize-for-size \
|
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||||
./node_modules/gulp/bin/gulp.js \
|
|
||||||
"vscode-reh-web-linux-x64${MINIFY:+-min}"
|
|
||||||
|
|
||||||
# Reset so if you develop after building you will not be stuck with the wrong
|
# Reset so if you develop after building you will not be stuck with the wrong
|
||||||
# commit (the dev client will use `oss-dev` but the dev server will still use
|
# commit (the dev client will use `oss-dev` but the dev server will still use
|
||||||
|
|
|
||||||
|
|
@ -51,18 +51,6 @@ symlink_bin_script() {
|
||||||
cd "$oldpwd"
|
cd "$oldpwd"
|
||||||
}
|
}
|
||||||
|
|
||||||
command_exists() {
|
|
||||||
if [ ! "$1" ]; then return 1; fi
|
|
||||||
command -v "$@" > /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
is_root() {
|
|
||||||
if command_exists id && [ "$(id -u)" = 0 ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
OS="$(os)"
|
OS="$(os)"
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
@ -76,8 +64,8 @@ main() {
|
||||||
echo "USE AT YOUR OWN RISK!"
|
echo "USE AT YOUR OWN RISK!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-22}" ]; then
|
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
|
||||||
echo "ERROR: code-server currently requires node v22."
|
echo "ERROR: code-server currently requires node v18."
|
||||||
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
|
||||||
|
|
@ -87,20 +75,17 @@ main() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Under npm, if we are running as root, we need --unsafe-perm otherwise
|
|
||||||
# post-install scripts will not have sufficient permissions to do their thing.
|
|
||||||
if is_root; then
|
|
||||||
case "${npm_config_user_agent-}" in npm*)
|
case "${npm_config_user_agent-}" in npm*)
|
||||||
|
# We are running under npm.
|
||||||
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
||||||
echo "Please pass --unsafe-perm to npm to install code-server"
|
echo "Please pass --unsafe-perm to npm to install code-server"
|
||||||
echo "Otherwise post-install scripts will not have permissions to run"
|
echo "Otherwise the postinstall script does not have permissions to run"
|
||||||
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
||||||
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
|
|
||||||
if ! vscode_install; then
|
if ! vscode_install; then
|
||||||
echo "You may not have the required dependencies to build the native modules."
|
echo "You may not have the required dependencies to build the native modules."
|
||||||
|
|
@ -117,11 +102,14 @@ 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}"
|
||||||
# For development we enforce npm, but for installing the package as an
|
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
|
||||||
# end-user we want to keep using whatever package manager is in use.
|
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
|
||||||
case "${npm_config_user_agent-}" in
|
case "${npm_config_user_agent-}" in
|
||||||
npm*)
|
npm*)
|
||||||
if ! npm install --unsafe-perm --omit=dev; then
|
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
|
||||||
|
# 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
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
12
ci/dev/audit.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
# Prevents integration with moderate or higher vulnerabilities
|
||||||
|
# Docs: https://github.com/IBM/audit-ci#options
|
||||||
|
yarn audit-ci --moderate
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
13
ci/dev/ci.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
yarn fmt
|
||||||
|
yarn lint
|
||||||
|
yarn _audit
|
||||||
|
yarn test:unit
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|
@ -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 " npm run doctoc"
|
echo " yarn doctoc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,44 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Generate icons from a single favicon.svg. favicon.svg should have no fill
|
|
||||||
# colors set.
|
|
||||||
main() {
|
main() {
|
||||||
cd src/browser/media
|
cd src/browser/media
|
||||||
|
|
||||||
# We need .ico for backwards compatibility. The other two are the only icon
|
# We need .ico for backwards compatibility.
|
||||||
# sizes required by Chrome and we use them for stuff like apple-touch-icon as
|
# The other two are the only icon sizes required by Chrome and
|
||||||
# well. https://web.dev/add-manifest/
|
# we use them for stuff like apple-touch-icon as well.
|
||||||
|
# https://web.dev/add-manifest/
|
||||||
#
|
#
|
||||||
# This should be enough and we can always add more if there are problems.
|
# This should be enough and we can always add more if there are problems.
|
||||||
#
|
|
||||||
# -quiet to avoid https://github.com/ImageMagick/ImageMagick/issues/884
|
|
||||||
# -background defaults to white but we want it transparent.
|
# -background defaults to white but we want it transparent.
|
||||||
# -density somehow makes the image both sharper and smaller in file size.
|
|
||||||
#
|
|
||||||
# https://imagemagick.org/script/command-line-options.php#background
|
# https://imagemagick.org/script/command-line-options.php#background
|
||||||
convert -quiet -background transparent \
|
convert -quiet -background transparent -resize 256x256 favicon.svg favicon.ico
|
||||||
-resize 256x256 -density 256x256 \
|
# We do not generate the pwa-icon from the favicon as they are slightly different
|
||||||
favicon.svg favicon.ico
|
# designs and sizes.
|
||||||
|
# See favicon.afdesign and #2401 for details on the differences.
|
||||||
|
convert -quiet -background transparent -resize 192x192 pwa-icon.png pwa-icon-192.png
|
||||||
|
convert -quiet -background transparent -resize 512x512 pwa-icon.png pwa-icon-512.png
|
||||||
|
|
||||||
# Generate PWA icons. There should be enough padding to support masking.
|
# We use -quiet above to avoid https://github.com/ImageMagick/ImageMagick/issues/884
|
||||||
convert -quiet -border 60x60 -bordercolor white -background white \
|
|
||||||
-resize 192x192 -density 192x192 \
|
|
||||||
favicon.svg pwa-icon-maskable-192.png
|
|
||||||
convert -quiet -border 160x160 -bordercolor white -background white \
|
|
||||||
-resize 512x512 -density 512x512 \
|
|
||||||
favicon.svg pwa-icon-maskable-512.png
|
|
||||||
|
|
||||||
# Generate non-maskable PWA icons.
|
# The following adds dark mode support for the favicon as favicon-dark-support.svg
|
||||||
magick pwa-icon-maskable-192.png \
|
# There is no similar capability for pwas or .ico so we can only add support to the svg.
|
||||||
\( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 50,50" \) \
|
favicon_dark_style="<style>
|
||||||
-channel-fx "| gray=>alpha" \
|
@media (prefers-color-scheme: dark) {
|
||||||
pwa-icon-192.png
|
* {
|
||||||
magick pwa-icon-maskable-512.png \
|
fill: white;
|
||||||
\( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 100,100" \) \
|
}
|
||||||
-channel-fx "| gray=>alpha" \
|
}
|
||||||
pwa-icon-512.png
|
</style>"
|
||||||
|
# See https://stackoverflow.com/a/22901380/4283659
|
||||||
# The following adds dark mode support for the favicon as
|
# This escapes all newlines so that sed will accept them.
|
||||||
# favicon-dark-support.svg There is no similar capability for pwas or .ico so
|
favicon_dark_style="$(printf "%s\n" "$favicon_dark_style" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g')"
|
||||||
# we can only add support to the svg.
|
sed "$(
|
||||||
favicon_dark_style="<style>@media (prefers-color-scheme: dark) {* { fill: white; }}</style>"
|
cat -n << EOF
|
||||||
cp favicon.svg favicon-dark-support.svg
|
s%<rect id="favicon"%$favicon_dark_style<rect id="favicon"%
|
||||||
sed "s%<path%$favicon_dark_style\n <path%" favicon.svg > favicon-dark-support.svg
|
EOF
|
||||||
|
)" favicon.svg > favicon-dark-support.svg
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@ set -euo pipefail
|
||||||
|
|
||||||
# Install dependencies in $1.
|
# Install dependencies in $1.
|
||||||
install-deps() {
|
install-deps() {
|
||||||
local args=()
|
local args=(install)
|
||||||
if [[ ${CI-} ]]; then
|
if [[ ${CI-} ]]; then
|
||||||
args+=(ci)
|
args+=(--frozen-lockfile)
|
||||||
else
|
|
||||||
args+=(install)
|
|
||||||
fi
|
fi
|
||||||
# If there is no package.json then npm will look upward and end up installing
|
if [[ "$1" == "lib/vscode" ]]; then
|
||||||
|
args+=(--no-default-rc)
|
||||||
|
fi
|
||||||
|
# If there is no package.json then yarn will look upward and end up installing
|
||||||
# from the root resulting in an infinite loop (this can happen if you have not
|
# 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
|
||||||
|
|
@ -18,7 +19,7 @@ install-deps() {
|
||||||
fi
|
fi
|
||||||
pushd "$1"
|
pushd "$1"
|
||||||
echo "Installing dependencies for $PWD"
|
echo "Installing dependencies for $PWD"
|
||||||
npm "${args[@]}"
|
yarn "${args[@]}"
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
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 'npm run watch' or you can build a release"
|
echo >&2 " You can build with 'yarn watch' or you can build a release"
|
||||||
echo >&2 " For example: 'npm run build && npm run build:vscode && KEEP_MODULES=1 npm run release'"
|
echo >&2 " For example: 'yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release'"
|
||||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release npm run test:e2e'"
|
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release yarn 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"
|
||||||
npm run build
|
yarn build
|
||||||
popd
|
popd
|
||||||
|
|
||||||
local dir="$PWD"
|
local dir="$PWD"
|
||||||
|
|
@ -44,7 +44,7 @@ main() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd test
|
cd test
|
||||||
./node_modules/.bin/playwright test "$@"
|
yarn 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 'npm run release:standalone'"
|
echo >&2 " You can build the standalone release with 'yarn 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' npm run test:integration"
|
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
# 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" ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./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 'npm run release:standalone'"
|
echo >&2 " You can build the standalone release with 'yarn 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' npm run test:integration"
|
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,15 @@ 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.
|
||||||
./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts"
|
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,9 @@ 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("npm", ["run", "watch"], { cwd: this.paths.vscodeDir }),
|
vscode: spawn("yarn", ["watch"], { cwd: this.paths.vscodeDir }),
|
||||||
vscodeWebExtensions: spawn("npm", ["run", "watch-web"], { cwd: this.paths.vscodeDir }),
|
vscodeWebExtensions: spawn("yarn", ["watch-web"], { cwd: this.paths.vscodeDir }),
|
||||||
plugins: this.paths.pluginDir
|
plugins: this.paths.pluginDir ? spawn("yarn", ["build", "--watch"], { cwd: this.paths.pluginDir }) : undefined,
|
||||||
? 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.31.2
|
version: 3.15.1
|
||||||
|
|
||||||
# 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.104.2
|
appVersion: 4.19.1
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,8 @@ metadata:
|
||||||
helm.sh/chart: {{ include "code-server.chart" . }}
|
helm.sh/chart: {{ include "code-server.chart" . }}
|
||||||
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 }}
|
||||||
{{- if .Values.annotations }}
|
|
||||||
annotations: {{- toYaml .Values.annotations | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.replicaCount | default 1 }}
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
selector:
|
selector:
|
||||||
|
|
@ -38,9 +35,8 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) .Values.extraInitContainers }}
|
|
||||||
initContainers:
|
|
||||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||||
|
initContainers:
|
||||||
- name: init-chmod-data
|
- name: init-chmod-data
|
||||||
image: busybox:latest
|
image: busybox:latest
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
@ -54,7 +50,6 @@ 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 }}
|
||||||
|
|
@ -182,12 +177,9 @@ spec:
|
||||||
{{- if .existingClaim }}
|
{{- if .existingClaim }}
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ .existingClaim }}
|
claimName: {{ .existingClaim }}
|
||||||
{{- else if .hostPath }}
|
{{- else }}
|
||||||
hostPath:
|
hostPath:
|
||||||
path: {{ .hostPath }}
|
path: {{ .hostPath }}
|
||||||
type: Directory
|
type: Directory
|
||||||
{{- else }}
|
|
||||||
emptyDir:
|
|
||||||
{{- toYaml .emptyDir | nindent 10 }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ replicaCount: 1
|
||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.104.2'
|
tag: '4.19.1'
|
||||||
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,9 +19,6 @@ 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,9 +28,6 @@ serviceAccount:
|
||||||
# If not set and create is true, a name is generated using the fullname template
|
# If not set and create is true, a name is generated using the fullname template
|
||||||
name: ""
|
name: ""
|
||||||
|
|
||||||
# Specifies annotations for deployment
|
|
||||||
annotations: {}
|
|
||||||
|
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
||||||
podSecurityContext: {}
|
podSecurityContext: {}
|
||||||
|
|
@ -78,9 +72,8 @@ extraArgs: []
|
||||||
extraVars: []
|
extraVars: []
|
||||||
# - name: DISABLE_TELEMETRY
|
# - name: DISABLE_TELEMETRY
|
||||||
# value: "true"
|
# value: "true"
|
||||||
# if dind is desired:
|
|
||||||
# - name: DOCKER_HOST
|
# - name: DOCKER_HOST
|
||||||
# value: "tcp://localhost:2376"
|
# value: "tcp://localhost:2375"
|
||||||
|
|
||||||
##
|
##
|
||||||
## Init containers parameters:
|
## Init containers parameters:
|
||||||
|
|
@ -143,39 +136,25 @@ lifecycle:
|
||||||
# - -c
|
# - -c
|
||||||
# - curl -s -L SOME_SCRIPT | bash
|
# - curl -s -L SOME_SCRIPT | bash
|
||||||
|
|
||||||
# for dind, the following may be helpful
|
|
||||||
# postStart:
|
|
||||||
# exec:
|
|
||||||
# command:
|
|
||||||
# - /bin/sh
|
|
||||||
# - -c
|
|
||||||
# - |
|
|
||||||
# sudo apt-get update \
|
|
||||||
# && sudo apt-get install -y docker.io
|
|
||||||
|
|
||||||
## Enable an Specify container in extraContainers.
|
## Enable an Specify container in extraContainers.
|
||||||
## This is meant to allow adding code-server dependencies, like docker-dind.
|
## This is meant to allow adding code-server dependencies, like docker-dind.
|
||||||
extraContainers: |
|
extraContainers: |
|
||||||
# If docker-dind is used, DOCKER_HOST env is mandatory to set in "extraVars"
|
# If docker-dind is used, DOCKER_HOST env is mandatory to set in "extraVars"
|
||||||
#- name: docker-dind
|
#- name: docker-dind
|
||||||
# image: docker:28.3.2-dind
|
# image: docker:19.03-dind
|
||||||
# imagePullPolicy: IfNotPresent
|
# imagePullPolicy: IfNotPresent
|
||||||
# resources:
|
# resources:
|
||||||
# requests:
|
# requests:
|
||||||
# cpu: 1
|
# cpu: 250m
|
||||||
# ephemeral-storage: "50Gi"
|
# memory: 256M
|
||||||
# memory: 10Gi
|
|
||||||
# securityContext:
|
# securityContext:
|
||||||
# privileged: true
|
# privileged: true
|
||||||
# procMount: Default
|
# procMount: Default
|
||||||
# env:
|
# env:
|
||||||
# - name: DOCKER_TLS_CERTDIR
|
# - name: DOCKER_TLS_CERTDIR
|
||||||
# value: "" # disable TLS setup
|
# value: ""
|
||||||
# command:
|
# - name: DOCKER_DRIVER
|
||||||
# - dockerd
|
# value: "overlay2"
|
||||||
# - --host=unix:///var/run/docker.sock
|
|
||||||
# - --host=tcp://0.0.0.0:2376
|
|
||||||
|
|
||||||
|
|
||||||
extraInitContainers: |
|
extraInitContainers: |
|
||||||
# - name: customization
|
# - name: customization
|
||||||
|
|
@ -211,7 +190,6 @@ extraVolumeMounts: []
|
||||||
# readOnly: true
|
# readOnly: true
|
||||||
# existingClaim: volume-claim
|
# existingClaim: volume-claim
|
||||||
# hostPath: ""
|
# hostPath: ""
|
||||||
# emptyDir: {}
|
|
||||||
|
|
||||||
extraConfigmapMounts: []
|
extraConfigmapMounts: []
|
||||||
# - name: certs-configmap
|
# - name: certs-configmap
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,7 @@ 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 if grep -q 1000 /etc/passwd; then \
|
RUN adduser --gecos '' --disabled-password coder \
|
||||||
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)" \
|
||||||
|
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
# syntax=docker/dockerfile:experimental
|
|
||||||
|
|
||||||
ARG BASE=fedora:39
|
|
||||||
FROM scratch AS packages
|
|
||||||
COPY release-packages/code-server*.rpm /tmp/
|
|
||||||
|
|
||||||
FROM $BASE
|
|
||||||
|
|
||||||
RUN dnf update -y \
|
|
||||||
&& dnf install -y \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
git-lfs \
|
|
||||||
htop \
|
|
||||||
nano \
|
|
||||||
openssh-clients \
|
|
||||||
procps \
|
|
||||||
wget \
|
|
||||||
zsh \
|
|
||||||
dumb-init \
|
|
||||||
glibc-langpack-en \
|
|
||||||
&& rm -rf /var/cache/dnf
|
|
||||||
RUN git lfs install
|
|
||||||
|
|
||||||
ENV LANG=en_US.UTF-8
|
|
||||||
RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
|
|
||||||
|
|
||||||
RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
|
||||||
|
|
||||||
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \
|
|
||||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
|
||||||
&& chown root:root /usr/local/bin/fixuid \
|
|
||||||
&& chmod 4755 /usr/local/bin/fixuid \
|
|
||||||
&& mkdir -p /etc/fixuid \
|
|
||||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
|
||||||
|
|
||||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
|
||||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm
|
|
||||||
|
|
||||||
# Allow users to have scripts run on container startup to prepare workspace.
|
|
||||||
# https://github.com/coder/code-server/issues/5177
|
|
||||||
ENV ENTRYPOINTD=${HOME}/entrypoint.d
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
|
|
||||||
# the uid will remain the same. note: only relevant if -u isn't passed to
|
|
||||||
# docker-run.
|
|
||||||
USER 1000
|
|
||||||
ENV USER=coder
|
|
||||||
WORKDIR /home/coder
|
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."]
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
# syntax=docker/dockerfile:experimental
|
|
||||||
|
|
||||||
ARG BASE=opensuse/tumbleweed
|
|
||||||
FROM scratch AS packages
|
|
||||||
COPY release-packages/code-server*.rpm /tmp/
|
|
||||||
|
|
||||||
FROM $BASE
|
|
||||||
|
|
||||||
RUN zypper dup -y \
|
|
||||||
&& zypper in -y \
|
|
||||||
curl \
|
|
||||||
git \
|
|
||||||
git-lfs \
|
|
||||||
htop \
|
|
||||||
nano \
|
|
||||||
openssh-clients \
|
|
||||||
procps \
|
|
||||||
wget \
|
|
||||||
zsh \
|
|
||||||
sudo \
|
|
||||||
catatonit \
|
|
||||||
&& rm -rf /var/cache/zypp /var/cache/zypper
|
|
||||||
RUN git lfs install
|
|
||||||
|
|
||||||
ENV LANG=en_US.UTF-8
|
|
||||||
RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
|
|
||||||
|
|
||||||
RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
|
||||||
|
|
||||||
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \
|
|
||||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
|
||||||
&& chown root:root /usr/local/bin/fixuid \
|
|
||||||
&& chmod 4755 /usr/local/bin/fixuid \
|
|
||||||
&& mkdir -p /etc/fixuid \
|
|
||||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
|
||||||
|
|
||||||
COPY ci/release-image/entrypoint-catatonit.sh /usr/bin/entrypoint-catatonit.sh
|
|
||||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm
|
|
||||||
|
|
||||||
# Allow users to have scripts run on container startup to prepare workspace.
|
|
||||||
# https://github.com/coder/code-server/issues/5177
|
|
||||||
ENV ENTRYPOINTD=${HOME}/entrypoint.d
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
|
|
||||||
# the uid will remain the same. note: only relevant if -u isn't passed to
|
|
||||||
# docker-run.
|
|
||||||
USER 1000
|
|
||||||
ENV USER=coder
|
|
||||||
WORKDIR /home/coder
|
|
||||||
ENTRYPOINT ["/usr/bin/entrypoint-catatonit.sh", "--bind-addr", "0.0.0.0:8080", "."]
|
|
||||||
|
|
@ -18,9 +18,6 @@ group "default" {
|
||||||
targets = [
|
targets = [
|
||||||
"code-server-debian-12",
|
"code-server-debian-12",
|
||||||
"code-server-ubuntu-focal",
|
"code-server-ubuntu-focal",
|
||||||
"code-server-ubuntu-noble",
|
|
||||||
"code-server-fedora-39",
|
|
||||||
"code-server-opensuse-tumbleweed",
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,38 +66,3 @@ target "code-server-ubuntu-focal" {
|
||||||
}
|
}
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
platforms = ["linux/amd64", "linux/arm64"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "code-server-ubuntu-noble" {
|
|
||||||
dockerfile = "ci/release-image/Dockerfile"
|
|
||||||
tags = concat(
|
|
||||||
gen_tags_for_docker_and_ghcr("noble"),
|
|
||||||
)
|
|
||||||
args = {
|
|
||||||
BASE = "ubuntu:noble"
|
|
||||||
}
|
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "code-server-fedora-39" {
|
|
||||||
dockerfile = "ci/release-image/Dockerfile.fedora"
|
|
||||||
tags = concat(
|
|
||||||
gen_tags_for_docker_and_ghcr("fedora"),
|
|
||||||
gen_tags_for_docker_and_ghcr("39"),
|
|
||||||
)
|
|
||||||
args = {
|
|
||||||
BASE = "fedora:39"
|
|
||||||
}
|
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "code-server-opensuse-tumbleweed" {
|
|
||||||
dockerfile = "ci/release-image/Dockerfile.opensuse"
|
|
||||||
tags = concat(
|
|
||||||
gen_tags_for_docker_and_ghcr("opensuse"),
|
|
||||||
gen_tags_for_docker_and_ghcr("tumbleweed"),
|
|
||||||
)
|
|
||||||
args = {
|
|
||||||
BASE = "opensuse/tumbleweed"
|
|
||||||
}
|
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
# We do this first to ensure sudo works below when renaming the user.
|
|
||||||
# Otherwise the current container UID may not exist in the passwd database.
|
|
||||||
eval "$(fixuid -q)"
|
|
||||||
|
|
||||||
if [ "${DOCKER_USER-}" ]; then
|
|
||||||
USER="$DOCKER_USER"
|
|
||||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
|
||||||
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
|
|
||||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
|
||||||
sudo usermod --login "$DOCKER_USER" coder
|
|
||||||
sudo groupmod -n "$DOCKER_USER" coder
|
|
||||||
|
|
||||||
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Allow users to have scripts run on container startup to prepare workspace.
|
|
||||||
# https://github.com/coder/code-server/issues/5177
|
|
||||||
if [ -d "${ENTRYPOINTD}" ]; then
|
|
||||||
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec catatonit -- /usr/bin/code-server "$@"
|
|
||||||
|
|
@ -7,7 +7,7 @@ eval "$(fixuid -q)"
|
||||||
|
|
||||||
if [ "${DOCKER_USER-}" ]; then
|
if [ "${DOCKER_USER-}" ]; then
|
||||||
USER="$DOCKER_USER"
|
USER="$DOCKER_USER"
|
||||||
if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then
|
if [ "$DOCKER_USER" != "$(whoami)" ]; 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 `npm install code-server@<pr-number>`
|
# a developer to install this version with `yarn add 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 `npm install code-server@beta`
|
# a developer to install this version with `yarn add 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 `npm install code-server@latest`
|
# a developer to install this version with `yarn add 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 `npm install code-server`
|
# and installed when a user runs `yarn 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 `npm install code-server@beta`
|
# and installed when a user runs `yarn 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 `npm install code-server@<pr number>`
|
# and installed when a user runs `yarn install code-server@<pr number>`
|
||||||
NPM_TAG="$PR_NUMBER"
|
NPM_TAG="$PR_NUMBER"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -120,7 +120,10 @@ 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.
|
||||||
|
|
@ -131,6 +134,7 @@ 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
|
||||||
|
|
@ -140,10 +144,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.
|
||||||
cd release
|
yarn publish --non-interactive release --tag "$NPM_TAG" --access public
|
||||||
npm publish --tag "$NPM_TAG" --access public
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
- [Linux-specific requirements](#linux-specific-requirements)
|
- [Linux-specific requirements](#linux-specific-requirements)
|
||||||
|
- [Creating pull requests](#creating-pull-requests)
|
||||||
|
- [Commits and commit history](#commits-and-commit-history)
|
||||||
- [Development workflow](#development-workflow)
|
- [Development workflow](#development-workflow)
|
||||||
- [Version updates to Code](#version-updates-to-code)
|
- [Version updates to Code](#version-updates-to-code)
|
||||||
- [Patching Code](#patching-code)
|
- [Patching Code](#patching-code)
|
||||||
|
|
@ -26,16 +28,19 @@
|
||||||
<!-- 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 -->
|
||||||
|
|
||||||
|
- [Detailed CI and build process docs](../ci)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
The prerequisites for contributing to code-server are almost the same as those
|
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` v22.x
|
- `node` v18.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)
|
||||||
- [`npm`](https://www.npmjs.com/)
|
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||||
- 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
|
||||||
|
|
@ -55,23 +60,38 @@ Here is what is needed:
|
||||||
|
|
||||||
### Linux-specific requirements
|
### Linux-specific requirements
|
||||||
|
|
||||||
If you're developing code-server on Linux, make sure you have installed or
|
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
||||||
install the following dependencies:
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
|
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
|
||||||
```
|
```
|
||||||
|
|
||||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)
|
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
|
||||||
for more information.
|
|
||||||
|
## Creating pull requests
|
||||||
|
|
||||||
|
Please create a [GitHub Issue](https://github.com/coder/code-server/issues) that
|
||||||
|
includes context for issues that you see. You can skip this if the proposed fix
|
||||||
|
is minor.
|
||||||
|
|
||||||
|
In your pull requests (PR), link to the issue that the PR solves.
|
||||||
|
|
||||||
|
Please ensure that the base of your PR is the **main** branch.
|
||||||
|
|
||||||
|
### Commits and commit history
|
||||||
|
|
||||||
|
We prefer a clean commit history. This means you should squash all fixups and
|
||||||
|
fixup-type commits before asking for a review (e.g., clean up, squash, then force
|
||||||
|
push). If you need help with this, feel free to leave a comment in your PR, and
|
||||||
|
we'll guide you.
|
||||||
|
|
||||||
## Development workflow
|
## Development workflow
|
||||||
|
|
||||||
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. `npm install` - Install dependencies
|
4. `yarn` - Install dependencies
|
||||||
5. `npm run watch` - Launch code-server localhost:8080. code-server will be live
|
5. `yarn 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
|
||||||
|
|
@ -79,62 +99,55 @@ need to apply them with `quilt`. If you pull down changes that update the
|
||||||
`vscode` submodule you will need to run `git submodule update --init` and
|
`vscode` submodule you will need to run `git submodule update --init` and
|
||||||
re-apply the patches.
|
re-apply the patches.
|
||||||
|
|
||||||
When you make a change that affects people deploying the marketplace please
|
|
||||||
update the changelog as part of your PR.
|
|
||||||
|
|
||||||
Note that building code-server takes a very, very long time, and loading it in
|
|
||||||
the browser in development mode also takes a very, very long time.
|
|
||||||
|
|
||||||
Display language (Spanish, etc) support only works in a full build; it will not
|
|
||||||
work in development mode.
|
|
||||||
|
|
||||||
Generally we prefer that PRs be squashed into `main` but you can rebase or merge
|
|
||||||
if it is important to keep the individual commits (make sure to clean up the
|
|
||||||
commits first if you are doing this).
|
|
||||||
|
|
||||||
### Version updates to Code
|
### Version updates to Code
|
||||||
|
|
||||||
1. Remove any patches with `quilt pop -a`.
|
1. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||||
2. Update the `lib/vscode` submodule to the desired upstream version branch.
|
|
||||||
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
|
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
|
||||||
2. `git add lib && git commit -m "chore: update to Code <version>"`
|
2. `git add lib && git commit -m "chore: update Code"`
|
||||||
3. Apply the patches one at a time (`quilt push`). If the application succeeds
|
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
|
||||||
but the lines changed, update the patch with `quilt refresh`. If there are
|
stage you may need to resolve conflicts. For example use `quilt push -f`,
|
||||||
conflicts, then force apply with `quilt push -f`, manually add back the
|
manually apply the rejected portions, then `quilt refresh`.
|
||||||
rejected code, then run `quilt refresh`.
|
3. From the code-server **project root**, run `yarn install`.
|
||||||
4. From the code-server **project root**, run `npm install`.
|
4. Test code-server locally to make sure everything works.
|
||||||
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 your version of Node.js to match.
|
||||||
|
6. Commit the updated submodule and patches to `code-server`.
|
||||||
|
7. Open a PR.
|
||||||
|
|
||||||
|
Tip: if you're certain all patches are applied correctly and you simply need to
|
||||||
|
refresh, you can use this trick:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
while quilt push; do quilt refresh; done
|
||||||
|
```
|
||||||
|
|
||||||
|
[Source](https://raphaelhertzog.com/2012/08/08/how-to-use-quilt-to-manage-patches-in-debian-packages/)
|
||||||
|
|
||||||
### Patching Code
|
### Patching Code
|
||||||
|
|
||||||
1. You can go through the patch stack with `quilt push` and `quilt pop`.
|
0. You can go through the patch stack with `quilt push` and `quilt pop`.
|
||||||
2. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
1. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
||||||
3. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
|
1. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
|
||||||
**must** be added before you make changes to it.
|
**must** be added before you make changes to it.
|
||||||
4. Make your changes. Patches do not need to be independent of each other but
|
1. Make your changes. Patches do not need to be independent of each other but
|
||||||
each patch must result in a working code-server without any broken in-between
|
each patch must result in a working code-server without any broken in-between
|
||||||
states otherwise they are difficult to test and modify.
|
states otherwise they are difficult to test and modify.
|
||||||
5. Add your changes to the patch (`quilt refresh`)
|
1. Add your changes to the patch (`quilt refresh`)
|
||||||
6. Add a comment in the patch about the reason for the patch and how to
|
1. Add a comment in the patch about the reason for the patch and how to
|
||||||
reproduce the behavior it fixes or adds. Every patch should have an e2e test
|
reproduce the behavior it fixes or adds. Every patch should have an e2e test
|
||||||
as well.
|
as well.
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
|
|
||||||
You can build a full production as follows:
|
You can build as follows:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git submodule update --init
|
yarn build
|
||||||
quilt push -a
|
yarn build:vscode
|
||||||
npm install
|
yarn release
|
||||||
npm run build
|
|
||||||
VERSION=0.0.0 npm run build:vscode
|
|
||||||
npm run release
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This does not keep `node_modules`. If you want them to be kept, use
|
_NOTE: this does not keep `node_modules`. If you want them to be kept, use `KEEP_MODULES=1 yarn release` (if you're testing in Coder, you'll want to do this)_
|
||||||
`KEEP_MODULES=1 npm run release`
|
|
||||||
|
|
||||||
Run your build:
|
Run your build:
|
||||||
|
|
||||||
|
|
@ -145,16 +158,16 @@ npm install --omit=dev # Skip if you used KEEP_MODULES=1
|
||||||
node .
|
node .
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, to build the release package:
|
Build the release packages (make sure that you run `yarn release` first):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm run release:standalone
|
yarn release:standalone
|
||||||
npm run test:integration
|
yarn test:integration
|
||||||
npm run package
|
yarn package
|
||||||
```
|
```
|
||||||
|
|
||||||
> On Linux, the currently running distro will become the minimum supported
|
> On Linux, the currently running distro will become the minimum supported
|
||||||
> version. In our GitHub Actions CI, we use CentOS 8 for maximum compatibility.
|
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
||||||
> If you need your builds to support older distros, run the build commands
|
> If you need your builds to support older distros, run the build commands
|
||||||
> inside a Docker container with all the build requirements installed.
|
> inside a Docker container with all the build requirements installed.
|
||||||
|
|
||||||
|
|
@ -168,32 +181,27 @@ writing, we do this for the following platforms/architectures:
|
||||||
- Linux arm7l (.tar.gz)
|
- Linux arm7l (.tar.gz)
|
||||||
- Linux armhf.deb
|
- Linux armhf.deb
|
||||||
- Linux armhf.rpm
|
- Linux armhf.rpm
|
||||||
- macOS arm64.tar.gz
|
- macOS amd64 (Intel-based)
|
||||||
|
|
||||||
Currently, these are compiled in CI using the `npm run release:standalone`
|
Currently, these are compiled in CI using the `yarn release-standalone` command
|
||||||
command in the `release.yaml` workflow. We then upload them to the draft release
|
in the `release.yaml` workflow. We then upload them to the draft release and
|
||||||
and distribute via GitHub Releases.
|
distribute via GitHub Releases.
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
#### I see "Forbidden access" when I load code-server in the browser
|
#### I see "Forbidden access" when I load code-server in the browser
|
||||||
|
|
||||||
This means your patches didn't apply correctly. We have a patch to remove the
|
This means your patches didn't apply correctly. We have a patch to remove the auth from vanilla Code because we use our own.
|
||||||
auth from vanilla Code because we use our own.
|
|
||||||
|
|
||||||
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push
|
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push -a`.
|
||||||
-a`.
|
|
||||||
|
|
||||||
#### "Can only have one anonymous define call per script"
|
#### "Can only have one anonymous define call per script"
|
||||||
|
|
||||||
Code might be trying to use a dev or prod HTML in the wrong context. You can try
|
Code might be trying to use a dev or prod HTML in the wrong context. You can try re-running code-server and setting `VSCODE_DEV=1`.
|
||||||
re-running code-server and setting `VSCODE_DEV=1`.
|
|
||||||
|
|
||||||
### Help
|
### Help
|
||||||
|
|
||||||
If you get stuck or need help, you can always start a new GitHub Discussion
|
If you get stuck or need help, you can always start a new GitHub Discussion [here](https://github.com/coder/code-server/discussions). One of the maintainers will respond and help you out.
|
||||||
[here](https://github.com/coder/code-server/discussions). One of the maintainers
|
|
||||||
will respond and help you out.
|
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
|
|
||||||
|
|
@ -211,9 +219,7 @@ Our unit tests are written in TypeScript and run using
|
||||||
|
|
||||||
These live under [test/unit](../test/unit).
|
These live under [test/unit](../test/unit).
|
||||||
|
|
||||||
We use unit tests for functions and things that can be tested in isolation. The
|
We use unit tests for functions and things that can be tested in isolation. The file structure is modeled closely after `/src` so it's easy for people to know where test files should live.
|
||||||
file structure is modeled closely after `/src` so it's easy for people to know
|
|
||||||
where test files should live.
|
|
||||||
|
|
||||||
### Script tests
|
### Script tests
|
||||||
|
|
||||||
|
|
@ -221,14 +227,12 @@ Our script tests are written in bash and run using [bats](https://github.com/bat
|
||||||
|
|
||||||
These tests live under `test/scripts`.
|
These tests live under `test/scripts`.
|
||||||
|
|
||||||
We use these to test anything related to our scripts (most of which live under
|
We use these to test anything related to our scripts (most of which live under `ci`).
|
||||||
`ci`).
|
|
||||||
|
|
||||||
### Integration tests
|
### Integration tests
|
||||||
|
|
||||||
These are a work in progress. We build code-server and run tests with `npm run
|
These are a work in progress. We build code-server and run tests with `yarn test:integration`, which ensures that code-server builds work on their respective
|
||||||
test:integration`, which ensures that code-server builds work on their
|
platforms.
|
||||||
respective platforms.
|
|
||||||
|
|
||||||
Our integration tests look at components that rely on one another. For example,
|
Our integration tests look at components that rely on one another. For example,
|
||||||
testing the CLI requires us to build and package code-server.
|
testing the CLI requires us to build and package code-server.
|
||||||
|
|
@ -249,10 +253,15 @@ Take a look at `codeServer.test.ts` to see how you would use it (see
|
||||||
We also have a model where you can create helpers to use within tests. See
|
We also have a model where you can create helpers to use within tests. See
|
||||||
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
|
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
|
||||||
|
|
||||||
|
Generally speaking, e2e means testing code-server while running in the browser
|
||||||
|
and interacting with it in a way that's similar to how a user would interact
|
||||||
|
with it. When running these tests with `yarn test:e2e`, you must have
|
||||||
|
code-server running locally. In CI, this is taken care of for you.
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|
||||||
code-server essentially serves as an HTTP API for logging in and starting a
|
The `code-server` script serves as an HTTP API for login and starting a remote
|
||||||
remote Code process.
|
Code process.
|
||||||
|
|
||||||
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
|
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
|
||||||
in [src/node/routes](../src/node/routes).
|
in [src/node/routes](../src/node/routes).
|
||||||
|
|
|
||||||
46
docs/FAQ.md
|
|
@ -31,14 +31,12 @@
|
||||||
- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia)
|
- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia)
|
||||||
- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server)
|
- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server)
|
||||||
- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces)
|
- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces)
|
||||||
- [What's the difference between code-server and VS Code web?](#whats-the-difference-between-code-server-and-vs-code-web)
|
|
||||||
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
||||||
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
||||||
- [How do I change the port?](#how-do-i-change-the-port)
|
- [How do I change the port?](#how-do-i-change-the-port)
|
||||||
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
||||||
- [How do I disable the proxy?](#how-do-i-disable-the-proxy)
|
- [How do I disable the proxy?](#how-do-i-disable-the-proxy)
|
||||||
- [How do I disable file download?](#how-do-i-disable-file-download)
|
- [How do I disable file download?](#how-do-i-disable-file-download)
|
||||||
- [Why do web views not work?](#why-do-web-views-not-work)
|
|
||||||
|
|
||||||
<!-- 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 -->
|
||||||
|
|
@ -323,8 +321,12 @@ As long as there is an active browser connection, code-server touches
|
||||||
`~/.local/share/code-server/heartbeat` once a minute.
|
`~/.local/share/code-server/heartbeat` once a minute.
|
||||||
|
|
||||||
If you want to shutdown code-server if there hasn't been an active connection
|
If you want to shutdown code-server if there hasn't been an active connection
|
||||||
after a predetermined amount of time, you can use the --idle-timeout-seconds flag
|
after a predetermined amount of time, you can do so by checking continuously for
|
||||||
or set an `CODE_SERVER_IDLE_TIMEOUT_SECONDS` environment variable.
|
the last modified time on the heartbeat file. If it is older than X minutes (or
|
||||||
|
whatever amount of time you'd like), you can kill code-server.
|
||||||
|
|
||||||
|
Eventually, [#1636](https://github.com/coder/code-server/issues/1636) will make
|
||||||
|
this process better.
|
||||||
|
|
||||||
## How do I change the password?
|
## How do I change the password?
|
||||||
|
|
||||||
|
|
@ -354,12 +356,6 @@ hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIW
|
||||||
|
|
||||||
The `hashed-password` field takes precedence over `password`.
|
The `hashed-password` field takes precedence over `password`.
|
||||||
|
|
||||||
If you're using Docker Compose file, in order to make this work, you need to change all the single $ to $$. For example:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
- HASHED_PASSWORD=$$argon2i$$v=19$$m=4096,t=3,p=1$$wST5QhBgk2lu1ih4DMuxvg$$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4
|
|
||||||
```
|
|
||||||
|
|
||||||
## Is multi-tenancy possible?
|
## Is multi-tenancy possible?
|
||||||
|
|
||||||
If you want to run multiple code-servers on shared infrastructure, we recommend
|
If you want to run multiple code-servers on shared infrastructure, we recommend
|
||||||
|
|
@ -380,9 +376,6 @@ mount into `/home/coder/myproject` from inside the `code-server` container. You
|
||||||
need to make sure the Docker daemon's `/home/coder/myproject` is the same as the
|
need to make sure the Docker daemon's `/home/coder/myproject` is the same as the
|
||||||
one mounted inside the `code-server` container, and the mount will work.
|
one mounted inside the `code-server` container, and the mount will work.
|
||||||
|
|
||||||
If you want Docker enabled when deploying on Kubernetes, look at the `values.yaml`
|
|
||||||
file for the 3 fields: `extraVars`, `lifecycle.postStart`, and `extraContainers`.
|
|
||||||
|
|
||||||
## How do I disable telemetry?
|
## How do I disable telemetry?
|
||||||
|
|
||||||
Use the `--disable-telemetry` flag to disable telemetry.
|
Use the `--disable-telemetry` flag to disable telemetry.
|
||||||
|
|
@ -440,8 +433,6 @@ Specific changes include:
|
||||||
- The ability to use your own marketplace and collect your own telemetry
|
- The ability to use your own marketplace and collect your own telemetry
|
||||||
- Built-in proxy for accessing ports on the remote machine integrated into
|
- Built-in proxy for accessing ports on the remote machine integrated into
|
||||||
VS Code's ports panel
|
VS Code's ports panel
|
||||||
- Settings are stored on disk like desktop VS Code, instead of in browser
|
|
||||||
storage (note that state is still stored in browser storage).
|
|
||||||
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
||||||
- Notification when updates are available
|
- Notification when updates are available
|
||||||
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
||||||
|
|
@ -450,12 +441,6 @@ Some of these changes appear very unlikely to ever be adopted by Microsoft.
|
||||||
Some may make their way upstream, further closing the gap, but at the moment it
|
Some may make their way upstream, further closing the gap, but at the moment it
|
||||||
looks like there will always be some subtle differences.
|
looks like there will always be some subtle differences.
|
||||||
|
|
||||||
## What's the difference between code-server and VS Code web?
|
|
||||||
|
|
||||||
VS Code web (which can be ran using `code serve-web`) has the same differences
|
|
||||||
as the Codespaces section above. VS Code web can be a better choice if you need
|
|
||||||
access to the official Microsoft marketplace.
|
|
||||||
|
|
||||||
## Does code-server have any security login validation?
|
## Does code-server have any security login validation?
|
||||||
|
|
||||||
code-server supports setting a single password and limits logins to two per
|
code-server supports setting a single password and limits logins to two per
|
||||||
|
|
@ -496,22 +481,3 @@ when using the option.
|
||||||
## How do I disable file download?
|
## How do I disable file download?
|
||||||
|
|
||||||
You can pass the flag `--disable-file-downloads` to `code-server`
|
You can pass the flag `--disable-file-downloads` to `code-server`
|
||||||
|
|
||||||
## Why do web views not work?
|
|
||||||
|
|
||||||
Web views rely on service workers, and service workers are only available in a
|
|
||||||
secure context, so most likely the answer is that you are using an insecure
|
|
||||||
context (for example an IP address).
|
|
||||||
|
|
||||||
If this happens, in the browser log you will see something like:
|
|
||||||
|
|
||||||
> Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope with script: An SSL certificate error occurred when fetching the script..
|
|
||||||
|
|
||||||
To fix this, you must either:
|
|
||||||
|
|
||||||
- Access over localhost/127.0.0.1 which is always considered secure.
|
|
||||||
- Use a domain with a real certificate (for example with Let's Encrypt).
|
|
||||||
- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or
|
|
||||||
create and trust a certificate manually).
|
|
||||||
- Disable security if your browser allows it. For example, in Chromium see
|
|
||||||
`chrome://flags/#unsafely-treat-insecure-origin-as-secure`
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,24 @@
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Maintaining
|
# Maintaining
|
||||||
|
|
||||||
- [Releasing](#releasing)
|
- [Team](#team)
|
||||||
|
- [Onboarding](#onboarding)
|
||||||
|
- [Offboarding](#offboarding)
|
||||||
|
- [Workflow](#workflow)
|
||||||
|
- [Milestones](#milestones)
|
||||||
|
- [Triage](#triage)
|
||||||
|
- [Versioning](#versioning)
|
||||||
|
- [Pull requests](#pull-requests)
|
||||||
|
- [Merge strategies](#merge-strategies)
|
||||||
|
- [Changelog](#changelog)
|
||||||
|
- [Releases](#releases)
|
||||||
|
- [Publishing a release](#publishing-a-release)
|
||||||
- [Release Candidates](#release-candidates)
|
- [Release Candidates](#release-candidates)
|
||||||
- [AUR](#aur)
|
- [AUR](#aur)
|
||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
- [Homebrew](#homebrew)
|
- [Homebrew](#homebrew)
|
||||||
- [nixpkgs](#nixpkgs)
|
|
||||||
- [npm](#npm)
|
- [npm](#npm)
|
||||||
|
- [Syncing with upstream Code](#syncing-with-upstream-code)
|
||||||
- [Testing](#testing)
|
- [Testing](#testing)
|
||||||
- [Documentation](#documentation)
|
- [Documentation](#documentation)
|
||||||
- [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
|
@ -17,30 +28,131 @@
|
||||||
<!-- 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 -->
|
||||||
|
|
||||||
We keep code-server up to date with VS Code releases (there are usually two or
|
This document is meant to serve current and future maintainers of code-server,
|
||||||
three a month) but we are not generally actively developing code-server aside
|
as well as share our workflow for maintaining the project.
|
||||||
from fixing regressions.
|
|
||||||
|
|
||||||
Most of the work is keeping on top of issues and discussions.
|
## Team
|
||||||
|
|
||||||
## Releasing
|
Current maintainers:
|
||||||
|
|
||||||
1. Check that the changelog lists all the important changes.
|
- @code-asher
|
||||||
2. Make sure the changelog entry lists the current version of VS Code.
|
- @jsjoeio
|
||||||
3. Update the changelog with the release date.
|
|
||||||
4. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
Occasionally, other Coder employees may step in time to time to assist with code-server.
|
||||||
|
|
||||||
|
### Onboarding
|
||||||
|
|
||||||
|
To onboard a new maintainer to the project, please make sure to do the following:
|
||||||
|
|
||||||
|
- [ ] Add to [coder/code-server](https://github.com/orgs/coder/teams/code-server)
|
||||||
|
- [ ] Add as Admin under [Repository Settings > Access](https://github.com/coder/code-server/settings/access)
|
||||||
|
- [ ] Add to [npm Coder org](https://www.npmjs.com/org/coder)
|
||||||
|
- [ ] Add as [AUR maintainer](https://aur.archlinux.org/packages/code-server/) (talk to Colin)
|
||||||
|
- [ ] Introduce to community via Discussion (see [example](https://github.com/coder/code-server/discussions/3955))
|
||||||
|
|
||||||
|
### Offboarding
|
||||||
|
|
||||||
|
Very similar to Onboarding but Remove maintainer from all teams and revoke access. Please also do the following:
|
||||||
|
|
||||||
|
- [ ] Write farewell post via Discussion (see [example](https://github.com/coder/code-server/discussions/3933))
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
The workflow used by code-server maintainers aims to be easy to understood by
|
||||||
|
the community and easy enough for new maintainers to jump in and start
|
||||||
|
contributing on day one.
|
||||||
|
|
||||||
|
### Milestones
|
||||||
|
|
||||||
|
We operate mainly using
|
||||||
|
[milestones](https://github.com/coder/code-server/milestones). This was heavily
|
||||||
|
inspired by our friends over at [vscode](https://github.com/microsoft/vscode).
|
||||||
|
|
||||||
|
Here are the milestones we use and how we use them:
|
||||||
|
|
||||||
|
- "Backlog" -> Work not yet planned for a specific release.
|
||||||
|
- "On Deck" -> Work under consideration for upcoming milestones.
|
||||||
|
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait
|
||||||
|
for the community to weigh in.
|
||||||
|
- "<Month>" -> Work to be done for said month.
|
||||||
|
|
||||||
|
With this flow, any un-assigned issues are essentially in triage state. Once
|
||||||
|
triaged, issues are either "Backlog" or "Backlog Candidates". They will
|
||||||
|
eventually move to "On Deck" (or be closed). Lastly, they will end up on a
|
||||||
|
version milestone where they will be worked on.
|
||||||
|
|
||||||
|
### Triage
|
||||||
|
|
||||||
|
We use the following process for triaging GitHub issues:
|
||||||
|
|
||||||
|
1. Create an issue
|
||||||
|
1. Add appropriate labels to the issue (including "needs-investigation" if we
|
||||||
|
should look into it further)
|
||||||
|
1. Add the issue to a milestone
|
||||||
|
1. If it should be fixed soon, add to version milestone or "On Deck"
|
||||||
|
2. If not urgent, add to "Backlog"
|
||||||
|
3. Otherwise, add to "Backlog Candidate" for future consideration
|
||||||
|
|
||||||
|
## Versioning
|
||||||
|
|
||||||
|
`<major.minor.patch>`
|
||||||
|
|
||||||
|
The code-server project follows traditional [semantic
|
||||||
|
versioning](https://semver.org/), with the objective of minimizing major changes
|
||||||
|
that break backward compatibility. We increment the patch level for all
|
||||||
|
releases, except when the upstream Visual Studio Code project increments its
|
||||||
|
minor version or we change the plugin API in a backward-compatible manner. In
|
||||||
|
those cases, we increment the minor version rather than the patch level.
|
||||||
|
|
||||||
|
## Pull requests
|
||||||
|
|
||||||
|
Ideally, every PR should fix an issue. If it doesn't, make sure it's associated
|
||||||
|
with a version milestone.
|
||||||
|
|
||||||
|
If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
|
||||||
|
version milestone will have duplicate information: the issue and the PR fixing
|
||||||
|
the issue.
|
||||||
|
|
||||||
|
### Merge strategies
|
||||||
|
|
||||||
|
For most things, we recommend the **squash and merge** strategy. There
|
||||||
|
may be times where **creating a merge commit** makes sense as well. Use your
|
||||||
|
best judgment. If you're unsure, you can always discuss in the PR with the team.
|
||||||
|
|
||||||
|
### Changelog
|
||||||
|
|
||||||
|
To save time when creating a new release for code-server, we keep a running
|
||||||
|
changelog at `CHANGELOG.md`.
|
||||||
|
|
||||||
|
If either the author or reviewer of a PR believes the change should be mentioned
|
||||||
|
in the changelog, then it should be added.
|
||||||
|
|
||||||
|
If there is not a **Next Version** when you modify `CHANGELOG.md`, please add it
|
||||||
|
using the template you see near the top of the changelog.
|
||||||
|
|
||||||
|
When writing your changelog item, ask yourself:
|
||||||
|
|
||||||
|
1. How do these changes affect code-server users?
|
||||||
|
2. What actions do they need to take (if any)?
|
||||||
|
|
||||||
|
If you need inspiration, we suggest looking at the [Emacs
|
||||||
|
changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
||||||
|
|
||||||
|
## Releases
|
||||||
|
|
||||||
|
### Publishing a release
|
||||||
|
|
||||||
|
1. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
||||||
release. Make sure CI has finished the build workflow on that commit or this
|
release. Make sure CI has finished the build workflow on that commit or this
|
||||||
will fail. For the version we match VS Code's minor and patch version. The
|
will fail.
|
||||||
patch number may become temporarily out of sync if we need to put out a
|
2. CI will automatically grab the build artifact on that commit, inject the
|
||||||
patch, but if we make our own minor change then we will not release it until
|
version into the `package.json`, put together platform-specific packages, and
|
||||||
the next minor VS Code release.
|
upload those packages to a draft release.
|
||||||
5. CI will automatically grab the build artifact on that commit (which is why CI
|
3. Summarize the major changes in the `CHANGELOG.md`.
|
||||||
has to have completed), inject the provided version into the `package.json`,
|
4. Copy the relevant changelog section to the release then publish it.
|
||||||
put together platform-specific packages, and upload those packages to a draft
|
5. CI will automatically publish the NPM package, Docker image, and update
|
||||||
release.
|
Homebrew using the published release assets.
|
||||||
6. Update the resulting draft release with the changelog contents.
|
6. Bump the chart version in `Chart.yaml` and merge in the changelog updates.
|
||||||
7. Publish the draft release after validating it.
|
|
||||||
8. Bump the Helm chart version once the Docker images have published.
|
|
||||||
|
|
||||||
#### Release Candidates
|
#### Release Candidates
|
||||||
|
|
||||||
|
|
@ -59,7 +171,7 @@ We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-se
|
||||||
|
|
||||||
#### Docker
|
#### Docker
|
||||||
|
|
||||||
We publish code-server as a Docker image [here](https://hub.docker.com/r/codercom/code-server), tagging it both with the version and latest.
|
We publish code-server as a Docker image [here](https://registry.hub.docker.com/r/codercom/code-server), tagging it both with the version and latest.
|
||||||
|
|
||||||
This is currently automated with the release process.
|
This is currently automated with the release process.
|
||||||
|
|
||||||
|
|
@ -74,44 +186,37 @@ This is currently automated with the release process (but may fail occasionally)
|
||||||
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
||||||
```
|
```
|
||||||
|
|
||||||
#### nixpkgs
|
|
||||||
|
|
||||||
We publish code-server in nixpkgs but it must be updated manually.
|
|
||||||
|
|
||||||
#### npm
|
#### npm
|
||||||
|
|
||||||
We publish code-server as a npm package [here](https://www.npmjs.com/package/code-server/v/latest).
|
We publish code-server as a npm package [here](https://www.npmjs.com/package/code-server/v/latest).
|
||||||
|
|
||||||
This is currently automated with the release process.
|
This is currently automated with the release process.
|
||||||
|
|
||||||
|
## Syncing with upstream Code
|
||||||
|
|
||||||
|
Refer to the [contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#version-updates-to-code) for information on how to update Code within code-server.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Our testing structure is laid out under our [Contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
Our testing structure is laid out under our [Contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
||||||
|
|
||||||
|
We hope to eventually hit 100% test coverage with our unit tests, and maybe one day our scripts (coverage not tracked currently).
|
||||||
|
|
||||||
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 `npm run test:unit` and look at the coverage chart. You'll see all the
|
- run `yarn 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 tests there.
|
||||||
- look at `test/scripts` to see which scripts are tested. We can always use more
|
|
||||||
tests there.
|
|
||||||
- look at `test/e2e`. We can always use more end-to-end tests.
|
- look at `test/e2e`. We can always use more end-to-end tests.
|
||||||
|
|
||||||
Otherwise, talk to a current maintainer and ask which part of the codebase is
|
Otherwise, talk to a current maintainer and ask which part of the codebase is lacking most when it comes to tests.
|
||||||
lacking most when it comes to tests.
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in
|
Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in realtime, which means you need to have the logs open in one tab and reproduce your error in another tab. Since our logs are private to Coder the organization, you can only follow these steps if you're a Coder employee. Ask a maintainer for help if you need it.
|
||||||
realtime, which means you need to have the logs open in one tab and reproduce
|
|
||||||
your error in another tab. Since our logs are private to Coder the organization,
|
|
||||||
you can only follow these steps if you're a Coder employee. Ask a maintainer for
|
|
||||||
help if you need it.
|
|
||||||
|
|
||||||
Taking a real scenario, let's say you wanted to troubleshoot [this docs
|
Taking a real scenario, let's say you wanted to troubleshoot [this docs change](https://github.com/coder/code-server/pull/4042). Here is how you would do it:
|
||||||
change](https://github.com/coder/code-server/pull/4042). Here is how you would
|
|
||||||
do it:
|
|
||||||
|
|
||||||
1. Go to https://vercel.com/codercom/codercom
|
1. Go to https://vercel.com/codercom/codercom
|
||||||
2. Click "View Function Logs"
|
2. Click "View Function Logs"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# code-server
|
# code-server
|
||||||
|
|
||||||
[](https://github.com/coder/code-server/discussions) [](https://coder.com/community) [](https://twitter.com/coderhq) [](https://discord.com/invite/coder) [](https://codecov.io/gh/coder/code-server) [](https://coder.com/docs/code-server/latest)
|
[](https://github.com/coder/code-server/discussions) [](https://coder.com/community) [](https://twitter.com/coderhq) [](https://codecov.io/gh/coder/code-server) [](https://coder.com/docs/code-server/latest)
|
||||||
|
|
||||||
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
||||||
access it in the browser.
|
access it in the browser.
|
||||||
|
|
@ -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 five ways to get started:
|
There are four 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,9 +35,6 @@ There are five 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,10 @@ 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`)
|
||||||
- `npm audit`
|
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
||||||
- Audits NPM dependencies.
|
- Audits npm and Yarn dependencies in CI (see `Audit for vulnerabilities` step
|
||||||
|
in `build.yaml`) on PRs into the default branch and fails CI if moderate or
|
||||||
|
higher vulnerabilities (see the `audit.sh` script) are present.
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
6. Exit the terminal using `exit` and then reopen the terminal
|
6. Exit the terminal using `exit` and then reopen the terminal
|
||||||
7. Install and use Node.js 22:
|
7. Install and use Node.js 18:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nvm install 22
|
nvm install 18
|
||||||
nvm use 22
|
nvm use 18
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Install code-server globally on device with: `npm install --global code-server`
|
8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`
|
||||||
9. Run code-server with `code-server`
|
9. Run code-server with `code-server`
|
||||||
10. Access on localhost:8080 in your browser
|
10. Access on localhost:8080 in your browser
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,5 @@ resource "coder_app" "code-server" {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use our official [`code-server`](https://registry.coder.com/modules/code-server) module from the Coder [module registry](htpps://registry.coder.com/modules):
|
|
||||||
|
|
||||||
```terraform
|
|
||||||
module "code-server" {
|
|
||||||
source = "registry.coder.com/modules/code-server/coder"
|
|
||||||
version = "1.0.5"
|
|
||||||
agent_id = coder_agent.example.id
|
|
||||||
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
If you run into issues, ask for help on the `coder/coder` [Discussions
|
If you run into issues, ask for help on the `coder/coder` [Discussions
|
||||||
here](https://github.com/coder/coder/discussions).
|
here](https://github.com/coder/coder/discussions).
|
||||||
|
|
|
||||||
175
docs/guide.md
|
|
@ -20,11 +20,9 @@
|
||||||
- [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)
|
- [SSH into code-server on VS Code](#ssh-into-code-server-on-vs-code)
|
||||||
- [Preflight requests](#preflight-requests)
|
- [Option 1: cloudflared tunnel](#option-1-cloudflared-tunnel)
|
||||||
- [Internationalization and customization](#internationalization-and-customization)
|
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
|
||||||
- [Available keys and placeholders](#available-keys-and-placeholders)
|
|
||||||
- [Legacy flag](#legacy-flag)
|
|
||||||
|
|
||||||
<!-- 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 -->
|
||||||
|
|
@ -123,12 +121,12 @@ 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.
|
||||||
|
|
||||||
2. You'll need a domain name (if you don't have one, you can purchase one from
|
1. 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.
|
||||||
|
|
||||||
3. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
1. 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
|
||||||
|
|
@ -138,7 +136,7 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
||||||
sudo apt install caddy
|
sudo apt install caddy
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
mydomain.com {
|
mydomain.com {
|
||||||
|
|
@ -157,7 +155,7 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
||||||
|
|
||||||
Remember to replace `mydomain.com` with your domain name!
|
Remember to replace `mydomain.com` with your domain name!
|
||||||
|
|
||||||
5. Reload Caddy:
|
1. Reload Caddy:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
sudo systemctl reload caddy
|
sudo systemctl reload caddy
|
||||||
|
|
@ -168,22 +166,21 @@ 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
|
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
||||||
sure that your instance allows HTTP/HTTPS traffic.
|
|
||||||
|
|
||||||
2. You'll need a domain name (if you don't have one, you can purchase one from
|
1. 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.
|
||||||
|
|
||||||
3. Install NGINX:
|
1. 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
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
1. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||||
configuration:
|
configuration:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
@ -204,11 +201,13 @@ 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!
|
||||||
|
|
||||||
5. Enable the config:
|
1. 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
|
||||||
|
|
@ -274,9 +273,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.com/docs/guides/code-server.html)
|
- [Pomerium](https://www.pomerium.io/guides/code-server.html)
|
||||||
- [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/)
|
- [oauth2_proxy](https://github.com/pusher/oauth2_proxy)
|
||||||
- [Cloudflare Access](https://www.cloudflare.com/zero-trust/products/access/)
|
- [Cloudflare Access](https://teams.cloudflare.com/access)
|
||||||
|
|
||||||
## HTTPS and self-signed certificates
|
## HTTPS and self-signed certificates
|
||||||
|
|
||||||
|
|
@ -295,9 +294,7 @@ 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
|
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.
|
||||||
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
|
||||||
|
|
||||||
|
|
@ -383,16 +380,14 @@ PUBLIC_URL=/absproxy/3000 \
|
||||||
BROWSER=none yarn start
|
BROWSER=none yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
You should then be able to visit
|
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
||||||
`https://my-code-server-address.io/absproxy/3000` to see your app exposed
|
code-server!
|
||||||
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
|
Similar to the situation with React apps, you have to make a few modifications to proxy a Vue app.
|
||||||
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):
|
||||||
|
|
@ -413,8 +408,7 @@ 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
|
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
|
||||||
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`
|
||||||
|
|
@ -423,8 +417,7 @@ 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
|
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
|
||||||
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):
|
||||||
|
|
@ -443,70 +436,92 @@ const config = {
|
||||||
|
|
||||||
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
|
## SSH into code-server on VS Code
|
||||||
|
|
||||||
This is a case where you need to serve an application via `absproxy` as
|
[](https://ohmyz.sh/) [](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff) [](vscode:extension/ms-vscode-remote.remote-ssh)
|
||||||
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
|
Follow these steps where code-server is running:
|
||||||
this result:
|
|
||||||
|
|
||||||
1. Start code-server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
1. Install `openssh-server`, `wget`, and `unzip`.
|
||||||
2. Follow one of the instructions above for your framework.
|
|
||||||
|
|
||||||
### Preflight requests
|
```bash
|
||||||
|
# example for Debian and Ubuntu operating systems
|
||||||
By default, if you have auth enabled, code-server will authenticate all proxied
|
sudo apt update
|
||||||
requests including preflight requests. This can cause issues because preflight
|
sudo apt install wget unzip openssh-server
|
||||||
requests do not typically include credentials. To allow all preflight requests
|
|
||||||
through the proxy without authentication, use `--skip-auth-preflight`.
|
|
||||||
|
|
||||||
## Internationalization and customization
|
|
||||||
|
|
||||||
code-server allows you to provide a JSON file to configure certain strings. This
|
|
||||||
can be used for both internationalization and customization.
|
|
||||||
|
|
||||||
Create a JSON file with your custom strings:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"WELCOME": "Welcome to {{app}}",
|
|
||||||
"LOGIN_TITLE": "{{app}} Access Portal",
|
|
||||||
"LOGIN_BELOW": "Please log in to continue",
|
|
||||||
"PASSWORD_PLACEHOLDER": "Enter Password"
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then reference the file:
|
2. Start the SSH server and set the password for your user, if you haven't already. If you use [deploy-code-server](https://github.com/coder/deploy-code-server),
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo service ssh start
|
||||||
|
sudo passwd {user} # replace user with your code-server user
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 1: cloudflared tunnel
|
||||||
|
|
||||||
|
[](https://github.com/cloudflare/cloudflared)
|
||||||
|
|
||||||
|
1. Install [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared) on your local computer and remote server
|
||||||
|
2. Then go to `~/.ssh/config` and add the following on your local computer:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
code-server --i18n /path/to/custom-strings.json
|
Host *.trycloudflare.com
|
||||||
|
HostName %h
|
||||||
|
User user
|
||||||
|
Port 22
|
||||||
|
ProxyCommand "cloudflared location" access ssh --hostname %h
|
||||||
```
|
```
|
||||||
|
|
||||||
Or this can be done in the config file:
|
3. Run `cloudflared tunnel --url ssh://localhost:22` on the remote server
|
||||||
|
|
||||||
```yaml
|
4. Finally on VS Code or any IDE that supports SSH, run `ssh user@https://your-link.trycloudflare.com` or `ssh user@your-link.trycloudflare.com`
|
||||||
i18n: /path/to/custom-strings.json
|
|
||||||
|
### Option 2: ngrok tunnel
|
||||||
|
|
||||||
|
[](https://ngrok.com/)
|
||||||
|
|
||||||
|
1. Make a new account for ngrok [here](https://dashboard.ngrok.com/login)
|
||||||
|
|
||||||
|
2. Now, get the ngrok binary with `wget` and unzip it with `unzip`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
|
||||||
|
unzip "ngrok-stable-linux-amd64.zip"
|
||||||
```
|
```
|
||||||
|
|
||||||
You can combine this with the `--locale` flag to configure language support for
|
5. Then, go to [dashboard.ngrok.com](https://dashboard.ngrok.com) and go to the `Your Authtoken` section.
|
||||||
both code-server and VS Code in cases where code-server has no support but VS
|
6. Copy the Authtoken shown there.
|
||||||
Code does. If you are using this for internationalization, please consider
|
7. Now, go to the folder where you unzipped ngrok and store the Authtoken from the ngrok Dashboard.
|
||||||
sending us a pull request to contribute it to `src/node/i18n/locales`.
|
|
||||||
|
|
||||||
### Available keys and placeholders
|
```bash
|
||||||
|
./ngrok authtoken YOUR_AUTHTOKEN # replace YOUR_AUTHTOKEN with the ngrok authtoken.
|
||||||
|
```
|
||||||
|
|
||||||
Refer to [../src/node/i18n/locales/en.json](../src/node/i18n/locales/en.json)
|
8. Now, forward port 22, which is the SSH port with this command:
|
||||||
for a full list of the available keys for translations. Note that the only
|
|
||||||
placeholders supported for each key are the ones used in the default string.
|
|
||||||
|
|
||||||
The `--app-name` flag controls the `{{app}}` placeholder in templates. If you
|
```bash
|
||||||
want to change the name, you can either:
|
./ngrok tcp 22
|
||||||
|
```
|
||||||
|
|
||||||
1. Set `--app-name` (potentially alongside `--i18n`)
|
Now, you get a screen in the terminal like this:
|
||||||
2. Use `--i18n` and hardcode the name in your strings
|
|
||||||
|
|
||||||
### Legacy flag
|
```console
|
||||||
|
ngrok by @inconshreveable(Ctrl+C to quit)
|
||||||
|
|
||||||
The `--welcome-text` flag is now deprecated. Use the `WELCOME` key instead.
|
Session Status online
|
||||||
|
Account {Your name} (Plan: Free)
|
||||||
|
Version 2.3.40
|
||||||
|
Region United States (us)
|
||||||
|
Web Interface http://127.0.0.1:4040
|
||||||
|
Forwarding tcp://0.tcp.ngrok.io:19028 -> localhost:22
|
||||||
|
```
|
||||||
|
|
||||||
|
In this case, copy the forwarded link `0.tcp.ngrok.io` and remember the port number `19028`. Type this on your local Visual Studio Code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh user@0.tcp.ngrok.io -p 19028
|
||||||
|
```
|
||||||
|
|
||||||
|
The port redirects you to the default SSH port 22, and you can then successfully connect to code-server by entering the password you set for the user.
|
||||||
|
|
||||||
|
Note: the port and the url provided by ngrok will change each time you run it so modify as needed.
|
||||||
|
|
|
||||||
|
|
@ -82,11 +82,13 @@ _exact_ same commands presented in the rest of this document.
|
||||||
- For Arch Linux, code-server will install the AUR package.
|
- For Arch Linux, code-server will install the AUR package.
|
||||||
- For any unrecognized Linux operating system, code-server will install the
|
- For any unrecognized Linux operating system, code-server will install the
|
||||||
latest standalone release into `~/.local`.
|
latest standalone release into `~/.local`.
|
||||||
|
|
||||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||||
|
|
||||||
- For macOS, code-server will install the Homebrew package (if you don't have
|
- For macOS, code-server will install the Homebrew package (if you don't have
|
||||||
Homebrew installed, code-server will install the latest standalone release
|
Homebrew installed, code-server will install the latest standalone release
|
||||||
into `~/.local`).
|
into `~/.local`).
|
||||||
|
|
||||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||||
|
|
||||||
- For FreeBSD, code-server will install the [npm package](#npm) with `npm`
|
- For FreeBSD, code-server will install the [npm package](#npm) with `npm`
|
||||||
|
|
|
||||||
15
docs/npm.md
|
|
@ -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 `22.x`. VS Code also [lists Node.js
|
currently `18.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,7 +62,8 @@ Proceed to [installing](#installing)
|
||||||
## Alpine
|
## Alpine
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
apk add alpine-sdk bash libstdc++ libc6-compat python3 krb5-dev
|
apk add alpine-sdk bash libstdc++ libc6-compat
|
||||||
|
npm config set python python3
|
||||||
```
|
```
|
||||||
|
|
||||||
Proceed to [installing](#installing)
|
Proceed to [installing](#installing)
|
||||||
|
|
@ -78,7 +79,7 @@ Proceed to [installing](#installing)
|
||||||
## FreeBSD
|
## FreeBSD
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pkg install -y git python npm-node22 pkgconf
|
pkg install -y git python npm-node18 pkgconf
|
||||||
pkg install -y libinotify
|
pkg install -y libinotify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -91,7 +92,7 @@ Installing code-server requires all of the [prerequisites for VS Code developmen
|
||||||
Next, install code-server with:
|
Next, install code-server with:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --global code-server
|
npm install --global code-server --unsafe-perm
|
||||||
code-server
|
code-server
|
||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
@ -111,7 +112,7 @@ For help and additional troubleshooting, see [#1397](https://github.com/coder/co
|
||||||
After adding the dependencies for your OS, install the code-server package globally:
|
After adding the dependencies for your OS, install the code-server package globally:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --global code-server
|
npm install --global code-server --unsafe-perm
|
||||||
code-server
|
code-server
|
||||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||||
```
|
```
|
||||||
|
|
@ -143,8 +144,8 @@ To debug installation issues, install with `npm`:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# Uninstall
|
# Uninstall
|
||||||
npm uninstall --global code-server > /dev/null 2>&1
|
npm uninstall --global --unsafe-perm code-server > /dev/null 2>&1
|
||||||
|
|
||||||
# Install with logging
|
# Install with logging
|
||||||
npm install --loglevel verbose --global code-server
|
npm install --loglevel verbose --global --unsafe-perm code-server
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ npm config set python python3
|
||||||
node -v
|
node -v
|
||||||
```
|
```
|
||||||
|
|
||||||
you will get Node version `v22`
|
you will get Node version `v18`
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
|
@ -70,7 +70,7 @@ code-server --auth none
|
||||||
7. If already installed then use the following command for upgradation.
|
7. If already installed then use the following command for upgradation.
|
||||||
|
|
||||||
```
|
```
|
||||||
npm update --global code-server
|
npm update --global code-server --unsafe-perm
|
||||||
```
|
```
|
||||||
|
|
||||||
## Upgrade
|
## Upgrade
|
||||||
|
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
20
flake.lock
|
|
@ -5,11 +5,11 @@
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533236,
|
"lastModified": 1681202837,
|
||||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -20,18 +20,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1739303263,
|
"lastModified": 1683594133,
|
||||||
"narHash": "sha256-c/Z/6gZLN8BIpYh1B3qMzEn0TArjf4F2lmy59lDLVBM=",
|
"narHash": "sha256-iUhLhEAgOCnexSGDsYT2ouydis09uDoNzM7UC685XGE=",
|
||||||
"owner": "nixos",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6cc4213488e886db863878a1e3dc26cc932d38b8",
|
"rev": "8d447c5626cfefb9b129d5b30103344377fe09bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-unstable-small",
|
"type": "indirect"
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
|
|
|
||||||
20
flake.nix
|
|
@ -1,30 +1,18 @@
|
||||||
{
|
{
|
||||||
description = "code-server";
|
description = "code-server";
|
||||||
|
|
||||||
inputs = {
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
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_22;
|
nodejs = pkgs.nodejs-18_x;
|
||||||
|
yarn' = pkgs.yarn.override { inherit nodejs; };
|
||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
imagemagick
|
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 ])
|
||||||
|
|
|
||||||
12
install.sh
|
|
@ -424,7 +424,7 @@ install_standalone() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_npm() {
|
install_npm() {
|
||||||
echoh "Installing v$VERSION from npm."
|
echoh "Installing latest from npm."
|
||||||
echoh
|
echoh
|
||||||
|
|
||||||
NPM_PATH="${YARN_PATH-npm}"
|
NPM_PATH="${YARN_PATH-npm}"
|
||||||
|
|
@ -436,12 +436,12 @@ install_npm() {
|
||||||
fi
|
fi
|
||||||
echoh "Installing with npm."
|
echoh "Installing with npm."
|
||||||
echoh
|
echoh
|
||||||
"$sh_c" "$NPM_PATH" install -g "code-server@$VERSION" --unsafe-perm
|
"$sh_c" "$NPM_PATH" install -g code-server --unsafe-perm
|
||||||
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echoerr "Please install npm to install code-server!"
|
echoerr "Please install npm to install code-server!"
|
||||||
echoerr "You will need at least node v20 and a few C dependencies."
|
echoerr "You will need at least node v18 and a few C dependencies."
|
||||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -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
|
||||||
arm64) return 0 ;;
|
amd64) return 0 ;;
|
||||||
# We only have arm64 for macOS.
|
# We only have amd64 for macOS.
|
||||||
amd64)
|
arm64)
|
||||||
[ "$(distro)" != macos ]
|
[ "$(distro)" != macos ]
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 302ff6a2e235c95b88e587d4a4b6eeb1b6613297
|
Subproject commit 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
|
||||||
6750
package-lock.json
generated
47
package.json
|
|
@ -23,49 +23,47 @@
|
||||||
"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 --log-level=warn --cache .",
|
"prettier": "prettier --write --loglevel=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": "npm run prettier && ./ci/dev/doctoc.sh",
|
"_audit": "./ci/dev/audit.sh",
|
||||||
|
"fmt": "yarn 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 npm run test:unit or npm run test:e2e' && exit 1",
|
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||||
|
"ci": "./ci/dev/ci.sh",
|
||||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
"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/eslint__js": "^8.42.3",
|
"@types/express": "^4.17.17",
|
||||||
"@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": "22.x",
|
"@types/node": "^18.0.0",
|
||||||
"@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": "^6.7.2",
|
||||||
|
"@typescript-eslint/parser": "^6.7.2",
|
||||||
|
"audit-ci": "^6.6.1",
|
||||||
"doctoc": "^2.2.1",
|
"doctoc": "^2.2.1",
|
||||||
"eslint": "^9.12.0",
|
"eslint": "^8.49.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-import-resolver-typescript": "^4.4.4",
|
"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",
|
||||||
"globals": "^16.1.0",
|
"prettier": "^3.0.3",
|
||||||
"prettier": "3.6.2",
|
"prettier-plugin-sh": "^0.13.1",
|
||||||
"prettier-plugin-sh": "^0.14.0",
|
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^5.6.2",
|
"typescript": "^5.2.2"
|
||||||
"typescript-eslint": "^8.8.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coder/logger": "^3.0.1",
|
"@coder/logger": "^3.0.1",
|
||||||
|
|
@ -73,23 +71,28 @@
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-parser": "^1.4.6",
|
"cookie-parser": "^1.4.6",
|
||||||
"env-paths": "^2.2.1",
|
"env-paths": "^2.2.1",
|
||||||
"express": "^5.0.1",
|
"express": "5.0.0-alpha.8",
|
||||||
"http-proxy": "^1.18.1",
|
"http-proxy": "^1.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
"httpolyglot": "^0.1.2",
|
||||||
"i18next": "^25.3.0",
|
"i18next": "^23.5.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"limiter": "^2.1.0",
|
"limiter": "^2.1.0",
|
||||||
"pem": "^1.14.8",
|
"pem": "^1.14.8",
|
||||||
"proxy-agent": "^6.3.1",
|
"proxy-agent": "^6.3.1",
|
||||||
"qs": "6.14.0",
|
"qs": "6.9.7",
|
||||||
"rotating-file-stream": "^3.1.1",
|
"rotating-file-stream": "^3.1.1",
|
||||||
|
"safe-buffer": "^5.2.1",
|
||||||
"safe-compare": "^1.1.4",
|
"safe-compare": "^1.1.4",
|
||||||
"semver": "^7.5.4",
|
"semver": "^7.5.4",
|
||||||
"ws": "^8.14.2",
|
"ws": "^8.14.2",
|
||||||
"xdg-basedir": "^4.0.0"
|
"xdg-basedir": "^4.0.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/node": "22.x"
|
"@types/node": "^18.0.0",
|
||||||
|
"qs": "6.9.7"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"qs": "6.9.7"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"code-server": "out/node/entry.js"
|
"code-server": "out/node/entry.js"
|
||||||
|
|
@ -104,7 +107,7 @@
|
||||||
"remote-development"
|
"remote-development"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "22"
|
"node": "18"
|
||||||
},
|
},
|
||||||
"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
|
||||||
@@ -237,7 +237,9 @@ class RemoteAuthoritiesImpl {
|
@@ -181,7 +181,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" />
|
||||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -39,7 +39,7 @@
|
|
||||||
|
|
||||||
<!-- Startup (do not modify order of script tags!) -->
|
<body aria-label="">
|
||||||
|
@@ -39,7 +39,7 @@
|
||||||
|
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||||
|
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||||
<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();
|
||||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||||
</script>
|
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||||
<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,54 +83,49 @@ 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 rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@@ -36,7 +36,7 @@
|
@@ -38,7 +38,7 @@
|
||||||
|
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||||
<!-- Startup (do not modify order of script tags!) -->
|
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||||
<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();
|
||||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||||
</script>
|
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||||
<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
|
||||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||||
@@ -282,6 +282,7 @@ export class BrowserSocketFactory implem
|
@@ -281,6 +281,7 @@ export class BrowserSocketFactory implem
|
||||||
connect({ host, port }: WebSocketRemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
|
connect({ host, port }: WebSocketRemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
|
||||||
return new Promise<ISocket>((resolve, reject) => {
|
return new Promise<ISocket>((resolve, reject) => {
|
||||||
const webSocketSchema = (/^https:/.test(mainWindow.location.href) ? 'wss' : 'ws');
|
const webSocketSchema = (/^https:/.test(mainWindow.location.href) ? 'wss' : 'ws');
|
||||||
+ path = (mainWindow.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
+ path = (mainWindow.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||||
const disposables = new DisposableStore();
|
const errorListener = socket.onError(reject);
|
||||||
disposables.add(socket.onError(reject));
|
socket.onOpen(() => {
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -245,7 +245,9 @@ export class WebClientServer {
|
@@ -269,16 +269,15 @@ 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.
|
||||||
let remoteAuthority = (
|
const 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)
|
||||||
|
|
@ -138,35 +133,42 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
);
|
);
|
||||||
if (!remoteAuthority) {
|
if (!remoteAuthority) {
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
@@ -334,6 +340,7 @@ export class WebClientServer {
|
@@ -305,8 +304,12 @@ export class WebClientServer {
|
||||||
|
scopes: [['user:email'], ['repo']]
|
||||||
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
+ const base = relativeRoot(getOriginalUrl(req))
|
||||||
|
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||||
|
+
|
||||||
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
+ rootEndpoint: rootBase,
|
+ rootEndpoint: base,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -387,7 +394,9 @@ export class WebClientServer {
|
@@ -341,8 +344,10 @@ 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: staticRoute,
|
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||||
WORKBENCH_NLS_URL,
|
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '',
|
||||||
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
|
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||||
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
|
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||||
+ BASE: rootBase,
|
+ BASE: base,
|
||||||
+ VS_BASE: basePath,
|
+ VS_BASE: vscodeBase,
|
||||||
};
|
};
|
||||||
|
|
||||||
// DEV ---------------------------------------------------------------------------------------
|
if (useTestResolver) {
|
||||||
@@ -424,7 +433,7 @@ export class WebClientServer {
|
@@ -369,7 +374,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 ?? ''} 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' ${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 ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' ${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:;',
|
||||||
@@ -497,3 +506,70 @@ export class WebClientServer {
|
@@ -442,3 +447,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -241,7 +243,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
|
||||||
@@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -56,6 +56,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
|
|
@ -253,7 +255,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
|
||||||
@@ -339,7 +339,8 @@ class LocalStorageURLCallbackProvider ex
|
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
|
||||||
this.startListening();
|
this.startListening();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -263,7 +265,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||||
}
|
}
|
||||||
|
|
||||||
private startListening(): void {
|
private startListening(): void {
|
||||||
@@ -584,17 +585,6 @@ class WorkspaceProvider implements IWork
|
@@ -550,17 +551,6 @@ class WorkspaceProvider implements IWork
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -281,7 +283,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
|
||||||
@@ -604,8 +594,8 @@ function readCookie(name: string): strin
|
@@ -569,8 +559,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');
|
||||||
}
|
}
|
||||||
|
|
@ -296,7 +298,15 @@ 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
|
||||||
@@ -120,7 +120,7 @@ export abstract class AbstractExtensionR
|
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||||
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
|
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
|
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||||
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
|
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
||||||
|
|
||||||
|
@@ -102,7 +101,7 @@ export abstract class AbstractExtensionR
|
||||||
: version,
|
: version,
|
||||||
path: 'extension'
|
path: 'extension'
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
@@ -107,10 +107,14 @@ class RemoteTerminalBackend extends Base
|
@@ -104,10 +104,14 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
const reqId = e.reqId;
|
const reqId = e.reqId;
|
||||||
const commandId = e.commandId;
|
const commandId = e.commandId;
|
||||||
|
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
|
||||||
@@ -8,6 +8,7 @@ import { isWeb } from '../../../base/com
|
|
||||||
import { isString } from '../../../base/common/types.js';
|
|
||||||
import { URI, UriComponents } from '../../../base/common/uri.js';
|
|
||||||
import { localize } from '../../../nls.js';
|
|
||||||
+import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js';
|
|
||||||
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
|
||||||
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
|
||||||
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
|
||||||
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
|
||||||
+ const clipboardService = accessor.get(IClipboardService);
|
|
||||||
+ clipboardService.writeText(content);
|
|
||||||
+})
|
|
||||||
+
|
|
||||||
class RemoteExtensionManagementCLI extends ExtensionManagementCLI {
|
|
||||||
|
|
||||||
private _location: string | undefined;
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
|
||||||
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
|
|
||||||
force?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
-export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
|
||||||
+export interface ClipboardPipeArgs {
|
|
||||||
+ type: 'clipboard';
|
|
||||||
+ content: string;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
|
||||||
|
|
||||||
export interface ICommandsExecuter {
|
|
||||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
|
||||||
@@ -106,6 +111,9 @@ export class CLIServerBase {
|
|
||||||
case 'extensionManagement':
|
|
||||||
returnObj = await this.manageExtensions(data);
|
|
||||||
break;
|
|
||||||
+ case 'clipboard':
|
|
||||||
+ returnObj = await this.clipboard(data);
|
|
||||||
+ break;
|
|
||||||
default:
|
|
||||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
|
||||||
break;
|
|
||||||
@@ -173,6 +181,10 @@ export class CLIServerBase {
|
|
||||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
|
||||||
}
|
|
||||||
|
|
||||||
+ private async clipboard(data: ClipboardPipeArgs): Promise<undefined> {
|
|
||||||
+ return await this._commands.executeCommand('_remoteCLI.setClipboard', data.content);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
dispose(): void {
|
|
||||||
this._server.close();
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
|
||||||
@@ -98,7 +98,7 @@ class RemoteTerminalBackend extends Base
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
|
||||||
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
|
||||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
|
||||||
// Ensure this request for for this window
|
|
||||||
const pty = this._ptys.get(e.persistentProcessId);
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
|
||||||
@@ -137,6 +137,7 @@ export interface NativeParsedArgs {
|
|
||||||
'disable-chromium-sandbox'?: boolean;
|
|
||||||
sandbox?: boolean;
|
|
||||||
'enable-coi'?: boolean;
|
|
||||||
+ 'stdin-to-clipboard'?: boolean;
|
|
||||||
'unresponsive-sample-interval'?: string;
|
|
||||||
'unresponsive-sample-period'?: string;
|
|
||||||
'enable-rdp-display-tracking'?: boolean;
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
|
||||||
@@ -105,6 +105,7 @@ export const OPTIONS: OptionDescriptions
|
|
||||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
|
||||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
|
||||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
|
||||||
+ 'stdin-to-clipboard': { type: 'boolean', cat: 'o', alias: 'c', description: localize('clipboard', "copies the STDIN to the clipboard") },
|
|
||||||
|
|
||||||
'extensions-dir': { type: 'string', deprecates: ['extensionHomePath'], cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
|
||||||
'extensions-download-dir': { type: 'string' },
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
|
||||||
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
|
|
||||||
case 'verbose':
|
|
||||||
case 'remote':
|
|
||||||
case 'locate-shell-integration-path':
|
|
||||||
+ case 'stdin-to-clipboard':
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
@@ -300,6 +301,22 @@ export async function main(desc: Product
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
+ if (parsedArgs['stdin-to-clipboard']) {
|
|
||||||
+ if(!hasStdinWithoutTty()) {
|
|
||||||
+ console.error("stdin has a tty.");
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
|
||||||
+ const clipboardContent = stdinBuffer.toString();
|
|
||||||
+ sendToPipe({
|
|
||||||
+ type: 'clipboard',
|
|
||||||
+ content: clipboardContent
|
|
||||||
+ }, verbose).catch(e => {
|
|
||||||
+ console.error('Error when requesting status:', e);
|
|
||||||
+ });
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (parsedArgs.status) {
|
|
||||||
await sendToPipe({
|
|
||||||
type: 'status'
|
|
||||||
|
|
@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||||
@@ -341,6 +341,10 @@ export class Extension implements IExten
|
@@ -245,6 +245,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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,38 @@
|
||||||
Add display language support
|
Add display language support
|
||||||
|
|
||||||
VS Code web appears to implement language support by setting a cookie and
|
We can remove this once upstream supports all language packs.
|
||||||
downloading language packs from a URL configured in the product.json. This patch
|
|
||||||
supports language pack extensions and uses files on the remote to set the
|
1. Proxies language packs to the service on the backend.
|
||||||
language instead, so it works like the desktop version.
|
2. NLS configuration is embedded into the HTML for the browser to pick up. This
|
||||||
|
code to generate this configuration is copied from the native portion.
|
||||||
|
3. Remove configuredLocale since we have our own thing.
|
||||||
|
4. Move the argv.json file to the server instead of in-browser storage. This is
|
||||||
|
where the current locale is stored and currently the server needs to be able
|
||||||
|
to read it.
|
||||||
|
5. Add the locale flag.
|
||||||
|
6. Remove the redundant locale verification. It does the same as the existing
|
||||||
|
one but is worse because it does not handle non-existent or empty files.
|
||||||
|
7. Replace some caching and Node requires because code-server does not restart
|
||||||
|
when changing the language unlike native Code.
|
||||||
|
8. Make language extensions installable like normal rather than using the
|
||||||
|
special set/clear language actions.
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
@@ -11,7 +11,7 @@ import * as path from 'vs/base/common/pa
|
||||||
import { IURITransformer } from '../../base/common/uriIpc.js';
|
import { IURITransformer } from 'vs/base/common/uriIpc';
|
||||||
import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js';
|
import { getMachineId, getSqmMachineId } from 'vs/base/node/id';
|
||||||
import { Promises } from '../../base/node/pfs.js';
|
import { Promises } from 'vs/base/node/pfs';
|
||||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
import { ProtocolConstants } from 'vs/base/parts/ipc/common/ipc.net';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
import { ConfigurationService } from 'vs/platform/configuration/common/configurationService';
|
||||||
@@ -272,6 +272,9 @@ export async function setupServerService
|
@@ -228,6 +228,9 @@ export async function setupServerService
|
||||||
|
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||||
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
socketServer.registerChannel('extensions', channel);
|
||||||
|
|
||||||
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService), disposables);
|
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService), disposables);
|
||||||
+ socketServer.registerChannel('languagePacks', languagePackChannel);
|
+ socketServer.registerChannel('languagePacks', languagePackChannel);
|
||||||
|
|
@ -28,11 +40,105 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
// clean up extensions folder
|
// clean up extensions folder
|
||||||
remoteExtensionsScanner.whenExtensionsReady().then(() => extensionManagementService.cleanUp());
|
remoteExtensionsScanner.whenExtensionsReady().then(() => extensionManagementService.cleanUp());
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/base/common/platform.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||||
|
@@ -2,8 +2,6 @@
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
-import * as nls from 'vs/nls';
|
||||||
|
-
|
||||||
|
export const LANGUAGE_DEFAULT = 'en';
|
||||||
|
|
||||||
|
let _isWindows = false;
|
||||||
|
@@ -85,17 +83,21 @@ if (typeof navigator === 'object' && !is
|
||||||
|
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
||||||
|
_isWeb = true;
|
||||||
|
|
||||||
|
- const configuredLocale = nls.getConfiguredDefaultLocale(
|
||||||
|
- // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`
|
||||||
|
- // to ensure that the NLS AMD Loader plugin has been loaded and configured.
|
||||||
|
- // This is because the loader plugin decides what the default locale is based on
|
||||||
|
- // how it's able to resolve the strings.
|
||||||
|
- nls.localize({ key: 'ensureLoaderPluginIsLoaded', comment: ['{Locked}'] }, '_')
|
||||||
|
- );
|
||||||
|
-
|
||||||
|
- _locale = configuredLocale || LANGUAGE_DEFAULT;
|
||||||
|
+ _locale = LANGUAGE_DEFAULT;
|
||||||
|
_language = _locale;
|
||||||
|
_platformLocale = navigator.language;
|
||||||
|
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
||||||
|
+ const rawNlsConfig = el && el.getAttribute('data-settings');
|
||||||
|
+ if (rawNlsConfig) {
|
||||||
|
+ try {
|
||||||
|
+ const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
|
||||||
|
+ const resolved = nlsConfig.availableLanguages['*'];
|
||||||
|
+ _locale = nlsConfig.locale;
|
||||||
|
+ _platformLocale = nlsConfig.osLocale;
|
||||||
|
+ _language = resolved ? resolved : LANGUAGE_DEFAULT;
|
||||||
|
+ _translationsConfigFile = nlsConfig._translationsConfigFile;
|
||||||
|
+ } catch (error) { /* Oh well. */ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Native environment
|
||||||
|
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/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||||
|
@@ -23,6 +23,9 @@
|
||||||
|
<!-- Workbench Auth Session -->
|
||||||
|
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||||
|
|
||||||
|
+ <!-- NLS Configuration -->
|
||||||
|
+ <meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
|
||||||
|
+
|
||||||
|
<!-- Workbench Icon/Manifest/CSS -->
|
||||||
|
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
|
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
|
@@ -48,15 +51,27 @@
|
||||||
|
// Normalize locale to lowercase because translationServiceUrl is case-sensitive.
|
||||||
|
// ref: https://github.com/microsoft/vscode/issues/187795
|
||||||
|
const locale = localStorage.getItem('vscode.nls.locale') || navigator.language.toLowerCase();
|
||||||
|
- if (!locale.startsWith('en')) {
|
||||||
|
- nlsConfig['vs/nls'] = {
|
||||||
|
- availableLanguages: {
|
||||||
|
- '*': locale
|
||||||
|
- },
|
||||||
|
- translationServiceUrl: '{{WORKBENCH_NLS_BASE_URL}}'
|
||||||
|
- };
|
||||||
|
- }
|
||||||
|
|
||||||
|
+ try {
|
||||||
|
+ nlsConfig['vs/nls'] = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))
|
||||||
|
+ if (nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation) {
|
||||||
|
+ const bundles = Object.create(null)
|
||||||
|
+ nlsConfig['vs/nls'].loadBundle = (bundle, _language, cb) => {
|
||||||
|
+ const result = bundles[bundle]
|
||||||
|
+ if (result) {
|
||||||
|
+ return cb(undefined, result)
|
||||||
|
+ }
|
||||||
|
+ const path = nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation + "/" + bundle.replace(/\//g, "!") + ".nls.json"
|
||||||
|
+ fetch(`{{WORKBENCH_WEB_BASE_URL}}/../vscode-remote-resource?path=${encodeURIComponent(path)}`)
|
||||||
|
+ .then((response) => response.json())
|
||||||
|
+ .then((json) => {
|
||||||
|
+ bundles[bundle] = json
|
||||||
|
+ cb(undefined, json)
|
||||||
|
+ })
|
||||||
|
+ .catch(cb)
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ } catch (error) { /* Probably fine. */ }
|
||||||
|
require.config({
|
||||||
|
baseUrl: `${baseUrl}/out`,
|
||||||
|
recordStats: true,
|
||||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
@@ -98,7 +98,7 @@ export abstract class AbstractNativeEnvi
|
@@ -101,7 +101,7 @@ export abstract class AbstractNativeEnvi
|
||||||
return URI.file(join(vscodePortable, 'argv.json'));
|
return URI.file(join(vscodePortable, 'argv.json'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,37 +151,31 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
@@ -3,6 +3,8 @@
|
@@ -32,6 +32,12 @@ export function getNLSConfiguration(lang
|
||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
if (InternalNLSConfiguration.is(value)) {
|
||||||
*--------------------------------------------------------------------------------------------*/
|
value._languagePackSupport = true;
|
||||||
|
}
|
||||||
+import { promises as fs } from 'fs';
|
+ // If the configuration has no results keep trying since code-server
|
||||||
+import * as path from 'path';
|
+ // doesn't restart when a language is installed so this result would
|
||||||
import { FileAccess } from '../../base/common/network.js';
|
+ // persist (the plugin might not be installed yet for example).
|
||||||
import { join } from '../../base/common/path.js';
|
+ if (value.locale !== 'en' && value.locale !== 'en-us' && Object.keys(value.availableLanguages).length === 0) {
|
||||||
import type { INLSConfiguration } from '../../nls.js';
|
+ _cache.delete(key);
|
||||||
@@ -33,7 +35,94 @@ export async function getNLSConfiguratio
|
+ }
|
||||||
if (!result) {
|
return value;
|
||||||
result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath });
|
});
|
||||||
nlsConfigurationCache.set(cacheKey, result);
|
_cache.set(key, result);
|
||||||
+ // If the language pack does not yet exist, it defaults to English, which is
|
@@ -46,3 +52,43 @@ export namespace InternalNLSConfiguratio
|
||||||
+ // then cached and you have to restart even if you then install the pack.
|
return candidate && typeof candidate._languagePackId === 'string';
|
||||||
+ result.then((r) => {
|
|
||||||
+ if (!language.startsWith('en') && r.resolvedLanguage.startsWith('en')) {
|
|
||||||
+ nlsConfigurationCache.delete(cacheKey);
|
|
||||||
+ }
|
|
||||||
+ })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * Copied from from src/main.js.
|
+ * The code below is copied from from src/main.js.
|
||||||
+ */
|
+ */
|
||||||
|
+
|
||||||
+export const getLocaleFromConfig = async (argvResource: string): Promise<string> => {
|
+export const getLocaleFromConfig = async (argvResource: string): Promise<string> => {
|
||||||
+ try {
|
+ try {
|
||||||
+ const content = stripComments(await fs.readFile(argvResource, 'utf8'));
|
+ const content = stripComments(await fs.promises.readFile(argvResource, 'utf8'));
|
||||||
+ return JSON.parse(content).locale;
|
+ return JSON.parse(content).locale;
|
||||||
+ } catch (error) {
|
+ } catch (error) {
|
||||||
+ if (error.code !== "ENOENT") {
|
+ if (error.code !== "ENOENT") {
|
||||||
|
|
@ -85,9 +185,6 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
+ }
|
+ }
|
||||||
+};
|
+};
|
||||||
+
|
+
|
||||||
+/**
|
|
||||||
+ * Copied from from src/main.js.
|
|
||||||
+ */
|
|
||||||
+const stripComments = (content: string): string => {
|
+const stripComments = (content: string): string => {
|
||||||
+ const regexp = /('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
|
+ const regexp = /('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
|
||||||
+
|
+
|
||||||
|
|
@ -111,116 +208,95 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||||
+ }
|
+ }
|
||||||
+ });
|
+ });
|
||||||
+};
|
+};
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * Generate translations then return a path to a JavaScript file that sets the
|
|
||||||
+ * translations into global variables. This file is loaded by the browser to
|
|
||||||
+ * set global variables that the loader uses when looking for translations.
|
|
||||||
+ *
|
|
||||||
+ * Normally, VS Code pulls these files from a CDN but we want them to be local.
|
|
||||||
+ */
|
|
||||||
+export async function getBrowserNLSConfiguration(locale: string, userDataPath: string): Promise<string> {
|
|
||||||
+ if (locale.startsWith('en')) {
|
|
||||||
+ return ''; // Use fallback translations.
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ const nlsConfig = await getNLSConfiguration(locale, userDataPath);
|
|
||||||
+ const messagesFile = nlsConfig?.languagePack?.messagesFile;
|
|
||||||
+ const resolvedLanguage = nlsConfig?.resolvedLanguage;
|
|
||||||
+ if (!messagesFile || !resolvedLanguage) {
|
|
||||||
+ return ''; // Use fallback translations.
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ const nlsFile = path.join(path.dirname(messagesFile), "nls.messages.js");
|
|
||||||
+ try {
|
|
||||||
+ await fs.stat(nlsFile);
|
|
||||||
+ return nlsFile; // We already generated the file.
|
|
||||||
+ } catch (error) {
|
|
||||||
+ // ENOENT is fine, that just means we need to generate the file.
|
|
||||||
+ if (error.code !== 'ENOENT') {
|
|
||||||
+ throw error;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ const messages = (await fs.readFile(messagesFile)).toString();
|
|
||||||
+ const content = `globalThis._VSCODE_NLS_MESSAGES=${messages};
|
|
||||||
+globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(resolvedLanguage)};`
|
|
||||||
+ await fs.writeFile(nlsFile, content, "utf-8");
|
|
||||||
+
|
|
||||||
+ return nlsFile;
|
|
||||||
+}
|
|
||||||
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
|
||||||
@@ -25,6 +25,7 @@ import { URI } from '../../base/common/u
|
@@ -27,6 +27,7 @@ import { URI } from 'vs/base/common/uri'
|
||||||
import { streamToBuffer } from '../../base/common/buffer.js';
|
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||||
import { IProductConfiguration } from '../../base/common/product.js';
|
import { IProductConfiguration } from 'vs/base/common/product';
|
||||||
import { isString, Mutable } from '../../base/common/types.js';
|
import { isString } from 'vs/base/common/types';
|
||||||
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
||||||
import { CharCode } from '../../base/common/charCode.js';
|
import { CharCode } from 'vs/base/common/charCode';
|
||||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
||||||
@@ -385,14 +386,22 @@ export class WebClientServer {
|
@@ -345,6 +346,8 @@ export class WebClientServer {
|
||||||
|
callbackRoute: this._callbackRoute
|
||||||
};
|
};
|
||||||
|
|
||||||
const cookies = cookie.parse(req.headers.cookie || '');
|
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
||||||
- const locale = cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
||||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath) || cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
||||||
let WORKBENCH_NLS_BASE_URL: string | undefined;
|
|
||||||
let WORKBENCH_NLS_URL: string;
|
|
||||||
if (!locale.startsWith('en') && this._productService.nlsCoreBaseUrl) {
|
|
||||||
WORKBENCH_NLS_BASE_URL = this._productService.nlsCoreBaseUrl;
|
|
||||||
WORKBENCH_NLS_URL = `${WORKBENCH_NLS_BASE_URL}${this._productService.commit}/${this._productService.version}/${locale}/nls.messages.js`;
|
|
||||||
} else {
|
|
||||||
- WORKBENCH_NLS_URL = ''; // fallback will apply
|
|
||||||
+ try {
|
|
||||||
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
|
||||||
+ WORKBENCH_NLS_URL = nlsFile
|
|
||||||
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
|
||||||
+ : '';
|
|
||||||
+ } catch (error) {
|
|
||||||
+ console.error("Failed to generate translations", error);
|
|
||||||
+ WORKBENCH_NLS_URL = '';
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
const values: { [key: string]: string } = {
|
const values: { [key: string]: string } = {
|
||||||
|
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||||
|
@@ -353,6 +356,7 @@ export class WebClientServer {
|
||||||
|
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||||
|
BASE: base,
|
||||||
|
VS_BASE: vscodeBase,
|
||||||
|
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (useTestResolver) {
|
||||||
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
|
||||||
@@ -22,6 +22,7 @@ export const serverOptions: OptionDescri
|
@@ -18,6 +18,7 @@ export const serverOptions: OptionDescri
|
||||||
|
'auth': { type: 'string' },
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
'disable-file-uploads': { type: 'boolean' },
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
'disable-getting-started-override': { type: 'boolean' },
|
|
||||||
+ 'locale': { type: 'string' },
|
+ 'locale': { type: 'string' },
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -113,6 +114,7 @@ export interface ServerParsedArgs {
|
@@ -101,6 +102,7 @@ export interface ServerParsedArgs {
|
||||||
|
'auth'?: string
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
'disable-getting-started-override'?: boolean,
|
|
||||||
+ 'locale'?: string
|
+ 'locale'?: string
|
||||||
|
|
||||||
/* ----- 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
|
||||||
|
@@ -50,7 +50,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';
|
||||||
|
@@ -116,8 +116,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 '../../../base/common/cancellation.js';
|
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
||||||
import { URI } from '../../../base/common/uri.js';
|
import { URI } from 'vs/base/common/uri';
|
||||||
+import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js';
|
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js';
|
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||||
import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.js';
|
import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
||||||
-import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js';
|
-import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from '../common/languagePacks.js';
|
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||||
import { ILogService } from '../../log/common/log.js';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
+import { IRemoteAgentService } from '../../../workbench/services/remote/common/remoteAgentService.js';
|
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||||
|
|
||||||
export class WebLanguagePacksService extends LanguagePackBaseService {
|
export class WebLanguagePacksService extends LanguagePackBaseService {
|
||||||
+ private readonly languagePackService: ILanguagePackService;
|
+ private readonly languagePackService: ILanguagePackService;
|
||||||
|
|
@ -244,10 +320,10 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
|
||||||
+ return this.languagePackService.getInstalledLanguages()
|
+ return this.languagePackService.getInstalledLanguages()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/localization/electron-sandbox/localeService.ts
|
||||||
@@ -51,7 +51,8 @@ class NativeLocaleService implements ILo
|
@@ -51,7 +51,8 @@ class NativeLocaleService implements ILo
|
||||||
@IProductService private readonly productService: IProductService
|
@IProductService private readonly productService: IProductService
|
||||||
) { }
|
) { }
|
||||||
|
|
@ -272,17 +348,17 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
@@ -475,9 +475,6 @@ export class InstallAction extends Exten
|
@@ -321,9 +321,6 @@ export class InstallAction extends Exten
|
||||||
if (this.extension.isBuiltin) {
|
if (this.extension.isBuiltin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||||
- return;
|
- return;
|
||||||
- }
|
- }
|
||||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
||||||
return;
|
this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
||||||
}
|
this.updateLabel();
|
||||||
@@ -782,7 +779,7 @@ export abstract class InstallInOtherServ
|
@@ -591,7 +588,7 @@ export abstract class InstallInOtherServ
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
|
|
@ -291,7 +367,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prefers to run on UI
|
// Prefers to run on UI
|
||||||
@@ -2073,17 +2070,6 @@ export class SetLanguageAction extends E
|
@@ -1751,17 +1748,6 @@ export class SetLanguageAction extends E
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = SetLanguageAction.DisabledClass;
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
|
|
@ -309,15 +385,15 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
@@ -2100,7 +2086,6 @@ export class ClearLanguageAction extends
|
@@ -1778,7 +1764,6 @@ export class ClearLanguageAction extends
|
||||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||||
@ILocaleService private readonly localeService: ILocaleService,
|
@ILocaleService private readonly localeService: ILocaleService,
|
||||||
) {
|
) {
|
||||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||||
@@ -2110,17 +2095,6 @@ export class ClearLanguageAction extends
|
@@ -1788,17 +1773,6 @@ export class ClearLanguageAction extends
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = ClearLanguageAction.DisabledClass;
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
|
|
@ -335,16 +411,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
|
||||||
===================================================================
|
|
||||||
--- 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
|
|
||||||
@@ -54,7 +54,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-browser/localeService.js';
|
|
||||||
import './services/path/browser/pathService.js';
|
|
||||||
import './services/themes/browser/browserHostColorSchemeService.js';
|
|
||||||
import './services/encryption/browser/encryptionService.js';
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -303,6 +303,16 @@ export interface IWorkbenchConstructionO
|
@@ -281,6 +281,16 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly userDataPath?: string
|
readonly userDataPath?: string
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -19,6 +19,8 @@ export const serverOptions: OptionDescri
|
@@ -16,6 +16,8 @@ export const serverOptions: OptionDescri
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
|
|
@ -99,10 +99,10 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -107,6 +109,8 @@ export interface ServerParsedArgs {
|
@@ -97,6 +99,8 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string;
|
'auth'?: string
|
||||||
+ 'disable-file-downloads'?: boolean;
|
+ 'disable-file-downloads'?: boolean;
|
||||||
+ 'disable-file-uploads'?: boolean;
|
+ 'disable-file-uploads'?: boolean;
|
||||||
|
|
||||||
|
|
@ -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
|
||||||
@@ -369,6 +369,8 @@ export class WebClientServer {
|
@@ -332,6 +332,8 @@ export class WebClientServer {
|
||||||
serverBasePath: basePath,
|
remoteAuthority,
|
||||||
webviewEndpoint: staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
+ isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
+ isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||||
|
|
@ -125,31 +125,33 @@ 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
|
||||||
@@ -6,10 +6,10 @@
|
@@ -7,12 +7,12 @@ import { Event } from 'vs/base/common/ev
|
||||||
import { Disposable } from '../../base/common/lifecycle.js';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/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, AuxiliaryBarMaximizedContext, InAutomationContext } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext } 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, AuxiliaryBarMaximizedContext, InAutomationContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||||
-import { IWorkbenchEnvironmentService } from '../services/environment/common/environmentService.js';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from '../../platform/workspace/common/workspace.js';
|
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||||
import { IWorkbenchLayoutService, Parts, positionToString } from '../services/layout/browser/layoutService.js';
|
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||||
import { getRemoteName } from '../../platform/remote/common/remoteHosts.js';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
@@ -69,7 +69,7 @@ export class WorkbenchContextKeysHandler
|
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
||||||
|
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
||||||
|
@@ -84,7 +84,7 @@ export class WorkbenchContextKeysHandler
|
||||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||||
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||||
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
|
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
|
||||||
@IProductService private readonly productService: IProductService,
|
@IProductService private readonly productService: IProductService,
|
||||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
|
||||||
@IEditorService private readonly editorService: IEditorService,
|
@IEditorService private readonly editorService: IEditorService,
|
||||||
@@ -199,6 +199,10 @@ export class WorkbenchContextKeysHandler
|
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||||
this.auxiliaryBarMaximizedContext = AuxiliaryBarMaximizedContext.bindTo(this.contextKeyService);
|
@@ -220,6 +220,10 @@ export class WorkbenchContextKeysHandler
|
||||||
this.auxiliaryBarMaximizedContext.set(this.layoutService.isAuxiliaryBarMaximized());
|
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||||
|
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||||
|
|
||||||
+ // code-server
|
+ // code-server
|
||||||
+ IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
+ IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
|
|
@ -163,15 +165,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 '../../../services/filesConfiguration/common/filesConfigurationService.js';
|
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||||
import { WorkbenchListDoubleSelection } from '../../../../platform/list/browser/listService.js';
|
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||||
import { Schemas } from '../../../../base/common/network.js';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, MultipleEditorsSelectedInGroupContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey } from '../../../common/contextkeys.js';
|
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext } 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 { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, IsEnabledFileDownloads, IsEnabledFileUploads } from 'vs/workbench/common/contextkeys';
|
||||||
import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js';
|
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||||
import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js';
|
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { ThemeIcon } from '../../../../base/common/themables.js';
|
import { ThemeIcon } from 'vs/base/common/themables';
|
||||||
@@ -571,13 +571,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -550,13 +550,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
id: DOWNLOAD_COMMAND_ID,
|
id: DOWNLOAD_COMMAND_ID,
|
||||||
title: DOWNLOAD_LABEL
|
title: DOWNLOAD_LABEL
|
||||||
},
|
},
|
||||||
|
|
@ -195,7 +197,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -589,6 +592,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -568,6 +571,7 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
title: UPLOAD_LABEL,
|
title: UPLOAD_LABEL,
|
||||||
},
|
},
|
||||||
when: ContextKeyExpr.and(
|
when: ContextKeyExpr.and(
|
||||||
|
|
@ -207,30 +209,30 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -39,6 +39,9 @@ export const EmbedderIdentifierContext =
|
@@ -40,6 +40,9 @@ export const HasWebFileSystemAccess = ne
|
||||||
|
|
||||||
export const InAutomationContext = new RawContextKey<boolean>('inAutomation', false, localize('inAutomation', "Whether VS Code is running under automation/smoke test"));
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
+export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
+export const IsEnabledFileUploads = new RawContextKey<boolean>('isEnabledFileUploads', true, true);
|
||||||
+
|
+
|
||||||
//#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 '../../../
|
@@ -18,7 +18,7 @@ import { IModelService } from 'vs/editor
|
||||||
import { ILanguageService } from '../../../../editor/common/languages/language.js';
|
import { ILanguageService } from 'vs/editor/common/languages/language';
|
||||||
import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js';
|
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
|
||||||
import { Schemas } from '../../../../base/common/network.js';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
-import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from '../../environment/browser/environmentService.js';
|
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||||
import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
|
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||||
import { IContextKeyService, IContextKey, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { equalsIgnoreCase, format, startsWithIgnoreCase } from '../../../../base/common/strings.js';
|
import { equalsIgnoreCase, format, startsWithIgnoreCase } from 'vs/base/common/strings';
|
||||||
@@ -144,7 +144,7 @@ export class SimpleFileDialog extends Di
|
@@ -143,7 +143,7 @@ export class SimpleFileDialog implements
|
||||||
@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,
|
||||||
|
|
@ -239,10 +241,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,
|
||||||
@@ -311,20 +311,22 @@ export class SimpleFileDialog extends Di
|
@@ -287,20 +287,22 @@ export class SimpleFileDialog implements
|
||||||
this.filePickBox.placeholder = nls.localize('remoteFileDialog.placeholder', "Folder path");
|
this.filePickBox.autoFocusOnList = false;
|
||||||
|
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');
|
||||||
|
|
@ -280,15 +282,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 '../../../../../
|
@@ -68,6 +68,7 @@ import { HoverPosition } from 'vs/base/b
|
||||||
import { IFilesConfigurationService } from '../../../../services/filesConfiguration/common/filesConfigurationService.js';
|
import { IFilesConfigurationService } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||||
import { mainWindow } from '../../../../../base/browser/window.js';
|
import { mainWindow } from 'vs/base/browser/window';
|
||||||
import { IExplorerFileContribution, explorerFileContribRegistry } from '../explorerFileContrib.js';
|
import { IExplorerFileContribution, explorerFileContribRegistry } from 'vs/workbench/contrib/files/browser/explorerFileContrib';
|
||||||
+import { IBrowserWorkbenchEnvironmentService } from '../../../../services/environment/browser/environmentService.js';
|
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||||
import { WorkbenchCompressibleAsyncDataTree } from '../../../../../platform/list/browser/listService.js';
|
|
||||||
import { ISearchService, QueryType, getExcludes, ISearchConfiguration, ISearchComplete, IFileQuery } from '../../../../services/search/common/search.js';
|
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
|
||||||
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
|
||||||
@@ -1594,7 +1595,8 @@ export class FileDragAndDrop implements
|
@@ -1079,7 +1080,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,
|
||||||
|
|
@ -298,7 +300,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/views/explo
|
||||||
) {
|
) {
|
||||||
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
const updateDropEnablement = (e: IConfigurationChangeEvent | undefined) => {
|
||||||
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
if (!e || e.affectsConfiguration('explorer.enableDragAndDrop')) {
|
||||||
@@ -1819,15 +1821,17 @@ export class FileDragAndDrop implements
|
@@ -1283,15 +1285,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) {
|
||||||
|
|
@ -329,7 +331,7 @@ Index: code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderS
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts
|
+++ code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderServer.ts
|
||||||
@@ -99,6 +99,7 @@ export abstract class AbstractDiskFileSy
|
@@ -92,6 +92,7 @@ export abstract class AbstractDiskFileSy
|
||||||
|
|
||||||
private async readFile(uriTransformer: IURITransformer, _resource: UriComponents, opts?: IFileAtomicReadOptions): Promise<VSBuffer> {
|
private async readFile(uriTransformer: IURITransformer, _resource: UriComponents, opts?: IFileAtomicReadOptions): Promise<VSBuffer> {
|
||||||
const resource = this.transformIncoming(uriTransformer, _resource, true);
|
const resource = this.transformIncoming(uriTransformer, _resource, true);
|
||||||
|
|
@ -337,7 +339,7 @@ Index: code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderS
|
||||||
const buffer = await this.provider.readFile(resource, opts);
|
const buffer = await this.provider.readFile(resource, opts);
|
||||||
|
|
||||||
return VSBuffer.wrap(buffer);
|
return VSBuffer.wrap(buffer);
|
||||||
@@ -117,6 +118,7 @@ export abstract class AbstractDiskFileSy
|
@@ -110,6 +111,7 @@ export abstract class AbstractDiskFileSy
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -345,7 +347,7 @@ Index: code-server/lib/vscode/src/vs/platform/files/node/diskFileSystemProviderS
|
||||||
const fileStream = this.provider.readFileStream(resource, opts, cts.token);
|
const fileStream = this.provider.readFileStream(resource, opts, cts.token);
|
||||||
listenStream(fileStream, {
|
listenStream(fileStream, {
|
||||||
onData: chunk => emitter.fire(VSBuffer.wrap(chunk)),
|
onData: chunk => emitter.fire(VSBuffer.wrap(chunk)),
|
||||||
@@ -137,7 +139,7 @@ export abstract class AbstractDiskFileSy
|
@@ -130,7 +132,7 @@ export abstract class AbstractDiskFileSy
|
||||||
|
|
||||||
private writeFile(uriTransformer: IURITransformer, _resource: UriComponents, content: VSBuffer, opts: IFileWriteOptions): Promise<void> {
|
private writeFile(uriTransformer: IURITransformer, _resource: UriComponents, content: VSBuffer, opts: IFileWriteOptions): Promise<void> {
|
||||||
const resource = this.transformIncoming(uriTransformer, _resource);
|
const resource = this.transformIncoming(uriTransformer, _resource);
|
||||||
|
|
|
||||||
|
|
@ -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 '../../../../base/browser/dom.js';
|
-import { $, Dimension, addDisposableListener, append, clearNode, getWindow, reset } from 'vs/base/browser/dom';
|
||||||
+import { $, Dimension, addDisposableListener, append, clearNode, reset, prepend } from '../../../../base/browser/dom.js';
|
+import { $, Dimension, addDisposableListener, append, clearNode, getWindow, reset, prepend } from 'vs/base/browser/dom';
|
||||||
import { renderFormattedText } from '../../../../base/browser/formattedTextRenderer.js';
|
import { renderFormattedText } from 'vs/base/browser/formattedTextRenderer';
|
||||||
import { StandardKeyboardEvent } from '../../../../base/browser/keyboardEvent.js';
|
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||||
import { Button } from '../../../../base/browser/ui/button/button.js';
|
import { Button } from 'vs/base/browser/ui/button/button';
|
||||||
@@ -53,7 +53,7 @@ import { IRecentFolder, IRecentWorkspace
|
@@ -58,7 +58,7 @@ import { IRecentFolder, IRecentWorkspace
|
||||||
import { OpenRecentAction } from '../../../browser/actions/windowActions.js';
|
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
||||||
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from '../../../browser/actions/workspaceActions.js';
|
import { OpenFileFolderAction, OpenFolderAction, OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||||
import { EditorPane } from '../../../browser/parts/editor/editorPane.js';
|
import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane';
|
||||||
-import { WorkbenchStateContext } from '../../../common/contextkeys.js';
|
-import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||||
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from '../../../common/contextkeys.js';
|
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
||||||
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
|
import { IEditorOpenContext, IEditorSerializer } from 'vs/workbench/common/editor';
|
||||||
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
|
import { IWebviewElement, IWebviewService } from 'vs/workbench/contrib/webview/browser/webview';
|
||||||
import './gettingStartedColors.js';
|
import { IFeaturedExtensionsService } from 'vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService';
|
||||||
@@ -916,6 +916,72 @@ export class GettingStartedPage extends
|
@@ -793,6 +793,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', {},);
|
||||||
|
|
||||||
@@ -951,6 +1017,9 @@ export class GettingStartedPage extends
|
@@ -842,6 +908,9 @@ export class GettingStartedPage extends
|
||||||
recentList.setLimit(5);
|
recentList.setLimit(5);
|
||||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
||||||
+ }
|
+ }
|
||||||
};
|
};
|
||||||
|
|
||||||
gettingStartedList.onDidChange(layoutLists);
|
featuredExtensionList.onDidChange(layoutFeaturedExtension);
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
||||||
|
|
@ -135,7 +135,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -313,6 +313,11 @@ export interface IWorkbenchConstructionO
|
@@ -291,6 +291,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly isEnabledFileUploads?: boolean
|
readonly isEnabledFileUploads?: boolean
|
||||||
|
|
||||||
|
|
@ -181,18 +181,18 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -21,6 +21,7 @@ export const serverOptions: OptionDescri
|
@@ -19,6 +19,7 @@ export const serverOptions: OptionDescri
|
||||||
'auth': { type: 'string' },
|
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
'disable-file-uploads': { type: 'boolean' },
|
'disable-file-uploads': { type: 'boolean' },
|
||||||
|
'locale': { type: 'string' },
|
||||||
+ 'disable-getting-started-override': { type: 'boolean' },
|
+ 'disable-getting-started-override': { type: 'boolean' },
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -111,6 +112,7 @@ export interface ServerParsedArgs {
|
@@ -103,6 +104,7 @@ export interface ServerParsedArgs {
|
||||||
'auth'?: string;
|
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'disable-file-uploads'?: boolean;
|
'disable-file-uploads'?: boolean;
|
||||||
|
'locale'?: string
|
||||||
+ 'disable-getting-started-override'?: boolean,
|
+ 'disable-getting-started-override'?: boolean,
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -373,6 +373,7 @@ export class WebClientServer {
|
@@ -336,6 +336,7 @@ export class WebClientServer {
|
||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
isEnabledFileUploads: !this._environmentService.args['disable-file-uploads'],
|
||||||
|
|
@ -213,16 +213,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||||
@@ -6,7 +6,7 @@
|
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
|
||||||
import { Disposable } from '../../base/common/lifecycle.js';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from '../../platform/contextkey/common/contextkey.js';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from '../../platform/contextkey/common/contextkeys.js';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/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, AuxiliaryBarMaximizedContext, InAutomationContext, IsEnabledFileDownloads, IsEnabledFileUploads } from '../common/contextkeys.js';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, 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, AuxiliaryBarMaximizedContext, InAutomationContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from '../common/contextkeys.js';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, IsEnabledFileDownloads, IsEnabledFileUploads, IsEnabledCoderGettingStarted, } from 'vs/workbench/common/contextkeys';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from '../services/editor/common/editorGroupsService.js';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
|
||||||
import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService.js';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
@@ -202,6 +202,7 @@ export class WorkbenchContextKeysHandler
|
@@ -223,6 +223,7 @@ export class WorkbenchContextKeysHandler
|
||||||
// code-server
|
// code-server
|
||||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
IsEnabledFileUploads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileUploads ?? true)
|
||||||
|
|
@ -234,7 +234,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -41,6 +41,7 @@ export const InAutomationContext = new R
|
@@ -42,6 +42,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 "../../base/common/lifecycle.js";
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
+import { localize } from '../../nls.js';
|
+import { localize } from 'vs/nls';
|
||||||
+import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||||
|
|
||||||
export class CodeServerClient extends Disposable {
|
export class CodeServerClient extends Disposable {
|
||||||
constructor (
|
constructor (
|
||||||
|
|
|
||||||
|
|
@ -3,28 +3,26 @@ 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 entry point to allow importing the code, instead of just running
|
2. Modify the terminal environment to filter out code-server environment variables.
|
||||||
the server immediately.
|
3. Add the code-server version to the help dialog.
|
||||||
3. Modify the terminal environment to filter out code-server environment variables.
|
4. Add ready events for use in an iframe.
|
||||||
4. Add the code-server version to the help dialog.
|
5. Add our icons.
|
||||||
5. Add ready events for use in an iframe.
|
6. Use our own manifest.
|
||||||
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 '../../platform/environment/node/argv.js';
|
import { parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv';
|
||||||
import { join, dirname } from '../../base/common/path.js';
|
import { join, dirname } from 'vs/base/common/path';
|
||||||
import { performance } from 'perf_hooks';
|
import { performance } from 'perf_hooks';
|
||||||
-import { serverOptions } from './serverEnvironmentService.js';
|
-import { serverOptions } from 'vs/server/node/serverEnvironmentService';
|
||||||
+import { serverOptions, ServerParsedArgs } from './serverEnvironmentService.js';
|
+import { serverOptions, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService';
|
||||||
import product from '../../platform/product/common/product.js';
|
import product from 'vs/platform/product/common/product';
|
||||||
import * as perf from '../../base/common/performance.js';
|
import * as perf from 'vs/base/common/performance';
|
||||||
|
|
||||||
@@ -34,38 +34,47 @@ const errorReporter: ErrorReporter = {
|
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -80,7 +78,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);
|
||||||
+function spawnCli(args = parse()): Promise<void> {
|
+export function spawnCli(args = parse()): Promise<void> {
|
||||||
+ return runCli(args, createDirs(args), serverOptions);
|
+ return runCli(args, createDirs(args), serverOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,13 +87,9 @@ 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);
|
||||||
+function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
+export 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
|
||||||
|
|
@ -109,12 +103,30 @@ Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||||
];
|
];
|
||||||
const envKeys = Object.keys(env);
|
const envKeys = Object.keys(env);
|
||||||
envKeys
|
envKeys
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||||
|
@@ -77,8 +77,11 @@ export class BrowserDialogHandler extend
|
||||||
|
|
||||||
|
async about(): Promise<void> {
|
||||||
|
const detailString = (useAgo: boolean): string => {
|
||||||
|
- return localize('aboutDetail',
|
||||||
|
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||||
|
+ return localize('aboutCodeServerDetail',
|
||||||
|
+ "code-server: {0}",
|
||||||
|
+ this.productService.codeServerVersion ? `v${this.productService.codeServerVersion}` : 'Unknown'
|
||||||
|
+ ) + '\n' + localize('aboutDetail',
|
||||||
|
+ "Code: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||||
|
this.productService.version || 'Unknown',
|
||||||
|
this.productService.commit || 'Unknown',
|
||||||
|
this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ 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 "../../base/common/lifecycle.js";
|
+import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
+
|
+
|
||||||
+export class CodeServerClient extends Disposable {
|
+export class CodeServerClient extends Disposable {
|
||||||
+ constructor (
|
+ constructor (
|
||||||
|
|
@ -164,15 +176,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 '../../pl
|
@@ -64,6 +64,7 @@ import { IOpenerService } from 'vs/platf
|
||||||
import { mixin, safeStringify } from '../../base/common/objects.js';
|
import { mixin, safeStringify } from 'vs/base/common/objects';
|
||||||
import { IndexedDB } from '../../base/browser/indexedDB.js';
|
import { IndexedDB } from 'vs/base/browser/indexedDB';
|
||||||
import { WebFileSystemAccess } from '../../platform/files/browser/webFileSystemAccess.js';
|
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||||
+import { CodeServerClient } from '../../workbench/browser/client.js';
|
+import { CodeServerClient } from 'vs/workbench/browser/client';
|
||||||
import { IProgressService } from '../../platform/progress/common/progress.js';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
|
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||||
import { dirname, joinPath } from '../../base/common/resources.js';
|
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||||
@@ -133,6 +134,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();
|
||||||
|
|
||||||
|
|
@ -186,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -65,6 +65,8 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -55,6 +55,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
|
|
@ -209,18 +221,19 @@ 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,8 +27,9 @@
|
@@ -26,9 +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" />
|
||||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
<body aria-label="">
|
||||||
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
|
||||||
|
|
@ -244,81 +257,18 @@ 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 rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.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
|
||||||
@@ -333,6 +333,7 @@ export class WebClientServer {
|
@@ -306,6 +306,7 @@ export class WebClientServer {
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration = <Partial<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,
|
||||||
Index: code-server/lib/vscode/src/server-main.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/server-main.ts
|
|
||||||
+++ code-server/lib/vscode/src/server-main.ts
|
|
||||||
@@ -22,6 +22,9 @@ import { IServerAPI } from './vs/server/
|
|
||||||
perf.mark('code/server/start');
|
|
||||||
(globalThis as { vscodeServerStartTime?: number }).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'],
|
|
||||||
@@ -150,6 +153,7 @@ if (shouldSpawnCli) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
+}
|
|
||||||
|
|
||||||
function sanitizeStringArg(val: unknown): string | undefined {
|
|
||||||
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
|
||||||
@@ -283,3 +287,22 @@ function prompt(question: string): Promi
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+async function loadCodeWithNls() {
|
|
||||||
+ const nlsConfiguration = await resolveNLSConfiguration({
|
|
||||||
+ userLocale: 'en',
|
|
||||||
+ osLocale: 'en',
|
|
||||||
+ commit: product.commit,
|
|
||||||
+ userDataPath: '',
|
|
||||||
+ nlsMetadataPath: import.meta.dirname,
|
|
||||||
+ });
|
|
||||||
+ return loadCode(nlsConfiguration);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+// 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();
|
|
||||||
+}
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/dialogs/browser/dialog.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/dialogs/browser/dialog.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/dialogs/browser/dialog.ts
|
|
||||||
@@ -45,8 +45,11 @@ export function createWorkbenchDialogOpt
|
|
||||||
|
|
||||||
export function createBrowserAboutDialogDetails(productService: IProductService): { title: string; details: string; detailsToCopy: string } {
|
|
||||||
const detailString = (useAgo: boolean): string => {
|
|
||||||
- return localize('aboutDetail',
|
|
||||||
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
|
||||||
+ return localize('aboutCodeServerDetail',
|
|
||||||
+ "code-server: {0}",
|
|
||||||
+ productService.codeServerVersion ? `v${productService.codeServerVersion}` : 'Unknown'
|
|
||||||
+ ) + '\n' + localize('aboutDetail',
|
|
||||||
+ "Code: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
|
||||||
productService.version || 'Unknown',
|
|
||||||
productService.commit || 'Unknown',
|
|
||||||
productService.date ? `${productService.date}${useAgo ? ' (' + fromNow(new Date(productService.date), true) + ')' : ''}` : 'Unknown',
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
This can be removed after upgrading to Node >= 19 as keepAlive is defaulted to
|
|
||||||
true after 19.
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/request/node/proxy.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/request/node/proxy.ts
|
|
||||||
@@ -42,6 +42,7 @@ export async function getProxyAgent(rawR
|
|
||||||
port: (proxyEndpoint.port ? +proxyEndpoint.port : 0) || (proxyEndpoint.protocol === 'https' ? 443 : 80),
|
|
||||||
auth: proxyEndpoint.auth,
|
|
||||||
rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true,
|
|
||||||
+ keepAlive: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (requestURL.protocol === 'http:') {
|
|
||||||
|
|
@ -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
|
||||||
@@ -364,6 +364,7 @@ export class WebClientServer {
|
@@ -327,6 +327,7 @@ export class WebClientServer {
|
||||||
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
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() },
|
||||||
|
|
@ -30,9 +30,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -298,6 +298,11 @@ export interface IWorkbenchConstructionO
|
@@ -276,6 +276,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly configurationDefaults?: Record<string, unknown>;
|
readonly configurationDefaults?: Record<string, any>;
|
||||||
|
|
||||||
+ /**
|
+ /**
|
||||||
+ * Path to the user data directory.
|
+ * Path to the user data directory.
|
||||||
|
|
@ -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
|
||||||
@@ -147,8 +147,10 @@ export class WorkspaceService extends Di
|
@@ -145,8 +145,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
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -556,6 +558,12 @@ export class WorkspaceService extends Di
|
@@ -552,6 +554,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
|
||||||
@@ -68,6 +68,7 @@ export interface IProductConfiguration {
|
@@ -58,6 +58,7 @@ export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
|
|
@ -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
|
||||||
@@ -18,6 +18,7 @@ import { ProtocolConstants } from '../..
|
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri'
|
||||||
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,11 +28,11 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ export const serverOptions: OptionDescri
|
@@ -95,6 +96,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
+ 'auth'?: string;
|
+ 'auth'?: string
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
|
|
@ -40,11 +40,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -341,6 +341,7 @@ export class WebClientServer {
|
@@ -311,6 +311,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: base,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
+ logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
};
|
};
|
||||||
|
|
@ -53,14 +53,14 @@ 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 "../../base/common/lifecycle.js";
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { localize } from '../../nls.js';
|
import { localize } from 'vs/nls';
|
||||||
+import { MenuId, MenuRegistry } from '../../platform/actions/common/actions.js';
|
+import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||||
+import { CommandsRegistry } from '../../platform/commands/common/commands.js';
|
+import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||||
import { ILogService } from '../../platform/log/common/log.js';
|
import { ILogService } from 'vs/platform/log/common/log';
|
||||||
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||||
import { IProductService } from '../../platform/product/common/productService.js';
|
import { IProductService } from 'vs/platform/product/common/productService';
|
||||||
import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||||
|
|
||||||
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
|
||||||
@@ -49,6 +49,17 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -47,6 +47,16 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
||||||
version: pkg.version
|
version: pkg.version
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,6 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
||||||
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
||||||
+ itemUrl: "https://open-vsx.org/vscode/item",
|
+ itemUrl: "https://open-vsx.org/vscode/item",
|
||||||
+ extensionUrlTemplate: "https://open-vsx.org/vscode/gallery/{publisher}/{name}/latest",
|
|
||||||
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||||
+ controlUrl: "",
|
+ controlUrl: "",
|
||||||
+ recommendationsUrl: "",
|
+ recommendationsUrl: "",
|
||||||
|
|
@ -41,67 +40,49 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -326,7 +326,6 @@ export class WebClientServer {
|
@@ -113,7 +113,7 @@ export class WebClientServer {
|
||||||
|
const serverRootPath = getRemoteServerRootPath(_productService);
|
||||||
|
this._staticRoute = `${serverRootPath}/static`;
|
||||||
|
this._callbackRoute = `${serverRootPath}/callback`;
|
||||||
|
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
||||||
|
+ this._webExtensionRoute = `/web-extension-resource`;
|
||||||
|
}
|
||||||
|
|
||||||
const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
|
/**
|
||||||
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
|
@@ -311,14 +311,7 @@ export class WebClientServer {
|
||||||
- const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
|
|
||||||
|
|
||||||
const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });
|
|
||||||
|
|
||||||
@@ -342,14 +341,7 @@ export class WebClientServer {
|
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: base,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
- extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||||
- ...this._productService.extensionsGallery,
|
- ...this._productService.extensionsGallery,
|
||||||
- resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
|
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||||
- scheme: 'http',
|
- scheme: 'http',
|
||||||
- authority: remoteAuthority,
|
- authority: remoteAuthority,
|
||||||
- path: `${webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||||
- }).toString(true)
|
- }).toString(true)
|
||||||
- } : undefined
|
- } : undefined
|
||||||
+ extensionsGallery: this._productService.extensionsGallery,
|
+ extensionsGallery: this._productService.extensionsGallery,
|
||||||
};
|
};
|
||||||
|
|
||||||
const proposedApi = this._environmentService.args['enable-proposed-api'];
|
if (!this._environmentService.isBuilt) {
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
+++ 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 '../
|
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||||
import { IStorageService } from '../../storage/common/storage.js';
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
import { TelemetryLevel } from '../../telemetry/common/telemetry.js';
|
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { getTelemetryLevel, supportsTelemetry } from '../../telemetry/common/telemetryUtils.js';
|
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
-import { RemoteAuthorities } from '../../../base/common/network.js';
|
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
import { TargetPlatform } from '../../extensions/common/extensions.js';
|
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';
|
||||||
import { ExtensionGalleryResourceType, getExtensionGalleryManifestResourceUri, IExtensionGalleryManifest, IExtensionGalleryManifestService } from '../../extensionManagement/common/extensionGalleryManifest.js';
|
|
||||||
import { ILogService } from '../../log/common/log.js';
|
|
||||||
@@ -163,9 +162,9 @@ export abstract class AbstractExtensionR
|
|
||||||
}
|
|
||||||
|
|
||||||
protected _isWebExtensionResourceEndPoint(uri: URI): boolean {
|
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||||
- const uriPath = uri.path, serverRootPath = RemoteAuthorities.getServerRootPath();
|
@@ -77,7 +76,7 @@ export abstract class AbstractExtensionR
|
||||||
- // test if the path starts with the server root path followed by the web extension resource end point segment
|
private readonly _environmentService: IEnvironmentService,
|
||||||
- return uriPath.startsWith(serverRootPath) && uriPath.startsWith(WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT, serverRootPath.length);
|
private readonly _configurationService: IConfigurationService,
|
||||||
+ const uriPath = uri.path;
|
) {
|
||||||
+ // test if the path starts with the web extension resource end point segment
|
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||||
+ return uriPath.startsWith(WEB_EXTENSION_RESOURCE_END_POINT_SEGMENT);
|
+ this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||||
}
|
if (_productService.extensionsGallery) {
|
||||||
|
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
||||||
}
|
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
|
||||||
Index: code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
|
|
||||||
@@ -26,6 +26,10 @@ export async function resolveMarketplace
|
|
||||||
'User-Agent': `VSCode ${version} (${productService.nameShort})`
|
|
||||||
};
|
|
||||||
|
|
||||||
+ if (productService.extensionsGallery?.authorizationHeaderToken) {
|
|
||||||
+ headers['Authorization'] = `Bearer ${productService.extensionsGallery.authorizationHeaderToken}`;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (supportsTelemetry(productService, environmentService) && getTelemetryLevel(configurationService) === TelemetryLevel.USAGE) {
|
|
||||||
const serviceMachineId = await getServiceMachineId(environmentService, fileService, storageService);
|
|
||||||
headers['X-Market-User-Id'] = serviceMachineId;
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
@@ -321,10 +321,7 @@ function extensionDescriptionArrayToMap(
|
@@ -312,10 +312,7 @@ function extensionDescriptionArrayToMap(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||||
|
|
@ -26,7 +26,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts
|
||||||
@@ -31,7 +31,7 @@ export class ExtensionsProposedApi {
|
@@ -24,7 +24,7 @@ export class ExtensionsProposedApi {
|
||||||
|
|
||||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -69,6 +69,7 @@ export interface IProductConfiguration {
|
@@ -59,6 +59,7 @@ export interface IProductConfiguration {
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
|
|
@ -42,16 +42,16 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityReso
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||||
@@ -35,7 +35,7 @@ export class RemoteAuthorityResolverServ
|
@@ -34,7 +34,7 @@ export class RemoteAuthorityResolverServ
|
||||||
|
isWorkbenchOptionsBasedResolution: boolean,
|
||||||
connectionToken: Promise<string> | string | undefined,
|
connectionToken: Promise<string> | string | undefined,
|
||||||
resourceUriProvider: ((uri: URI) => URI) | undefined,
|
resourceUriProvider: ((uri: URI) => URI) | undefined,
|
||||||
serverBasePath: string | undefined,
|
|
||||||
- @IProductService productService: IProductService,
|
- @IProductService productService: IProductService,
|
||||||
+ @IProductService private readonly productService: IProductService,
|
+ @IProductService private readonly productService: IProductService,
|
||||||
@ILogService private readonly _logService: ILogService,
|
@ILogService private readonly _logService: ILogService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
@@ -86,9 +86,14 @@ export class RemoteAuthorityResolverServ
|
@@ -85,9 +85,14 @@ export class RemoteAuthorityResolverServ
|
||||||
const connectionToken = await Promise.resolve(this._connectionTokens.get(authority) || this._connectionToken);
|
const connectionToken = await Promise.resolve(this._connectionTokens.get(authority) || this._connectionToken);
|
||||||
performance.mark(`code/didResolveConnectionToken/${authorityPrefix}`);
|
performance.mark(`code/didResolveConnectionToken/${authorityPrefix}`);
|
||||||
this._logService.info(`Resolved connection token (${authorityPrefix}) after ${sw.elapsed()} ms`);
|
this._logService.info(`Resolved connection token (${authorityPrefix}) after ${sw.elapsed()} ms`);
|
||||||
|
|
@ -71,11 +71,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -342,6 +342,7 @@ export class WebClientServer {
|
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: base,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
};
|
};
|
||||||
|
|
@ -83,7 +83,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||||
@@ -292,7 +292,7 @@ export async function createTerminalEnvi
|
@@ -271,7 +271,7 @@ export async function createTerminalEnvi
|
||||||
|
|
||||||
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
||||||
// variables
|
// variables
|
||||||
|
|
@ -96,15 +96,15 @@ 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
|
||||||
@@ -20,6 +20,7 @@ import { ISecretStorageProvider } from '
|
@@ -19,6 +19,7 @@ import { ISecretStorageProvider } from '
|
||||||
import { isFolderToOpen, isWorkspaceToOpen } from '../../../platform/window/common/window.js';
|
import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window';
|
||||||
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from '../../../workbench/browser/web.api.js';
|
import type { IWorkbenchConstructionOptions, IWorkspace, IWorkspaceProvider } from 'vs/workbench/browser/web.api';
|
||||||
import { AuthenticationSessionInfo } from '../../../workbench/services/authentication/browser/authenticationService.js';
|
import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
|
||||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from '../../../platform/tunnel/common/tunnel.js';
|
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
||||||
import type { IURLCallbackProvider } from '../../../workbench/services/url/browser/urlService.js';
|
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
||||||
import { create } from '../../../workbench/workbench.web.main.internal.js';
|
import { create } from 'vs/workbench/workbench.web.main';
|
||||||
|
|
||||||
@@ -606,6 +607,39 @@ class WorkspaceProvider implements IWork
|
@@ -571,6 +572,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,14 +148,12 @@ 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
|
||||||
@@ -83,8 +83,8 @@ export class ForwardedPortsView extends
|
@@ -81,7 +81,7 @@ export class ForwardedPortsView extends
|
||||||
private async enableForwardedPortsFeatures() {
|
this.contextKeyListener = undefined;
|
||||||
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 (featuresEnabled || viewEnabled) {
|
if (viewEnabled) {
|
||||||
// Also enable the view if it isn't already.
|
const viewContainer = await this.getViewContainer();
|
||||||
|
|
|
||||||
68
patches/safari.diff
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
Revert back to es2020
|
||||||
|
|
||||||
|
es2022 outputs static blocks when using static properties that are not
|
||||||
|
compatible with Safari, or at least not older versions of Safari.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/tsconfig.base.json
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/tsconfig.base.json
|
||||||
|
+++ code-server/lib/vscode/src/tsconfig.base.json
|
||||||
|
@@ -17,9 +17,30 @@
|
||||||
|
"./vs/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
- "target": "es2022",
|
||||||
|
- "useDefineForClassFields": false,
|
||||||
|
+ "target": "es2020",
|
||||||
|
"lib": [
|
||||||
|
+ "ES2016",
|
||||||
|
+ "ES2017.Object",
|
||||||
|
+ "ES2017.String",
|
||||||
|
+ "ES2017.Intl",
|
||||||
|
+ "ES2017.TypedArrays",
|
||||||
|
+ "ES2018.AsyncIterable",
|
||||||
|
+ "ES2018.AsyncGenerator",
|
||||||
|
+ "ES2018.Promise",
|
||||||
|
+ "ES2018.Regexp",
|
||||||
|
+ "ES2018.Intl",
|
||||||
|
+ "ES2019.Array",
|
||||||
|
+ "ES2019.Object",
|
||||||
|
+ "ES2019.String",
|
||||||
|
+ "ES2019.Symbol",
|
||||||
|
+ "ES2020.BigInt",
|
||||||
|
+ "ES2020.Promise",
|
||||||
|
+ "ES2020.String",
|
||||||
|
+ "ES2020.Symbol.WellKnown",
|
||||||
|
+ "ES2020.Intl",
|
||||||
|
+ "ES2021.Promise",
|
||||||
|
+ "ES2021.String",
|
||||||
|
+ "ES2021.WeakRef",
|
||||||
|
"ES2022",
|
||||||
|
"DOM",
|
||||||
|
"DOM.Iterable",
|
||||||
|
Index: code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
+++ code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
@@ -293,7 +293,7 @@ class SwcTranspiler {
|
||||||
|
tsx: false,
|
||||||
|
decorators: true
|
||||||
|
},
|
||||||
|
- target: 'es2022',
|
||||||
|
+ target: 'es2020',
|
||||||
|
loose: false,
|
||||||
|
minify: {
|
||||||
|
compress: false,
|
||||||
|
Index: code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
+++ code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
@@ -376,7 +376,7 @@ export class SwcTranspiler implements IT
|
||||||
|
tsx: false,
|
||||||
|
decorators: true
|
||||||
|
},
|
||||||
|
- target: 'es2022',
|
||||||
|
+ target: 'es2020',
|
||||||
|
loose: false,
|
||||||
|
minify: {
|
||||||
|
compress: false,
|
||||||
|
|
@ -15,10 +15,7 @@ service-worker.diff
|
||||||
sourcemaps.diff
|
sourcemaps.diff
|
||||||
external-file-actions.diff
|
external-file-actions.diff
|
||||||
telemetry.diff
|
telemetry.diff
|
||||||
|
display-language.diff
|
||||||
cli-window-open.diff
|
cli-window-open.diff
|
||||||
getting-started.diff
|
getting-started.diff
|
||||||
keepalive.diff
|
safari.diff
|
||||||
clipboard.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
|
||||||
@@ -70,6 +70,10 @@ export interface IProductConfiguration {
|
@@ -60,6 +60,10 @@ export interface IProductConfiguration {
|
||||||
readonly updateEndpoint?: string
|
readonly updateEndpoint?: string
|
||||||
readonly logoutEndpoint?: string
|
readonly logoutEndpoint?: string
|
||||||
readonly proxyEndpointTemplate?: string
|
readonly proxyEndpointTemplate?: string
|
||||||
|
|
@ -54,13 +54,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -343,6 +343,10 @@ export class WebClientServer {
|
@@ -313,6 +313,10 @@ export class WebClientServer {
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? rootBase + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? rootBase + '/proxy/{{port}}/',
|
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||||
+ serviceWorker: {
|
+ serviceWorker: {
|
||||||
+ scope: vscodeBase + '/',
|
+ scope: vscodeBase + '/',
|
||||||
+ path: rootBase + '/_static/out/browser/serviceWorker.js',
|
+ path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
+ },
|
+ },
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
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());
|
|
||||||
|
|
@ -6,37 +6,37 @@ not host our source maps there and want them to be self-hosted even if we could.
|
||||||
|
|
||||||
To test try debugging/browsing the source of a build in a browser.
|
To test try debugging/browsing the source of a build in a browser.
|
||||||
|
|
||||||
Index: code-server/lib/vscode/build/gulpfile.reh.ts
|
Index: code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.ts
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.ts
|
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
@@ -257,8 +257,7 @@ function packageTask(type: string, platf
|
@@ -235,8 +235,7 @@ function packageTask(type, platform, arc
|
||||||
return () => {
|
|
||||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||||
.pipe(rename(function (path) { path.dirname = path.dirname!.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||||
- .pipe(util.setExecutableBit(['**/*.sh']))
|
- .pipe(util.setExecutableBit(['**/*.sh']))
|
||||||
- .pipe(filter(['**', '!**/*.{js,css}.map']));
|
- .pipe(filter(['**', '!**/*.js.map']));
|
||||||
+ .pipe(util.setExecutableBit(['**/*.sh']));
|
+ .pipe(util.setExecutableBit(['**/*.sh']));
|
||||||
|
|
||||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||||
const isUIExtension = (manifest: { extensionKind?: string; main?: string; contributes?: Record<string, unknown> }) => {
|
const isUIExtension = (manifest) => {
|
||||||
@@ -298,9 +297,9 @@ function packageTask(type: string, platf
|
@@ -275,9 +274,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 });
|
||||||
- const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true });
|
- const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true });
|
||||||
- const sources = es.merge(src, extensions, extensionsCommonDependencies)
|
- const sources = es.merge(src, extensions, extensionsCommonDependencies)
|
||||||
+ const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true })
|
+ const extensionsCommonDependencies = gulp.src('.build/extensions/node_modules/**', { base: '.build', dot: true })
|
||||||
.pipe(filter(['**', '!**/*.{js,css}.map'], { dot: true }));
|
.pipe(filter(['**', '!**/*.js.map'], { dot: true }));
|
||||||
+ const sources = es.merge(src, extensions, extensionsCommonDependencies);
|
+ const sources = es.merge(src, extensions, extensionsCommonDependencies);
|
||||||
|
|
||||||
let version = packageJson.version;
|
let version = packageJson.version;
|
||||||
const quality = (product as typeof product & { quality?: string }).quality;
|
const quality = product.quality;
|
||||||
@@ -453,7 +452,7 @@ function tweakProductForServerWeb(produc
|
@@ -424,7 +423,7 @@ function tweakProductForServerWeb(produc
|
||||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||||
bundleTask,
|
optimizeTask,
|
||||||
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://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
|
||||||
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
||||||
));
|
));
|
||||||
gulp.task(minifyTask);
|
gulp.task(minifyTask);
|
||||||
|
|
|
||||||
|
|
@ -15,24 +15,25 @@ 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
|
||||||
@@ -3,6 +3,7 @@
|
@@ -2,7 +2,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 '../../../base/common/performance.js';
|
import * as performance from 'vs/base/common/performance';
|
||||||
import type * as vscode from 'vscode';
|
import { createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl';
|
||||||
import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js';
|
import { RequireInterceptor } from 'vs/workbench/api/common/extHostRequireInterceptor';
|
||||||
@@ -18,6 +19,7 @@ import { ExtensionRuntime } from '../com
|
@@ -17,6 +17,7 @@ import { ExtensionRuntime } from 'vs/wor
|
||||||
import { CLIServer } from './extHostCLIServer.js';
|
import { CLIServer } from 'vs/workbench/api/node/extHostCLIServer';
|
||||||
import { realpathSync } from '../../../base/node/pfs.js';
|
import { realpathSync } from 'vs/base/node/extpath';
|
||||||
import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js';
|
import { ExtHostConsoleForwarder } from 'vs/workbench/api/node/extHostConsoleForwarder';
|
||||||
+import { IExtHostWorkspace } from '../common/extHostWorkspace.js';
|
+import { IExtHostWorkspace } from '../common/extHostWorkspace';
|
||||||
import { ExtHostDiskFileSystemProvider } from './extHostDiskFileSystemProvider.js';
|
import { ExtHostDiskFileSystemProvider } from 'vs/workbench/api/node/extHostDiskFileSystemProvider';
|
||||||
import nodeModule from 'node:module';
|
|
||||||
import { assertType } from '../../../base/common/types.js';
|
|
||||||
@@ -226,6 +228,52 @@ export class ExtHostExtensionService ext
|
|
||||||
|
|
||||||
|
class NodeModuleRequireInterceptor extends RequireInterceptor {
|
||||||
|
@@ -83,6 +84,52 @@ export class ExtHostExtensionService ext
|
||||||
|
await interceptor.install();
|
||||||
performance.mark('code/extHost/didInitAPI');
|
performance.mark('code/extHost/didInitAPI');
|
||||||
|
|
||||||
+ (async () => {
|
+ (async () => {
|
||||||
|
|
@ -83,7 +84,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, this._store);
|
await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._logService, this._mainThreadTelemetryProxy, this._initData);
|
||||||
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
|
||||||
|
|
@ -93,10 +94,10 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
+import * as _http from 'http';
|
+import * as _http from 'http';
|
||||||
import minimist from 'minimist';
|
|
||||||
import * as nativeWatchdog from 'native-watchdog';
|
import * as nativeWatchdog from 'native-watchdog';
|
||||||
import * as net from 'net';
|
import * as net from 'net';
|
||||||
@@ -469,7 +470,28 @@ async function startExtensionHostProcess
|
import * as minimist from 'minimist';
|
||||||
|
@@ -400,7 +401,28 @@ async function startExtensionHostProcess
|
||||||
);
|
);
|
||||||
|
|
||||||
// rewrite onTerminate-function to be a proper shutdown
|
// rewrite onTerminate-function to be a proper shutdown
|
||||||
|
|
|
||||||
|
|
@ -12,112 +12,68 @@ 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
|
||||||
@@ -4,6 +4,7 @@
|
@@ -65,6 +65,7 @@ import { IExtensionsScannerService } fro
|
||||||
*--------------------------------------------------------------------------------------------*/
|
import { ExtensionsScannerService } from 'vs/server/node/extensionsScannerService';
|
||||||
|
import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService';
|
||||||
import { hostname, release } from 'os';
|
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||||
+import { promises as fs } from 'fs';
|
+import { TelemetryClient } from 'vs/server/node/telemetryClient';
|
||||||
import { Emitter, Event } from '../../base/common/event.js';
|
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||||
import { DisposableStore, toDisposable } from '../../base/common/lifecycle.js';
|
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||||
import { Schemas } from '../../base/common/network.js';
|
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||||
@@ -65,6 +66,7 @@ import { IExtensionsScannerService } fro
|
@@ -149,7 +150,10 @@ export async function setupServerService
|
||||||
import { ExtensionsScannerService } from './extensionsScannerService.js';
|
|
||||||
import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js';
|
|
||||||
import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js';
|
|
||||||
+import { TelemetryClient } from './telemetryClient.js';
|
|
||||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
|
||||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
|
||||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
|
||||||
@@ -166,11 +168,23 @@ export async function setupServerService
|
|
||||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
|
||||||
services.set(IRequestService, requestService);
|
|
||||||
|
|
||||||
+ let isContainer = undefined;
|
|
||||||
+ try {
|
|
||||||
+ await fs.stat('/run/.containerenv');
|
|
||||||
+ isContainer = true;
|
|
||||||
+ } catch (error) { /* Does not exist, probably. */ }
|
|
||||||
+ if (!isContainer) {
|
|
||||||
+ try {
|
|
||||||
+ const content = await fs.readFile('/proc/self/cgroup', 'utf8')
|
|
||||||
+ isContainer = content.includes('docker');
|
|
||||||
+ } catch (error) { /* Permission denied, probably. */ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
let oneDsAppender: ITelemetryAppender = NullAppender;
|
let oneDsAppender: ITelemetryAppender = NullAppender;
|
||||||
const isInternal = isInternalTelemetry(productService, configurationService);
|
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||||
if (supportsTelemetry(productService, environmentService)) {
|
if (supportsTelemetry(productService, environmentService)) {
|
||||||
- if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
- if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
||||||
- oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
+ const telemetryEndpoint = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
|
||||||
+ if (!isLoggingOnly(productService, environmentService) && productService.telemetryEndpoint) {
|
+ if (telemetryEndpoint) {
|
||||||
+ oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, () => new TelemetryClient(productService.telemetryEndpoint!, machineId, isContainer));
|
+ oneDsAppender = new OneDataSystemAppender(requestService, false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint));
|
||||||
|
+ } else if (!isLoggingOnly(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
||||||
|
oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
||||||
disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
||||||
}
|
}
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
+++ code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||||
@@ -0,0 +1,71 @@
|
@@ -0,0 +1,49 @@
|
||||||
+import { AppInsightsCore, IExtendedTelemetryItem, ITelemetryItem } from '@microsoft/1ds-core-js';
|
+import { AppInsightsCore, IExtendedTelemetryItem, ITelemetryItem } from '@microsoft/1ds-core-js';
|
||||||
+import * as https from 'https';
|
+import * as https from 'https';
|
||||||
+import * as http from 'http';
|
+import * as http from 'http';
|
||||||
+import * as os from 'os';
|
+import * as os from 'os';
|
||||||
+
|
+
|
||||||
+interface SystemInfo {
|
|
||||||
+ measurements: Record<string, number | undefined>;
|
|
||||||
+ properties: Record<string, string | boolean | null | undefined>;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+export class TelemetryClient extends AppInsightsCore {
|
+export class TelemetryClient extends AppInsightsCore {
|
||||||
+ private readonly systemInfo: SystemInfo = {
|
+ public constructor(private readonly endpoint: string) {
|
||||||
+ measurements: {},
|
|
||||||
+ properties: {},
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ public constructor(
|
|
||||||
+ private readonly endpoint: string,
|
|
||||||
+ machineId: string,
|
|
||||||
+ isContainer: boolean | undefined) {
|
|
||||||
+ super();
|
+ super();
|
||||||
+
|
|
||||||
+ // os.cpus() can take a very long time sometimes (personally I see 1-2
|
|
||||||
+ // seconds in a Coder workspace). This adds up significantly, especially
|
|
||||||
+ // when many telemetry requests are sent during startup, which can cause
|
|
||||||
+ // connection timeouts. Try to cache as much as we can.
|
|
||||||
+ try {
|
|
||||||
+ const cpus = os.cpus();
|
|
||||||
+ this.systemInfo.measurements.cores = cpus.length;
|
|
||||||
+ this.systemInfo.properties['common.cpuModel'] = cpus[0].model;
|
|
||||||
+ } catch (error) {}
|
|
||||||
+
|
|
||||||
+ try {
|
|
||||||
+ this.systemInfo.properties['common.shell'] = os.userInfo().shell;
|
|
||||||
+ this.systemInfo.properties['common.release'] = os.release();
|
|
||||||
+ this.systemInfo.properties['common.arch'] = os.arch();
|
|
||||||
+ } catch (error) {}
|
|
||||||
+
|
|
||||||
+ this.systemInfo.properties['common.remoteMachineId'] = machineId;
|
|
||||||
+ this.systemInfo.properties['common.isContainer'] = isContainer;
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public override track(item: IExtendedTelemetryItem | ITelemetryItem): void {
|
+ public override track(item: IExtendedTelemetryItem | ITelemetryItem): void {
|
||||||
+ const options = item.baseData || {}
|
+ const options = item.baseData || {}
|
||||||
+ options.measurements = {
|
+ if (!options.properties) {
|
||||||
+ ...(options.measurements || {}),
|
+ options.properties = {};
|
||||||
+ ...this.systemInfo.measurements,
|
|
||||||
+ }
|
+ }
|
||||||
+ options.properties = {
|
+ if (!options.measurements) {
|
||||||
+ ...(options.properties || {}),
|
+ options.measurements = {};
|
||||||
+ ...this.systemInfo.properties,
|
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ try {
|
+ try {
|
||||||
|
+ const cpus = os.cpus();
|
||||||
|
+ options.measurements.cores = cpus.length;
|
||||||
|
+ options.properties['common.cpuModel'] = cpus[0].model;
|
||||||
|
+ } catch (error) {}
|
||||||
|
+
|
||||||
|
+ try {
|
||||||
+ options.measurements.memoryFree = os.freemem();
|
+ options.measurements.memoryFree = os.freemem();
|
||||||
+ options.measurements.memoryTotal = os.totalmem();
|
+ options.measurements.memoryTotal = os.totalmem();
|
||||||
+ } catch (error) {}
|
+ } catch (error) {}
|
||||||
+
|
+
|
||||||
+ try {
|
+ try {
|
||||||
|
+ options.properties['common.shell'] = os.userInfo().shell;
|
||||||
|
+ options.properties['common.release'] = os.release();
|
||||||
|
+ options.properties['common.arch'] = os.arch();
|
||||||
|
+ } catch (error) {}
|
||||||
|
+
|
||||||
|
+ try {
|
||||||
+ const request = (/^http:/.test(this.endpoint) ? http : https).request(this.endpoint, {
|
+ const request = (/^http:/.test(this.endpoint) ? http : https).request(this.endpoint, {
|
||||||
+ method: 'POST',
|
+ method: 'POST',
|
||||||
+ headers: {
|
+ headers: {
|
||||||
|
|
@ -134,38 +90,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -347,6 +347,8 @@ export class WebClientServer {
|
@@ -317,6 +317,7 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: rootBase + '/_static/out/browser/serviceWorker.js',
|
path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
+ enableTelemetry: this._productService.enableTelemetry,
|
+ enableTelemetry: this._productService.enableTelemetry,
|
||||||
+ telemetryEndpoint: this._productService.telemetryEndpoint,
|
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
};
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
|
||||||
@@ -74,6 +74,7 @@ export interface IProductConfiguration {
|
|
||||||
readonly path: string;
|
|
||||||
readonly scope: string;
|
|
||||||
}
|
|
||||||
+ readonly telemetryEndpoint?: string
|
|
||||||
|
|
||||||
readonly version: string;
|
|
||||||
readonly date?: string;
|
|
||||||
Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|
||||||
@@ -58,7 +58,8 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
|
||||||
resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
|
||||||
controlUrl: "",
|
|
||||||
recommendationsUrl: "",
|
|
||||||
- })
|
|
||||||
+ }),
|
|
||||||
+ telemetryEndpoint: env.CS_TELEMETRY_URL || product.telemetryEndpoint || "https://v1.telemetry.coder.com/track",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
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
|
|
||||||
@@ -23,6 +23,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 ----- */
|
|
||||||
|
|
||||||
@@ -115,6 +116,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 '../../../../platform/userDataProfile/common/userDataProfile.js';
|
import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||||
import { IAnyWorkspaceIdentifier } from '../../../../platform/workspace/common/workspace.js';
|
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
||||||
import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
|
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';
|
||||||
+import { hash } from '../../../../base/common/hash.js';
|
+import { hash } from 'vs/base/common/hash';
|
||||||
|
|
||||||
export class BrowserStorageService extends AbstractStorageService {
|
export class BrowserStorageService extends AbstractStorageService {
|
||||||
|
|
||||||
@@ -300,7 +301,11 @@ export class IndexedDBStorageDatabase ex
|
@@ -298,7 +299,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 "../../base/common/lifecycle.js";
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { localize } from '../../nls.js';
|
import { localize } from 'vs/nls';
|
||||||
+import { ILogService } from '../../platform/log/common/log.js';
|
+import { ILogService } from 'vs/platform/log/common/log';
|
||||||
import { INotificationService, Severity } from '../../platform/notification/common/notification.js';
|
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||||
+import { IProductService } from '../../platform/product/common/productService.js';
|
+import { IProductService } from 'vs/platform/product/common/productService';
|
||||||
+import { IStorageService, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js';
|
+import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||||
|
|
||||||
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
|
||||||
@@ -67,6 +67,7 @@ export type ExtensionVirtualWorkspaceSup
|
@@ -57,6 +57,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||||
export interface IProductConfiguration {
|
export interface IProductConfiguration {
|
||||||
readonly codeServerVersion?: string
|
readonly codeServerVersion?: string
|
||||||
readonly rootEndpoint?: string
|
readonly rootEndpoint?: string
|
||||||
|
|
@ -101,23 +101,15 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
|
|
||||||
readonly version: string;
|
readonly version: string;
|
||||||
readonly date?: string;
|
readonly date?: string;
|
||||||
@@ -112,6 +113,7 @@ export interface IProductConfiguration {
|
|
||||||
readonly resourceUrlTemplate: string;
|
|
||||||
readonly nlsBaseUrl: string;
|
|
||||||
readonly accessSKUs?: string[];
|
|
||||||
+ readonly authorizationHeaderToken?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
readonly mcpGallery?: {
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -340,6 +340,7 @@ export class WebClientServer {
|
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: rootBase,
|
rootEndpoint: base,
|
||||||
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? rootBase + '/update/check' : undefined,
|
+ updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
};
|
};
|
||||||
|
|
@ -125,8 +117,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -16,6 +16,8 @@ import { join } from '../../base/common/
|
@@ -13,6 +13,8 @@ import { memoize } from 'vs/base/common/
|
||||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
+ /* ----- code-server ----- */
|
+ /* ----- code-server ----- */
|
||||||
|
|
@ -134,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -101,6 +103,8 @@ export const serverOptions: OptionDescri
|
@@ -91,6 +93,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
|
||||||
@@ -220,7 +220,7 @@ export class BrowserWorkbenchEnvironment
|
@@ -225,7 +225,7 @@ export class BrowserWorkbenchEnvironment
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
get webviewExternalEndpoint(): string {
|
get webviewExternalEndpoint(): string {
|
||||||
|
|
@ -54,11 +54,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -360,6 +360,7 @@ export class WebClientServer {
|
@@ -323,6 +323,7 @@ export class WebClientServer {
|
||||||
|
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
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,
|
||||||
|
|
@ -70,21 +70,29 @@ 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-TaWGDzV7c9rUH2q/5ygOyYUHSyHIqBMYfucPh3lnKvU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-frEVWVmmI4TWHGHXZaCTWqGQI9jv+i8hv+sOa87Gqlc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-nQZh+9dHKZP2cHbhYlCbWDtqxxJtGjRGBx57zNP2DZM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-1BNp/IJ0Swu9k0gYe2BJz18zVYJ4emIdN3fjPgGScQI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -256,7 +256,7 @@
|
@@ -339,6 +339,12 @@
|
||||||
}
|
|
||||||
|
|
||||||
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
|
const hostname = location.hostname;
|
||||||
- navigator.serviceWorker.register(swPath, { type: 'module' })
|
|
||||||
+ navigator.serviceWorker.register(swPath)
|
+ // It is safe to run if we are on the same host.
|
||||||
.then(async registration => {
|
+ const parent = new URL(parentOrigin)
|
||||||
/**
|
+ if (parent.hostname === hostname) {
|
||||||
* @param {MessageEvent} event
|
+ return start(parentOrigin)
|
||||||
@@ -370,6 +370,12 @@
|
+ }
|
||||||
|
+
|
||||||
|
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
|
||||||
|
@@ -338,6 +338,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
|
|
@ -105,12 +113,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-cl8ijlOzEe+0GRCQNJQu2k6nUQ0fAYNYIuuKEm72JDs=' https: http://localhost:* blob:;
|
- script-src 'self' 'unsafe-eval' 'sha256-75NYUUvf+5++1WbfCZOV3PSWxBhONpaxwx+mkOFRv/Y=' https:;
|
||||||
+ script-src 'self' 'unsafe-eval' 'sha256-yhZXuB8LS6t73dvNg6rtLX8y4PHLnqRm5+6DdOGkOcw=' https: http://localhost:* blob:;
|
+ script-src 'self' 'unsafe-eval' 'sha256-c7vPrYRaSLDtFSrI4CuHYgBQ3a4c4x2LSm/LefSZADQ=' https:;
|
||||||
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>
|
||||||
@@ -25,6 +25,13 @@
|
@@ -23,6 +23,13 @@
|
||||||
// validation not requested
|
// validation not requested
|
||||||
return start();
|
return start();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
src/browser/favicon.afdesign
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:625d2049c38ae27df0613fa533020e889fa98affd603050f46d3748be7b90d0b
|
||||||
|
size 38675
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
<svg width="100%" height="100%" viewBox="0 0 147 147" xmlns="http://www.w3.org/2000/svg">
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 2250 2250" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><style>
|
||||||
<style>@media (prefers-color-scheme: dark) {* { fill: white; }}</style>
|
@media (prefers-color-scheme: dark) {
|
||||||
<path d="m42.4214,39.655c-24.4057,0 -42.1554,13.1721 -42.1554,33.845c0,20.5814 18.4892,33.845 42.1554,33.845c23.6662,0 38.1803,-11.6171 38.7349,-28.7225l-21.0777,-0.4574c-0.9244,9.3303 -9.1059,15.1845 -17.6572,15.1845c-11.7406,0 -20.4306,-7.5922 -20.4306,-19.8496c0,-12.2574 8.69,-19.9868 20.4306,-20.2155c8.5513,-0.183 16.9177,5.9457 17.4723,15.276l21.0777,-0.6403c-0.4622,-16.8311 -14.1442,-28.2652 -38.55,-28.2652zm48.8446,2l55.468,0l0,64.0311l-55.468,0l0,-64.0311z" clip-rule="evenodd" fill-rule="evenodd"/>
|
* {
|
||||||
</svg>
|
fill: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style><rect id="favicon" x="0" y="0" width="2250" height="2250" style="fill:none;"/><g id="favicon1" serif:id="favicon"><path d="M1991.66,1034.72c-38.493,0 -64.144,-22.57 -64.144,-68.897l-0,-266.084c-0,-169.867 -69.982,-263.709 -250.762,-263.709l-83.976,0l-0,179.368l25.661,0c71.144,0 104.967,39.201 104.967,109.285l0,235.201c0,102.156 30.324,143.733 96.806,165.114c-66.482,20.196 -96.806,62.958 -96.806,165.114l0,174.621c0,48.7 0,96.216 -12.829,144.917c-12.829,45.141 -33.823,87.903 -62.98,124.726c-16.329,21.386 -34.991,39.202 -55.981,55.835l-0,23.755l83.971,-0c180.781,-0 250.763,-93.843 250.763,-263.709l-0,-266.084c-0,-47.516 24.485,-68.897 64.144,-68.897l47.822,-0l-0,-179.37l-46.656,-0l0,-1.186Z" style="fill-rule:nonzero;"/><path d="M1420.16,706.904l-258.923,0c-5.833,0 -10.495,-4.752 -10.495,-10.691l-0,-20.192c-0,-5.941 4.662,-10.692 10.495,-10.692l260.089,0c5.83,0 10.495,4.751 10.495,10.692l0,20.192c0,5.939 -5.833,10.691 -11.661,10.691Z" style="fill-rule:nonzero;"/><path d="M1464.48,963.474l-188.942,0c-5.833,0 -10.501,-4.754 -10.501,-10.693l0,-20.192c0,-5.938 4.668,-10.691 10.501,-10.691l188.942,-0c5.833,-0 10.495,4.753 10.495,10.691l-0,20.192c-0,4.754 -4.662,10.693 -10.495,10.693Z" style="fill-rule:nonzero;"/><path d="M1539.12,835.188l-377.885,0c-5.833,0 -10.495,-4.75 -10.495,-10.689l-0,-20.196c-0,-5.939 4.662,-10.69 10.495,-10.69l376.719,0c5.833,0 10.499,4.751 10.499,10.69l-0,20.196c-0,4.75 -3.5,10.689 -9.333,10.689Z" style="fill-rule:nonzero;"/><path d="M861.493,765.074c25.658,0 51.319,2.376 75.811,8.316l0,-48.705c0,-68.897 34.989,-109.285 104.971,-109.285l25.658,0l-0,-179.368l-83.977,0c-180.781,0 -250.758,93.842 -250.758,263.709l0,87.901c40.819,-14.252 83.977,-22.568 128.295,-22.568Z" style="fill-rule:nonzero;"/><path d="M1618.44,1411.25c-18.662,-150.861 -132.962,-276.776 -279.919,-305.285c-40.818,-8.314 -81.642,-9.504 -121.295,-2.376c-1.166,-0 -1.166,-1.189 -2.332,-1.189c-64.148,-136.605 -201.772,-226.884 -351.063,-226.884c-149.289,-0 -285.747,87.905 -351.062,224.51c-1.166,-0 -1.166,1.188 -2.332,1.188c-41.987,-4.753 -83.975,-2.379 -125.963,8.314c-144.623,35.634 -254.257,159.175 -274.085,308.847c-2.332,15.441 -3.499,30.883 -3.499,45.141c0,45.136 30.325,86.713 74.645,92.652c54.817,8.317 102.636,-34.448 101.469,-89.089c0,-8.317 0,-17.821 1.167,-26.134c9.331,-76.025 66.48,-140.168 141.123,-157.99c23.328,-5.939 46.654,-7.124 68.814,-3.559c71.146,9.502 141.124,-27.324 171.449,-91.467c22.162,-47.516 57.151,-89.094 103.804,-111.664c51.314,-24.946 109.633,-28.506 163.286,-9.499c55.979,20.192 97.966,62.954 123.627,116.409c26.824,52.27 39.653,89.093 96.805,96.221c23.325,3.559 88.639,2.374 113.132,1.185c47.82,0 95.64,16.631 129.463,51.079c22.156,23.757 38.485,53.455 45.486,86.715c10.495,53.455 -2.334,106.908 -33.825,147.296c-22.162,28.509 -52.485,49.89 -86.308,59.394c-16.329,4.754 -32.657,5.939 -48.986,5.939l-257.757,0c-51.314,0 -92.138,-41.573 -92.138,-93.842l0,-348.049c0,-14.251 -11.661,-26.13 -25.658,-26.13l-36.156,0c-71.148,1.185 -128.295,81.964 -128.295,167.488l-0,312.415c-0,92.652 73.476,167.488 164.451,167.488c0,0 404.714,-1.19 410.544,-1.19c93.304,-9.503 179.614,-58.204 237.927,-133.04c58.319,-72.46 85.142,-167.492 73.481,-264.894Z" style="fill-rule:nonzero;"/></g></svg>
|
||||||
|
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.8 KiB |
|
|
@ -1,3 +1 @@
|
||||||
<svg width="100%" height="100%" viewBox="0 0 147 147" xmlns="http://www.w3.org/2000/svg">
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 2250 2250" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="favicon" x="0" y="0" width="2250" height="2250" style="fill:none;"/><g id="favicon1" serif:id="favicon"><path d="M1991.66,1034.72c-38.493,0 -64.144,-22.57 -64.144,-68.897l-0,-266.084c-0,-169.867 -69.982,-263.709 -250.762,-263.709l-83.976,0l-0,179.368l25.661,0c71.144,0 104.967,39.201 104.967,109.285l0,235.201c0,102.156 30.324,143.733 96.806,165.114c-66.482,20.196 -96.806,62.958 -96.806,165.114l0,174.621c0,48.7 0,96.216 -12.829,144.917c-12.829,45.141 -33.823,87.903 -62.98,124.726c-16.329,21.386 -34.991,39.202 -55.981,55.835l-0,23.755l83.971,-0c180.781,-0 250.763,-93.843 250.763,-263.709l-0,-266.084c-0,-47.516 24.485,-68.897 64.144,-68.897l47.822,-0l-0,-179.37l-46.656,-0l0,-1.186Z" style="fill-rule:nonzero;"/><path d="M1420.16,706.904l-258.923,0c-5.833,0 -10.495,-4.752 -10.495,-10.691l-0,-20.192c-0,-5.941 4.662,-10.692 10.495,-10.692l260.089,0c5.83,0 10.495,4.751 10.495,10.692l0,20.192c0,5.939 -5.833,10.691 -11.661,10.691Z" style="fill-rule:nonzero;"/><path d="M1464.48,963.474l-188.942,0c-5.833,0 -10.501,-4.754 -10.501,-10.693l0,-20.192c0,-5.938 4.668,-10.691 10.501,-10.691l188.942,-0c5.833,-0 10.495,4.753 10.495,10.691l-0,20.192c-0,4.754 -4.662,10.693 -10.495,10.693Z" style="fill-rule:nonzero;"/><path d="M1539.12,835.188l-377.885,0c-5.833,0 -10.495,-4.75 -10.495,-10.689l-0,-20.196c-0,-5.939 4.662,-10.69 10.495,-10.69l376.719,0c5.833,0 10.499,4.751 10.499,10.69l-0,20.196c-0,4.75 -3.5,10.689 -9.333,10.689Z" style="fill-rule:nonzero;"/><path d="M861.493,765.074c25.658,0 51.319,2.376 75.811,8.316l0,-48.705c0,-68.897 34.989,-109.285 104.971,-109.285l25.658,0l-0,-179.368l-83.977,0c-180.781,0 -250.758,93.842 -250.758,263.709l0,87.901c40.819,-14.252 83.977,-22.568 128.295,-22.568Z" style="fill-rule:nonzero;"/><path d="M1618.44,1411.25c-18.662,-150.861 -132.962,-276.776 -279.919,-305.285c-40.818,-8.314 -81.642,-9.504 -121.295,-2.376c-1.166,-0 -1.166,-1.189 -2.332,-1.189c-64.148,-136.605 -201.772,-226.884 -351.063,-226.884c-149.289,-0 -285.747,87.905 -351.062,224.51c-1.166,-0 -1.166,1.188 -2.332,1.188c-41.987,-4.753 -83.975,-2.379 -125.963,8.314c-144.623,35.634 -254.257,159.175 -274.085,308.847c-2.332,15.441 -3.499,30.883 -3.499,45.141c0,45.136 30.325,86.713 74.645,92.652c54.817,8.317 102.636,-34.448 101.469,-89.089c0,-8.317 0,-17.821 1.167,-26.134c9.331,-76.025 66.48,-140.168 141.123,-157.99c23.328,-5.939 46.654,-7.124 68.814,-3.559c71.146,9.502 141.124,-27.324 171.449,-91.467c22.162,-47.516 57.151,-89.094 103.804,-111.664c51.314,-24.946 109.633,-28.506 163.286,-9.499c55.979,20.192 97.966,62.954 123.627,116.409c26.824,52.27 39.653,89.093 96.805,96.221c23.325,3.559 88.639,2.374 113.132,1.185c47.82,0 95.64,16.631 129.463,51.079c22.156,23.757 38.485,53.455 45.486,86.715c10.495,53.455 -2.334,106.908 -33.825,147.296c-22.162,28.509 -52.485,49.89 -86.308,59.394c-16.329,4.754 -32.657,5.939 -48.986,5.939l-257.757,0c-51.314,0 -92.138,-41.573 -92.138,-93.842l0,-348.049c0,-14.251 -11.661,-26.13 -25.658,-26.13l-36.156,0c-71.148,1.185 -128.295,81.964 -128.295,167.488l-0,312.415c-0,92.652 73.476,167.488 164.451,167.488c0,0 404.714,-1.19 410.544,-1.19c93.304,-9.503 179.614,-58.204 237.927,-133.04c58.319,-72.46 85.142,-167.492 73.481,-264.894Z" style="fill-rule:nonzero;"/></g></svg>
|
||||||
<path d="m42.4214,39.655c-24.4057,0 -42.1554,13.1721 -42.1554,33.845c0,20.5814 18.4892,33.845 42.1554,33.845c23.6662,0 38.1803,-11.6171 38.7349,-28.7225l-21.0777,-0.4574c-0.9244,9.3303 -9.1059,15.1845 -17.6572,15.1845c-11.7406,0 -20.4306,-7.5922 -20.4306,-19.8496c0,-12.2574 8.69,-19.9868 20.4306,-20.2155c8.5513,-0.183 16.9177,5.9457 17.4723,15.276l21.0777,-0.6403c-0.4622,-16.8311 -14.1442,-28.2652 -38.55,-28.2652zm48.8446,2l55.468,0l0,64.0311l-55.468,0l0,-64.0311z" clip-rule="evenodd" fill-rule="evenodd"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 611 B After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 5.1 KiB |
BIN
src/browser/media/pwa-icon.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
.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" />
|
||||||
|
|
|
||||||