Compare commits

..

9 Commits

Author SHA1 Message Date
Joe Previte
fa2f887c6e chore: bump version 4.8.2 2022-11-02 14:10:08 -07:00
Joe Previte
3736cffdca refactor: warn plugin range incompatibble 2022-11-01 11:08:35 -07:00
Joe Previte
26c46beab8 Merge branch 'main' into release/v4.8.2 2022-11-01 10:50:14 -07:00
Joe Previte
428e21dfdf docs: add release candidate notes 2022-11-01 10:42:02 -07:00
Joe Previte
c37d9c5cbe fixup: use 4.8.2-rc.1 2022-11-01 10:41:52 -07:00
Joe Previte
7db7c81a58 Revert "chore: bump version to 4.8.2"
This reverts commit 5d70994f22.
2022-11-01 10:35:18 -07:00
Joe Previte
2988146593 docs: add back line in publishing release
See https://github.com/coder/code-server/pull/5732#discussion_r1010685933
2022-11-01 10:17:48 -07:00
Joe Previte
3949927d5c chore: update CHANGELOG 2022-11-01 10:17:19 -07:00
Joe Previte
5d70994f22 chore: bump version to 4.8.2 2022-11-01 10:17:19 -07:00
49 changed files with 321 additions and 456 deletions

View File

@@ -24,7 +24,7 @@ concurrency:
jobs: jobs:
prettier: prettier:
name: Format with Prettier name: Format with Prettier
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
@@ -37,7 +37,7 @@ jobs:
doctoc: doctoc:
name: Doctoc markdown files name: Doctoc markdown files
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
@@ -66,7 +66,7 @@ jobs:
lint-helm: lint-helm:
name: Lint Helm chart name: Lint Helm chart
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
@@ -97,7 +97,7 @@ jobs:
lint-ts: lint-ts:
name: Lint TypeScript files name: Lint TypeScript files
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
@@ -141,7 +141,7 @@ jobs:
build: build:
name: Build code-server name: Build code-server
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -187,6 +187,10 @@ jobs:
id: vscode-rev id: vscode-rev
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)" 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 # We need to rebuild when we have a new version of Code, when any of
# the patches changed, or when the code-server version changes (since # the patches changed, or when the code-server version changes (since
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to # it gets embedded into the code). Use VSCODE_CACHE_VERSION to
@@ -196,11 +200,9 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: lib/vscode-reh-web-* path: lib/vscode-reh-web-*
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }} key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
- name: Build vscode - name: Build vscode
env:
VERSION: "0.0.0"
if: steps.cache-vscode.outputs.cache-hit != 'true' if: steps.cache-vscode.outputs.cache-hit != 'true'
run: yarn build:vscode run: yarn build:vscode
@@ -244,7 +246,7 @@ jobs:
# Only run if PR comes from base repo or event is not a PR # Only run if PR comes from base repo or event is not a PR
# Reason: forks cannot access secrets and this will always fail # 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' if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -259,12 +261,6 @@ jobs:
- name: Run ./ci/steps/publish-npm.sh - name: Run ./ci/steps/publish-npm.sh
run: yarn publish:npm run: yarn publish:npm
env: 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 }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# NOTE@jsjoeio # NOTE@jsjoeio
@@ -295,8 +291,8 @@ jobs:
test-e2e: test-e2e:
name: Run e2e tests name: Run e2e tests
needs: build needs: build
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 25 timeout-minutes: 15
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -351,7 +347,7 @@ jobs:
test-e2e-proxy: test-e2e-proxy:
name: Run e2e tests behind proxy name: Run e2e tests behind proxy
needs: build needs: build
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
timeout-minutes: 25 timeout-minutes: 25
steps: steps:
- name: Checkout repo - name: Checkout repo

View File

@@ -41,7 +41,7 @@ jobs:
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

View File

@@ -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,21 @@ jobs:
- name: Checkout code-server - name: Checkout code-server
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Get version
id: version
run: echo "::set-output name=version::$(jq -r .version package.json)"
- name: Download npm package from release artifacts - name: Download npm package from 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: ${{ github.event.inputs.version || github.ref_name }} tag: v${{ steps.version.outputs.version }}
fileName: "package.tar.gz" fileName: "package.tar.gz"
out-file-path: "release-npm-package" out-file-path: "release-npm-package"
# NOTE@jsjoeio - we do this so we can strip out the v
# 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: 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 +62,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 +73,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,6 +81,13 @@ 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:
@@ -118,17 +106,10 @@ 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: 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 +147,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 }}

View File

@@ -2,11 +2,6 @@ name: Draft release
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
version:
description: The version to publish (include "v", i.e. "v4.9.1").
type: string
required: true
permissions: permissions:
contents: write # For creating releases. contents: write # For creating releases.
@@ -26,7 +21,6 @@ jobs:
name: x86-64 Linux build name: x86-64 Linux build
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
needs: npm-version
container: "centos:7" container: "centos:7"
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -57,10 +51,15 @@ jobs:
- name: Install yarn - name: Install yarn
run: npm install -g yarn run: npm install -g yarn
- name: Download npm package - name: Download artifacts
uses: actions/download-artifact@v3 uses: dawidd6/action-download-artifact@v2
id: download
with: with:
name: npm-release-package branch: ${{ github.ref }}
workflow: build.yaml
workflow_conclusion: completed
check_artifacts: true
name: npm-package
- name: Decompress npm package - name: Decompress npm package
run: tar -xzf package.tar.gz run: tar -xzf package.tar.gz
@@ -92,16 +91,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
if: success() 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 - name: Build packages with nfpm
env:
VERSION: ${{ env.VERSION }}
run: yarn package run: yarn package
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
@@ -133,7 +123,6 @@ jobs:
name: Linux cross-compile builds name: Linux cross-compile builds
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
timeout-minutes: 15 timeout-minutes: 15
needs: npm-version
strategy: strategy:
matrix: matrix:
include: include:
@@ -170,10 +159,15 @@ jobs:
env: env:
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }} PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
- name: Download npm package - name: Download artifacts
uses: actions/download-artifact@v3 uses: dawidd6/action-download-artifact@v2
id: download
with: with:
name: npm-release-package branch: ${{ github.ref }}
workflow: build.yaml
workflow_conclusion: completed
check_artifacts: true
name: npm-package
- name: Decompress npm package - name: Decompress npm package
run: tar -xzf package.tar.gz run: tar -xzf package.tar.gz
@@ -187,16 +181,7 @@ jobs:
tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2 tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
mv ./node ./release-standalone/lib/node mv ./node ./release-standalone/lib/node
# NOTE@jsjoeio - we do this so we can strip out the v
# 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 - name: Build packages with nfpm
env:
VERSION: ${{ env.VERSION }}
run: yarn package ${NPM_CONFIG_ARCH} run: yarn package ${NPM_CONFIG_ARCH}
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
@@ -209,7 +194,6 @@ jobs:
name: x86-64 macOS build name: x86-64 macOS build
runs-on: macos-latest runs-on: macos-latest
timeout-minutes: 15 timeout-minutes: 15
needs: npm-version
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -225,10 +209,15 @@ jobs:
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
echo "$HOME/.local/bin" >> $GITHUB_PATH echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Download npm package - name: Download artifacts
uses: actions/download-artifact@v3 uses: dawidd6/action-download-artifact@v2
id: download
with: with:
name: npm-release-package branch: ${{ github.ref }}
workflow: build.yaml
workflow_conclusion: completed
check_artifacts: true
name: npm-package
- name: Decompress npm package - name: Decompress npm package
run: tar -xzf package.tar.gz run: tar -xzf package.tar.gz
@@ -252,16 +241,7 @@ jobs:
- name: Run native module tests on standalone release - name: Run native module tests on standalone release
run: yarn test:native 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 - name: Build packages with nfpm
env:
VERSION: ${{ env.VERSION }}
run: yarn package run: yarn package
- uses: softprops/action-gh-release@v1 - uses: softprops/action-gh-release@v1
@@ -274,23 +254,6 @@ jobs:
name: Upload npm package name: Upload npm package
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 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: steps:
- name: Download artifacts - name: Download artifacts
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2
@@ -302,34 +265,8 @@ jobs:
check_artifacts: true check_artifacts: true
name: npm-package name: npm-package
- name: Decompress npm package - uses: softprops/action-gh-release@v1
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
# Ensure it has the same permissions as before
chmod 644 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: with:
name: npm-release-package draft: true
path: ./package.tar.gz discussion_category_name: "📣 Announcements"
files: ./package.tar.gz

View File

@@ -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

View File

@@ -65,7 +65,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Run Trivy vulnerability scanner in repo mode - name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5 uses: aquasecurity/trivy-action@e55de85beea5fcec743de6bb6bc56943a0af3c33
with: with:
scan-type: "fs" scan-type: "fs"
scan-ref: "." scan-ref: "."

View File

@@ -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@e55de85beea5fcec743de6bb6bc56943a0af3c33
with: with:
image-ref: "docker.io/codercom/code-server:latest" image-ref: "docker.io/codercom/code-server:latest"
ignore-unfixed: true ignore-unfixed: true

View File

@@ -1,7 +1,6 @@
lib/vscode lib/vscode
lib/vscode-reh-web-linux-x64 lib/vscode-reh-web-linux-x64
release-standalone release-standalone
release-packages
release release
helm-chart helm-chart
test/scripts test/scripts

View File

@@ -20,28 +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
known issues: https://github.com/adobe/fetch/pull/318#issuecomment-1306070259
cert won't work for anyone using Ubuntu 22.04
## [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 ## [4.8.2](https://github.com/coder/code-server/releases/tag/v4.8.2) - 2022-11-02
Code v1.72.1 Code v1.72.1

View File

@@ -42,12 +42,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.

View File

@@ -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"

103
ci/build/release-prep.sh Executable file
View 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 "$@"

View File

@@ -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.3.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.8.2

View File

@@ -6,7 +6,7 @@ replicaCount: 1
image: image:
repository: codercom/code-server repository: codercom/code-server
tag: '4.8.3' tag: '4.8.2'
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

View File

@@ -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
} }
@@ -44,6 +48,8 @@ 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)

View File

@@ -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

View File

@@ -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

View File

@@ -142,16 +142,16 @@ changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
### 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. Run `yarn release:prep`
has finished on that commit. 1. Bump chart version in `Chart.yaml`.
1. CI will automatically grab the 1. Summarize the major changes in the `CHANGELOG.md`
1. Download CI artifacts and make sure code-server works locally.
1. Merge PR and wait for CI build on `main` to finish.
1. Go to GitHub Actions > Draft release > Run workflow off `main`. CI will automatically upload the artifacts to the release.
1. Add the release notes from the `CHANGELOG.md` and publish release. 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. After, create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
1. Summarize the major changes in the `CHANGELOG.md`
1. Bump chart version in `Chart.yaml`.
#### Release Candidates #### Release Candidates

View File

@@ -59,7 +59,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.

View File

@@ -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
])); ]);
}; };
} }
); );

View File

@@ -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() {
@@ -387,7 +379,7 @@ install_aur() {
if [ ! "${DRY_RUN-}" ]; then if [ ! "${DRY_RUN-}" ]; then
cd "$CACHE_DIR/code-server-aur" cd "$CACHE_DIR/code-server-aur"
fi fi
sh_c makepkg -si --noconfirm sh_c makepkg -si
echo_systemd_postinstall AUR echo_systemd_postinstall AUR
} }
@@ -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
;; ;;

View File

@@ -1,7 +1,7 @@
{ {
"name": "code-server", "name": "code-server",
"license": "MIT", "license": "MIT",
"version": "0.0.0", "version": "4.8.2",
"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": {
@@ -61,7 +61,7 @@
"eslint-import-resolver-typescript": "^3.5.2", "eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"prettier": "2.8.0", "prettier": "2.7.1",
"prettier-plugin-sh": "^0.12.8", "prettier-plugin-sh": "^0.12.8",
"ts-node": "^10.0.0", "ts-node": "^10.0.0",
"typescript": "^4.6.2" "typescript": "^4.6.2"
@@ -87,7 +87,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",
@@ -116,8 +116,7 @@
"ide", "ide",
"coder", "coder",
"vscode-remote", "vscode-remote",
"browser-ide", "browser-ide"
"remote-development"
], ],
"engines": { "engines": {
"node": "16" "node": "16"

View File

@@ -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);
} }
} }
+ +
@@ -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';

View File

@@ -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 @@ -1234,6 +1238,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;
} }

View File

@@ -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;
} }
@@ -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
}, },

View File

@@ -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 @@ -209,6 +209,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);
@@ -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'));
} }
@@ -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 @@ -123,8 +123,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()

24
patches/exec-argv.diff Normal file
View 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}`];
}

View File

@@ -10,7 +10,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
@@ -62,7 +62,7 @@ import { GettingStartedIndexList } from @@ -62,7 +62,7 @@ import { GettingStartedIndexList } from
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes'; import { KeyCode } from 'vs/base/common/keyCodes';
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils'; import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
@@ -19,106 +19,32 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions'; import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions'; import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions';
import { Toggle } from 'vs/base/browser/ui/toggle/toggle'; import { Toggle } from 'vs/base/browser/ui/toggle/toggle';
@@ -758,6 +758,72 @@ export class GettingStartedPage extends @@ -753,11 +753,24 @@ export class GettingStartedPage extends
onShowOnStartupChanged();
}));
- const header = $('.header', {},
+ let header = $('.header', {},
$('h1.product-name.caption', {}, this.productService.nameLong),
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved")) $('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
); );
+ let gettingStartedCoder: HTMLElement = $('.header', {});
+ if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) { + if (this.contextService.contextMatchesRules(IsEnabledCoderGettingStarted)) {
+ gettingStartedCoder = $('.gettingStartedCategory', {}, + header = $('.header', {},
+ $('h2', { + $('h1.product-name.caption', {}, this.productService.nameLong),
+ style: 'margin-bottom: 12px', + $('p.subtitle.description.coder', {},
+ }, 'Next Up'), + "Using code-server on a team?",
+ $('a', { + ),
+ href: 'https://cdr.co/code-server-to-coder', + $('p.subtitle.description.coder-coder', {},
+ target: '_blank', + "Check out: ",
+ }, + $('a', { href: "https://github.com/coder/coder" }, "coder/coder")
+ $('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 leftColumn = $('.categories-column.categories-column-left', {},);
const rightColumn = $('.categories-column.categories-column-right', {},); 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 Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css --- code-server.orig/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css
@@ -159,7 +85,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
@@ -37,6 +37,11 @@ export interface IBrowserWorkbenchEnviro @@ -36,6 +36,11 @@ export interface IBrowserWorkbenchEnviro
* Enable downloading files via menu actions. * Enable downloading files via menu actions.
*/ */
readonly isEnabledFileDownloads?: boolean; readonly isEnabledFileDownloads?: boolean;
@@ -171,7 +97,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
} }
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService { export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
@@ -99,6 +104,13 @@ export class BrowserWorkbenchEnvironment @@ -74,6 +79,13 @@ export class BrowserWorkbenchEnvironment
return this.options.isEnabledFileDownloads; return this.options.isEnabledFileDownloads;
} }

View File

@@ -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();

View File

@@ -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 }); }

View File

@@ -21,7 +21,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts --- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -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' },

View File

@@ -65,10 +65,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';

View File

@@ -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 { @@ -1462,7 +1462,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 {

View File

@@ -92,7 +92,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 +105,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 @@ -392,7 +392,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

View File

@@ -18,4 +18,5 @@ disable-downloads.diff
telemetry.diff telemetry.diff
display-language.diff display-language.diff
cli-window-open.diff cli-window-open.diff
exec-argv.diff
getting-started.diff getting-started.diff

View File

@@ -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 @@ -191,8 +191,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 @@ -231,9 +230,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,7 +32,7 @@ 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 @@ -387,7 +386,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`),

View File

@@ -4,7 +4,6 @@ To test:
1. Create a RequestBin - https://requestbin.io/ 1. Create a RequestBin - https://requestbin.io/
2. Run code-server with `CS_TELEMETRY_URL` set: 2. Run code-server with `CS_TELEMETRY_URL` set:
i.e. `CS_TELEMETRY_URL="https://requestbin.io/1ebub9z1" ./code-server-<version>-macos-amd64/bin/code-server` i.e. `CS_TELEMETRY_URL="https://requestbin.io/1ebub9z1" ./code-server-<version>-macos-amd64/bin/code-server`
NOTE: it has to be a production build.
3. Load code-server in browser an do things (i.e. open a file) 3. Load code-server in browser an do things (i.e. open a file)
4. Refresh RequestBin and you should see logs 4. Refresh RequestBin and you should see logs
@@ -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)) {

View File

@@ -120,7 +120,7 @@ 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' },

View File

@@ -41,7 +41,7 @@ Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/envi
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts --- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts +++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
@@ -210,7 +210,7 @@ export class BrowserWorkbenchEnvironment @@ -177,7 +177,7 @@ export class BrowserWorkbenchEnvironment
@memoize @memoize
get webviewExternalEndpoint(): string { get webviewExternalEndpoint(): string {
@@ -70,8 +70,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-wwaDxsm1+SKIUb5YJXiZlYMyV7QPB8+zd6HPcTjigZs=' '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-IZkGO4jZeUn7pzM6pBZCZc9bUYm8oVNV3z8zEa8gxlk=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming --> <!-- Disable pinch zooming -->
<meta name="viewport" <meta name="viewport"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -1,6 +0,0 @@
Contact: mailto:security@coder.com
Acknowledgments: https://coder.com/security/thanks
Preferred-Languages: en-US
Canonical: https://coder.com/.well-known/security.txt
Policy: https://coder.com/security/policy
Hiring: https://coder.com/careers

View File

@@ -814,7 +814,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 +835,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,
} }
} }

View File

@@ -81,13 +81,6 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
return res.redirect(`https://${req.headers.host}${req.originalUrl}`) return res.redirect(`https://${req.headers.host}${req.originalUrl}`)
} }
// Return security.txt.
if (req.originalUrl === "/security.txt" || req.originalUrl === "/.well-known/security.txt") {
const resourcePath = path.resolve(rootPath, "src/browser/security.txt")
res.set("Content-Type", getMediaMime(resourcePath))
return res.send(await fs.readFile(resourcePath))
}
// Return robots.txt. // Return robots.txt.
if (req.originalUrl === "/robots.txt") { if (req.originalUrl === "/robots.txt") {
const resourcePath = path.resolve(rootPath, "src/browser/robots.txt") const resourcePath = path.resolve(rootPath, "src/browser/robots.txt")

View File

@@ -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
})
})

View File

@@ -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"

View File

@@ -795,7 +795,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"

View File

@@ -1,18 +0,0 @@
import { ChildProcess } from "child_process"
import { ParentProcess, isChild } from "../../../src/node/wrapper"
describe("wrapper", () => {
describe("isChild", () => {
it("should return false for parent process", () => {
const p = new ParentProcess("1")
expect(isChild(p)).toBe(false)
})
})
it("should return false for parent process", () => {
const p = new ChildProcess()
// our ChildProcess isn't exported
// and shouldn't be for a test so surpressing TS error.
// @ts-expect-error - see above
expect(isChild(p)).toBe(false)
})
})

View File

@@ -41,7 +41,7 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
"@mapbox/node-pre-gyp@^1.0.10": "@mapbox/node-pre-gyp@^1.0.9":
version "1.0.10" version "1.0.10"
resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz#8e6735ccebbb1581e5a7e652244cadc8a844d03c" resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz#8e6735ccebbb1581e5a7e652244cadc8a844d03c"
integrity sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA== integrity sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==
@@ -505,12 +505,12 @@ arg@^4.1.0:
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
argon2@0.30.2: argon2@0.29.0:
version "0.30.2" version "0.29.0"
resolved "https://registry.yarnpkg.com/argon2/-/argon2-0.30.2.tgz#b308a039d6d0cda5a3c47cbddd12685f033c33fa" resolved "https://registry.yarnpkg.com/argon2/-/argon2-0.29.0.tgz#94b6ef96cbdbe9f3562523c7130552af4c8d25bb"
integrity sha512-RBbXTUsrJUQH259/72CCJxQa0hV961pV4PyZ7R1czGkArSsQP4DToCS2axmNfHywXaBNEMPWMW6rM82EArulYA== integrity sha512-J8XxGYjq90qohrN5ySXTIXJ2HyDjMOw3uXMOsWrHzKe9daT6TtFCCtrADz1wPFuDH2bOxumPwbgBhKa5AknIhw==
dependencies: dependencies:
"@mapbox/node-pre-gyp" "^1.0.10" "@mapbox/node-pre-gyp" "^1.0.9"
"@phc/format" "^1.0.0" "@phc/format" "^1.0.0"
node-addon-api "^5.0.0" node-addon-api "^5.0.0"
@@ -2775,10 +2775,10 @@ prettier-plugin-sh@^0.12.8:
sh-syntax "^0.3.6" sh-syntax "^0.3.6"
synckit "^0.8.1" synckit "^0.8.1"
prettier@2.8.0: prettier@2.7.1:
version "2.8.0" version "2.7.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.0.tgz#c7df58393c9ba77d6fba3921ae01faf994fb9dc9" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA== integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
proxy-addr@~2.0.5: proxy-addr@~2.0.5:
version "2.0.6" version "2.0.6"