mirror of
https://github.com/coder/code-server.git
synced 2026-04-17 08:27:28 -05:00
Compare commits
10 Commits
v4.9.0-rc.
...
v4.7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6809ded1da | ||
|
|
d31b934991 | ||
|
|
8bb8fb74cf | ||
|
|
bfd2231b4d | ||
|
|
0fcaff8740 | ||
|
|
9640bdd15a | ||
|
|
9c58360aac | ||
|
|
9f1ef13946 | ||
|
|
36f6149be1 | ||
|
|
a7777ffa42 |
@@ -12,6 +12,5 @@ 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 -->
|
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
|
||||||
|
|
||||||
- [ ] update `CHANGELOG.md`
|
- [ ] publish release and merge PR
|
||||||
- [ ] manually run "Draft release" workflow after merging this PR
|
- [ ] update the AUR package
|
||||||
- [ ] merge PR opened in [code-server-aur](https://github.com/coder/code-server-aur)
|
|
||||||
|
|||||||
429
.github/workflows/build.yaml
vendored
429
.github/workflows/build.yaml
vendored
@@ -1,429 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
# Cancel in-progress runs for pull requests when developers push
|
|
||||||
# additional changes, and serialize builds in branches.
|
|
||||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
# Note: if: success() is used in several jobs -
|
|
||||||
# this ensures that it only executes if all previous jobs succeeded.
|
|
||||||
|
|
||||||
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
# will skip running `yarn install` if it successfully fetched from cache
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prettier:
|
|
||||||
name: Format with Prettier
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Run prettier with actionsx/prettier
|
|
||||||
uses: actionsx/prettier@v2
|
|
||||||
with:
|
|
||||||
args: --check --loglevel=warn .
|
|
||||||
|
|
||||||
doctoc:
|
|
||||||
name: Doctoc markdown files
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v26.1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
docs/**
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
cache: "yarn"
|
|
||||||
|
|
||||||
- name: Install doctoc
|
|
||||||
run: yarn global add doctoc@2.2.1
|
|
||||||
|
|
||||||
- name: Run doctoc
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
run: yarn doctoc
|
|
||||||
|
|
||||||
lint-helm:
|
|
||||||
name: Lint Helm chart
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v26.1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
ci/helm-chart/**
|
|
||||||
|
|
||||||
- name: Install helm
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: azure/setup-helm@v3.4
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- 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:
|
|
||||||
name: Lint TypeScript files
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: Get changed files
|
|
||||||
id: changed-files
|
|
||||||
uses: tj-actions/changed-files@v26.1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
**/*.ts
|
|
||||||
**/*.js
|
|
||||||
files_ignore: |
|
|
||||||
lib/vscode/**
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
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
|
|
||||||
|
|
||||||
build:
|
|
||||||
name: Build code-server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 30
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
|
|
||||||
- name: Install quilt
|
|
||||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
||||||
with:
|
|
||||||
packages: quilt
|
|
||||||
version: 1.0
|
|
||||||
|
|
||||||
- name: Patch Code
|
|
||||||
run: quilt push -a
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
run: yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Build code-server
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
# Get Code's git hash. When this changes it means the content is
|
|
||||||
# different and we need to rebuild.
|
|
||||||
- name: Get latest lib/vscode rev
|
|
||||||
id: vscode-rev
|
|
||||||
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
|
|
||||||
|
|
||||||
# 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
|
|
||||||
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
|
||||||
# force a rebuild.
|
|
||||||
- name: Fetch prebuilt Code package from cache
|
|
||||||
id: cache-vscode
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
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') }}
|
|
||||||
|
|
||||||
- name: Build vscode
|
|
||||||
env:
|
|
||||||
VERSION: "0.0.0"
|
|
||||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
|
||||||
run: yarn build:vscode
|
|
||||||
|
|
||||||
# Our code imports code from VS Code's `out` directory meaning VS Code
|
|
||||||
# must be built before running these tests.
|
|
||||||
# TODO: Move to its own step?
|
|
||||||
- name: Run code-server unit tests
|
|
||||||
run: yarn test:unit
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
- name: Upload coverage report to Codecov
|
|
||||||
uses: codecov/codecov-action@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
# The release package does not contain any native modules
|
|
||||||
# and is neutral to architecture/os/libc version.
|
|
||||||
- name: Create release package
|
|
||||||
run: yarn release
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
# https://github.com/actions/upload-artifact/issues/38
|
|
||||||
- name: Compress release package
|
|
||||||
run: tar -czf package.tar.gz release
|
|
||||||
|
|
||||||
- name: Upload npm package artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: npm-package
|
|
||||||
path: ./package.tar.gz
|
|
||||||
|
|
||||||
npm:
|
|
||||||
name: Publish npm package
|
|
||||||
# the npm-package gets uploaded as an artifact in Build
|
|
||||||
# so we need that to complete before this runs
|
|
||||||
needs: build
|
|
||||||
# This environment "npm" requires someone from
|
|
||||||
# coder/code-server-reviewers to approve the PR before this job runs.
|
|
||||||
environment: npm
|
|
||||||
# Only run if PR comes from base repo or event is not a PR
|
|
||||||
# Reason: forks cannot access secrets and this will always fail
|
|
||||||
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
id: download
|
|
||||||
with:
|
|
||||||
name: "npm-package"
|
|
||||||
path: release-npm-package
|
|
||||||
|
|
||||||
- name: Run ./ci/steps/publish-npm.sh
|
|
||||||
run: yarn publish:npm
|
|
||||||
env:
|
|
||||||
# NOTE@jsjoeio
|
|
||||||
# This is because npm enforces semantic versioning
|
|
||||||
# so it has to be a valid version. We only use this
|
|
||||||
# to publish dev versions from prs
|
|
||||||
# and beta versions from main.
|
|
||||||
VERSION: "0.0.0"
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
# NOTE@jsjoeio
|
|
||||||
# NPM_ENVIRONMENT intentionally not set here.
|
|
||||||
# Instead, itis determined in publish-npm.sh script
|
|
||||||
# using GITHUB environment variables
|
|
||||||
|
|
||||||
- name: Comment npm information
|
|
||||||
uses: marocchino/sticky-pull-request-comment@v2
|
|
||||||
with:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
header: npm-dev-build
|
|
||||||
message: |
|
|
||||||
✨ code-server dev build published to npm for PR #${{ github.event.number }}!
|
|
||||||
* _Last publish status_: success
|
|
||||||
* _Commit_: ${{ github.event.pull_request.head.sha }}
|
|
||||||
|
|
||||||
To install in a local project, run:
|
|
||||||
```shell-session
|
|
||||||
npm install @coder/code-server-pr@${{ github.event.number }}
|
|
||||||
```
|
|
||||||
|
|
||||||
To install globally, run:
|
|
||||||
```shell-session
|
|
||||||
npm install -g @coder/code-server-pr@${{ github.event.number }}
|
|
||||||
```
|
|
||||||
|
|
||||||
test-e2e:
|
|
||||||
name: Run e2e tests
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 25
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: npm-package
|
|
||||||
|
|
||||||
- name: Decompress npm package
|
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
- name: Install release package dependencies
|
|
||||||
run: cd release && yarn install
|
|
||||||
|
|
||||||
- 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
|
|
||||||
run: |
|
|
||||||
./test/node_modules/.bin/playwright install-deps
|
|
||||||
./test/node_modules/.bin/playwright install
|
|
||||||
|
|
||||||
- name: Run end-to-end tests
|
|
||||||
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
|
|
||||||
|
|
||||||
- name: Upload test artifacts
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: failed-test-videos
|
|
||||||
path: ./test/test-results
|
|
||||||
|
|
||||||
- name: Remove release packages and test artifacts
|
|
||||||
run: rm -rf ./release ./test/test-results
|
|
||||||
|
|
||||||
test-e2e-proxy:
|
|
||||||
name: Run e2e tests behind proxy
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 25
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: npm-package
|
|
||||||
|
|
||||||
- name: Decompress npm package
|
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
- name: Install release package dependencies
|
|
||||||
run: cd release && yarn install
|
|
||||||
|
|
||||||
- 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
|
|
||||||
run: |
|
|
||||||
./test/node_modules/.bin/playwright install-deps
|
|
||||||
./test/node_modules/.bin/playwright install
|
|
||||||
|
|
||||||
- name: Cache Caddy
|
|
||||||
uses: actions/cache@v2
|
|
||||||
id: caddy-cache
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/caddy
|
|
||||||
key: cache-caddy-2.5.2
|
|
||||||
|
|
||||||
- name: Install Caddy
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
|
||||||
mkdir -p ~/.cache/caddy
|
|
||||||
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
|
||||||
|
|
||||||
- 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()
|
|
||||||
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
|
||||||
|
|
||||||
- name: Upload test artifacts
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: failed-test-videos-proxy
|
|
||||||
path: ./test/test-results
|
|
||||||
|
|
||||||
- name: Remove release packages and test artifacts
|
|
||||||
run: rm -rf ./release ./test/test-results
|
|
||||||
625
.github/workflows/ci.yaml
vendored
Normal file
625
.github/workflows/ci.yaml
vendored
Normal file
@@ -0,0 +1,625 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
|
# Note: if: success() is used in several jobs -
|
||||||
|
# this ensures that it only executes if all previous jobs succeeded.
|
||||||
|
|
||||||
|
# if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
# will skip running `yarn install` if it successfully fetched from cache
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prebuild:
|
||||||
|
name: Pre-build checks
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Install helm
|
||||||
|
uses: azure/setup-helm@v3.3
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run yarn fmt
|
||||||
|
run: yarn fmt
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
- name: Run yarn lint
|
||||||
|
run: yarn lint
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
audit-ci:
|
||||||
|
name: Run audit-ci
|
||||||
|
needs: prebuild
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Audit for vulnerabilities
|
||||||
|
run: yarn _audit
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
needs: prebuild
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
env:
|
||||||
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install quilt
|
||||||
|
run: sudo apt update && sudo apt install quilt
|
||||||
|
|
||||||
|
- name: Patch Code
|
||||||
|
run: quilt push -a
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Build code-server
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
# Get Code's git hash. When this changes it means the content is
|
||||||
|
# different and we need to rebuild.
|
||||||
|
- name: Get latest lib/vscode rev
|
||||||
|
id: vscode-rev
|
||||||
|
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
id: version
|
||||||
|
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
||||||
|
# force a rebuild.
|
||||||
|
- name: Fetch prebuilt Code package from cache
|
||||||
|
id: cache-vscode
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: lib/vscode-reh-web-*
|
||||||
|
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
||||||
|
|
||||||
|
- name: Build vscode
|
||||||
|
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||||
|
run: yarn build:vscode
|
||||||
|
|
||||||
|
# Our code imports code from VS Code's `out` directory meaning VS Code
|
||||||
|
# must be built before running these tests.
|
||||||
|
# TODO: Move to its own step?
|
||||||
|
- name: Run code-server unit tests
|
||||||
|
run: yarn test:unit
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
- name: Upload coverage report to Codecov
|
||||||
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
# The release package does not contain any native modules
|
||||||
|
# and is neutral to architecture/os/libc version.
|
||||||
|
- name: Create release package
|
||||||
|
run: yarn release
|
||||||
|
if: success()
|
||||||
|
|
||||||
|
# https://github.com/actions/upload-artifact/issues/38
|
||||||
|
- name: Compress release package
|
||||||
|
run: tar -czf package.tar.gz release
|
||||||
|
|
||||||
|
- name: Upload npm package artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: npm-package
|
||||||
|
path: ./package.tar.gz
|
||||||
|
|
||||||
|
npm:
|
||||||
|
# the npm-package gets uploaded as an artifact in Build
|
||||||
|
# so we need that to complete before this runs
|
||||||
|
needs: build
|
||||||
|
# This environment "npm" requires someone from
|
||||||
|
# coder/code-server-reviewers to approve the PR before this job runs.
|
||||||
|
environment: npm
|
||||||
|
# Only run if PR comes from base repo or event is not a PR
|
||||||
|
# Reason: forks cannot access secrets and this will always fail
|
||||||
|
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Download artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
id: download
|
||||||
|
with:
|
||||||
|
name: "npm-package"
|
||||||
|
path: release-npm-package
|
||||||
|
|
||||||
|
- name: Run ./ci/steps/publish-npm.sh
|
||||||
|
run: yarn publish:npm
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
# NOTE@jsjoeio
|
||||||
|
# NPM_ENVIRONMENT intentionally not set here.
|
||||||
|
# Instead, itis determined in publish-npm.sh script
|
||||||
|
# using GITHUB environment variables
|
||||||
|
|
||||||
|
- name: Comment npm information
|
||||||
|
uses: marocchino/sticky-pull-request-comment@v2
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
header: npm-dev-build
|
||||||
|
message: |
|
||||||
|
✨ code-server dev build published to npm for PR #${{ github.event.number }}!
|
||||||
|
* _Last publish status_: success
|
||||||
|
* _Commit_: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
To install in a local project, run:
|
||||||
|
```shell-session
|
||||||
|
npm install @coder/code-server-pr@${{ github.event.number }}
|
||||||
|
```
|
||||||
|
|
||||||
|
To install globally, run:
|
||||||
|
```shell-session
|
||||||
|
npm install -g @coder/code-server-pr@${{ github.event.number }}
|
||||||
|
```
|
||||||
|
|
||||||
|
# TODO: cache building yarn --production
|
||||||
|
# possibly 2m30s of savings(?)
|
||||||
|
# this requires refactoring our release scripts
|
||||||
|
package-linux-amd64:
|
||||||
|
name: x86-64 Linux build
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
container: "centos:7"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Install development tools
|
||||||
|
run: |
|
||||||
|
yum install -y epel-release centos-release-scl
|
||||||
|
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
|
||||||
|
|
||||||
|
- name: Install nfpm and envsubst
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.local/bin
|
||||||
|
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||||
|
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
||||||
|
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-package
|
||||||
|
|
||||||
|
- name: Decompress npm package
|
||||||
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
|
# NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
|
||||||
|
# file when running inside a docker container.
|
||||||
|
- name: Build standalone release
|
||||||
|
run: source scl_source enable devtoolset-9 && yarn release:standalone
|
||||||
|
|
||||||
|
- name: Install test dependencies
|
||||||
|
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||||
|
|
||||||
|
- name: Run integration tests on standalone release
|
||||||
|
run: yarn test:integration
|
||||||
|
|
||||||
|
- name: Build packages with nfpm
|
||||||
|
run: yarn package
|
||||||
|
|
||||||
|
- name: Upload release artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: ./release-packages
|
||||||
|
|
||||||
|
# NOTE@oxy:
|
||||||
|
# We use Ubuntu 16.04 here, so that our build is more compatible
|
||||||
|
# with older libc versions. We used to (Q1'20) use CentOS 7 here,
|
||||||
|
# but it has a full update EOL of Q4'20 and a 'critical security'
|
||||||
|
# update EOL of 2024. We're dropping full support a few years before
|
||||||
|
# the final EOL, but I don't believe CentOS 7 has a large arm64 userbase.
|
||||||
|
# It is not feasible to cross-compile with CentOS.
|
||||||
|
|
||||||
|
# Cross-compile notes: To compile native dependencies for arm64,
|
||||||
|
# we install the aarch64/armv7l cross toolchain and then set it as the default
|
||||||
|
# compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
|
||||||
|
# qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
|
||||||
|
# so we just build with "native"/x86_64 node, then download arm64/armv7l node
|
||||||
|
# and then put it in our release. We can't smoke test the cross build this way,
|
||||||
|
# but this means we don't need to maintain a self-hosted runner!
|
||||||
|
|
||||||
|
# NOTE@jsjoeio:
|
||||||
|
# We used to use 16.04 until GitHub deprecated it on September 20, 2021
|
||||||
|
# See here: https://github.com/actions/virtual-environments/pull/3862/files
|
||||||
|
package-linux-cross:
|
||||||
|
name: Linux cross-compile builds
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
timeout-minutes: 15
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- prefix: aarch64-linux-gnu
|
||||||
|
arch: arm64
|
||||||
|
- prefix: arm-linux-gnueabihf
|
||||||
|
arch: armv7l
|
||||||
|
|
||||||
|
env:
|
||||||
|
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
||||||
|
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
||||||
|
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||||
|
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
||||||
|
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
||||||
|
NODE_VERSION: v16.13.0
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Install cross-compiler
|
||||||
|
run: sudo apt update && sudo apt install $PACKAGE
|
||||||
|
env:
|
||||||
|
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
||||||
|
|
||||||
|
- name: Download npm package
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: npm-package
|
||||||
|
|
||||||
|
- name: Decompress npm package
|
||||||
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
|
- name: Build standalone release
|
||||||
|
run: yarn release:standalone
|
||||||
|
|
||||||
|
- name: Replace node with cross-compile equivalent
|
||||||
|
run: |
|
||||||
|
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz
|
||||||
|
tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
|
||||||
|
mv ./node ./release-standalone/lib/node
|
||||||
|
|
||||||
|
- name: Build packages with nfpm
|
||||||
|
run: yarn package ${NPM_CONFIG_ARCH}
|
||||||
|
|
||||||
|
- name: Upload release artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: ./release-packages
|
||||||
|
|
||||||
|
package-macos-amd64:
|
||||||
|
name: x86-64 macOS build
|
||||||
|
needs: build
|
||||||
|
runs-on: macos-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
- name: Download npm package
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: npm-package
|
||||||
|
|
||||||
|
- name: Decompress npm package
|
||||||
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
|
- name: Build standalone release
|
||||||
|
run: yarn release:standalone
|
||||||
|
|
||||||
|
- name: Install test dependencies
|
||||||
|
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||||
|
|
||||||
|
- name: Run integration tests on standalone release
|
||||||
|
run: yarn test:integration
|
||||||
|
|
||||||
|
- name: Build packages with nfpm
|
||||||
|
run: yarn package
|
||||||
|
|
||||||
|
- name: Upload release artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: ./release-packages
|
||||||
|
|
||||||
|
test-e2e:
|
||||||
|
name: End-to-end tests
|
||||||
|
needs: package-linux-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
env:
|
||||||
|
# Since we build code-server we might as well run tests from the release
|
||||||
|
# since VS Code will load faster due to the bundling.
|
||||||
|
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Download release packages
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: ./release-packages
|
||||||
|
|
||||||
|
- name: Untar code-server release
|
||||||
|
run: |
|
||||||
|
cd release-packages
|
||||||
|
tar -xzf code-server*-linux-amd64.tar.gz
|
||||||
|
mv code-server*-linux-amd64 code-server-linux-amd64
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install Playwright OS dependencies
|
||||||
|
run: |
|
||||||
|
./test/node_modules/.bin/playwright install-deps
|
||||||
|
./test/node_modules/.bin/playwright install
|
||||||
|
|
||||||
|
- name: Run end-to-end tests
|
||||||
|
run: yarn test:e2e --global-timeout 840000
|
||||||
|
|
||||||
|
- name: Upload test artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: failed-test-videos
|
||||||
|
path: ./test/test-results
|
||||||
|
|
||||||
|
- name: Remove release packages and test artifacts
|
||||||
|
run: rm -rf ./release-packages ./test/test-results
|
||||||
|
|
||||||
|
test-e2e-proxy:
|
||||||
|
name: End-to-end tests behind proxy
|
||||||
|
needs: package-linux-amd64
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 25
|
||||||
|
env:
|
||||||
|
# Since we build code-server we might as well run tests from the release
|
||||||
|
# since VS Code will load faster due to the bundling.
|
||||||
|
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Node.js v16
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: "16"
|
||||||
|
|
||||||
|
- name: Fetch dependencies from cache
|
||||||
|
id: cache-yarn
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: "**/node_modules"
|
||||||
|
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
yarn-build-
|
||||||
|
|
||||||
|
- name: Download release packages
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: release-packages
|
||||||
|
path: ./release-packages
|
||||||
|
|
||||||
|
- name: Untar code-server release
|
||||||
|
run: |
|
||||||
|
cd release-packages
|
||||||
|
tar -xzf code-server*-linux-amd64.tar.gz
|
||||||
|
mv code-server*-linux-amd64 code-server-linux-amd64
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||||
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install Playwright OS dependencies
|
||||||
|
run: |
|
||||||
|
./test/node_modules/.bin/playwright install-deps
|
||||||
|
./test/node_modules/.bin/playwright install
|
||||||
|
|
||||||
|
- name: Cache Caddy
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: caddy-cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/caddy
|
||||||
|
key: cache-caddy-2.5.2
|
||||||
|
|
||||||
|
- name: Install Caddy
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
||||||
|
mkdir -p ~/.cache/caddy
|
||||||
|
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
||||||
|
|
||||||
|
- name: Start Caddy
|
||||||
|
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||||
|
|
||||||
|
- name: Run end-to-end tests
|
||||||
|
run: yarn test:e2e:proxy
|
||||||
|
|
||||||
|
- name: Stop Caddy
|
||||||
|
if: always()
|
||||||
|
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||||
|
|
||||||
|
- name: Upload test artifacts
|
||||||
|
if: always()
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: failed-test-videos-proxy
|
||||||
|
path: ./test/test-results
|
||||||
|
|
||||||
|
- name: Remove release packages and test artifacts
|
||||||
|
run: rm -rf ./release-packages ./test/test-results
|
||||||
|
|
||||||
|
trivy-scan-repo:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner in repo mode
|
||||||
|
uses: aquasecurity/trivy-action@d63413b0a4a4482237085319f7f4a1ce99a8f2ac
|
||||||
|
with:
|
||||||
|
scan-type: "fs"
|
||||||
|
scan-ref: "."
|
||||||
|
ignore-unfixed: true
|
||||||
|
format: "template"
|
||||||
|
template: "@/contrib/sarif.tpl"
|
||||||
|
output: "trivy-repo-results.sarif"
|
||||||
|
severity: "HIGH,CRITICAL"
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: "trivy-repo-results.sarif"
|
||||||
47
.github/workflows/codeql-analysis.yml
vendored
Normal file
47
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: "Code Scanning"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [main]
|
||||||
|
schedule:
|
||||||
|
# Runs every Monday morning PST
|
||||||
|
- cron: "17 15 * * 1"
|
||||||
|
|
||||||
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
|
# additional changes, and serialize builds in branches.
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
permissions:
|
||||||
|
actions: read # for github/codeql-action/init to get workflow details
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
config-file: ./.github/codeql-config.yml
|
||||||
|
languages: javascript
|
||||||
|
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -6,13 +6,11 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "install.sh"
|
- "install.sh"
|
||||||
- ".github/workflows/installer.yaml"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "install.sh"
|
- "install.sh"
|
||||||
- ".github/workflows/installer.yaml"
|
|
||||||
|
|
||||||
# Cancel in-progress runs for pull requests when developers push
|
# Cancel in-progress runs for pull requests when developers push
|
||||||
# additional changes, and serialize builds in branches.
|
# additional changes, and serialize builds in branches.
|
||||||
@@ -35,13 +33,13 @@ jobs:
|
|||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
|
|
||||||
- name: Test code-server was installed globally
|
- name: Test code-server
|
||||||
run: code-server --help
|
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||||
|
|
||||||
alpine:
|
alpine:
|
||||||
name: Test installer on Alpine
|
name: Test installer on Alpine
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: "alpine:3.17"
|
container: "alpine:3.16"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -56,11 +54,6 @@ jobs:
|
|||||||
- name: Test standalone to a non-existent prefix
|
- name: Test standalone to a non-existent prefix
|
||||||
run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
|
run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
|
||||||
|
|
||||||
# We do not actually have Alpine standalone builds so running code-server
|
|
||||||
# will not work.
|
|
||||||
- name: Test code-server was installed to prefix
|
|
||||||
run: test -f /tmp/does/not/yet/exist/bin/code-server
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
name: Test installer on macOS
|
name: Test installer on macOS
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
@@ -72,5 +65,5 @@ jobs:
|
|||||||
- name: Install code-server
|
- name: Install code-server
|
||||||
run: ./install.sh
|
run: ./install.sh
|
||||||
|
|
||||||
- name: Test code-server was installed globally
|
- name: Test code-server
|
||||||
run: code-server --help
|
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||||
78
.github/workflows/publish.yaml
vendored
78
.github/workflows/publish.yaml
vendored
@@ -4,11 +4,6 @@ on:
|
|||||||
# Shows the manual trigger in GitHub UI
|
# Shows the manual trigger in GitHub UI
|
||||||
# helpful as a back-up in case the GitHub Actions Workflow fails
|
# helpful as a back-up in case the GitHub Actions Workflow fails
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
types: [released]
|
types: [released]
|
||||||
@@ -29,25 +24,23 @@ jobs:
|
|||||||
- name: Checkout code-server
|
- name: Checkout code-server
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Download npm package from release artifacts
|
- name: Get version
|
||||||
uses: robinraju/release-downloader@v1.6
|
id: version
|
||||||
with:
|
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||||
repository: "coder/code-server"
|
|
||||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
|
||||||
fileName: "package.tar.gz"
|
|
||||||
out-file-path: "release-npm-package"
|
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
- name: Download artifact
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
uses: dawidd6/action-download-artifact@v2
|
||||||
- name: Get and set VERSION
|
id: download
|
||||||
run: |
|
with:
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
branch: release/v${{ steps.version.outputs.version }}
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
workflow: ci.yaml
|
||||||
|
workflow_conclusion: completed
|
||||||
|
name: "npm-package"
|
||||||
|
path: release-npm-package
|
||||||
|
|
||||||
- name: Publish npm package and tag with "latest"
|
- name: Publish npm package and tag with "latest"
|
||||||
run: yarn publish:npm
|
run: yarn publish:npm
|
||||||
env:
|
env:
|
||||||
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"
|
||||||
@@ -71,18 +64,9 @@ jobs:
|
|||||||
git config --global user.name cdrci
|
git config --global user.name cdrci
|
||||||
git config --global user.email opensource@coder.com
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
||||||
# 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
|
- name: Bump code-server homebrew version
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
|
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
|
||||||
|
|
||||||
run: ./ci/steps/brew-bump.sh
|
run: ./ci/steps/brew-bump.sh
|
||||||
|
|
||||||
aur:
|
aur:
|
||||||
@@ -91,7 +75,6 @@ jobs:
|
|||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
|
|
||||||
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
|
||||||
@@ -100,35 +83,28 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
path: "./code-server"
|
path: "./code-server"
|
||||||
|
|
||||||
|
- name: Get code-server version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
pushd code-server
|
||||||
|
echo "::set-output name=version::$(jq -r .version package.json)"
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Checkout code-server-aur repo
|
- name: Checkout code-server-aur repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: "cdrci/code-server-aur"
|
repository: "cdrci/code-server-aur"
|
||||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||||
ref: "master"
|
|
||||||
|
|
||||||
- name: Merge in master
|
|
||||||
run: |
|
|
||||||
git remote add upstream https://github.com/coder/code-server-aur.git
|
|
||||||
git fetch upstream
|
|
||||||
git merge upstream/master
|
|
||||||
|
|
||||||
- name: Configure git
|
- name: Configure git
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name cdrci
|
git config --global user.name cdrci
|
||||||
git config --global user.email opensource@coder.com
|
git config --global user.email opensource@coder.com
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
|
||||||
# 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: Validate package
|
- name: Validate package
|
||||||
uses: hapakaien/archlinux-package-action@v2
|
uses: hapakaien/archlinux-package-action@v2
|
||||||
with:
|
with:
|
||||||
pkgver: ${{ env.VERSION }}
|
pkgver: ${{ steps.version.outputs.version }}
|
||||||
updpkgsums: true
|
updpkgsums: true
|
||||||
srcinfo: true
|
srcinfo: true
|
||||||
|
|
||||||
@@ -166,23 +142,19 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
- name: Get version
|
||||||
# i.e. v4.9.1 -> 4.9.1
|
id: version
|
||||||
- name: Get and set VERSION
|
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||||
run: |
|
|
||||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
|
||||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Download release artifacts
|
- name: Download release artifacts
|
||||||
uses: robinraju/release-downloader@v1.6
|
uses: robinraju/release-downloader@v1.5
|
||||||
with:
|
with:
|
||||||
repository: "coder/code-server"
|
repository: "coder/code-server"
|
||||||
tag: v${{ env.VERSION }}
|
tag: v${{ steps.version.outputs.version }}
|
||||||
fileName: "*.deb"
|
fileName: "*.deb"
|
||||||
out-file-path: "release-packages"
|
out-file-path: "release-packages"
|
||||||
|
|
||||||
- name: Publish to Docker
|
- name: Publish to Docker
|
||||||
run: yarn publish:docker
|
run: yarn publish:docker
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
333
.github/workflows/release.yaml
vendored
333
.github/workflows/release.yaml
vendored
@@ -1,333 +0,0 @@
|
|||||||
name: Draft release
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write # For creating releases.
|
|
||||||
discussions: write # For creating a discussion.
|
|
||||||
|
|
||||||
# Cancel in-progress runs for pull requests when developers push
|
|
||||||
# additional changes
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# TODO: cache building yarn --production
|
|
||||||
# possibly 2m30s of savings(?)
|
|
||||||
# this requires refactoring our release scripts
|
|
||||||
package-linux-amd64:
|
|
||||||
name: x86-64 Linux build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
container: "centos:7"
|
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Install development tools
|
|
||||||
run: |
|
|
||||||
yum install -y epel-release centos-release-scl make
|
|
||||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
|
|
||||||
|
|
||||||
- name: Install nfpm and envsubst
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
|
||||||
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
|
||||||
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
|
|
||||||
|
|
||||||
# NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
|
|
||||||
# file when running inside a docker container.
|
|
||||||
- name: Build standalone release
|
|
||||||
run: source scl_source enable devtoolset-9 && yarn release:standalone
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install test dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
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/*
|
|
||||||
|
|
||||||
# NOTE@oxy:
|
|
||||||
# We use Ubuntu 16.04 here, so that our build is more compatible
|
|
||||||
# with older libc versions. We used to (Q1'20) use CentOS 7 here,
|
|
||||||
# but it has a full update EOL of Q4'20 and a 'critical security'
|
|
||||||
# update EOL of 2024. We're dropping full support a few years before
|
|
||||||
# the final EOL, but I don't believe CentOS 7 has a large arm64 userbase.
|
|
||||||
# It is not feasible to cross-compile with CentOS.
|
|
||||||
|
|
||||||
# Cross-compile notes: To compile native dependencies for arm64,
|
|
||||||
# we install the aarch64/armv7l cross toolchain and then set it as the default
|
|
||||||
# compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
|
|
||||||
# qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
|
|
||||||
# so we just build with "native"/x86_64 node, then download arm64/armv7l node
|
|
||||||
# and then put it in our release. We can't smoke test the cross build this way,
|
|
||||||
# but this means we don't need to maintain a self-hosted runner!
|
|
||||||
|
|
||||||
# NOTE@jsjoeio:
|
|
||||||
# We used to use 16.04 until GitHub deprecated it on September 20, 2021
|
|
||||||
# See here: https://github.com/actions/virtual-environments/pull/3862/files
|
|
||||||
package-linux-cross:
|
|
||||||
name: Linux cross-compile builds
|
|
||||||
runs-on: ubuntu-18.04
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- prefix: aarch64-linux-gnu
|
|
||||||
arch: arm64
|
|
||||||
- prefix: arm-linux-gnueabihf
|
|
||||||
arch: armv7l
|
|
||||||
|
|
||||||
env:
|
|
||||||
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
|
||||||
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
|
||||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
|
||||||
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
|
||||||
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
|
||||||
NODE_VERSION: v16.13.0
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- name: Install cross-compiler
|
|
||||||
run: sudo apt update && sudo apt install $PACKAGE
|
|
||||||
env:
|
|
||||||
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
|
||||||
|
|
||||||
- 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: yarn release:standalone
|
|
||||||
|
|
||||||
- name: Replace node with cross-compile equivalent
|
|
||||||
run: |
|
|
||||||
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz
|
|
||||||
tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
|
|
||||||
mv ./node ./release-standalone/lib/node
|
|
||||||
|
|
||||||
# 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 ${NPM_CONFIG_ARCH}
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
discussion_category_name: "📣 Announcements"
|
|
||||||
files: ./release-packages/*
|
|
||||||
|
|
||||||
package-macos-amd64:
|
|
||||||
name: x86-64 macOS build
|
|
||||||
runs-on: macos-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
- 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: yarn release:standalone
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-node-modules
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install test dependencies
|
|
||||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
|
||||||
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
|
|
||||||
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/*
|
|
||||||
|
|
||||||
npm-package:
|
|
||||||
name: Upload npm package
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: npm-version
|
|
||||||
steps:
|
|
||||||
- name: Download npm package
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
discussion_category_name: "📣 Announcements"
|
|
||||||
files: ./package.tar.gz
|
|
||||||
|
|
||||||
npm-version:
|
|
||||||
name: Modify package.json version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
steps:
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: dawidd6/action-download-artifact@v2
|
|
||||||
id: download
|
|
||||||
with:
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
workflow: build.yaml
|
|
||||||
workflow_conclusion: completed
|
|
||||||
check_artifacts: true
|
|
||||||
name: npm-package
|
|
||||||
|
|
||||||
- name: Decompress npm package
|
|
||||||
run: tar -xzf package.tar.gz
|
|
||||||
|
|
||||||
# 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: Modify version
|
|
||||||
env:
|
|
||||||
VERSION: ${{ env.VERSION }}
|
|
||||||
run: |
|
|
||||||
echo "Updating version in root package.json"
|
|
||||||
npm version --prefix release "$VERSION"
|
|
||||||
|
|
||||||
echo "Updating version in lib/vscode/product.json"
|
|
||||||
tmp=$(mktemp)
|
|
||||||
jq '.codeServerVersion = "$VERSION"' release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
|
||||||
|
|
||||||
- name: Compress release package
|
|
||||||
run: tar -czf package.tar.gz release
|
|
||||||
|
|
||||||
- name: Upload npm package artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: npm-release-package
|
|
||||||
path: ./package.tar.gz
|
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
name: Run script unit tests
|
name: Run script unit tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# This runs on Alpine to make sure we're testing with actual sh.
|
# This runs on Alpine to make sure we're testing with actual sh.
|
||||||
container: "alpine:3.17"
|
container: "alpine:3.16"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -51,17 +51,3 @@ jobs:
|
|||||||
|
|
||||||
- name: Run script unit tests
|
- name: Run script unit tests
|
||||||
run: ./ci/dev/test-scripts.sh
|
run: ./ci/dev/test-scripts.sh
|
||||||
|
|
||||||
lint:
|
|
||||||
name: Lint shell files
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 5
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install lint utilities
|
|
||||||
run: sudo apt install shellcheck
|
|
||||||
|
|
||||||
- name: Lint shell files
|
|
||||||
run: ./ci/dev/lint-scripts.sh
|
|
||||||
106
.github/workflows/security.yaml
vendored
106
.github/workflows/security.yaml
vendored
@@ -1,106 +0,0 @@
|
|||||||
name: Security
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- "package.json"
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- "package.json"
|
|
||||||
schedule:
|
|
||||||
# Runs every Monday morning PST
|
|
||||||
- cron: "17 15 * * 1"
|
|
||||||
|
|
||||||
# Cancel in-progress runs for pull requests when developers push
|
|
||||||
# additional changes, and serialize builds in branches.
|
|
||||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
audit-ci:
|
|
||||||
name: Audit node modules
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install Node.js v16
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: "16"
|
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
|
||||||
id: cache-yarn
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Audit for vulnerabilities
|
|
||||||
run: yarn _audit
|
|
||||||
if: success()
|
|
||||||
|
|
||||||
trivy-scan-repo:
|
|
||||||
name: Scan repo with Trivy
|
|
||||||
permissions:
|
|
||||||
contents: read # for actions/checkout to fetch code
|
|
||||||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in repo mode
|
|
||||||
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
|
|
||||||
with:
|
|
||||||
scan-type: "fs"
|
|
||||||
scan-ref: "."
|
|
||||||
ignore-unfixed: true
|
|
||||||
format: "template"
|
|
||||||
template: "@/contrib/sarif.tpl"
|
|
||||||
output: "trivy-repo-results.sarif"
|
|
||||||
severity: "HIGH,CRITICAL"
|
|
||||||
|
|
||||||
- name: Upload Trivy scan results to GitHub Security tab
|
|
||||||
uses: github/codeql-action/upload-sarif@v2
|
|
||||||
with:
|
|
||||||
sarif_file: "trivy-repo-results.sarif"
|
|
||||||
|
|
||||||
codeql-analyze:
|
|
||||||
permissions:
|
|
||||||
actions: read # for github/codeql-action/init to get workflow details
|
|
||||||
contents: read # for actions/checkout to fetch code
|
|
||||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
|
||||||
name: Analyze with CodeQL
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v2
|
|
||||||
with:
|
|
||||||
config-file: ./.github/codeql-config.yml
|
|
||||||
languages: javascript
|
|
||||||
|
|
||||||
- name: Autobuild
|
|
||||||
uses: github/codeql-action/autobuild@v2
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v2
|
|
||||||
2
.github/workflows/trivy-docker.yaml
vendored
2
.github/workflows/trivy-docker.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Run Trivy vulnerability scanner in image mode
|
- name: Run Trivy vulnerability scanner in image mode
|
||||||
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
|
uses: aquasecurity/trivy-action@d63413b0a4a4482237085319f7f4a1ce99a8f2ac
|
||||||
with:
|
with:
|
||||||
image-ref: "docker.io/codercom/code-server:latest"
|
image-ref: "docker.io/codercom/code-server:latest"
|
||||||
ignore-unfixed: true
|
ignore-unfixed: true
|
||||||
|
|||||||
@@ -1,8 +1 @@
|
|||||||
lib/vscode
|
lib/vscode
|
||||||
lib/vscode-reh-web-linux-x64
|
|
||||||
release-standalone
|
|
||||||
release
|
|
||||||
helm-chart
|
|
||||||
test/scripts
|
|
||||||
test/e2e/extensions/test-extension
|
|
||||||
.pc
|
|
||||||
2
.stylelintrc.yaml
Normal file
2
.stylelintrc.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
extends:
|
||||||
|
- stylelint-config-recommended
|
||||||
78
CHANGELOG.md
78
CHANGELOG.md
@@ -20,84 +20,6 @@ Code v99.99.999
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
## [4.9.0](https://github.com/coder/code-server/releases/tag/v4.9.0) - 2022-11-14
|
|
||||||
|
|
||||||
Code v1.73.0
|
|
||||||
|
|
||||||
WIP
|
|
||||||
|
|
||||||
## [4.8.3](https://github.com/coder/code-server/releases/tag/v4.8.3) - 2022-11-07
|
|
||||||
|
|
||||||
Code v1.72.1
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- install script now supports arch-like (i.e. manjaro, endeavourous, etc.)
|
|
||||||
architectures
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated text in the Getting Started page.
|
|
||||||
|
|
||||||
## [4.8.2](https://github.com/coder/code-server/releases/tag/v4.8.2) - 2022-11-02
|
|
||||||
|
|
||||||
Code v1.72.1
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- New text in the Getting Started page with info about
|
|
||||||
`coder/coder`. This is enabled by default but can be disabled by passing the CLI
|
|
||||||
flag `--disable-getting-started-override` or setting
|
|
||||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
|
||||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
|
||||||
|
|
||||||
## [4.8.1](https://github.com/coder/code-server/releases/tag/v4.8.1) - 2022-10-28
|
|
||||||
|
|
||||||
Code v1.72.1
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed CSP error introduced in 4.8.0 that caused issues with webviews and most
|
|
||||||
extensions.
|
|
||||||
|
|
||||||
## [4.8.0](https://github.com/coder/code-server/releases/tag/v4.8.0) - 2022-10-24
|
|
||||||
|
|
||||||
Code v1.72.1
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Support for the Ports panel which leverages code-server's built-in proxy. It
|
|
||||||
also uses `VSCODE_PROXY_URI` where `{{port}}` is replace when forwarding a port.
|
|
||||||
Example: `VSCODE_PROXY_URI=https://{{port}}.kyle.dev` would forward an
|
|
||||||
application running on localhost:3000 to https://3000.kyle.dev
|
|
||||||
- Support for `--disable-workspace-trust` CLI flag
|
|
||||||
- Support for `--goto` flag to open file @ line:column
|
|
||||||
- Added Ubuntu-based images for Docker releases. If you run into issues with
|
|
||||||
`PATH` being overwritten in Docker please try the Ubuntu image as this is a
|
|
||||||
problem in the Debian base image.
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated Code to 1.72.1
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Enabled `BROWSER` environment variable
|
|
||||||
- Patched `asExternalUri` to work so now extensions run inside code-server can use it
|
|
||||||
|
|
||||||
## [4.7.1](https://github.com/coder/code-server/releases/tag/v4.7.1) - 2022-09-30
|
|
||||||
|
|
||||||
Code v1.71.2
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated Code to 1.71.2
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed install script not upgrading code-server when already installed on RPM-based machines
|
|
||||||
- Fixed install script failing to gain root permissions on FreeBSD
|
|
||||||
|
|
||||||
## [4.7.0](https://github.com/coder/code-server/releases/tag/v4.7.0) - 2022-09-09
|
## [4.7.0](https://github.com/coder/code-server/releases/tag/v4.7.0) - 2022-09-09
|
||||||
|
|
||||||
Code v1.71.0
|
Code v1.71.0
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ main() {
|
|||||||
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
||||||
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
||||||
|
|
||||||
|
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
||||||
|
ln -s "./lib/node" "$RELEASE_PATH/node"
|
||||||
|
|
||||||
pushd "$RELEASE_PATH"
|
pushd "$RELEASE_PATH"
|
||||||
npm install --unsafe-perm --omit=dev
|
npm install --unsafe-perm --omit=dev
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ copy-bin-script() {
|
|||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest"
|
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest"
|
||||||
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest"
|
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest"
|
||||||
# We do not want expansion here; this text should make it to the file as-is.
|
|
||||||
# shellcheck disable=SC2016
|
|
||||||
sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest"
|
|
||||||
|
|
||||||
# Fix Node path on Windows.
|
# Fix Node path on Windows.
|
||||||
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest"
|
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest"
|
||||||
@@ -42,12 +39,6 @@ main() {
|
|||||||
|
|
||||||
pushd lib/vscode
|
pushd lib/vscode
|
||||||
|
|
||||||
if [[ ! ${VERSION-} ]]; then
|
|
||||||
echo "VERSION not set. Please set before running this script:"
|
|
||||||
echo "VERSION='0.0.0' yarn build:vscode"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set the commit Code will embed into the product.json. We need to do this
|
# Set the commit Code will embed into the product.json. We need to do this
|
||||||
# since Code tries to get the commit from the `.git` directory which will fail
|
# since Code tries to get the commit from the `.git` directory which will fail
|
||||||
# as it is a submodule.
|
# as it is a submodule.
|
||||||
@@ -88,16 +79,11 @@ main() {
|
|||||||
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
||||||
"linkProtectionTrustedDomains": [
|
"linkProtectionTrustedDomains": [
|
||||||
"https://open-vsx.org"
|
"https://open-vsx.org"
|
||||||
],
|
]
|
||||||
"aiConfig": {
|
|
||||||
"ariaKey": "code-server"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
) > product.json
|
) > product.json
|
||||||
|
|
||||||
chmod +x product.json
|
|
||||||
|
|
||||||
# Any platform here works since we will do our own packaging. We have to do
|
# Any platform here works since we will do our own packaging. We have to do
|
||||||
# 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
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ _realpath() {
|
|||||||
cd "$(dirname "$script")"
|
cd "$(dirname "$script")"
|
||||||
|
|
||||||
while [ -L "$(basename "$script")" ]; do
|
while [ -L "$(basename "$script")" ]; do
|
||||||
|
if [ -L "./node" ] && [ -L "./code-server" ] \
|
||||||
|
&& [ -f "package.json" ] \
|
||||||
|
&& cat package.json | grep -q '^ "name": "code-server",$'; then
|
||||||
|
echo "***** Please use the script in bin/code-server instead!" >&2
|
||||||
|
echo "***** This script will soon be removed!" >&2
|
||||||
|
echo "***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
script="$(readlink "$(basename "$script")")"
|
script="$(readlink "$(basename "$script")")"
|
||||||
cd "$(dirname "$script")"
|
cd "$(dirname "$script")"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ platform: "linux"
|
|||||||
version: "v${VERSION}"
|
version: "v${VERSION}"
|
||||||
section: "devel"
|
section: "devel"
|
||||||
priority: "optional"
|
priority: "optional"
|
||||||
maintainer: "Joe Previte <joe@coder.com>"
|
maintainer: "Anmol Sethi <hi@nhooyr.io>"
|
||||||
description: |
|
description: |
|
||||||
Run VS Code in the browser.
|
Run VS Code in the browser.
|
||||||
vendor: "Coder"
|
vendor: "Coder"
|
||||||
|
|||||||
28
ci/build/release-github-assets.sh
Executable file
28
ci/build/release-github-assets.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Downloads the release artifacts from CI for the current
|
||||||
|
# commit and then uploads them to the release with the version
|
||||||
|
# in package.json.
|
||||||
|
# You will need $GITHUB_TOKEN set.
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
source ./ci/lib.sh
|
||||||
|
source ./ci/steps/steps-lib.sh
|
||||||
|
|
||||||
|
# NOTE@jsjoeio - only needed if we use the download_artifact
|
||||||
|
# because we talk to the GitHub API.
|
||||||
|
# Needed to use GitHub API
|
||||||
|
if ! is_env_var_set "GITHUB_TOKEN"; then
|
||||||
|
echo "GITHUB_TOKEN is not set. Cannot download npm release-packages without GitHub credentials."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
download_artifact release-packages ./release-packages
|
||||||
|
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm})
|
||||||
|
|
||||||
|
EDITOR=true gh release upload "v$VERSION" "${assets[@]}" --clobber
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
50
ci/build/release-github-draft.sh
Executable file
50
ci/build/release-github-draft.sh
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Creates a draft release with the template for the version in package.json
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
source ./ci/lib.sh
|
||||||
|
|
||||||
|
gh release create "v$VERSION" \
|
||||||
|
--notes-file - \
|
||||||
|
--target "$(git rev-parse HEAD)" \
|
||||||
|
--draft << EOF
|
||||||
|
v$VERSION
|
||||||
|
|
||||||
|
VS Code v$(vscode_version)
|
||||||
|
|
||||||
|
Upgrading is as easy as installing the new version over the old one. code-server
|
||||||
|
maintains all user data in \`~/.local/share/code-server\` so that it is preserved in between
|
||||||
|
installations.
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
|
||||||
|
⭐ Summarize new features here with references to issues
|
||||||
|
|
||||||
|
- item
|
||||||
|
|
||||||
|
## Bug Fixes
|
||||||
|
|
||||||
|
⭐ Summarize bug fixes here with references to issues
|
||||||
|
|
||||||
|
- item
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
⭐ Summarize doc changes here with references to issues
|
||||||
|
|
||||||
|
- item
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
⭐ Summarize development/testing changes here with references to issues
|
||||||
|
|
||||||
|
- item
|
||||||
|
|
||||||
|
Cheers! 🍻
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
103
ci/build/release-prep.sh
Executable file
103
ci/build/release-prep.sh
Executable file
@@ -0,0 +1,103 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Description: This is a script to make the release process easier
|
||||||
|
# Run it with `yarn release:prep` and it will do the following:
|
||||||
|
# 1. Check that you have gh installed and that you're signed in
|
||||||
|
# 2. Update the version of code-server (package.json, docs, etc.)
|
||||||
|
# 3. Update the code coverage badge in the README
|
||||||
|
# 4. Open a draft PR using the release_template.md and view in browser
|
||||||
|
# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
CHECKMARK="\xE2\x9C\x94"
|
||||||
|
DASH="-"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [ "${DRY_RUN-}" = 1 ]; then
|
||||||
|
echo "Performing a dry run..."
|
||||||
|
CMD="echo"
|
||||||
|
else
|
||||||
|
CMD=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
# Check that gh is installed
|
||||||
|
if ! command -v gh &> /dev/null; then
|
||||||
|
echo "gh could not be found."
|
||||||
|
echo "We use this with the release-github-draft.sh and release-github-assets.sh scripts."
|
||||||
|
echo -e "See docs here: https://github.com/cli/cli#installation"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that they have jq installed
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
echo "jq could not be found."
|
||||||
|
echo "We use this to parse the package.json and grab the current version of code-server."
|
||||||
|
echo -e "See docs here: https://stedolan.github.io/jq/download/"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that they have rg installed
|
||||||
|
if ! command -v rg &> /dev/null; then
|
||||||
|
echo "rg could not be found."
|
||||||
|
echo "We use this when updating files across the codebase."
|
||||||
|
echo -e "See docs here: https://github.com/BurntSushi/ripgrep#installation"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that they have node installed
|
||||||
|
if ! command -v node &> /dev/null; then
|
||||||
|
echo "node could not be found."
|
||||||
|
echo "That's surprising..."
|
||||||
|
echo "We use it in this script for getting the package.json version"
|
||||||
|
echo -e "See docs here: https://nodejs.org/en/download/"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check that gh is authenticated
|
||||||
|
if ! gh auth status -h github.com &> /dev/null; then
|
||||||
|
echo "gh isn't authenticated to github.com."
|
||||||
|
echo "This is needed for our scripts that use gh."
|
||||||
|
echo -e "See docs regarding authentication: https://cli.github.com/manual/gh_auth_login"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Note: we need to set upstream as well or the gh pr create step will fail
|
||||||
|
# See: https://github.com/cli/cli/issues/575
|
||||||
|
CURRENT_BRANCH=$(git branch | grep '\*' | cut -d' ' -f2-)
|
||||||
|
if [[ -z $(git config "branch.${CURRENT_BRANCH}.remote") ]]; then
|
||||||
|
echo "Doesn't look like you've pushed this branch to remote"
|
||||||
|
# Note: we need to set upstream as well or the gh pr create step will fail
|
||||||
|
# See: https://github.com/cli/cli/issues/575
|
||||||
|
echo "Please set the upstream and then run the script"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# credit to jakwuh for this solution
|
||||||
|
# https://gist.github.com/DarrenN/8c6a5b969481725a4413#gistcomment-1971123
|
||||||
|
CODE_SERVER_CURRENT_VERSION=$(node -pe "require('./package.json').version")
|
||||||
|
# Ask which version we should update to
|
||||||
|
# In the future, we'll automate this and determine the latest version automatically
|
||||||
|
echo -e "$DASH Current version: ${CODE_SERVER_CURRENT_VERSION}"
|
||||||
|
# The $'\n' adds a line break. See: https://stackoverflow.com/a/39581815/3015595
|
||||||
|
CODE_SERVER_VERSION_TO_UPDATE=$(git rev-parse --abbrev-ref HEAD | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/')
|
||||||
|
echo -e "$CHECKMARK Version in branch name"
|
||||||
|
echo -e "$CHECKMARK Updating to: $CODE_SERVER_VERSION_TO_UPDATE"
|
||||||
|
|
||||||
|
$CMD rg -g '!yarn.lock' -g '!*.svg' -g '!CHANGELOG.md' -g '!lib/vscode/**' --files-with-matches --fixed-strings "${CODE_SERVER_CURRENT_VERSION}" | $CMD xargs sd "$CODE_SERVER_CURRENT_VERSION" "$CODE_SERVER_VERSION_TO_UPDATE"
|
||||||
|
|
||||||
|
$CMD git commit --no-verify -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE"
|
||||||
|
|
||||||
|
# This runs from the root so that's why we use this path vs. ../../
|
||||||
|
RELEASE_TEMPLATE_STRING=$(cat ./.github/PULL_REQUEST_TEMPLATE/release_template.md)
|
||||||
|
|
||||||
|
echo -e "\nOpening a draft PR on GitHub"
|
||||||
|
# To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
|
||||||
|
$CMD gh pr create --base main --title "release: $CODE_SERVER_VERSION_TO_UPDATE" --body "$RELEASE_TEMPLATE_STRING" --reviewer @coder/code-server --repo coder/code-server --draft --assignee "@me"
|
||||||
|
|
||||||
|
# Open PR in browser
|
||||||
|
$CMD gh pr view --web
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@@ -4,6 +4,24 @@ set -euo pipefail
|
|||||||
main() {
|
main() {
|
||||||
cd "$(dirname "$0")/../.."
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
local prettierExts
|
||||||
|
prettierExts=(
|
||||||
|
"*.js"
|
||||||
|
"*.ts"
|
||||||
|
"*.tsx"
|
||||||
|
"*.html"
|
||||||
|
"*.json"
|
||||||
|
"*.css"
|
||||||
|
"*.md"
|
||||||
|
"*.toml"
|
||||||
|
"*.yaml"
|
||||||
|
"*.yml"
|
||||||
|
"*.sh"
|
||||||
|
)
|
||||||
|
prettier --write --loglevel=warn $(
|
||||||
|
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart'
|
||||||
|
)
|
||||||
|
|
||||||
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
|
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
|
||||||
doctoc --title '# Setup Guide' docs/guide.md > /dev/null
|
doctoc --title '# Setup Guide' docs/guide.md > /dev/null
|
||||||
doctoc --title '# Install' docs/install.md > /dev/null
|
doctoc --title '# Install' docs/install.md > /dev/null
|
||||||
@@ -14,11 +32,12 @@ main() {
|
|||||||
doctoc --title '# iPad' docs/ipad.md > /dev/null
|
doctoc --title '# iPad' docs/ipad.md > /dev/null
|
||||||
doctoc --title '# Termux' docs/termux.md > /dev/null
|
doctoc --title '# Termux' docs/termux.md > /dev/null
|
||||||
|
|
||||||
|
# TODO: replace with a method that generates fewer false positives.
|
||||||
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
|
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
|
||||||
echo "Files need generation or are formatted incorrectly:"
|
echo "Files need generation or are formatted incorrectly:"
|
||||||
git -c color.ui=always status | grep --color=no '\[31m'
|
git -c color.ui=always status | grep --color=no '\[31m'
|
||||||
echo "Please run the following locally:"
|
echo "Please run the following locally:"
|
||||||
echo " yarn doctoc"
|
echo " yarn fmt"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
main() {
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
18
ci/dev/lint.sh
Executable file
18
ci/dev/lint.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "lib/vscode")
|
||||||
|
stylelint $(git ls-files "*.css" | grep -v "lib/vscode")
|
||||||
|
tsc --noEmit --skipLibCheck
|
||||||
|
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "lib/vscode")
|
||||||
|
if command -v helm && helm kubeval --help > /dev/null; then
|
||||||
|
helm kubeval ci/helm-chart
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$OLDPWD"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
|
||||||
echo >&2 " Or you can pass in a custom path."
|
|
||||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
|
||||||
# will look for release-standalone in the current directory.
|
|
||||||
#
|
|
||||||
# This is to make sure we don't have Node version errors or any other
|
|
||||||
# compilation-related errors.
|
|
||||||
main() {
|
|
||||||
cd "$(dirname "$0")/../.."
|
|
||||||
|
|
||||||
source ./ci/lib.sh
|
|
||||||
|
|
||||||
local path="$RELEASE_PATH-standalone/bin/code-server"
|
|
||||||
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
|
||||||
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
|
||||||
else
|
|
||||||
path="$CODE_SERVER_PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Running tests with code-server binary: '$path'"
|
|
||||||
|
|
||||||
if [[ ! -f $path ]]; then
|
|
||||||
echo >&2 "No code-server build detected"
|
|
||||||
echo >&2 "Looked in $path"
|
|
||||||
help
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration/help.test.ts"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -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.3.3
|
version: 3.2.2
|
||||||
|
|
||||||
# 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.8.3
|
appVersion: 4.7.0
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.8.3'
|
tag: '4.6.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
|
||||||
|
|||||||
47
ci/lib.sh
47
ci/lib.sh
@@ -9,6 +9,10 @@ popd() {
|
|||||||
builtin popd > /dev/null
|
builtin popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pkg_json_version() {
|
||||||
|
jq -r .version package.json
|
||||||
|
}
|
||||||
|
|
||||||
vscode_version() {
|
vscode_version() {
|
||||||
jq -r .version lib/vscode/package.json
|
jq -r .version lib/vscode/package.json
|
||||||
}
|
}
|
||||||
@@ -40,10 +44,53 @@ arch() {
|
|||||||
echo "$cpu"
|
echo "$cpu"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Grabs the most recent ci.yaml github workflow run that was triggered from the
|
||||||
|
# pull request of the release branch for this version (regardless of whether
|
||||||
|
# that run succeeded or failed). The release branch name must be in semver
|
||||||
|
# format with a v prepended.
|
||||||
|
# This will contain the artifacts we want.
|
||||||
|
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
|
||||||
|
get_artifacts_url() {
|
||||||
|
local artifacts_url
|
||||||
|
local version_branch="release/v$VERSION"
|
||||||
|
local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request&branch=$version_branch"
|
||||||
|
artifacts_url=$(gh api "$workflow_runs_url" | jq -r ".workflow_runs[] | select(.head_branch == \"$version_branch\") | .artifacts_url" | head -n 1)
|
||||||
|
if [[ -z "$artifacts_url" ]]; then
|
||||||
|
echo >&2 "ERROR: artifacts_url came back empty"
|
||||||
|
echo >&2 "We looked for a successful run triggered by a pull_request with for code-server version: $VERSION and a branch named $version_branch"
|
||||||
|
echo >&2 "URL used for gh API call: $workflow_runs_url"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$artifacts_url"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Grabs the artifact's download url.
|
||||||
|
# https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts
|
||||||
|
get_artifact_url() {
|
||||||
|
local artifact_name="$1"
|
||||||
|
gh api "$(get_artifacts_url)" | jq -r ".artifacts[] | select(.name == \"$artifact_name\") | .archive_download_url" | head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Uses the above two functions to download a artifact into a directory.
|
||||||
|
download_artifact() {
|
||||||
|
local artifact_name="$1"
|
||||||
|
local dst="$2"
|
||||||
|
|
||||||
|
local tmp_file
|
||||||
|
tmp_file="$(mktemp)"
|
||||||
|
|
||||||
|
gh api "$(get_artifact_url "$artifact_name")" > "$tmp_file"
|
||||||
|
unzip -q -o "$tmp_file" -d "$dst"
|
||||||
|
rm "$tmp_file"
|
||||||
|
}
|
||||||
|
|
||||||
rsync() {
|
rsync() {
|
||||||
command rsync -a --del "$@"
|
command rsync -a --del "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERSION="$(pkg_json_version)"
|
||||||
|
export VERSION
|
||||||
ARCH="$(arch)"
|
ARCH="$(arch)"
|
||||||
export ARCH
|
export ARCH
|
||||||
OS=$(os)
|
OS=$(os)
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
# syntax=docker/dockerfile:experimental
|
# syntax=docker/dockerfile:experimental
|
||||||
|
|
||||||
ARG BASE=debian:11
|
|
||||||
FROM scratch AS packages
|
FROM scratch AS packages
|
||||||
COPY release-packages/code-server*.deb /tmp/
|
COPY release-packages/code-server*.deb /tmp/
|
||||||
|
|
||||||
FROM $BASE
|
FROM debian:11
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
dumb-init \
|
dumb-init \
|
||||||
zsh \
|
zsh \
|
||||||
@@ -30,15 +29,15 @@ RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
|
|||||||
&& locale-gen
|
&& locale-gen
|
||||||
ENV LANG=en_US.UTF-8
|
ENV LANG=en_US.UTF-8
|
||||||
|
|
||||||
RUN adduser --gecos '' --disabled-password coder \
|
RUN 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)" && \
|
||||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid-0.5-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid-0.5-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - && \
|
||||||
&& chown root:root /usr/local/bin/fixuid \
|
chown root:root /usr/local/bin/fixuid && \
|
||||||
&& chmod 4755 /usr/local/bin/fixuid \
|
chmod 4755 /usr/local/bin/fixuid && \
|
||||||
&& mkdir -p /etc/fixuid \
|
mkdir -p /etc/fixuid && \
|
||||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||||
|
|
||||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
||||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
||||||
|
|||||||
@@ -6,63 +6,17 @@ variable "VERSION" {
|
|||||||
default = "latest"
|
default = "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "DOCKER_REGISTRY" {
|
|
||||||
default = "docker.io/codercom/code-server"
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "GITHUB_REGISTRY" {
|
|
||||||
default = "ghcr.io/coder/code-server"
|
|
||||||
}
|
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = [
|
targets = ["code-server"]
|
||||||
"code-server-debian-11",
|
}
|
||||||
"code-server-ubuntu-focal",
|
|
||||||
|
target "code-server" {
|
||||||
|
dockerfile = "ci/release-image/Dockerfile"
|
||||||
|
tags = [
|
||||||
|
"docker.io/codercom/code-server:latest",
|
||||||
|
notequal("latest",VERSION) ? "docker.io/codercom/code-server:${VERSION}" : "",
|
||||||
|
"ghcr.io/coder/code-server:latest",
|
||||||
|
notequal("latest",VERSION) ? "ghcr.io/coder/code-server:${VERSION}" : "",
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
|
||||||
function "prepend_hyphen_if_not_null" {
|
|
||||||
params = [tag]
|
|
||||||
result = notequal("","${tag}") ? "-${tag}" : "${tag}"
|
|
||||||
}
|
|
||||||
|
|
||||||
# use empty tag (tag="") to generate default tags
|
|
||||||
function "gen_tags" {
|
|
||||||
params = [registry, tag]
|
|
||||||
result = notequal("","${registry}") ? [
|
|
||||||
notequal("", "${tag}") ? "${registry}:${tag}" : "${registry}:latest",
|
|
||||||
notequal("latest",VERSION) ? "${registry}:${VERSION}${prepend_hyphen_if_not_null(tag)}" : "",
|
|
||||||
] : []
|
|
||||||
}
|
|
||||||
|
|
||||||
# helper function to generate tags for docker registry and github registry.
|
|
||||||
# set (DOCKER|GITHUB)_REGISTRY="" to disable corresponding registry
|
|
||||||
function "gen_tags_for_docker_and_ghcr" {
|
|
||||||
params = [tag]
|
|
||||||
result = concat(
|
|
||||||
gen_tags("${DOCKER_REGISTRY}", "${tag}"),
|
|
||||||
gen_tags("${GITHUB_REGISTRY}", "${tag}"),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
target "code-server-debian-11" {
|
|
||||||
dockerfile = "ci/release-image/Dockerfile"
|
|
||||||
tags = concat(
|
|
||||||
gen_tags_for_docker_and_ghcr(""),
|
|
||||||
gen_tags_for_docker_and_ghcr("debian"),
|
|
||||||
gen_tags_for_docker_and_ghcr("bullseye"),
|
|
||||||
)
|
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
|
||||||
}
|
|
||||||
|
|
||||||
target "code-server-ubuntu-focal" {
|
|
||||||
dockerfile = "ci/release-image/Dockerfile"
|
|
||||||
tags = concat(
|
|
||||||
gen_tags_for_docker_and_ghcr("ubuntu"),
|
|
||||||
gen_tags_for_docker_and_ghcr("focal"),
|
|
||||||
)
|
|
||||||
args = {
|
|
||||||
BASE = "ubuntu:focal"
|
|
||||||
}
|
|
||||||
platforms = ["linux/amd64", "linux/arm64"]
|
platforms = ["linux/amd64", "linux/arm64"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ set -euo pipefail
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "$0")/../.."
|
cd "$(dirname "$0")/../.."
|
||||||
# NOTE@jsjoeio - this script assumes VERSION exists as an
|
# ci/lib.sh sets VERSION so it's available to ci/release-image/docker-bake.hcl
|
||||||
# environment variable.
|
# to push the VERSION tag.
|
||||||
|
source ./ci/lib.sh
|
||||||
|
|
||||||
# NOTE@jsjoeio - this script assumes that you've downloaded
|
# NOTE@jsjoeio - this script assumes that you've downloaded
|
||||||
# the release-packages artifact to ./release-packages before
|
# the release-packages artifact to ./release-packages before
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ main() {
|
|||||||
# This is because npm won't publish your package unless it's a new version.
|
# This is because npm won't publish your package unless it's a new version.
|
||||||
# i.e. for development, we bump the version to <current version>-<pr number>-<commit sha>
|
# i.e. for development, we bump the version to <current version>-<pr number>-<commit sha>
|
||||||
# example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
# example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||||
|
# We need the current package.json VERSION
|
||||||
|
if ! is_env_var_set "VERSION"; then
|
||||||
|
echo "VERSION is not set. Cannot publish to npm without VERSION."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# We use this to grab the PR_NUMBER
|
# We use this to grab the PR_NUMBER
|
||||||
if ! is_env_var_set "GITHUB_REF"; then
|
if ! is_env_var_set "GITHUB_REF"; then
|
||||||
echo "GITHUB_REF is not set. Are you running this locally? We rely on values provided by GitHub."
|
echo "GITHUB_REF is not set. Are you running this locally? We rely on values provided by GitHub."
|
||||||
@@ -96,7 +102,6 @@ main() {
|
|||||||
# This means the npm version will be tagged with "beta"
|
# This means the npm version will be tagged with "beta"
|
||||||
# and installed when a user runs `yarn install code-server@beta`
|
# and installed when a user runs `yarn install code-server@beta`
|
||||||
NPM_TAG="beta"
|
NPM_TAG="beta"
|
||||||
PACKAGE_NAME="@coder/code-server-pr"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$NPM_ENVIRONMENT" == "development" ]]; then
|
if [[ "$NPM_ENVIRONMENT" == "development" ]]; then
|
||||||
|
|||||||
@@ -1,18 +1,5 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct)
|
|
||||||
- [Our Pledge](#our-pledge)
|
|
||||||
- [Our Standards](#our-standards)
|
|
||||||
- [Our Responsibilities](#our-responsibilities)
|
|
||||||
- [Scope](#scope)
|
|
||||||
- [Enforcement](#enforcement)
|
|
||||||
- [Attribution](#attribution)
|
|
||||||
|
|
||||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
|
|
||||||
# Contributor Covenant Code of Conduct
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Contributing
|
# Contributing
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
- [Currently Known Issues](#currently-known-issues)
|
- [Currently Known Issues](#currently-known-issues)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
- [Detailed CI and build process docs](../ci)
|
- [Detailed CI and build process docs](../ci)
|
||||||
|
|
||||||
@@ -113,15 +111,6 @@ re-apply the patches.
|
|||||||
6. Commit the updated submodule and patches to `code-server`.
|
6. Commit the updated submodule and patches to `code-server`.
|
||||||
7. Open a PR.
|
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
|
||||||
|
|
||||||
0. 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`.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# FAQ
|
# FAQ
|
||||||
@@ -32,10 +31,8 @@
|
|||||||
- [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)
|
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
## Questions?
|
## Questions?
|
||||||
|
|
||||||
@@ -419,9 +416,3 @@ There are two ways to change the port on which code-server runs:
|
|||||||
|
|
||||||
1. with an environment variable e.g. `PORT=3000 code-server`
|
1. with an environment variable e.g. `PORT=3000 code-server`
|
||||||
2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000`
|
2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000`
|
||||||
|
|
||||||
## How do I hide the coder/coder promotion in Help: Getting Started?
|
|
||||||
|
|
||||||
You can pass the flag `--disable-getting-started-override` to `code-server` or
|
|
||||||
you can set the environment variable `CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
|
||||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Maintaining
|
# Maintaining
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
- [Changelog](#changelog)
|
- [Changelog](#changelog)
|
||||||
- [Releases](#releases)
|
- [Releases](#releases)
|
||||||
- [Publishing a release](#publishing-a-release)
|
- [Publishing a release](#publishing-a-release)
|
||||||
- [Release Candidates](#release-candidates)
|
|
||||||
- [AUR](#aur)
|
- [AUR](#aur)
|
||||||
- [Docker](#docker)
|
- [Docker](#docker)
|
||||||
- [Homebrew](#homebrew)
|
- [Homebrew](#homebrew)
|
||||||
@@ -26,7 +24,6 @@
|
|||||||
- [Troubleshooting](#troubleshooting)
|
- [Troubleshooting](#troubleshooting)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
This document is meant to serve current and future maintainers of code-server,
|
This document is meant to serve current and future maintainers of code-server,
|
||||||
as well as share our workflow for maintaining the project.
|
as well as share our workflow for maintaining the project.
|
||||||
@@ -140,26 +137,43 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
|||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
|
With each release, we rotate the role of release manager to ensure every
|
||||||
|
maintainer goes through the process. This helps us keep documentation up-to-date
|
||||||
|
and encourages us to continually review and improve the flow.
|
||||||
|
|
||||||
|
If you're the current release manager, follow these steps:
|
||||||
|
|
||||||
|
1. Create a [release issue](../.github/ISSUE_TEMPLATE/release.md)
|
||||||
|
1. Fill out checklist
|
||||||
|
1. Publish the release
|
||||||
|
1. After release is published, close release milestone
|
||||||
|
|
||||||
### Publishing a release
|
### Publishing a release
|
||||||
|
|
||||||
1. Go to GitHub Actions > Draft release > Run workflow off commit you want to
|
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
|
||||||
release. CI will automatically upload the artifacts to the release. Make sure CI
|
1. If you don't do this, the `npm-brew` GitHub workflow will fail. It looks for the release artifacts under the branch pattern.
|
||||||
has finished on that commit.
|
1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`)
|
||||||
1. CI will automatically grab the
|
1. GitHub Actions will generate the `npm-package`, `release-packages` and
|
||||||
|
`release-images` artifacts. You do not have to wait for this step to complete
|
||||||
|
before proceeding.
|
||||||
|
1. Run `yarn release:github-draft` to create a GitHub draft release from the
|
||||||
|
template with the updated version. Make sure to update the `CHANGELOG.md`.
|
||||||
|
1. Bump chart version in `Chart.yaml`.
|
||||||
|
1. Summarize the major changes in the release notes and link to the relevant
|
||||||
|
issues.
|
||||||
|
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: release/v3.9.0`
|
||||||
|
1. Wait for the `npm-package`, `release-packages` and `release-images` artifacts
|
||||||
|
to build.
|
||||||
|
1. Run `yarn release:github-assets` to download the `release-packages` artifact.
|
||||||
|
They will upload them to the draft release.
|
||||||
|
1. Run some basic sanity tests on one of the released packages (pay special
|
||||||
|
attention to making sure the terminal works).
|
||||||
|
1. Publish the release and merge the PR. CI will automatically grab the
|
||||||
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
||||||
Hub image from `release-images`.
|
Hub image from `release-images`.
|
||||||
1. Publish release.
|
1. Update the AUR package. Instructions for updating the AUR package are at
|
||||||
1. After, create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
|
[coder/code-server-aur](https://github.com/coder/code-server-aur).
|
||||||
1. Summarize the major changes in the `CHANGELOG.md`
|
1. Wait for the npm package to be published.
|
||||||
1. Bump chart version in `Chart.yaml`.
|
|
||||||
|
|
||||||
#### Release Candidates
|
|
||||||
|
|
||||||
We prefer to do release candidates so the community can test things before a full-blown release. To do this follow the same steps as above but:
|
|
||||||
|
|
||||||
1. Only bump version in `package.json`
|
|
||||||
1. use `0.0.0-rc.0`
|
|
||||||
1. When you publish the release, select "pre-release"
|
|
||||||
|
|
||||||
#### AUR
|
#### AUR
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ We use the following tools to help us stay on top of vulnerability mitigation.
|
|||||||
- [trivy](https://github.com/aquasecurity/trivy)
|
- [trivy](https://github.com/aquasecurity/trivy)
|
||||||
- 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 `ci.yaml`)
|
||||||
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
||||||
- Audits npm and Yarn dependencies in CI (see `Audit for vulnerabilities` step
|
- 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
|
in `ci.yaml`) on PRs into the default branch and fails CI if moderate or
|
||||||
higher vulnerabilities (see the `audit.sh` script) are present.
|
higher vulnerabilities (see the `audit.sh` script) are present.
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Setup Guide
|
# Setup Guide
|
||||||
@@ -23,7 +22,6 @@
|
|||||||
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
|
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
This article will walk you through exposing code-server securely once you've
|
This article will walk you through exposing code-server securely once you've
|
||||||
completed the [installation process](install.md).
|
completed the [installation process](install.md).
|
||||||
@@ -91,10 +89,11 @@ we recommend using another method, such as [Let's Encrypt](#let-encrypt) instead
|
|||||||
using [mutagen](https://mutagen.io/documentation/introduction/installation)
|
using [mutagen](https://mutagen.io/documentation/introduction/installation)
|
||||||
to do so. Once you've installed mutagen, you can port forward as follows:
|
to do so. Once you've installed mutagen, you can port forward as follows:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
# This is the same as the above SSH command, but it runs in the background
|
# This is the same as the above SSH command, but it runs in the background
|
||||||
# continuously. Be sure to add `mutagen daemon start` to your ~/.bashrc to
|
# continuously. Be sure to add `mutagen daemon start` to your ~/.bashrc to
|
||||||
# start the mutagen daemon when you open a shell.
|
# start the mutagen daemon when you open a shell.
|
||||||
|
|
||||||
mutagen forward create --name=code-server tcp:127.0.0.1:8080 < instance-ip > :tcp:127.0.0.1:8080
|
mutagen forward create --name=code-server tcp:127.0.0.1:8080 < instance-ip > :tcp:127.0.0.1:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -418,20 +417,20 @@ sudo passwd {user} # replace user with your code-server user
|
|||||||
|
|
||||||
[](https://github.com/cloudflare/cloudflared)
|
[](https://github.com/cloudflare/cloudflared)
|
||||||
|
|
||||||
1. Install [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared) on your local computer and remote server
|
1. Install [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared) on your local computer
|
||||||
2. Then go to `~/.ssh/config` and add the following on your local computer:
|
2. Then go to `~/.ssh/config` and add the following:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
Host *.trycloudflare.com
|
Host *.trycloudflare.com
|
||||||
HostName %h
|
HostName %h
|
||||||
User user
|
User root
|
||||||
Port 22
|
Port 22
|
||||||
ProxyCommand "cloudflared location" access ssh --hostname %h
|
ProxyCommand "cloudflared location" access ssh --hostname %h
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run `cloudflared tunnel --url ssh://localhost:22` on the remote server
|
3. Run `cloudflared tunnel --url ssh://localhost:22` on the remote server
|
||||||
|
|
||||||
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`
|
4. Finally on VS Code or any IDE that supports SSH, run `ssh coder@https://your-link.trycloudflare.com` or `ssh coder@your-link.trycloudflare.com`
|
||||||
|
|
||||||
### Option 2: ngrok tunnel
|
### Option 2: ngrok tunnel
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# code-server Helm Chart
|
# code-server Helm Chart
|
||||||
|
|
||||||
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.8.0-informational?style=flat-square)
|
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.7.0-informational?style=flat-square)
|
||||||
|
|
||||||
[code-server](https://github.com/coder/code-server) code-server is VS Code running
|
[code-server](https://github.com/coder/code-server) code-server is VS Code running
|
||||||
on a remote server, accessible through the browser.
|
on a remote server, accessible through the browser.
|
||||||
@@ -73,7 +73,7 @@ and their default values.
|
|||||||
| hostnameOverride | string | `""` |
|
| hostnameOverride | string | `""` |
|
||||||
| image.pullPolicy | string | `"Always"` |
|
| image.pullPolicy | string | `"Always"` |
|
||||||
| image.repository | string | `"codercom/code-server"` |
|
| image.repository | string | `"codercom/code-server"` |
|
||||||
| image.tag | string | `"4.8.0"` |
|
| image.tag | string | `"4.7.0"` |
|
||||||
| imagePullSecrets | list | `[]` |
|
| imagePullSecrets | list | `[]` |
|
||||||
| ingress.enabled | bool | `false` |
|
| ingress.enabled | bool | `false` |
|
||||||
| nameOverride | string | `""` |
|
| nameOverride | string | `""` |
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Install
|
# Install
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
- [Debian, Ubuntu](#debian-ubuntu-1)
|
- [Debian, Ubuntu](#debian-ubuntu-1)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
This document demonstrates how to install `code-server` on various distros and
|
This document demonstrates how to install `code-server` on various distros and
|
||||||
operating systems.
|
operating systems.
|
||||||
@@ -59,7 +57,6 @@ following flags:
|
|||||||
- `--prefix=/usr/local`: install a standalone release archive system-wide.
|
- `--prefix=/usr/local`: install a standalone release archive system-wide.
|
||||||
- `--version=X.X.X`: install version `X.X.X` instead of latest version.
|
- `--version=X.X.X`: install version `X.X.X` instead of latest version.
|
||||||
- `--help`: see usage docs.
|
- `--help`: see usage docs.
|
||||||
- `--edge`: install the latest edge version (i.e. pre-release)
|
|
||||||
|
|
||||||
When done, the install script prints out instructions for running and starting
|
When done, the install script prints out instructions for running and starting
|
||||||
code-server.
|
code-server.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# iPad
|
# iPad
|
||||||
@@ -14,7 +13,6 @@
|
|||||||
- [Sharing a self-signed certificate with an iPad](#sharing-a-self-signed-certificate-with-an-ipad)
|
- [Sharing a self-signed certificate with an iPad](#sharing-a-self-signed-certificate-with-an-ipad)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
Once you've installed code-server, you can access it from an iPad.
|
Once you've installed code-server, you can access it from an iPad.
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"versions": ["v4.8.0"],
|
"versions": ["v4.7.0"],
|
||||||
"routes": [
|
"routes": [
|
||||||
{
|
{
|
||||||
"title": "Home",
|
"title": "Home",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# npm Install Requirements
|
# npm Install Requirements
|
||||||
@@ -16,7 +15,6 @@
|
|||||||
- [Debugging install issues with npm](#debugging-install-issues-with-npm)
|
- [Debugging install issues with npm](#debugging-install-issues-with-npm)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
If you're installing code-server via `npm`, you'll need to install additional
|
If you're installing code-server via `npm`, you'll need to install additional
|
||||||
dependencies required to build the native modules used by VS Code. This article
|
dependencies required to build the native modules used by VS Code. This article
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||||
# Termux
|
# Termux
|
||||||
@@ -15,7 +14,6 @@
|
|||||||
- [Working with PRoot](#working-with-proot)
|
- [Working with PRoot](#working-with-proot)
|
||||||
|
|
||||||
<!-- 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 -->
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
@@ -102,7 +100,7 @@ node -v
|
|||||||
|
|
||||||
you will get node version `v16.15.0`
|
you will get node version `v16.15.0`
|
||||||
|
|
||||||
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](./npm.md)
|
||||||
|
|
||||||
6. Congratulation code-server is installed on your device using the following command.
|
6. Congratulation code-server is installed on your device using the following command.
|
||||||
|
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
nodejs yarn' python pkg-config git rsync jq moreutils quilt bats
|
nodejs yarn' python pkg-config git rsync jq moreutils
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
||||||
++ (with xorg; [ libX11 libxkbfile ])
|
++ (with xorg; [ libX11 libxkbfile ])
|
||||||
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
++ lib.optionals stdenv.isDarwin [
|
||||||
AppKit Cocoa CoreServices Security xcbuild
|
AppKit Cocoa CoreServices Security cctools xcbuild
|
||||||
]));
|
]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
20
install.sh
20
install.sh
@@ -131,11 +131,6 @@ Or, if you don't want/need a background service you can run:
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
echo_coder_postinstall() {
|
|
||||||
echoh
|
|
||||||
echoh "Deploy code-server for your team with Coder: https://github.com/coder/coder"
|
|
||||||
}
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [ "${TRACE-}" ]; then
|
if [ "${TRACE-}" ]; then
|
||||||
set -x
|
set -x
|
||||||
@@ -248,7 +243,6 @@ main() {
|
|||||||
if [ "$METHOD" = standalone ]; then
|
if [ "$METHOD" = standalone ]; then
|
||||||
if has_standalone; then
|
if has_standalone; then
|
||||||
install_standalone
|
install_standalone
|
||||||
echo_coder_postinstall
|
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echoerr "There are no standalone releases for $ARCH"
|
echoerr "There are no standalone releases for $ARCH"
|
||||||
@@ -292,8 +286,6 @@ main() {
|
|||||||
npm_fallback install_standalone
|
npm_fallback install_standalone
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo_coder_postinstall
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_arg() {
|
parse_arg() {
|
||||||
@@ -372,7 +364,7 @@ install_rpm() {
|
|||||||
|
|
||||||
fetch "https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-$ARCH.rpm" \
|
fetch "https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-$ARCH.rpm" \
|
||||||
"$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
"$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
||||||
sudo_sh_c rpm -U "$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
sudo_sh_c rpm -i "$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
||||||
|
|
||||||
echo_systemd_postinstall rpm
|
echo_systemd_postinstall rpm
|
||||||
}
|
}
|
||||||
@@ -490,7 +482,7 @@ os() {
|
|||||||
# - amzn, centos, rhel, fedora, ... -> fedora
|
# - amzn, centos, rhel, fedora, ... -> fedora
|
||||||
# - opensuse-{leap,tumbleweed} -> opensuse
|
# - opensuse-{leap,tumbleweed} -> opensuse
|
||||||
# - alpine -> alpine
|
# - alpine -> alpine
|
||||||
# - arch, manjaro, endeavouros, ... -> arch
|
# - arch -> arch
|
||||||
#
|
#
|
||||||
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
|
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
|
||||||
distro() {
|
distro() {
|
||||||
@@ -504,7 +496,7 @@ distro() {
|
|||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
if [ "${ID_LIKE-}" ]; then
|
if [ "${ID_LIKE-}" ]; then
|
||||||
for id_like in $ID_LIKE; do
|
for id_like in $ID_LIKE; do
|
||||||
case "$id_like" in debian | fedora | opensuse | arch)
|
case "$id_like" in debian | fedora | opensuse)
|
||||||
echo "$id_like"
|
echo "$id_like"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
@@ -561,17 +553,15 @@ sh_c() {
|
|||||||
sudo_sh_c() {
|
sudo_sh_c() {
|
||||||
if [ "$(id -u)" = 0 ]; then
|
if [ "$(id -u)" = 0 ]; then
|
||||||
sh_c "$@"
|
sh_c "$@"
|
||||||
elif command_exists doas; then
|
|
||||||
sh_c "doas $*"
|
|
||||||
elif command_exists sudo; then
|
elif command_exists sudo; then
|
||||||
sh_c "sudo $*"
|
sh_c "sudo $*"
|
||||||
elif command_exists su; then
|
elif command_exists su; then
|
||||||
sh_c "su root -c '$*'"
|
sh_c "su - -c '$*'"
|
||||||
else
|
else
|
||||||
echoh
|
echoh
|
||||||
echoerr "This script needs to run the following command as root."
|
echoerr "This script needs to run the following command as root."
|
||||||
echoerr " $*"
|
echoerr " $*"
|
||||||
echoerr "Please install doas, sudo, or su."
|
echoerr "Please install sudo or su."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule lib/vscode updated: 6261075646...784b0177c5
41
package.json
41
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "code-server",
|
"name": "code-server",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.0",
|
"version": "4.7.0",
|
||||||
"description": "Run VS Code on a remote server.",
|
"description": "Run VS Code on a remote server.",
|
||||||
"homepage": "https://github.com/coder/code-server",
|
"homepage": "https://github.com/coder/code-server",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@@ -12,25 +12,23 @@
|
|||||||
"clean": "./ci/build/clean.sh",
|
"clean": "./ci/build/clean.sh",
|
||||||
"build": "./ci/build/build-code-server.sh",
|
"build": "./ci/build/build-code-server.sh",
|
||||||
"build:vscode": "./ci/build/build-vscode.sh",
|
"build:vscode": "./ci/build/build-vscode.sh",
|
||||||
"doctoc": "./ci/dev/doctoc.sh",
|
|
||||||
"release": "./ci/build/build-release.sh",
|
"release": "./ci/build/build-release.sh",
|
||||||
"release:standalone": "./ci/build/build-standalone-release.sh",
|
"release:standalone": "./ci/build/build-standalone-release.sh",
|
||||||
|
"release:github-draft": "./ci/build/release-github-draft.sh",
|
||||||
|
"release:github-assets": "./ci/build/release-github-assets.sh",
|
||||||
"release:prep": "./ci/build/release-prep.sh",
|
"release:prep": "./ci/build/release-prep.sh",
|
||||||
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
||||||
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
|
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
|
||||||
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
|
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
|
||||||
"test:integration": "./ci/dev/test-integration.sh",
|
"test:integration": "./ci/dev/test-integration.sh",
|
||||||
"test:native": "./ci/dev/test-native.sh",
|
|
||||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||||
"package": "./ci/build/build-packages.sh",
|
"package": "./ci/build/build-packages.sh",
|
||||||
"prettier": "prettier --write --loglevel=warn --cache .",
|
|
||||||
"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",
|
||||||
"_audit": "./ci/dev/audit.sh",
|
"_audit": "./ci/dev/audit.sh",
|
||||||
"fmt": "yarn prettier && ./ci/dev/doctoc.sh",
|
"fmt": "./ci/dev/fmt.sh",
|
||||||
"lint:scripts": "./ci/dev/lint-scripts.sh",
|
"lint": "./ci/dev/lint.sh",
|
||||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')",
|
|
||||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||||
"ci": "./ci/dev/ci.sh",
|
"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",
|
||||||
@@ -52,23 +50,26 @@
|
|||||||
"@types/split2": "^3.2.0",
|
"@types/split2": "^3.2.0",
|
||||||
"@types/trusted-types": "^2.0.2",
|
"@types/trusted-types": "^2.0.2",
|
||||||
"@types/ws": "^8.5.3",
|
"@types/ws": "^8.5.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||||
"@typescript-eslint/parser": "^5.41.0",
|
"@typescript-eslint/parser": "^5.23.0",
|
||||||
"audit-ci": "^6.0.0",
|
"audit-ci": "^6.0.0",
|
||||||
"doctoc": "2.2.1",
|
"doctoc": "^2.0.0",
|
||||||
"eslint": "^8.26.0",
|
"eslint": "^7.7.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.1.0",
|
||||||
"eslint-import-resolver-typescript": "^3.5.2",
|
"eslint-import-resolver-typescript": "^2.5.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.18.2",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"prettier": "2.8.0",
|
"prettier": "^2.2.1",
|
||||||
"prettier-plugin-sh": "^0.12.8",
|
"prettier-plugin-sh": "^0.12.0",
|
||||||
|
"shellcheck": "^1.0.0",
|
||||||
|
"stylelint": "^13.0.0",
|
||||||
|
"stylelint-config-recommended": "^5.0.0",
|
||||||
"ts-node": "^10.0.0",
|
"ts-node": "^10.0.0",
|
||||||
"typescript": "^4.6.2"
|
"typescript": "^4.6.2"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"ansi-regex": "^5.0.1",
|
"ansi-regex": "^5.0.1",
|
||||||
"normalize-package-data": "^5.0.0",
|
"normalize-package-data": "^4.0.0",
|
||||||
"doctoc/underscore": "^1.13.1",
|
"doctoc/underscore": "^1.13.1",
|
||||||
"doctoc/**/trim": "^1.0.0",
|
"doctoc/**/trim": "^1.0.0",
|
||||||
"postcss": "^8.2.1",
|
"postcss": "^8.2.1",
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
"vfile-message": "^2.0.2",
|
"vfile-message": "^2.0.2",
|
||||||
"tar": "^6.1.9",
|
"tar": "^6.1.9",
|
||||||
"path-parse": "^1.0.7",
|
"path-parse": "^1.0.7",
|
||||||
"vm2": "^3.9.11",
|
"vm2": "^3.9.6",
|
||||||
"follow-redirects": "^1.14.8",
|
"follow-redirects": "^1.14.8",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"nanoid": "^3.1.31",
|
"nanoid": "^3.1.31",
|
||||||
@@ -87,7 +88,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coder/logger": "^3.0.0",
|
"@coder/logger": "^3.0.0",
|
||||||
"argon2": "0.30.2",
|
"argon2": "^0.29.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-parser": "^1.4.5",
|
"cookie-parser": "^1.4.5",
|
||||||
"env-paths": "^2.2.0",
|
"env-paths": "^2.2.0",
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactor
|
|||||||
connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void {
|
connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void {
|
||||||
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
|
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
|
||||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
+ path = (window.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) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||||
const errorListener = socket.onError((err) => callback(err, undefined));
|
const errorListener = socket.onError((err) => callback(err, undefined));
|
||||||
socket.onOpen(() => {
|
socket.onOpen(() => {
|
||||||
@@ -282,6 +283,3 @@ export class BrowserSocketFactory implem
|
@@ -282,6 +283,3 @@ export class BrowserSocketFactory implem
|
||||||
@@ -119,7 +119,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
|
||||||
@@ -267,12 +267,11 @@ export class WebClientServer {
|
@@ -267,12 +267,11 @@ export class WebClientServer {
|
||||||
return void res.end();
|
return res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
- const getFirstHeader = (headerName: string) => {
|
- const getFirstHeader = (headerName: string) => {
|
||||||
@@ -176,7 +176,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data:;',
|
'worker-src \'self\' data:;',
|
||||||
@@ -417,3 +421,70 @@ export class WebClientServer {
|
@@ -417,3 +421,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
@@ -262,7 +262,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
|
||||||
@@ -489,6 +489,7 @@ function doCreateUri(path: string, query
|
@@ -485,6 +485,7 @@ function doCreateUri(path: string, query
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
return URI.parse(window.location.href).with({ path, query });
|
return URI.parse(window.location.href).with({ path, query });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,7 +501,7 @@ function doCreateUri(path: string, query
|
@@ -496,7 +497,7 @@ function doCreateUri(path: string, query
|
||||||
if (!configElement || !configElementAttribute) {
|
if (!configElement || !configElementAttribute) {
|
||||||
throw new Error('Missing web configuration element');
|
throw new Error('Missing web configuration element');
|
||||||
}
|
}
|
||||||
@@ -279,10 +279,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
|
|
||||||
// Create workbench
|
// Create workbench
|
||||||
create(document.body, {
|
create(document.body, {
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||||
@@ -100,10 +100,14 @@ class RemoteTerminalBackend extends Base
|
@@ -99,10 +99,14 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
const reqId = e.reqId;
|
const reqId = e.reqId;
|
||||||
const commandId = e.commandId;
|
const commandId = e.commandId;
|
||||||
|
|||||||
26
patches/connection-type.diff
Normal file
26
patches/connection-type.diff
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
Add connection type to web sockets
|
||||||
|
|
||||||
|
This allows the backend to distinguish them. In our case we use them to count a
|
||||||
|
single "open" of Code so we need to be able to distinguish between web sockets
|
||||||
|
from two instances and two web sockets used in a single instance.
|
||||||
|
|
||||||
|
To test this,
|
||||||
|
1. Run code-server
|
||||||
|
2. Open Network tab in Browser DevTools and filter for websocket requests
|
||||||
|
3. You should see the `type=<connection-type>` in the request url
|
||||||
|
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||||
|
@@ -233,7 +233,8 @@ async function connectToRemoteExtensionH
|
||||||
|
|
||||||
|
let socket: ISocket;
|
||||||
|
try {
|
||||||
|
- socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||||
|
+
|
||||||
|
+ socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||||
|
} catch (error) {
|
||||||
|
options.logService.error(`${logPrefix} socketFactory.connect() failed or timed out. Error:`);
|
||||||
|
options.logService.error(error);
|
||||||
@@ -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
|
||||||
@@ -237,6 +237,10 @@ export class Extension implements IExten
|
@@ -236,6 +236,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;
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
|
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1237,6 +1241,10 @@ export class ExtensionsWorkbenchService
|
@@ -1121,6 +1125,10 @@ export class ExtensionsWorkbenchService
|
||||||
// Skip if check updates only for builtin extensions and current extension is not builtin.
|
// Skip if check updates only for builtin extensions and current extension is not builtin.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -271,6 +271,11 @@ export interface IWorkbenchConstructionO
|
@@ -267,6 +267,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly userDataPath?: string
|
readonly userDataPath?: string
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
--- code-server.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
|
||||||
@@ -32,6 +32,11 @@ export interface IBrowserWorkbenchEnviro
|
@@ -31,6 +31,11 @@ export interface IBrowserWorkbenchEnviro
|
||||||
* Options used to configure the workbench.
|
* Options used to configure the workbench.
|
||||||
*/
|
*/
|
||||||
readonly options?: IWorkbenchConstructionOptions;
|
readonly options?: IWorkbenchConstructionOptions;
|
||||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||||
@@ -87,6 +92,13 @@ export class BrowserWorkbenchEnvironment
|
@@ -62,6 +67,13 @@ export class BrowserWorkbenchEnvironment
|
||||||
return this.options.userDataPath;
|
return this.options.userDataPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -94,6 +95,7 @@ export interface ServerParsedArgs {
|
@@ -95,6 +96,7 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string
|
'auth'?: string
|
||||||
@@ -84,8 +84,8 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
userDataPath: this._environmentService.userDataPath,
|
userDataPath: this._environmentService.userDataPath,
|
||||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
_wrapWebWorkerExtHostInIframe,
|
_wrapWebWorkerExtHostInIframe,
|
||||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
developmentOptions: {
|
||||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
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
|
||||||
@@ -93,16 +93,16 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
|
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext } from 'vs/workbench/common/contextkeys';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
||||||
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||||
import { WorkbenchState, IWorkspaceContextService, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace';
|
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||||
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
||||||
@@ -25,6 +24,7 @@ import { IPaneCompositePartService } fro
|
@@ -25,6 +24,7 @@ import { IPaneCompositePartService } fro
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
@@ -112,7 +112,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
|
|
||||||
export class WorkbenchContextKeysHandler extends Disposable {
|
export class WorkbenchContextKeysHandler extends Disposable {
|
||||||
private inputFocusedContext: IContextKey<boolean>;
|
private inputFocusedContext: IContextKey<boolean>;
|
||||||
@@ -77,7 +77,7 @@ export class WorkbenchContextKeysHandler
|
@@ -76,7 +76,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,
|
||||||
@@ -121,7 +121,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
@IProductService private readonly productService: IProductService,
|
@IProductService private readonly productService: IProductService,
|
||||||
@IEditorService private readonly editorService: IEditorService,
|
@IEditorService private readonly editorService: IEditorService,
|
||||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||||
@@ -202,6 +202,9 @@ export class WorkbenchContextKeysHandler
|
@@ -199,6 +199,9 @@ export class WorkbenchContextKeysHandler
|
||||||
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||||
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||||
|
|
||||||
@@ -135,16 +135,16 @@ 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,
|
@@ -22,7 +22,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||||
import { Schemas } from 'vs/base/common/network';
|
import { Schemas } from 'vs/base/common/network';
|
||||||
-import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext } from 'vs/workbench/common/contextkeys';
|
-import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey } from 'vs/workbench/common/contextkeys';
|
||||||
+import { DirtyWorkingCopiesContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, ActiveEditorAvailableEditorIdsContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
+import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||||
@@ -483,13 +483,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
@@ -477,13 +477,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||||
id: DOWNLOAD_COMMAND_ID,
|
id: DOWNLOAD_COMMAND_ID,
|
||||||
title: DOWNLOAD_LABEL
|
title: DOWNLOAD_LABEL
|
||||||
},
|
},
|
||||||
@@ -172,7 +172,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
|
||||||
@@ -32,6 +32,8 @@ export const IsFullscreenContext = new R
|
@@ -30,6 +30,8 @@ export const IsFullscreenContext = new R
|
||||||
|
|
||||||
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -216,6 +216,9 @@ export async function setupServerService
|
@@ -212,6 +212,9 @@ export async function setupServerService
|
||||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||||
socketServer.registerChannel('extensions', channel);
|
socketServer.registerChannel('extensions', channel);
|
||||||
|
|
||||||
@@ -39,11 +39,11 @@ Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
-import * as nls from 'vs/nls';
|
-import * as nls from 'vs/nls';
|
||||||
-
|
-
|
||||||
export const LANGUAGE_DEFAULT = 'en';
|
const LANGUAGE_DEFAULT = 'en';
|
||||||
|
|
||||||
let _isWindows = false;
|
let _isWindows = false;
|
||||||
@@ -83,17 +81,19 @@ if (typeof navigator === 'object' && !is
|
@@ -81,17 +79,19 @@ if (typeof navigator === 'object' && !is
|
||||||
_isMobile = _userAgent?.indexOf('Mobi') >= 0;
|
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
||||||
_isWeb = true;
|
_isWeb = true;
|
||||||
|
|
||||||
- const configuredLocale = nls.getConfiguredDefaultLocale(
|
- const configuredLocale = nls.getConfiguredDefaultLocale(
|
||||||
@@ -125,7 +125,7 @@ Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentServ
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||||
@@ -110,7 +110,7 @@ export abstract class AbstractNativeEnvi
|
@@ -105,7 +105,7 @@ export abstract class AbstractNativeEnvi
|
||||||
return URI.file(join(vscodePortable, 'argv.json'));
|
return URI.file(join(vscodePortable, 'argv.json'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
|
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
@@ -336,6 +339,7 @@ export class WebClientServer {
|
@@ -339,6 +342,7 @@ export class WebClientServer {
|
||||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||||
BASE: base,
|
BASE: base,
|
||||||
VS_BASE: vscodeBase,
|
VS_BASE: vscodeBase,
|
||||||
@@ -236,7 +236,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ export interface ServerParsedArgs {
|
@@ -97,6 +98,7 @@ export interface ServerParsedArgs {
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string
|
'auth'?: string
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
@@ -248,7 +248,7 @@ Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||||
@@ -119,8 +119,9 @@ import 'vs/workbench/contrib/logs/browse
|
@@ -122,8 +122,9 @@ import 'vs/workbench/contrib/logs/browse
|
||||||
// Explorer
|
// Explorer
|
||||||
import 'vs/workbench/contrib/files/browser/files.web.contribution';
|
import 'vs/workbench/contrib/files/browser/files.web.contribution';
|
||||||
|
|
||||||
@@ -264,35 +264,27 @@ Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePack
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||||
@@ -6,18 +6,24 @@
|
@@ -4,10 +4,23 @@
|
||||||
import { CancellationTokenSource } from 'vs/base/common/cancellation';
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import { Language } from 'vs/base/common/platform';
|
|
||||||
import { URI } from 'vs/base/common/uri';
|
import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
+import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||||
import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
|
||||||
-import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
|
||||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
|
||||||
import { ILogService } from 'vs/platform/log/common/log';
|
|
||||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||||
|
+import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||||
|
|
||||||
export class WebLanguagePacksService extends LanguagePackBaseService {
|
export class WebLanguagePacksService extends LanguagePackBaseService {
|
||||||
|
- // Web doesn't have a concept of language packs, so we just return an empty array
|
||||||
+ private readonly languagePackService: ILanguagePackService;
|
+ private readonly languagePackService: ILanguagePackService;
|
||||||
+
|
+
|
||||||
constructor(
|
+ constructor(
|
||||||
+ @IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
+ @IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||||
@IExtensionResourceLoaderService private readonly extensionResourceLoaderService: IExtensionResourceLoaderService,
|
+ @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService
|
||||||
@IExtensionGalleryService extensionGalleryService: IExtensionGalleryService,
|
+ ) {
|
||||||
@ILogService private readonly logService: ILogService
|
+ super(extensionGalleryService)
|
||||||
) {
|
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'));
|
||||||
super(extensionGalleryService);
|
+ }
|
||||||
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'))
|
+
|
||||||
}
|
|
||||||
|
|
||||||
async getBuiltInExtensionTranslationsUri(id: string): Promise<URI | undefined> {
|
|
||||||
@@ -73,6 +79,6 @@ export class WebLanguagePacksService ext
|
|
||||||
|
|
||||||
// Web doesn't have a concept of language packs, so we just return an empty array
|
|
||||||
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
|
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
|
||||||
- return Promise.resolve([]);
|
- return Promise.resolve([]);
|
||||||
+ return this.languagePackService.getInstalledLanguages()
|
+ return this.languagePackService.getInstalledLanguages()
|
||||||
@@ -322,3 +314,19 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
|
|||||||
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
|
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Index: code-server/lib/vscode/src/vs/base/node/languagePacks.js
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/base/node/languagePacks.js
|
||||||
|
+++ code-server/lib/vscode/src/vs/base/node/languagePacks.js
|
||||||
|
@@ -73,7 +73,10 @@
|
||||||
|
function getLanguagePackConfigurations(userDataPath) {
|
||||||
|
const configFile = path.join(userDataPath, 'languagepacks.json');
|
||||||
|
try {
|
||||||
|
- return nodeRequire(configFile);
|
||||||
|
+ // This must not use Node's require otherwise it will be cached forever.
|
||||||
|
+ // Code can get away with this since the process actually restarts but
|
||||||
|
+ // that is not currently the case with code-server.
|
||||||
|
+ return JSON.parse(fs.readFileSync(configFile, "utf8"));
|
||||||
|
} catch (err) {
|
||||||
|
// Do nothing. If we can't read the file we have no
|
||||||
|
// language pack config.
|
||||||
|
|||||||
24
patches/exec-argv.diff
Normal file
24
patches/exec-argv.diff
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
Preserve process.execArgv
|
||||||
|
|
||||||
|
This ensures flags like `--prof` are passed down to the code-server process so
|
||||||
|
we can profile everything.
|
||||||
|
|
||||||
|
To test this:
|
||||||
|
1. run `./lib/node --prof .`
|
||||||
|
2. in another terminal, run `ps -ejww`
|
||||||
|
|
||||||
|
You should see `--prof` next to every code-server process.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
||||||
|
@@ -228,7 +228,7 @@ export class ExtensionHostConnection {
|
||||||
|
|
||||||
|
public async start(startParams: IRemoteExtensionHostStartParams): Promise<void> {
|
||||||
|
try {
|
||||||
|
- let execArgv: string[] = [];
|
||||||
|
+ let execArgv: string[] = process.execArgv ? process.execArgv.filter(a => !/^--inspect(-brk)?=/.test(a)) : [];
|
||||||
|
if (startParams.port && !(<any>process).pkg) {
|
||||||
|
execArgv = [`--inspect${startParams.break ? '-brk' : ''}=${startParams.port}`];
|
||||||
|
}
|
||||||
@@ -1,252 +0,0 @@
|
|||||||
Modify Help: Getting Started
|
|
||||||
|
|
||||||
This modifies some text on the Getting Started page and adds text about using
|
|
||||||
code-server on a team.
|
|
||||||
|
|
||||||
It is enabled by default but can be overriden using the cli flag
|
|
||||||
`--disable-getting-started-override`.
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
|
|
||||||
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
|
|
||||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
|
||||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
|
||||||
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
|
|
||||||
-import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
|
||||||
+import { IsEnabledCoderGettingStarted, WorkbenchStateContext } from 'vs/workbench/common/contextkeys';
|
|
||||||
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
|
||||||
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
|
|
||||||
import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
|
|
||||||
@@ -758,6 +758,72 @@ export class GettingStartedPage extends
|
|
||||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
|
||||||
);
|
|
||||||
|
|
||||||
+ let gettingStartedCoder: HTMLElement = $('.header', {});
|
|
||||||
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
|
||||||
+ gettingStartedCoder = $('.gettingStartedCategory', {},
|
|
||||||
+ $('h2', {
|
|
||||||
+ style: 'margin-bottom: 12px',
|
|
||||||
+ }, 'Next Up'),
|
|
||||||
+ $('a', {
|
|
||||||
+ href: 'https://cdr.co/code-server-to-coder',
|
|
||||||
+ target: '_blank',
|
|
||||||
+ },
|
|
||||||
+ $('button', {
|
|
||||||
+ style: [
|
|
||||||
+ 'padding: 10px 16px ',
|
|
||||||
+ 'border-radius: 4px',
|
|
||||||
+ 'background: linear-gradient(94.04deg, #7934DA 0%, #4D52E0 101.2%)',
|
|
||||||
+ 'color: white',
|
|
||||||
+ 'overflow: hidden',
|
|
||||||
+ 'margin-right: 14px',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ },
|
|
||||||
+ $('h3', {
|
|
||||||
+ style: [
|
|
||||||
+ 'margin: 0px 0px 6px',
|
|
||||||
+ 'font-weight: 500',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ }, 'Deploy code-server for your team'),
|
|
||||||
+ $('p', {
|
|
||||||
+ style: [
|
|
||||||
+ 'margin: 0',
|
|
||||||
+ 'font-size: 13px',
|
|
||||||
+ 'color: #dcdee2',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ }, 'Provision software development environments on your infrastructure with Coder.'),
|
|
||||||
+ $('p', {
|
|
||||||
+ style: [
|
|
||||||
+ 'margin-top: 8px',
|
|
||||||
+ 'font-size: 13px',
|
|
||||||
+ 'color: #dcdee2',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ }, 'Coder is a self-service portal which provisions via Terraform—Linux, macOS, Windows, x86, ARM, and, of course, Kubernetes based infrastructure.'),
|
|
||||||
+ $('p', {
|
|
||||||
+ style: [
|
|
||||||
+ 'margin: 0',
|
|
||||||
+ 'margin-top: 8px',
|
|
||||||
+ 'font-size: 13px',
|
|
||||||
+ 'display: flex',
|
|
||||||
+ 'align-items: center',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ }, 'Get started ', $('span', {
|
|
||||||
+ class: Codicon.arrowRight.classNames,
|
|
||||||
+ style: [
|
|
||||||
+ 'color: white',
|
|
||||||
+ 'margin-left: 8px',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ })),
|
|
||||||
+ $('img', {
|
|
||||||
+ src: './_static/src/browser/media/templates.png',
|
|
||||||
+ style: [
|
|
||||||
+ 'margin-bottom: -65px',
|
|
||||||
+ ].join(';'),
|
|
||||||
+ }),
|
|
||||||
+ ),
|
|
||||||
+ ),
|
|
||||||
+ );
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
|
|
||||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
|
||||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
|
||||||
@@ -775,13 +841,23 @@ export class GettingStartedPage extends
|
|
||||||
const layoutLists = () => {
|
|
||||||
if (gettingStartedList.itemCount) {
|
|
||||||
this.container.classList.remove('noWalkthroughs');
|
|
||||||
- reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
|
||||||
- reset(rightColumn, gettingStartedList.getDomElement());
|
|
||||||
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
|
||||||
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement(), gettingStartedList.getDomElement());
|
|
||||||
+ reset(rightColumn, gettingStartedCoder);
|
|
||||||
+ } else {
|
|
||||||
+ reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
|
||||||
+ reset(rightColumn, gettingStartedList.getDomElement());
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
recentList.setLimit(5);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.container.classList.add('noWalkthroughs');
|
|
||||||
- reset(leftColumn, startList.getDomElement());
|
|
||||||
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
|
|
||||||
+ reset(leftColumn, startList.getDomElement(), gettingStartedCoder);
|
|
||||||
+ } else {
|
|
||||||
+ reset(leftColumn, startList.getDomElement());
|
|
||||||
+ }
|
|
||||||
reset(rightColumn, recentList.getDomElement());
|
|
||||||
recentList.setLimit(10);
|
|
||||||
}
|
|
||||||
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/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
|
|
||||||
@@ -60,6 +60,15 @@
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
+.monaco-workbench .part.editor > .content .gettingStartedContainer .coder {
|
|
||||||
+ margin-bottom: 0.2em;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+.monaco-workbench .part.editor>.content .gettingStartedContainer .coder-coder {
|
|
||||||
+ font-size: 1em;
|
|
||||||
+ margin-top: 0.2em;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
.monaco-workbench.hc-black .part.editor>.content .gettingStartedContainer .subtitle,
|
|
||||||
.monaco-workbench.hc-light .part.editor>.content .gettingStartedContainer .subtitle {
|
|
||||||
font-weight: 200;
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
|
||||||
@@ -276,6 +276,11 @@ export interface IWorkbenchConstructionO
|
|
||||||
*/
|
|
||||||
readonly isEnabledFileDownloads?: boolean
|
|
||||||
|
|
||||||
+ /**
|
|
||||||
+ * Whether to use Coder's custom Getting Started text.
|
|
||||||
+ */
|
|
||||||
+ readonly isEnabledCoderGettingStarted?: boolean
|
|
||||||
+
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
|
||||||
@@ -37,6 +37,11 @@ export interface IBrowserWorkbenchEnviro
|
|
||||||
* Enable downloading files via menu actions.
|
|
||||||
*/
|
|
||||||
readonly isEnabledFileDownloads?: boolean;
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Enable Coder's custom getting started text.
|
|
||||||
+ */
|
|
||||||
+ readonly isEnabledCoderGettingStarted?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
|
||||||
@@ -99,6 +104,13 @@ export class BrowserWorkbenchEnvironment
|
|
||||||
return this.options.isEnabledFileDownloads;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ get isEnabledCoderGettingStarted(): boolean {
|
|
||||||
+ if (typeof this.options.isEnabledCoderGettingStarted === "undefined") {
|
|
||||||
+ throw new Error('isEnabledCoderGettingStarted was not provided to the browser');
|
|
||||||
+ }
|
|
||||||
+ return this.options.isEnabledCoderGettingStarted;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
@memoize
|
|
||||||
get argvResource(): URI { return joinPath(this.userRoamingDataHome, 'argv.json'); }
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -16,6 +16,7 @@ export const serverOptions: OptionDescri
|
|
||||||
'auth': { type: 'string' },
|
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
|
||||||
'locale': { type: 'string' },
|
|
||||||
+ 'disable-getting-started-override': { type: 'boolean' },
|
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
|
||||||
|
|
||||||
@@ -98,6 +99,7 @@ export interface ServerParsedArgs {
|
|
||||||
'auth'?: string
|
|
||||||
'disable-file-downloads'?: boolean;
|
|
||||||
'locale'?: string
|
|
||||||
+ 'disable-getting-started-override'?: boolean;
|
|
||||||
|
|
||||||
/* ----- 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
|
|
||||||
@@ -308,6 +308,7 @@ export class WebClientServer {
|
|
||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
|
||||||
userDataPath: this._environmentService.userDataPath,
|
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
|
||||||
+ isEnabledCoderGettingStarted: !this._environmentService.args['disable-getting-started-override'],
|
|
||||||
_wrapWebWorkerExtHostInIframe,
|
|
||||||
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,
|
|
||||||
Index: code-server/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
|
|
||||||
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/ev
|
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
|
||||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
|
|
||||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted } from 'vs/workbench/common/contextkeys';
|
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
|
||||||
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
|
||||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
|
||||||
@@ -204,6 +204,7 @@ export class WorkbenchContextKeysHandler
|
|
||||||
|
|
||||||
// code-server
|
|
||||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
|
||||||
+ IsEnabledCoderGettingStarted.bindTo(this.contextKeyService).set(this.environmentService.isEnabledCoderGettingStarted ?? true)
|
|
||||||
|
|
||||||
this.registerListeners();
|
|
||||||
}
|
|
||||||
Index: code-server/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
|
|
||||||
@@ -33,6 +33,7 @@ export const IsFullscreenContext = new R
|
|
||||||
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
|
||||||
|
|
||||||
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
|
||||||
+export const IsEnabledCoderGettingStarted = new RawContextKey<boolean>('isEnabledCoderGettingStarted', true, true);
|
|
||||||
|
|
||||||
//#endregion
|
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
|||||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||||
@@ -117,6 +118,9 @@ export class BrowserMain extends Disposa
|
@@ -116,6 +117,9 @@ export class BrowserMain extends Disposa
|
||||||
// Startup
|
// Startup
|
||||||
const instantiationService = workbench.startup();
|
const instantiationService = workbench.startup();
|
||||||
|
|
||||||
@@ -221,13 +221,12 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
|||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||||
@@ -26,9 +27,9 @@
|
@@ -26,8 +27,9 @@
|
||||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||||
|
|
||||||
<!-- Workbench Icon/Manifest/CSS -->
|
<!-- Workbench Icon/Manifest/CSS -->
|
||||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||||
-
|
|
||||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
+ userDataPath: this._environmentService.userDataPath,
|
+ userDataPath: this._environmentService.userDataPath,
|
||||||
_wrapWebWorkerExtHostInIframe,
|
_wrapWebWorkerExtHostInIframe,
|
||||||
developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined, logLevel: this._logService.getLevel() },
|
developmentOptions: {
|
||||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||||
@@ -266,6 +266,11 @@ export interface IWorkbenchConstructionO
|
@@ -262,6 +262,11 @@ export interface IWorkbenchConstructionO
|
||||||
*/
|
*/
|
||||||
readonly configurationDefaults?: Record<string, any>;
|
readonly configurationDefaults?: Record<string, any>;
|
||||||
|
|
||||||
@@ -48,8 +48,8 @@ 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
|
||||||
@@ -78,7 +78,14 @@ export class BrowserWorkbenchEnvironment
|
@@ -53,7 +53,14 @@ export class BrowserWorkbenchEnvironment
|
||||||
get logFile(): URI { return joinPath(this.windowLogsPath, 'window.log'); }
|
get logFile(): URI { return joinPath(this.logsHome, 'window.log'); }
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
- get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.vscodeUserData }); }
|
- get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.vscodeUserData }); }
|
||||||
|
|||||||
21
patches/log-level.diff
Normal file
21
patches/log-level.diff
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
Propagate the log level to the client
|
||||||
|
|
||||||
|
This can be tested by using `--log trace`. You should see plenty of debug and
|
||||||
|
trace logs in the console.
|
||||||
|
|
||||||
|
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
|
||||||
|
@@ -304,7 +304,10 @@ export class WebClientServer {
|
||||||
|
remoteAuthority,
|
||||||
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
|
_wrapWebWorkerExtHostInIframe,
|
||||||
|
- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined },
|
||||||
|
+ developmentOptions: {
|
||||||
|
+ enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||||
|
+ logLevel: this._logService.getLevel(),
|
||||||
|
+ },
|
||||||
|
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||||
|
enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'],
|
||||||
|
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||||
@@ -21,14 +21,14 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -13,6 +13,7 @@ import { IEnvironmentService, INativeEnv
|
@@ -13,6 +13,7 @@ import { IEnvironmentService, INativeEnv
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<ServerParsedArgs> = {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
+ 'auth': { type: 'string' },
|
+ 'auth': { type: 'string' },
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ export const serverOptions: OptionDescri
|
@@ -93,6 +94,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
@@ -68,7 +68,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
constructor (
|
constructor (
|
||||||
@ILogService private logService: ILogService,
|
@ILogService private logService: ILogService,
|
||||||
@INotificationService private notificationService: INotificationService,
|
@INotificationService private notificationService: INotificationService,
|
||||||
@@ -81,6 +85,10 @@ export class CodeServerClient extends Di
|
@@ -82,6 +86,10 @@ export class CodeServerClient extends Di
|
||||||
if (this.productService.updateEndpoint) {
|
if (this.productService.updateEndpoint) {
|
||||||
this.checkUpdates(this.productService.updateEndpoint)
|
this.checkUpdates(this.productService.updateEndpoint)
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
private checkUpdates(updateEndpoint: string) {
|
private checkUpdates(updateEndpoint: string) {
|
||||||
@@ -132,4 +140,25 @@ export class CodeServerClient extends Di
|
@@ -133,4 +141,25 @@ export class CodeServerClient extends Di
|
||||||
|
|
||||||
updateLoop();
|
updateLoop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,23 +19,22 @@ 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
|
||||||
@@ -53,6 +53,16 @@ else if (typeof require?.__$__nodeRequir
|
@@ -45,7 +45,14 @@ else if (typeof require?.__$__nodeRequir
|
||||||
version: pkg.version
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ Object.assign(product, {
|
Object.assign(product, {
|
||||||
|
- version: pkg.version
|
||||||
|
+ version: pkg.version,
|
||||||
+ 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",
|
||||||
+ 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: "",
|
||||||
+ })
|
+ }),
|
||||||
+ });
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Web environment or unknown
|
|
||||||
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
|
||||||
@@ -65,10 +64,10 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
},
|
},
|
||||||
callbackRoute: this._callbackRoute
|
callbackRoute: this._callbackRoute
|
||||||
};
|
};
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
|||||||
24
patches/parent-origin.diff
Normal file
24
patches/parent-origin.diff
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
Remove parentOriginHash checko
|
||||||
|
|
||||||
|
This fixes webviews from not working properly due to a change upstream.
|
||||||
|
Upstream added a check to ensure parent authority is encoded into the webview
|
||||||
|
origin. Since our webview origin is the parent authority, we can bypass this
|
||||||
|
check.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||||
|
@@ -317,6 +317,12 @@ const hostMessaging = new class HostMess
|
||||||
|
const id = searchParams.get('id');
|
||||||
|
|
||||||
|
const hostname = location.hostname;
|
||||||
|
+
|
||||||
|
+ // It is safe to run if we are on the same host.
|
||||||
|
+ const parent = new URL(parentOrigin)
|
||||||
|
+ if (parent.hostname == location.hostname) {
|
||||||
|
+ return start(parentOrigin)
|
||||||
|
+ }
|
||||||
|
|
||||||
|
if (!crypto.subtle) {
|
||||||
|
// cannot validate, not running in a secure context
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
Unconditionally enable the proposed API
|
Unconditionally enable the proposed API
|
||||||
|
|
||||||
To test run an extension that uses the proposed API (i.e.
|
To test run an extension that uses the proposed API.
|
||||||
https://github.com/microsoft/vscode-extension-samples/tree/ddae6c0c9ff203b4ed6f6b43bfacdd0834215f83/proposed-api-sample)
|
|
||||||
|
|
||||||
We also override isProposedApiEnabled in case an extension does not declare the
|
We also override isProposedApiEnabled in case an extension does not declare the
|
||||||
APIs it needs correctly (the Jupyter extension had this issue).
|
APIs it needs correctly (the Jupyter extension had this issue).
|
||||||
@@ -10,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstra
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
||||||
@@ -1482,7 +1482,7 @@ class ProposedApiController {
|
@@ -1458,7 +1458,7 @@ class ProposedApiController {
|
||||||
|
|
||||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||||
|
|
||||||
@@ -23,7 +22,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||||
@@ -364,10 +364,7 @@ function extensionDescriptionArrayToMap(
|
@@ -359,10 +359,7 @@ function extensionDescriptionArrayToMap(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||||
|
|||||||
@@ -10,22 +10,6 @@ extensions, use --extensions-dir, or symlink it).
|
|||||||
|
|
||||||
This has e2e tests.
|
This has e2e tests.
|
||||||
|
|
||||||
For the `asExternalUri` changes, you'll need to test manually by:
|
|
||||||
1. running code-server with the test extension
|
|
||||||
2. Command Palette > code-server: asExternalUri test
|
|
||||||
3. input a url like http://localhost:3000
|
|
||||||
4. it should show a notification and show output as <code-server>/proxy/3000
|
|
||||||
|
|
||||||
Do the same thing but set `VSCODE_PROXY_URI: "https://{{port}}-main-workspace-name-user-name.coder.com"`
|
|
||||||
and the output should replace `{{port}}` with port used in input url.
|
|
||||||
|
|
||||||
This also enables the forwared ports view panel by default.
|
|
||||||
|
|
||||||
Lastly, it adds a tunnelProvider so that ports are forwarded using code-server's
|
|
||||||
built-in proxy. You can test this by starting a server i.e. `python3 -m
|
|
||||||
http.server` and it should show a notification and show up in the ports panel
|
|
||||||
using the /proxy/port.
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||||
@@ -84,7 +68,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
+ proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
},
|
},
|
||||||
@@ -92,7 +76,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||||
@@ -248,7 +248,7 @@ export class BrowserMain extends Disposa
|
@@ -247,7 +247,7 @@ export class BrowserMain extends Disposa
|
||||||
|
|
||||||
// Remote
|
// Remote
|
||||||
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
|
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
|
||||||
@@ -105,7 +89,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
|
||||||
@@ -381,7 +381,7 @@ export async function createTerminalEnvi
|
@@ -388,7 +388,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
|
||||||
@@ -114,68 +98,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalE
|
|||||||
|
|
||||||
// Merge config (settings) and ShellLaunchConfig environments
|
// Merge config (settings) and ShellLaunchConfig environments
|
||||||
mergeEnvironments(env, allowedEnvFromConfig);
|
mergeEnvironments(env, allowedEnvFromConfig);
|
||||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|
||||||
===================================================================
|
|
||||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|
||||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|
||||||
@@ -21,6 +21,7 @@ import type { ICredentialsProvider } fro
|
|
||||||
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
|
||||||
import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api';
|
|
||||||
import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService';
|
|
||||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
|
||||||
|
|
||||||
interface ICredential {
|
|
||||||
service: string;
|
|
||||||
@@ -511,6 +512,38 @@ function doCreateUri(path: string, query
|
|
||||||
} : undefined,
|
|
||||||
workspaceProvider: WorkspaceProvider.create(config),
|
|
||||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
|
||||||
- credentialsProvider: config.remoteAuthority ? undefined : new LocalStorageCredentialsProvider() // with a remote, we don't use a local credentials provider
|
|
||||||
+ credentialsProvider: config.remoteAuthority ? undefined : new LocalStorageCredentialsProvider(), // with a remote, we don't use a local credentials provider
|
|
||||||
+ resolveExternalUri: (uri: URI): Promise<URI> => {
|
|
||||||
+ let resolvedUri = uri
|
|
||||||
+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(resolvedUri)
|
|
||||||
+
|
|
||||||
+ if (localhostMatch && resolvedUri.authority !== location.host) {
|
|
||||||
+ if (config.productConfiguration && config.productConfiguration.proxyEndpointTemplate) {
|
|
||||||
+ resolvedUri = URI.parse(new URL(config.productConfiguration.proxyEndpointTemplate.replace('{{port}}', localhostMatch.port.toString()), window.location.href).toString())
|
|
||||||
+ } else {
|
|
||||||
+ throw new Error(`Failed to resolve external URI: ${uri.toString()}. Could not determine base url because productConfiguration missing.`)
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // If not localhost, return unmodified
|
|
||||||
+ return Promise.resolve(resolvedUri)
|
|
||||||
+ },
|
|
||||||
+ tunnelProvider: {
|
|
||||||
+ tunnelFactory: (tunnelOptions: TunnelOptions, tunnelCreationOptions: TunnelCreationOptions) => {
|
|
||||||
+ const onDidDispose: Emitter<void> = new Emitter();
|
|
||||||
+ let isDisposed = false;
|
|
||||||
+ return Promise.resolve({
|
|
||||||
+ remoteAddress: tunnelOptions.remoteAddress,
|
|
||||||
+ localAddress: `localhost:${tunnelOptions.remoteAddress.port}`,
|
|
||||||
+ onDidDispose: onDidDispose.event,
|
|
||||||
+ dispose: () => {
|
|
||||||
+ if (!isDisposed) {
|
|
||||||
+ isDisposed = true;
|
|
||||||
+ onDidDispose.fire();
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ })
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
Index: code-server/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
|
|
||||||
@@ -73,7 +73,7 @@ export class ForwardedPortsView extends
|
|
||||||
this.contextKeyListener = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
|
||||||
+ const viewEnabled: boolean = true;
|
|
||||||
|
|
||||||
if (this.environmentService.remoteAuthority && viewEnabled) {
|
|
||||||
const viewContainer = await this.getViewContainer();
|
|
||||||
|
|||||||
13
patches/safari-console.diff
Normal file
13
patches/safari-console.diff
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
|
||||||
|
@@ -286,7 +286,7 @@ export class XtermTerminal extends Dispo
|
||||||
|
}
|
||||||
|
|
||||||
|
private _shouldLoadCanvas(): boolean {
|
||||||
|
- return (this._configHelper.config.gpuAcceleration === 'auto' && (XtermTerminal._suggestedRendererType === undefined || XtermTerminal._suggestedRendererType === 'canvas')) || this._configHelper.config.gpuAcceleration === 'canvas';
|
||||||
|
+ return !isSafari && (this._configHelper.config.gpuAcceleration === 'auto' && (XtermTerminal._suggestedRendererType === undefined || XtermTerminal._suggestedRendererType === 'canvas')) || this._configHelper.config.gpuAcceleration === 'canvas';
|
||||||
|
}
|
||||||
|
|
||||||
|
forceRedraw() {
|
||||||
@@ -11,11 +11,14 @@ store-socket.diff
|
|||||||
proxy-uri.diff
|
proxy-uri.diff
|
||||||
github-auth.diff
|
github-auth.diff
|
||||||
unique-db.diff
|
unique-db.diff
|
||||||
|
log-level.diff
|
||||||
local-storage.diff
|
local-storage.diff
|
||||||
service-worker.diff
|
service-worker.diff
|
||||||
|
connection-type.diff
|
||||||
sourcemaps.diff
|
sourcemaps.diff
|
||||||
disable-downloads.diff
|
disable-downloads.diff
|
||||||
telemetry.diff
|
telemetry.diff
|
||||||
display-language.diff
|
display-language.diff
|
||||||
cli-window-open.diff
|
cli-window-open.diff
|
||||||
getting-started.diff
|
exec-argv.diff
|
||||||
|
safari-console.diff
|
||||||
|
|||||||
@@ -17,11 +17,26 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
|||||||
|
|
||||||
readonly version: string;
|
readonly version: string;
|
||||||
readonly date?: string;
|
readonly date?: string;
|
||||||
|
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
|
||||||
|
@@ -319,6 +319,10 @@ export class WebClientServer {
|
||||||
|
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||||
|
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
||||||
|
proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||||
|
+ serviceWorker: {
|
||||||
|
+ scope: vscodeBase + '/',
|
||||||
|
+ path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
|
+ },
|
||||||
|
embedderIdentifier: 'server-distro',
|
||||||
|
extensionsGallery: this._productService.extensionsGallery,
|
||||||
|
},
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||||
@@ -89,6 +89,10 @@ export class CodeServerClient extends Di
|
@@ -90,6 +90,10 @@ export class CodeServerClient extends Di
|
||||||
if (this.productService.logoutEndpoint) {
|
if (this.productService.logoutEndpoint) {
|
||||||
this.addLogoutCommand(this.productService.logoutEndpoint);
|
this.addLogoutCommand(this.productService.logoutEndpoint);
|
||||||
}
|
}
|
||||||
@@ -32,7 +47,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
private checkUpdates(updateEndpoint: string) {
|
private checkUpdates(updateEndpoint: string) {
|
||||||
@@ -161,4 +165,17 @@ export class CodeServerClient extends Di
|
@@ -162,4 +166,17 @@ export class CodeServerClient extends Di
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,18 +65,3 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.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/lib/vscode/src/vs/server/node/webClientServer.ts
|
|
||||||
@@ -316,6 +316,10 @@ export class WebClientServer {
|
|
||||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
|
||||||
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
|
|
||||||
proxyEndpointTemplate: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
|
||||||
+ serviceWorker: {
|
|
||||||
+ scope: vscodeBase + '/',
|
|
||||||
+ path: base + '/_static/out/browser/serviceWorker.js',
|
|
||||||
+ },
|
|
||||||
embedderIdentifier: 'server-distro',
|
|
||||||
extensionsGallery: this._productService.extensionsGallery,
|
|
||||||
},
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
--- code-server.orig/lib/vscode/build/gulpfile.reh.js
|
||||||
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
+++ code-server/lib/vscode/build/gulpfile.reh.js
|
||||||
@@ -192,8 +192,7 @@ function packageTask(type, platform, arc
|
@@ -196,8 +196,7 @@ function packageTask(type, platform, arc
|
||||||
|
|
||||||
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
const src = gulp.src(sourceFolderName + '/**', { base: '.' })
|
||||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); }))
|
||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
|
||||||
const isUIExtension = (manifest) => {
|
const isUIExtension = (manifest) => {
|
||||||
@@ -232,9 +231,9 @@ function packageTask(type, platform, arc
|
@@ -236,9 +235,9 @@ function packageTask(type, platform, arc
|
||||||
.map(name => `.build/extensions/${name}/**`);
|
.map(name => `.build/extensions/${name}/**`);
|
||||||
|
|
||||||
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
|
||||||
@@ -32,12 +32,12 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
|
|||||||
|
|
||||||
let version = packageJson.version;
|
let version = packageJson.version;
|
||||||
const quality = product.quality;
|
const quality = product.quality;
|
||||||
@@ -388,7 +387,7 @@ function tweakProductForServerWeb(produc
|
@@ -373,7 +372,7 @@ function tweakProductForServerWeb(produc
|
||||||
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
const minifyTask = task.define(`minify-vscode-${type}`, task.series(
|
||||||
optimizeTask,
|
optimizeTask,
|
||||||
util.rimraf(`out-vscode-${type}-min`),
|
util.rimraf(`out-vscode-${type}-min`),
|
||||||
- optimize.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
|
- common.minifyTask(`out-vscode-${type}`, `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`)
|
||||||
+ optimize.minifyTask(`out-vscode-${type}`, ``)
|
+ common.minifyTask(`out-vscode-${type}`, '')
|
||||||
));
|
));
|
||||||
gulp.task(minifyTask);
|
gulp.task(minifyTask);
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
Add support for telemetry endpoint
|
Add support for telemetry endpoint
|
||||||
|
|
||||||
|
Contains some fixes included in https://github.com/microsoft/vscode/commit/b108bc8294ce920fcf2ee8d53f97c3bcf3316e1c
|
||||||
|
|
||||||
To test:
|
To test:
|
||||||
1. Create a RequestBin - https://requestbin.io/
|
1. Look inside a build of code-server, inside `lib/vscode/vs/server/node/server.main.js`
|
||||||
2. Run code-server with `CS_TELEMETRY_URL` set:
|
2. Search for a `JSON.stringify` near `TelemetryClient`
|
||||||
i.e. `CS_TELEMETRY_URL="https://requestbin.io/1ebub9z1" ./code-server-<version>-macos-amd64/bin/code-server`
|
3. throw in a `console.log()` before it and make sure it logs telemetry data
|
||||||
NOTE: it has to be a production build.
|
|
||||||
3. Load code-server in browser an do things (i.e. open a file)
|
|
||||||
4. Refresh RequestBin and you should see logs
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
@@ -19,8 +18,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
+import { TelemetryClient } from "vs/server/node/telemetryClient";
|
+import { TelemetryClient } from "vs/server/node/telemetryClient";
|
||||||
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
import { NullPolicyService } from 'vs/platform/policy/common/policy';
|
||||||
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
import { OneDataSystemAppender } from 'vs/platform/telemetry/node/1dsAppender';
|
||||||
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
|
||||||
@@ -139,10 +140,13 @@ export async function setupServerService
|
@@ -133,10 +134,13 @@ export async function setupServerService
|
||||||
const machineId = await getMachineId();
|
const machineId = await getMachineId();
|
||||||
const isInternal = isInternalTelemetry(productService, configurationService);
|
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||||
if (supportsTelemetry(productService, environmentService)) {
|
if (supportsTelemetry(productService, environmentService)) {
|
||||||
@@ -90,11 +89,87 @@ Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
|||||||
+ } catch (error) {}
|
+ } catch (error) {}
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
|
Index: code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||||
|
+++ code-server/lib/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.ts
|
||||||
|
@@ -15,7 +15,7 @@ import { ClassifiedEvent, IGDPRProperty,
|
||||||
|
import { ITelemetryData, ITelemetryInfo, ITelemetryService, TelemetryLevel, TELEMETRY_SETTING_ID } from 'vs/platform/telemetry/common/telemetry';
|
||||||
|
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
|
||||||
|
import { ITelemetryServiceConfig, TelemetryService as BaseTelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||||
|
-import { isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
|
+import { getTelemetryLevel, isInternalTelemetry, ITelemetryAppender, NullTelemetryService, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||||
|
import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||||
|
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||||
|
import { resolveWorkbenchCommonProperties } from 'vs/workbench/services/telemetry/browser/workbenchCommonProperties';
|
||||||
|
@@ -24,7 +24,7 @@ export class TelemetryService extends Di
|
||||||
|
|
||||||
|
declare readonly _serviceBrand: undefined;
|
||||||
|
|
||||||
|
- private impl: ITelemetryService;
|
||||||
|
+ private impl: ITelemetryService = NullTelemetryService;
|
||||||
|
public readonly sendErrorTelemetry = true;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
@@ -37,11 +37,7 @@ export class TelemetryService extends Di
|
||||||
|
) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
- if (supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey) {
|
||||||
|
- this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);
|
||||||
|
- } else {
|
||||||
|
- this.impl = NullTelemetryService;
|
||||||
|
- }
|
||||||
|
+ this.impl = this.initializeService(environmentService, loggerService, configurationService, storageService, productService, remoteAgentService);
|
||||||
|
|
||||||
|
// When the level changes it could change from off to on and we want to make sure telemetry is properly intialized
|
||||||
|
this._register(configurationService.onDidChangeConfiguration(e => {
|
||||||
|
@@ -64,23 +60,28 @@ export class TelemetryService extends Di
|
||||||
|
productService: IProductService,
|
||||||
|
remoteAgentService: IRemoteAgentService
|
||||||
|
) {
|
||||||
|
- const telemetrySupported = supportsTelemetry(productService, environmentService) && productService.aiConfig?.ariaKey;
|
||||||
|
- if (telemetrySupported && this.impl === NullTelemetryService && this.telemetryLevel.value !== TelemetryLevel.NONE) {
|
||||||
|
+ const telemetrySupported = supportsTelemetry(productService, environmentService);
|
||||||
|
+ if (telemetrySupported && getTelemetryLevel(configurationService) !== TelemetryLevel.NONE && this.impl === NullTelemetryService) {
|
||||||
|
// If remote server is present send telemetry through that, else use the client side appender
|
||||||
|
const appenders = [];
|
||||||
|
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||||
|
- const telemetryProvider: ITelemetryAppender = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey);
|
||||||
|
- appenders.push(telemetryProvider);
|
||||||
|
- appenders.push(new TelemetryLogAppender(loggerService, environmentService));
|
||||||
|
- const config: ITelemetryServiceConfig = {
|
||||||
|
- appenders,
|
||||||
|
- commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
|
||||||
|
- sendErrorTelemetry: this.sendErrorTelemetry,
|
||||||
|
- };
|
||||||
|
+ const telemetryProvider: ITelemetryAppender | undefined = remoteAgentService.getConnection() !== null ? { log: remoteAgentService.logTelemetry.bind(remoteAgentService), flush: remoteAgentService.flushTelemetry.bind(remoteAgentService) } : productService.aiConfig?.ariaKey ? new OneDataSystemWebAppender(isInternal, 'monacoworkbench', null, productService.aiConfig?.ariaKey) : undefined;
|
||||||
|
+ if (telemetryProvider) {
|
||||||
|
+ appenders.push(telemetryProvider);
|
||||||
|
+ appenders.push(new TelemetryLogAppender(loggerService, environmentService));
|
||||||
|
+ const config: ITelemetryServiceConfig = {
|
||||||
|
+ appenders,
|
||||||
|
+ commonProperties: resolveWorkbenchCommonProperties(storageService, productService.commit, productService.version, isInternal, environmentService.remoteAuthority, productService.embedderIdentifier, productService.removeTelemetryMachineId, environmentService.options && environmentService.options.resolveCommonTelemetryProperties),
|
||||||
|
+ sendErrorTelemetry: this.sendErrorTelemetry,
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ return this._register(new BaseTelemetryService(config, configurationService, productService));
|
||||||
|
+ } else {
|
||||||
|
+ return this.impl;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- return this._register(new BaseTelemetryService(config, configurationService, productService));
|
||||||
|
}
|
||||||
|
- return NullTelemetryService;
|
||||||
|
+ return this.impl;
|
||||||
|
}
|
||||||
|
|
||||||
|
setExperimentProperty(name: string, value: string): void {
|
||||||
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
|
||||||
@@ -321,6 +321,7 @@ export class WebClientServer {
|
@@ -324,6 +324,7 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: base + '/_static/out/browser/serviceWorker.js',
|
path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,23 +14,23 @@ 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
|
||||||
@@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi
|
@@ -17,6 +17,7 @@ import { AbstractStorageService, isProfi
|
||||||
import { isUserDataProfile, IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||||
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
||||||
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';
|
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';
|
||||||
+import { hash } from 'vs/base/common/hash';
|
+import { hash } from 'vs/base/common/hash';
|
||||||
|
|
||||||
export class BrowserStorageService extends AbstractStorageService {
|
export class BrowserStorageService extends AbstractStorageService {
|
||||||
|
|
||||||
@@ -297,7 +298,11 @@ export class IndexedDBStorageDatabase ex
|
@@ -67,7 +68,11 @@ export class BrowserStorageService exten
|
||||||
|
return `global-${this.profileStorageProfile.id}`;
|
||||||
|
}
|
||||||
|
case StorageScope.WORKSPACE:
|
||||||
|
- return this.payload.id;
|
||||||
|
+ // Add a unique ID based on the current path for per-workspace databases.
|
||||||
|
+ // This prevents workspaces on different machines that share the same domain
|
||||||
|
+ // and file path from colliding (since it does not appear IndexedDB can be
|
||||||
|
+ // scoped to a path) as long as they are hosted on different paths.
|
||||||
|
+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async createWorkspaceStorage(workspaceId: string, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
|
||||||
- return IndexedDBStorageDatabase.create({ id: workspaceId }, logService);
|
|
||||||
+ // Add a unique ID based on the current path for per-workspace databases.
|
|
||||||
+ // This prevents workspaces on different machines that share the same domain
|
|
||||||
+ // and file path from colliding (since it does not appear IndexedDB can be
|
|
||||||
+ // scoped to a path) as long as they are hosted on different paths.
|
|
||||||
+ return IndexedDBStorageDatabase.create({ id: workspaceId + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16) }, logService);
|
|
||||||
}
|
|
||||||
|
|
||||||
static async create(options: IndexedDBStorageDatabaseOptions, logService: ILogService): Promise<IIndexedDBStorageDatabase> {
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
|||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
@@ -71,5 +77,59 @@ export class CodeServerClient extends Di
|
@@ -72,5 +78,59 @@ export class CodeServerClient extends Di
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -120,13 +120,13 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
@@ -11,6 +11,8 @@ import { refineServiceDecorator } from '
|
@@ -11,6 +11,8 @@ import { refineServiceDecorator } from '
|
||||||
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||||
|
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<ServerParsedArgs> = {
|
||||||
+ /* ----- code-server ----- */
|
+ /* ----- code-server ----- */
|
||||||
+ 'disable-update-check': { type: 'boolean' },
|
+ 'disable-update-check': { type: 'boolean' },
|
||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -88,6 +90,8 @@ export const serverOptions: OptionDescri
|
@@ -89,6 +91,8 @@ export const serverOptions: OptionDescri
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
|
|||||||
@@ -20,28 +20,11 @@ webview host is separate by default but we serve on the same host).
|
|||||||
|
|
||||||
To test, open a few types of webviews (images, markdown, extension details, etc).
|
To test, open a few types of webviews (images, markdown, extension details, etc).
|
||||||
|
|
||||||
Make sure to update the hash. To do so:
|
|
||||||
1. run code-server
|
|
||||||
2. open any webview (i.e. preview Markdown)
|
|
||||||
3. see error in console and copy hash
|
|
||||||
|
|
||||||
That will test the hash change in pre/index.html
|
|
||||||
|
|
||||||
Double-check the console to make sure there are no console errors for the webWorkerExtensionHostIframe
|
|
||||||
which also requires a hash change.
|
|
||||||
|
|
||||||
parentOriginHash changes
|
|
||||||
|
|
||||||
This fixes webviews from not working properly due to a change upstream.
|
|
||||||
Upstream added a check to ensure parent authority is encoded into the webview
|
|
||||||
origin. Since our webview origin is the parent authority, we can bypass this
|
|
||||||
check.
|
|
||||||
|
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
--- code-server.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
|
||||||
@@ -210,7 +210,7 @@ export class BrowserWorkbenchEnvironment
|
@@ -177,7 +177,7 @@ export class BrowserWorkbenchEnvironment
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
get webviewExternalEndpoint(): string {
|
get webviewExternalEndpoint(): string {
|
||||||
@@ -60,7 +43,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
+ webviewEndpoint: vscodeBase + this._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 },
|
||||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
|
||||||
===================================================================
|
===================================================================
|
||||||
@@ -70,8 +53,8 @@ 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-lC8sxUeeYqUtmkCpPt/OX/HQdE0JbHG1Z3dzrilsRU0=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-JpX/ganPoxpavjxWCz9DUZgwVZ59o2lwSYTQrziPsdU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-/9/YQU12wvTeVXCsIGB4shLwdWrMceCpKojfkloNjPU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-BRi/ZOLWtsisl3jAheglVzKmoA1T6n2Mmf2NM4UnIXE=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -87,7 +70,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
+
|
+
|
||||||
if (!crypto.subtle) {
|
if (!crypto.subtle) {
|
||||||
// cannot validate, not running in a secure context
|
// 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).`);
|
throw new Error(`Cannot validate in current context!`);
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
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.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
||||||
@@ -104,7 +87,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
+
|
+
|
||||||
if (!crypto.subtle) {
|
if (!crypto.subtle) {
|
||||||
// cannot validate, not running in a secure context
|
// 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).`);
|
throw new Error(`Cannot validate in current context!`);
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB |
@@ -10,7 +10,7 @@
|
|||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
|
||||||
/>
|
/>
|
||||||
<title>{{APP_NAME}} login</title>
|
<title>code-server login</title>
|
||||||
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
|
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
|
||||||
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
|
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
|
||||||
<link rel="manifest" href="{{BASE}}/manifest.json" crossorigin="use-credentials" />
|
<link rel="manifest" href="{{BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<div class="center-container">
|
<div class="center-container">
|
||||||
<div class="card-box">
|
<div class="card-box">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h1 class="main">{{WELCOME_TEXT}}</h1>
|
<h1 class="main">Welcome to code-server</h1>
|
||||||
<div class="sub">Please log in below. {{PASSWORD_MSG}}</div>
|
<div class="sub">Please log in below. {{PASSWORD_MSG}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { field, Level, logger } from "@coder/logger"
|
import { field, Level, logger } from "@coder/logger"
|
||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
import { load } from "js-yaml"
|
import yaml from "js-yaml"
|
||||||
import * as os from "os"
|
import * as os from "os"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { canConnect, generateCertificate, generatePassword, humanPath, paths, isNodeJSErrnoException } from "./util"
|
import { canConnect, generateCertificate, generatePassword, humanPath, paths, isNodeJSErrnoException } from "./util"
|
||||||
@@ -50,8 +50,6 @@ export interface UserProvidedCodeArgs {
|
|||||||
"github-auth"?: string
|
"github-auth"?: string
|
||||||
"disable-update-check"?: boolean
|
"disable-update-check"?: boolean
|
||||||
"disable-file-downloads"?: boolean
|
"disable-file-downloads"?: boolean
|
||||||
"disable-workspace-trust"?: boolean
|
|
||||||
"disable-getting-started-override"?: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,8 +84,6 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
|
|||||||
"ignore-last-opened"?: boolean
|
"ignore-last-opened"?: boolean
|
||||||
link?: OptionalString
|
link?: OptionalString
|
||||||
verbose?: boolean
|
verbose?: boolean
|
||||||
"app-name"?: string
|
|
||||||
"welcome-text"?: string
|
|
||||||
/* Positional arguments. */
|
/* Positional arguments. */
|
||||||
_?: string[]
|
_?: string[]
|
||||||
}
|
}
|
||||||
@@ -167,14 +163,6 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
description:
|
description:
|
||||||
"Disable file downloads from Code. This can also be set with CS_DISABLE_FILE_DOWNLOADS set to 'true' or '1'.",
|
"Disable file downloads from Code. This can also be set with CS_DISABLE_FILE_DOWNLOADS set to 'true' or '1'.",
|
||||||
},
|
},
|
||||||
"disable-workspace-trust": {
|
|
||||||
type: "boolean",
|
|
||||||
description: "Disable Workspace Trust feature. This switch only affects the current session.",
|
|
||||||
},
|
|
||||||
"disable-getting-started-override": {
|
|
||||||
type: "boolean",
|
|
||||||
description: "Disable the coder/coder override in the Help: Getting Started page.",
|
|
||||||
},
|
|
||||||
// --enable can be used to enable experimental features. These features
|
// --enable can be used to enable experimental features. These features
|
||||||
// provide no guarantees.
|
// provide no guarantees.
|
||||||
enable: { type: "string[]" },
|
enable: { type: "string[]" },
|
||||||
@@ -245,16 +233,7 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
|||||||
|
|
||||||
log: { type: LogLevel },
|
log: { type: LogLevel },
|
||||||
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },
|
verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." },
|
||||||
"app-name": {
|
|
||||||
type: "string",
|
|
||||||
short: "an",
|
|
||||||
description: "The name to use in branding. Will be shown in titlebar and welcome message",
|
|
||||||
},
|
|
||||||
"welcome-text": {
|
|
||||||
type: "string",
|
|
||||||
short: "w",
|
|
||||||
description: "Text to show on login page",
|
|
||||||
},
|
|
||||||
link: {
|
link: {
|
||||||
type: OptionalString,
|
type: OptionalString,
|
||||||
description: `
|
description: `
|
||||||
@@ -568,10 +547,6 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
|||||||
args["disable-file-downloads"] = true
|
args["disable-file-downloads"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE?.match(/^(1|true)$/)) {
|
|
||||||
args["disable-getting-started-override"] = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
|
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
|
||||||
if (process.env.HASHED_PASSWORD) {
|
if (process.env.HASHED_PASSWORD) {
|
||||||
args["hashed-password"] = process.env.HASHED_PASSWORD
|
args["hashed-password"] = process.env.HASHED_PASSWORD
|
||||||
@@ -666,7 +641,7 @@ export function parseConfigFile(configFile: string, configPath: string): ConfigA
|
|||||||
return { config: configPath }
|
return { config: configPath }
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = load(configFile, {
|
const config = yaml.load(configFile, {
|
||||||
filename: configPath,
|
filename: configPath,
|
||||||
})
|
})
|
||||||
if (!config || typeof config === "string") {
|
if (!config || typeof config === "string") {
|
||||||
@@ -814,7 +789,6 @@ export interface CodeArgs extends UserProvidedCodeArgs {
|
|||||||
"without-connection-token"?: boolean
|
"without-connection-token"?: boolean
|
||||||
"without-browser-env-var"?: boolean
|
"without-browser-env-var"?: boolean
|
||||||
compatibility: string
|
compatibility: string
|
||||||
log: string[] | undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -836,6 +810,5 @@ export const toCodeArgs = async (args: DefaultedArgs): Promise<CodeArgs> => {
|
|||||||
help: !!args.help,
|
help: !!args.help,
|
||||||
version: !!args.version,
|
version: !!args.version,
|
||||||
port: args.port?.toString(),
|
port: args.port?.toString(),
|
||||||
log: args.log ? [args.log] : undefined,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { AuthType, DefaultedArgs, Feature, SpawnCodeCli, toCodeArgs, UserProvide
|
|||||||
import { coderCloudBind } from "./coder_cloud"
|
import { coderCloudBind } from "./coder_cloud"
|
||||||
import { commit, version } from "./constants"
|
import { commit, version } from "./constants"
|
||||||
import { register } from "./routes"
|
import { register } from "./routes"
|
||||||
import { humanPath, isDirectory, loadAMDModule, open } from "./util"
|
import { humanPath, isFile, loadAMDModule, open } from "./util"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the user passed an extension-related VS Code flag.
|
* Return true if the user passed an extension-related VS Code flag.
|
||||||
@@ -69,15 +69,14 @@ export const openInExistingInstance = async (args: DefaultedArgs, socketPath: st
|
|||||||
fileURIs: [],
|
fileURIs: [],
|
||||||
forceReuseWindow: args["reuse-window"],
|
forceReuseWindow: args["reuse-window"],
|
||||||
forceNewWindow: args["new-window"],
|
forceNewWindow: args["new-window"],
|
||||||
gotoLineMode: true,
|
|
||||||
}
|
}
|
||||||
const paths = args._ || []
|
const paths = args._ || []
|
||||||
for (let i = 0; i < paths.length; i++) {
|
for (let i = 0; i < paths.length; i++) {
|
||||||
const fp = path.resolve(paths[i])
|
const fp = path.resolve(paths[i])
|
||||||
if (await isDirectory(fp)) {
|
if (await isFile(fp)) {
|
||||||
pipeArgs.folderURIs.push(fp)
|
|
||||||
} else {
|
|
||||||
pipeArgs.fileURIs.push(fp)
|
pipeArgs.fileURIs.push(fp)
|
||||||
|
} else {
|
||||||
|
pipeArgs.folderURIs.push(fp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pipeArgs.forceNewWindow && pipeArgs.fileURIs.length > 0) {
|
if (pipeArgs.forceNewWindow && pipeArgs.fileURIs.length > 0) {
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ export class PluginAPI {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
if (!semver.satisfies(version, packageJSON.engines["code-server"])) {
|
if (!semver.satisfies(version, packageJSON.engines["code-server"])) {
|
||||||
this.logger.warn(
|
throw new Error(
|
||||||
`plugin range ${q(packageJSON.engines["code-server"])} incompatible` + ` with code-server version ${version}`,
|
`plugin range ${q(packageJSON.engines["code-server"])} incompatible` + ` with code-server version ${version}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ export class RateLimiter {
|
|||||||
|
|
||||||
const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
||||||
const content = await fs.readFile(path.join(rootPath, "src/browser/pages/login.html"), "utf8")
|
const content = await fs.readFile(path.join(rootPath, "src/browser/pages/login.html"), "utf8")
|
||||||
const appName = req.args["app-name"] || "code-server"
|
|
||||||
const welcomeText = req.args["welcome-text"] || `Welcome to ${appName}`
|
|
||||||
let passwordMsg = `Check the config file at ${humanPath(os.homedir(), req.args.config)} for the password.`
|
let passwordMsg = `Check the config file at ${humanPath(os.homedir(), req.args.config)} for the password.`
|
||||||
if (req.args.usingEnvPassword) {
|
if (req.args.usingEnvPassword) {
|
||||||
passwordMsg = "Password was set from $PASSWORD."
|
passwordMsg = "Password was set from $PASSWORD."
|
||||||
@@ -40,8 +38,6 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
|||||||
return replaceTemplates(
|
return replaceTemplates(
|
||||||
req,
|
req,
|
||||||
content
|
content
|
||||||
.replace(/{{APP_NAME}}/g, appName)
|
|
||||||
.replace(/{{WELCOME_TEXT}}/g, welcomeText)
|
|
||||||
.replace(/{{PASSWORD_MSG}}/g, passwordMsg)
|
.replace(/{{PASSWORD_MSG}}/g, passwordMsg)
|
||||||
.replace(/{{ERROR}}/, error ? `<div class="error">${escapeHtml(error.message)}</div>` : ""),
|
.replace(/{{ERROR}}/, error ? `<div class="error">${escapeHtml(error.message)}</div>` : ""),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -156,7 +156,9 @@ export class CodeServerRouteWrapper {
|
|||||||
try {
|
try {
|
||||||
this._codeServerMain = await createVSServer(null, {
|
this._codeServerMain = await createVSServer(null, {
|
||||||
...(await toCodeArgs(args)),
|
...(await toCodeArgs(args)),
|
||||||
|
// TODO: Make the browser helper script work.
|
||||||
"without-connection-token": true,
|
"without-connection-token": true,
|
||||||
|
"without-browser-env-var": true,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logError(logger, "CodeServerRouteWrapper", error)
|
logError(logger, "CodeServerRouteWrapper", error)
|
||||||
|
|||||||
@@ -482,15 +482,6 @@ export const isFile = async (path: string): Promise<boolean> => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isDirectory = async (path: string): Promise<boolean> => {
|
|
||||||
try {
|
|
||||||
const stat = await fs.stat(path)
|
|
||||||
return stat.isDirectory()
|
|
||||||
} catch (error) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes any HTML string special characters, like &, <, >, ", and '.
|
* Escapes any HTML string special characters, like &, <, >, ", and '.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -321,7 +321,6 @@ export class ParentProcess extends Process {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
CODE_SERVER_PARENT_PID: process.pid.toString(),
|
CODE_SERVER_PARENT_PID: process.pid.toString(),
|
||||||
NODE_EXEC_PATH: process.execPath,
|
|
||||||
},
|
},
|
||||||
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { getMaybeProxiedCodeServer } from "../utils/helpers"
|
|||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
import { CodeServer } from "./models/CodeServer"
|
import { CodeServer } from "./models/CodeServer"
|
||||||
|
|
||||||
describe("code-server", ["--disable-workspace-trust"], {}, () => {
|
describe("code-server", [], {}, () => {
|
||||||
// TODO@asher: Generalize this? Could be nice if we were to ever need
|
// TODO@asher: Generalize this? Could be nice if we were to ever need
|
||||||
// multiple migration tests in other suites.
|
// multiple migration tests in other suites.
|
||||||
const instances = new Map<string, CodeServer>()
|
const instances = new Map<string, CodeServer>()
|
||||||
|
|||||||
@@ -3,17 +3,12 @@ import { describe, test, expect } from "./baseFixture"
|
|||||||
|
|
||||||
// Given a code-server environment with Spanish Language Pack extension installed
|
// Given a code-server environment with Spanish Language Pack extension installed
|
||||||
// and a languagepacks.json in the data-dir
|
// and a languagepacks.json in the data-dir
|
||||||
describe(
|
describe("--locale es", ["--extensions-dir", path.join(__dirname, "./extensions"), "--locale", "es"], {}, () => {
|
||||||
"--locale es",
|
test("should load code-server in Spanish", async ({ codeServerPage }) => {
|
||||||
["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions"), "--locale", "es"],
|
// When
|
||||||
{},
|
const visible = await codeServerPage.page.isVisible("text=Explorador")
|
||||||
() => {
|
|
||||||
test("should load code-server in Spanish", async ({ codeServerPage }) => {
|
|
||||||
// When
|
|
||||||
const visible = await codeServerPage.page.isVisible("text=Explorador")
|
|
||||||
|
|
||||||
// Then
|
// Then
|
||||||
expect(visible).toBe(true)
|
expect(visible).toBe(true)
|
||||||
})
|
})
|
||||||
},
|
})
|
||||||
)
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as path from "path"
|
|||||||
import { clean } from "../utils/helpers"
|
import { clean } from "../utils/helpers"
|
||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
|
describe("Downloads (enabled)", [], {}, async () => {
|
||||||
const testName = "downloads-enabled"
|
const testName = "downloads-enabled"
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await clean(testName)
|
await clean(testName)
|
||||||
@@ -25,7 +25,7 @@ describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Downloads (disabled)", ["--disable-workspace-trust", "--disable-file-downloads"], {}, async () => {
|
describe("Downloads (disabled)", ["--disable-file-downloads"], {}, async () => {
|
||||||
const testName = "downloads-disabled"
|
const testName = "downloads-disabled"
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await clean(testName)
|
await clean(testName)
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ function runTestExtensionTests() {
|
|||||||
const text = await codeServerPage.page.locator("text=proxyUri").first().textContent()
|
const text = await codeServerPage.page.locator("text=proxyUri").first().textContent()
|
||||||
// Remove end slash in address
|
// Remove end slash in address
|
||||||
const normalizedAddress = address.replace(/\/+$/, "")
|
const normalizedAddress = address.replace(/\/+$/, "")
|
||||||
expect(text).toBe(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}/`)
|
expect(text).toBe(`Info: proxyUri: ${normalizedAddress}/proxy/{{port}}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const flags = ["--disable-workspace-trust", "--extensions-dir", path.join(__dirname, "./extensions")]
|
const flags = ["--extensions-dir", path.join(__dirname, "./extensions")]
|
||||||
|
|
||||||
describe("Extensions", flags, {}, () => {
|
describe("Extensions", flags, {}, () => {
|
||||||
runTestExtensionTests()
|
runTestExtensionTests()
|
||||||
|
|||||||
@@ -28,11 +28,5 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"__metadata": {
|
|
||||||
"id": "47e020a1-33db-4cc0-a1b4-42f97781749a",
|
|
||||||
"publisherDisplayName": "MS-CEINTL",
|
|
||||||
"publisherId": "0b0882c3-aee3-4d7c-b5f9-872f9be0a115",
|
|
||||||
"isPreReleaseVersion": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import * as vscode from "vscode"
|
|||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
vscode.window.showInformationMessage("test extension loaded")
|
vscode.window.showInformationMessage("test extension loaded")
|
||||||
// Test extension
|
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
|
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
|
||||||
if (process.env.VSCODE_PROXY_URI) {
|
if (process.env.VSCODE_PROXY_URI) {
|
||||||
@@ -12,20 +11,4 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
// asExternalUri extension
|
|
||||||
context.subscriptions.push(
|
|
||||||
vscode.commands.registerCommand("codeServerTest.asExternalUri", async () => {
|
|
||||||
const input = await vscode.window.showInputBox({
|
|
||||||
prompt: "URL to pass through to asExternalUri",
|
|
||||||
})
|
|
||||||
|
|
||||||
if (input) {
|
|
||||||
const output = await vscode.env.asExternalUri(vscode.Uri.parse(input))
|
|
||||||
vscode.window.showInformationMessage(`input: ${input} output: ${output}`)
|
|
||||||
} else {
|
|
||||||
vscode.window.showErrorMessage(`Failed to run test case. No input provided.`)
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,6 @@
|
|||||||
"command": "codeServerTest.proxyUri",
|
"command": "codeServerTest.proxyUri",
|
||||||
"title": "Get proxy URI",
|
"title": "Get proxy URI",
|
||||||
"category": "code-server"
|
"category": "code-server"
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "codeServerTest.asExternalUri",
|
|
||||||
"title": "asExternalUri test",
|
|
||||||
"category": "code-server"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { test as base } from "@playwright/test"
|
|||||||
import { describe, expect, test } from "./baseFixture"
|
import { describe, expect, test } from "./baseFixture"
|
||||||
|
|
||||||
if (process.env.GITHUB_TOKEN) {
|
if (process.env.GITHUB_TOKEN) {
|
||||||
describe("GitHub token", ["--disable-workspace-trust"], {}, () => {
|
describe("GitHub token", [], {}, () => {
|
||||||
test("should be logged in to pull requests extension", async ({ codeServerPage }) => {
|
test("should be logged in to pull requests extension", async ({ codeServerPage }) => {
|
||||||
await codeServerPage.exec("git init")
|
await codeServerPage.exec("git init")
|
||||||
await codeServerPage.exec("git remote add origin https://github.com/coder/code-server")
|
await codeServerPage.exec("git remote add origin https://github.com/coder/code-server")
|
||||||
@@ -16,7 +16,7 @@ if (process.env.GITHUB_TOKEN) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("No GitHub token", ["--disable-workspace-trust"], { GITHUB_TOKEN: "" }, () => {
|
describe("No GitHub token", [], { GITHUB_TOKEN: "" }, () => {
|
||||||
test("should not be logged in to pull requests extension", async ({ codeServerPage }) => {
|
test("should not be logged in to pull requests extension", async ({ codeServerPage }) => {
|
||||||
await codeServerPage.exec("git init")
|
await codeServerPage.exec("git init")
|
||||||
await codeServerPage.exec("git remote add origin https://github.com/coder/code-server")
|
await codeServerPage.exec("git remote add origin https://github.com/coder/code-server")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { PASSWORD } from "../utils/constants"
|
import { PASSWORD } from "../utils/constants"
|
||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
describe("login", ["--disable-workspace-trust", "--auth", "password"], {}, () => {
|
describe("login", ["--auth", "password"], {}, () => {
|
||||||
test("should see the login page", async ({ codeServerPage }) => {
|
test("should see the login page", async ({ codeServerPage }) => {
|
||||||
// It should send us to the login page
|
// It should send us to the login page
|
||||||
expect(await codeServerPage.page.title()).toBe("code-server login")
|
expect(await codeServerPage.page.title()).toBe("code-server login")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// NOTE@jsjoeio commenting out until we can figure out what's wrong
|
// NOTE@jsjoeio commenting out until we can figure out what's wrong
|
||||||
// import { describe, test, expect } from "./baseFixture"
|
// import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
// describe("logout", true, ["--disable-workspace-trust"], {}, () => {
|
// describe("logout", true, [], {}, () => {
|
||||||
// test("should be able logout", async ({ codeServerPage }) => {
|
// test("should be able logout", async ({ codeServerPage }) => {
|
||||||
// // Recommended by Playwright for async navigation
|
// // Recommended by Playwright for async navigation
|
||||||
// // https://github.com/microsoft/playwright/issues/1987#issuecomment-620182151
|
// // https://github.com/microsoft/playwright/issues/1987#issuecomment-620182151
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ export class CodeServer {
|
|||||||
path.join(dir, "User/settings.json"),
|
path.join(dir, "User/settings.json"),
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
"workbench.startupEditor": "none",
|
"workbench.startupEditor": "none",
|
||||||
|
// NOTE@jsjoeio - needed to prevent Trust Policy prompt
|
||||||
|
// in end-to-end tests.
|
||||||
|
"security.workspace.trust.enabled": false,
|
||||||
}),
|
}),
|
||||||
"utf8",
|
"utf8",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { version } from "../../src/node/constants"
|
import { version } from "../../src/node/constants"
|
||||||
import { describe, test, expect } from "./baseFixture"
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
describe("Open Help > About", ["--disable-workspace-trust"], {}, () => {
|
describe("Open Help > About", [], {}, () => {
|
||||||
test("should see code-server version in about dialog", async ({ codeServerPage }) => {
|
test("should see code-server version in about dialog", async ({ codeServerPage }) => {
|
||||||
// Open using the menu.
|
// Open using the menu.
|
||||||
await codeServerPage.navigateMenus(["Help", "About"])
|
await codeServerPage.navigateMenus(["Help", "About"])
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import util from "util"
|
|||||||
import { clean, getMaybeProxiedCodeServer, tmpdir } from "../utils/helpers"
|
import { clean, getMaybeProxiedCodeServer, tmpdir } from "../utils/helpers"
|
||||||
import { describe, expect, test } from "./baseFixture"
|
import { describe, expect, test } from "./baseFixture"
|
||||||
|
|
||||||
describe("Integrated Terminal", ["--disable-workspace-trust"], {}, () => {
|
describe("Integrated Terminal", [], {}, () => {
|
||||||
const testName = "integrated-terminal"
|
const testName = "integrated-terminal"
|
||||||
test.beforeAll(async () => {
|
test.beforeAll(async () => {
|
||||||
await clean(testName)
|
await clean(testName)
|
||||||
@@ -30,7 +30,6 @@ describe("Integrated Terminal", ["--disable-workspace-trust"], {}, () => {
|
|||||||
expect(stdout).toMatch(address)
|
expect(stdout).toMatch(address)
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO@jsjoeio - add test to make sure full code-server path works
|
|
||||||
test("should be able to invoke `code-server` to open a file", async ({ codeServerPage }) => {
|
test("should be able to invoke `code-server` to open a file", async ({ codeServerPage }) => {
|
||||||
const tmpFolderPath = await tmpdir(testName)
|
const tmpFolderPath = await tmpdir(testName)
|
||||||
const tmpFile = path.join(tmpFolderPath, "test-file")
|
const tmpFile = path.join(tmpFolderPath, "test-file")
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { describe, test, expect } from "./baseFixture"
|
|
||||||
|
|
||||||
describe("Workspace trust (enabled)", [], {}, async () => {
|
|
||||||
test("should see the 'I Trust...' option", async ({ codeServerPage }) => {
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Yes, I trust")).toBe(true)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("Workspace trust (disabled)", ["--disable-workspace-trust"], {}, async () => {
|
|
||||||
test("should not see the 'I Trust...' option", async ({ codeServerPage }) => {
|
|
||||||
expect(await codeServerPage.page.isVisible("text=Yes, I trust")).toBe(false)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
import { promises as fs } from "fs"
|
|
||||||
import * as path from "path"
|
|
||||||
import { describe, test, expect } from "./baseFixture"
|
|
||||||
|
|
||||||
describe("Webviews", ["--disable-workspace-trust"], {}, () => {
|
|
||||||
test("should preview a Markdown file", async ({ codeServerPage }) => {
|
|
||||||
// Create Markdown file
|
|
||||||
const heading = "Hello world"
|
|
||||||
const dir = await codeServerPage.workspaceDir
|
|
||||||
const file = path.join(dir, "text.md")
|
|
||||||
await fs.writeFile(file, `# ${heading}`)
|
|
||||||
await codeServerPage.openFile(file)
|
|
||||||
|
|
||||||
// Open Preview
|
|
||||||
await codeServerPage.executeCommandViaMenus("Markdown: Open Preview to the Side")
|
|
||||||
// Wait for the iframe to open and load
|
|
||||||
await codeServerPage.waitForTab(`Preview ${file}`)
|
|
||||||
|
|
||||||
// It's an iframe within an iframe
|
|
||||||
// so we have to do .frameLocator twice
|
|
||||||
const renderedText = await codeServerPage.page
|
|
||||||
.frameLocator("iframe.webview.ready")
|
|
||||||
.frameLocator("#active-frame")
|
|
||||||
.locator("text=Hello world")
|
|
||||||
|
|
||||||
expect(renderedText).toBeVisible
|
|
||||||
})
|
|
||||||
})
|
|
||||||
@@ -8,7 +8,6 @@ import path from "path"
|
|||||||
// yarn test:e2e --workers 1 # Run with one worker
|
// yarn test:e2e --workers 1 # Run with one worker
|
||||||
// yarn test:e2e --project Chromium # Only run on Chromium
|
// yarn test:e2e --project Chromium # Only run on Chromium
|
||||||
// yarn test:e2e --grep login # Run tests matching "login"
|
// yarn test:e2e --grep login # Run tests matching "login"
|
||||||
// PWDEBUG=1 yarn test:e2e # Run Playwright inspector
|
|
||||||
const config: PlaywrightTestConfig = {
|
const config: PlaywrightTestConfig = {
|
||||||
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
testDir: path.join(__dirname, "e2e"), // Search for tests in this directory.
|
||||||
timeout: 60000, // Each test is given 60 seconds.
|
timeout: 60000, // Each test is given 60 seconds.
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ function should-use-deb() {
|
|||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 deb package from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 deb package from GitHub." ]
|
||||||
[ "${lines[-6]}" = "deb package has been installed." ]
|
[ "${lines[-5]}" = "deb package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-rpm() {
|
function should-use-rpm() {
|
||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 rpm package from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 rpm package from GitHub." ]
|
||||||
[ "${lines[-6]}" = "rpm package has been installed." ]
|
[ "${lines[-5]}" = "rpm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-fallback-npm() {
|
function should-fallback-npm() {
|
||||||
@@ -27,21 +27,21 @@ function should-fallback-npm() {
|
|||||||
[ "${lines[1]}" = "No standalone releases for $2." ]
|
[ "${lines[1]}" = "No standalone releases for $2." ]
|
||||||
[ "${lines[2]}" = "Falling back to installation from npm." ]
|
[ "${lines[2]}" = "Falling back to installation from npm." ]
|
||||||
[ "${lines[3]}" = "Installing latest from npm." ]
|
[ "${lines[3]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
[ "${lines[-5]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-npm() {
|
function should-use-npm() {
|
||||||
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
YARN_PATH=true DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from npm." ]
|
[ "${lines[1]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
[ "${lines[-5]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-aur() {
|
function should-use-aur() {
|
||||||
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
DISTRO=$1 ARCH=$2 OS=linux run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from the AUR." ]
|
[ "${lines[1]}" = "Installing latest from the AUR." ]
|
||||||
[ "${lines[-6]}" = "AUR package has been installed." ]
|
[ "${lines[-5]}" = "AUR package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-fallback-npm-brew() {
|
function should-fallback-npm-brew() {
|
||||||
@@ -52,21 +52,21 @@ function should-fallback-npm-brew() {
|
|||||||
[ "${lines[3]}" = "No standalone releases for $1." ]
|
[ "${lines[3]}" = "No standalone releases for $1." ]
|
||||||
[ "${lines[4]}" = "Falling back to installation from npm." ]
|
[ "${lines[4]}" = "Falling back to installation from npm." ]
|
||||||
[ "${lines[5]}" = "Installing latest from npm." ]
|
[ "${lines[5]}" = "Installing latest from npm." ]
|
||||||
[ "${lines[-6]}" = "npm package has been installed." ]
|
[ "${lines[-5]}" = "npm package has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-brew() {
|
function should-use-brew() {
|
||||||
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
|
BREW_PATH=true OS=macos ARCH=$1 run "$SCRIPT" --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing latest from Homebrew." ]
|
[ "${lines[1]}" = "Installing latest from Homebrew." ]
|
||||||
[ "${lines[-4]}" = "Brew release has been installed." ]
|
[ "${lines[-3]}" = "Brew release has been installed." ]
|
||||||
}
|
}
|
||||||
|
|
||||||
function should-use-standalone() {
|
function should-use-standalone() {
|
||||||
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
|
DISTRO=$1 ARCH=$2 OS=$3 run "$SCRIPT" --method standalone --dry-run
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[1]}" = "Installing v$VERSION of the $2 release from GitHub." ]
|
[ "${lines[1]}" = "Installing v$VERSION of the $2 release from GitHub." ]
|
||||||
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
|
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "$SCRIPT_NAME: usage with --help" {
|
@test "$SCRIPT_NAME: usage with --help" {
|
||||||
@@ -141,7 +141,7 @@ function should-use-standalone() {
|
|||||||
[ "${lines[1]}" = "Homebrew not installed." ]
|
[ "${lines[1]}" = "Homebrew not installed." ]
|
||||||
[ "${lines[2]}" = "Falling back to standalone installation." ]
|
[ "${lines[2]}" = "Falling back to standalone installation." ]
|
||||||
[ "${lines[3]}" = "Installing v$VERSION of the amd64 release from GitHub." ]
|
[ "${lines[3]}" = "Installing v$VERSION of the amd64 release from GitHub." ]
|
||||||
[[ "${lines[-6]}" = "Standalone release has been installed"* ]]
|
[[ "${lines[-5]}" = "Standalone release has been installed"* ]]
|
||||||
}
|
}
|
||||||
@test "$SCRIPT_NAME: macos i386 (no brew)" {
|
@test "$SCRIPT_NAME: macos i386 (no brew)" {
|
||||||
should-fallback-npm-brew "i386"
|
should-fallback-npm-brew "i386"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../tsconfig.json",
|
"extends": "../tsconfig.json",
|
||||||
"include": ["./**/*.ts"],
|
"include": ["./**/*.ts"]
|
||||||
"exclude": ["./unit/node/test-plugin"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ describe("parser", () => {
|
|||||||
delete process.env.LOG_LEVEL
|
delete process.env.LOG_LEVEL
|
||||||
delete process.env.PASSWORD
|
delete process.env.PASSWORD
|
||||||
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
delete process.env.CS_DISABLE_FILE_DOWNLOADS
|
||||||
delete process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE
|
|
||||||
console.log = jest.fn()
|
console.log = jest.fn()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -68,8 +67,6 @@ describe("parser", () => {
|
|||||||
|
|
||||||
"1",
|
"1",
|
||||||
"--verbose",
|
"--verbose",
|
||||||
["--app-name", "custom instance name"],
|
|
||||||
["--welcome-text", "welcome to code"],
|
|
||||||
"2",
|
"2",
|
||||||
|
|
||||||
["--locale", "ja"],
|
["--locale", "ja"],
|
||||||
@@ -98,8 +95,6 @@ describe("parser", () => {
|
|||||||
|
|
||||||
"--disable-file-downloads",
|
"--disable-file-downloads",
|
||||||
|
|
||||||
"--disable-getting-started-override",
|
|
||||||
|
|
||||||
["--host", "0.0.0.0"],
|
["--host", "0.0.0.0"],
|
||||||
"4",
|
"4",
|
||||||
"--",
|
"--",
|
||||||
@@ -117,7 +112,6 @@ describe("parser", () => {
|
|||||||
value: path.resolve("path/to/cert"),
|
value: path.resolve("path/to/cert"),
|
||||||
},
|
},
|
||||||
"disable-file-downloads": true,
|
"disable-file-downloads": true,
|
||||||
"disable-getting-started-override": true,
|
|
||||||
enable: ["feature1", "feature2"],
|
enable: ["feature1", "feature2"],
|
||||||
help: true,
|
help: true,
|
||||||
host: "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
@@ -129,8 +123,6 @@ describe("parser", () => {
|
|||||||
socket: path.resolve("mumble"),
|
socket: path.resolve("mumble"),
|
||||||
"socket-mode": "777",
|
"socket-mode": "777",
|
||||||
verbose: true,
|
verbose: true,
|
||||||
"app-name": "custom instance name",
|
|
||||||
"welcome-text": "welcome to code",
|
|
||||||
version: true,
|
version: true,
|
||||||
"bind-addr": "192.169.0.1:8080",
|
"bind-addr": "192.169.0.1:8080",
|
||||||
})
|
})
|
||||||
@@ -382,30 +374,6 @@ describe("parser", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should use env var CS_DISABLE_GETTING_STARTED_OVERRIDE", async () => {
|
|
||||||
process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE = "1"
|
|
||||||
const args = parse([])
|
|
||||||
expect(args).toEqual({})
|
|
||||||
|
|
||||||
const defaultArgs = await setDefaults(args)
|
|
||||||
expect(defaultArgs).toEqual({
|
|
||||||
...defaults,
|
|
||||||
"disable-getting-started-override": true,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should use env var CS_DISABLE_GETTING_STARTED_OVERRIDE set to true", async () => {
|
|
||||||
process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE = "true"
|
|
||||||
const args = parse([])
|
|
||||||
expect(args).toEqual({})
|
|
||||||
|
|
||||||
const defaultArgs = await setDefaults(args)
|
|
||||||
expect(defaultArgs).toEqual({
|
|
||||||
...defaults,
|
|
||||||
"disable-getting-started-override": true,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should error if password passed in", () => {
|
it("should error if password passed in", () => {
|
||||||
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
expect(() => parse(["--password", "supersecret123"])).toThrowError(
|
||||||
"--password can only be set in the config file or passed in via $PASSWORD",
|
"--password can only be set in the config file or passed in via $PASSWORD",
|
||||||
@@ -795,7 +763,6 @@ describe("toCodeArgs", () => {
|
|||||||
help: false,
|
help: false,
|
||||||
port: "8080",
|
port: "8080",
|
||||||
version: false,
|
version: false,
|
||||||
log: undefined,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const testName = "vscode-args"
|
const testName = "vscode-args"
|
||||||
|
|||||||
@@ -92,51 +92,5 @@ describe("login", () => {
|
|||||||
|
|
||||||
expect(htmlContent).toContain("Incorrect password")
|
expect(htmlContent).toContain("Incorrect password")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should return correct app-name", async () => {
|
|
||||||
process.env.PASSWORD = previousEnvPassword
|
|
||||||
const appName = "testnäme"
|
|
||||||
const codeServer = await integration.setup([`--app-name=${appName}`], "")
|
|
||||||
const resp = await codeServer.fetch("/login", { method: "GET" })
|
|
||||||
|
|
||||||
const htmlContent = await resp.text()
|
|
||||||
expect(resp.status).toBe(200)
|
|
||||||
expect(htmlContent).toContain(`${appName}</h1>`)
|
|
||||||
expect(htmlContent).toContain(`<title>${appName} login</title>`)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should return correct app-name when unset", async () => {
|
|
||||||
process.env.PASSWORD = previousEnvPassword
|
|
||||||
const appName = "code-server"
|
|
||||||
const codeServer = await integration.setup([], "")
|
|
||||||
const resp = await codeServer.fetch("/login", { method: "GET" })
|
|
||||||
|
|
||||||
const htmlContent = await resp.text()
|
|
||||||
expect(resp.status).toBe(200)
|
|
||||||
expect(htmlContent).toContain(`${appName}</h1>`)
|
|
||||||
expect(htmlContent).toContain(`<title>${appName} login</title>`)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should return correct welcome text", async () => {
|
|
||||||
process.env.PASSWORD = previousEnvPassword
|
|
||||||
const welcomeText = "Welcome to your code workspace! öäü🔐"
|
|
||||||
const codeServer = await integration.setup([`--welcome-text=${welcomeText}`], "")
|
|
||||||
const resp = await codeServer.fetch("/login", { method: "GET" })
|
|
||||||
|
|
||||||
const htmlContent = await resp.text()
|
|
||||||
expect(resp.status).toBe(200)
|
|
||||||
expect(htmlContent).toContain(welcomeText)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should return correct welcome text when none is set but app-name is", async () => {
|
|
||||||
process.env.PASSWORD = previousEnvPassword
|
|
||||||
const appName = "testnäme"
|
|
||||||
const codeServer = await integration.setup([`--app-name=${appName}`], "")
|
|
||||||
const resp = await codeServer.fetch("/login", { method: "GET" })
|
|
||||||
|
|
||||||
const htmlContent = await resp.text()
|
|
||||||
expect(resp.status).toBe(200)
|
|
||||||
expect(htmlContent).toContain(`Welcome to ${appName}`)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user