mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 12:31:58 +02:00
Compare commits
26 Commits
v4.16.0
...
v4.17.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58f6e24a07 | ||
|
|
7868f4db23 | ||
|
|
acc50a5d36 | ||
|
|
47ee7ae670 | ||
|
|
70d0c603cc | ||
|
|
2e29c233ea | ||
|
|
331a017309 | ||
|
|
f915d1e2c8 | ||
|
|
95bcf101d7 | ||
|
|
d80568df20 | ||
|
|
03dc8cd808 | ||
|
|
3e1c00e017 | ||
|
|
a76e5241b6 | ||
|
|
913fc30866 | ||
|
|
eb498b0d6d | ||
|
|
eb8099ff89 | ||
|
|
56d3548fa2 | ||
|
|
2d335bd1ea | ||
|
|
291682e1c0 | ||
|
|
97aeb77abe | ||
|
|
76fd2389e4 | ||
|
|
3cb92edc76 | ||
|
|
94ef3776ad | ||
|
|
a82f1ceaa5 | ||
|
|
25254214fb | ||
|
|
feb5e6770c |
43
.github/workflows/build.yaml
vendored
43
.github/workflows/build.yaml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Run prettier with actionsx/prettier
|
- name: Run prettier with actionsx/prettier
|
||||||
uses: actionsx/prettier@v2
|
uses: actionsx/prettier@v3
|
||||||
with:
|
with:
|
||||||
args: --check --loglevel=warn .
|
args: --check --loglevel=warn .
|
||||||
|
|
||||||
@@ -45,16 +45,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v38
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
docs/**
|
docs/**
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
cache: "yarn"
|
cache: "yarn"
|
||||||
|
|
||||||
- name: Install doctoc
|
- name: Install doctoc
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v38
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
ci/helm-chart/**
|
ci/helm-chart/**
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v38
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
**/*.ts
|
**/*.ts
|
||||||
@@ -115,11 +115,11 @@ jobs:
|
|||||||
files_ignore: |
|
files_ignore: |
|
||||||
lib/vscode/**
|
lib/vscode/**
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Fetch dependencies from cache
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
@@ -163,18 +163,18 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
id: changed-files
|
id: changed-files
|
||||||
uses: tj-actions/changed-files@v37
|
uses: tj-actions/changed-files@v38
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
**/*.ts
|
**/*.ts
|
||||||
files_ignore: |
|
files_ignore: |
|
||||||
lib/vscode/**
|
lib/vscode/**
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Fetch dependencies from cache
|
||||||
if: steps.changed-files.outputs.any_changed == 'true'
|
if: steps.changed-files.outputs.any_changed == 'true'
|
||||||
@@ -212,6 +212,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
|
|
||||||
- name: Install quilt
|
- name: Install quilt
|
||||||
uses: awalsh128/cache-apt-pkgs-action@latest
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
||||||
with:
|
with:
|
||||||
@@ -221,10 +224,10 @@ jobs:
|
|||||||
- name: Patch Code
|
- name: Patch Code
|
||||||
run: quilt push -a
|
run: quilt push -a
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Fetch dependencies from cache
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
@@ -292,10 +295,13 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install system dependencies
|
||||||
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
|
|
||||||
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Fetch dependencies from cache
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
@@ -348,10 +354,13 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install system dependencies
|
||||||
|
run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||||
|
|
||||||
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Fetch dependencies from cache
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
|
|||||||
79
.github/workflows/release.yaml
vendored
79
.github/workflows/release.yaml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
needs: npm-version
|
needs: npm-version
|
||||||
container: "centos:7"
|
container: "centos:8"
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
@@ -35,17 +35,17 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Install development tools
|
- name: Install development tools
|
||||||
run: |
|
run: |
|
||||||
yum install -y epel-release centos-release-scl make
|
cd /etc/yum.repos.d/
|
||||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
|
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
|
||||||
# for keytar
|
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
||||||
yum install -y libsecret-devel
|
yum install -y gcc-c++ make jq rsync python3 libsecret-devel krb5-devel
|
||||||
|
|
||||||
- name: Install nfpm and envsubst
|
- name: Install nfpm and envsubst
|
||||||
run: |
|
run: |
|
||||||
@@ -67,10 +67,8 @@ jobs:
|
|||||||
- name: Decompress npm package
|
- name: Decompress npm package
|
||||||
run: tar -xzf package.tar.gz
|
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
|
- name: Build standalone release
|
||||||
run: source scl_source enable devtoolset-9 && npm run release:standalone
|
run: npm run release:standalone
|
||||||
|
|
||||||
- name: Install test dependencies
|
- name: Install test dependencies
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||||
@@ -102,25 +100,7 @@ jobs:
|
|||||||
discussion_category_name: "📣 Announcements"
|
discussion_category_name: "📣 Announcements"
|
||||||
files: ./release-packages/*
|
files: ./release-packages/*
|
||||||
|
|
||||||
# NOTE@oxy:
|
# TODO: We should use the same CentOS image to cross-compile if possible?
|
||||||
# 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 18.04 until GitHub browned it out on December 15, 2022
|
|
||||||
# See here: https://github.com/actions/runner-images/issues/6002
|
|
||||||
package-linux-cross:
|
package-linux-cross:
|
||||||
name: Linux cross-compile builds
|
name: Linux cross-compile builds
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
@@ -139,17 +119,17 @@ jobs:
|
|||||||
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
||||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||||
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
||||||
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
npm_config_arch: ${{ matrix.arch }}
|
||||||
NODE_VERSION: v16.13.0
|
NODE_VERSION: v18.15.0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18.15.0"
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
@@ -157,8 +137,21 @@ 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: Install cross-compiler
|
- name: Install cross-compiler and system dependencies (arm64)
|
||||||
run: sudo apt update && sudo apt install $PACKAGE
|
if: ${{ matrix.arch != 'armv7l' }}
|
||||||
|
run: sudo apt update && sudo apt install -y $PACKAGE libkrb5-dev
|
||||||
|
env:
|
||||||
|
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
||||||
|
|
||||||
|
- name: Install cross-compiler and system dependencies (armv7l)
|
||||||
|
if: ${{ matrix.arch == 'armv7l' }}
|
||||||
|
run: |
|
||||||
|
sudo sed -i "s/^deb/deb [arch=amd64,i386]/g" /etc/apt/sources.list
|
||||||
|
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c) main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
|
||||||
|
echo "deb [arch=arm64,armhf] http://ports.ubuntu.com/ $(lsb_release -s -c)-updates main universe multiverse restricted" | sudo tee -a /etc/apt/sources.list
|
||||||
|
sudo dpkg --add-architecture armhf
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y $PACKAGE libkrb5-dev:armhf
|
||||||
env:
|
env:
|
||||||
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
||||||
|
|
||||||
@@ -170,15 +163,13 @@ jobs:
|
|||||||
- name: Decompress npm package
|
- name: Decompress npm package
|
||||||
run: tar -xzf package.tar.gz
|
run: tar -xzf package.tar.gz
|
||||||
|
|
||||||
# NOTE@jsjoeio - npm fails here
|
|
||||||
# so use yarn
|
|
||||||
- name: Build standalone release
|
- name: Build standalone release
|
||||||
run: yarn release:standalone
|
run: npm run release:standalone
|
||||||
|
|
||||||
- name: Replace node with cross-compile equivalent
|
- name: Replace node with cross-compile equivalent
|
||||||
run: |
|
run: |
|
||||||
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz
|
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${npm_config_arch}.tar.xz
|
||||||
tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
|
tar -xf node-${NODE_VERSION}-linux-${npm_config_arch}.tar.xz node-${NODE_VERSION}-linux-${npm_config_arch}/bin/node --strip-components=2
|
||||||
mv ./node ./release-standalone/lib/node
|
mv ./node ./release-standalone/lib/node
|
||||||
|
|
||||||
# NOTE@jsjoeio - we do this so we can strip out the v
|
# NOTE@jsjoeio - we do this so we can strip out the v
|
||||||
@@ -191,7 +182,7 @@ jobs:
|
|||||||
- name: Build packages with nfpm
|
- name: Build packages with nfpm
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ env.VERSION }}
|
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
|
||||||
with:
|
with:
|
||||||
@@ -208,10 +199,10 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Install nfpm
|
- name: Install nfpm
|
||||||
run: |
|
run: |
|
||||||
@@ -305,7 +296,7 @@ jobs:
|
|||||||
npm version --prefix release "$VERSION"
|
npm version --prefix release "$VERSION"
|
||||||
|
|
||||||
echo "Updating version in lib/vscode/product.json"
|
echo "Updating version in lib/vscode/product.json"
|
||||||
tmp=$(mktemp)
|
tmp=$(mktemp)
|
||||||
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
||||||
# Ensure it has the same permissions as before
|
# Ensure it has the same permissions as before
|
||||||
chmod 644 release/lib/vscode/product.json
|
chmod 644 release/lib/vscode/product.json
|
||||||
|
|||||||
23
.github/workflows/security.yaml
vendored
23
.github/workflows/security.yaml
vendored
@@ -29,26 +29,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install Node.js v16
|
- name: Install Node.js v18
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "18"
|
||||||
|
|
||||||
- name: Fetch dependencies from cache
|
- name: Audit yarn for vulnerabilities
|
||||||
id: cache-yarn
|
run: yarn audit
|
||||||
uses: actions/cache@v3
|
if: success()
|
||||||
with:
|
|
||||||
path: "**/node_modules"
|
|
||||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
yarn-build-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Audit npm for vulnerabilities
|
||||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
run: npm shrinkwrap && npm audit
|
||||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Audit for vulnerabilities
|
|
||||||
run: yarn _audit
|
|
||||||
if: success()
|
if: success()
|
||||||
|
|
||||||
trivy-scan-repo:
|
trivy-scan-repo:
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
16
|
18
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -22,6 +22,18 @@ Code v99.99.999
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## [4.16.1](https://github.com/coder/code-server/releases/tag/v4.16.1) - 2023-07-31
|
||||||
|
|
||||||
|
Code v1.80.2
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Updated to Code 1.80.2.
|
||||||
|
|
||||||
|
## [4.16.0](https://github.com/coder/code-server/releases/tag/v4.16.0) - 2023-07-28
|
||||||
|
|
||||||
|
Code v1.80.1
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- `--disable-proxy` flag. This disables the domain and path proxies but it does
|
- `--disable-proxy` flag. This disables the domain and path proxies but it does
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ bundle_code_server() {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
) > "$RELEASE_PATH/package.json"
|
) > "$RELEASE_PATH/package.json"
|
||||||
rsync yarn.lock "$RELEASE_PATH"
|
|
||||||
mv npm-shrinkwrap.json "$RELEASE_PATH"
|
mv npm-shrinkwrap.json "$RELEASE_PATH"
|
||||||
|
|
||||||
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
|
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
|
||||||
@@ -95,12 +94,10 @@ bundle_vscode() {
|
|||||||
"$VSCODE_SRC_PATH/remote/package.json" \
|
"$VSCODE_SRC_PATH/remote/package.json" \
|
||||||
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
||||||
|
|
||||||
rsync "$VSCODE_SRC_PATH/remote/yarn.lock" "$VSCODE_OUT_PATH/yarn.lock"
|
|
||||||
mv "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
mv "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
||||||
|
|
||||||
# Include global extension dependencies as well.
|
# Include global extension dependencies as well.
|
||||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
||||||
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions/yarn.lock"
|
|
||||||
mv "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
mv "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
||||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
|
||||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
|
||||||
export npm_config_build_from_source=true
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "${0}")/../.."
|
cd "$(dirname "${0}")/../.."
|
||||||
|
|
||||||
|
|||||||
@@ -53,10 +53,6 @@ symlink_bin_script() {
|
|||||||
|
|
||||||
OS="$(os)"
|
OS="$(os)"
|
||||||
|
|
||||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
|
||||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
|
||||||
export npm_config_build_from_source=true
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# Grabs the major version of node from $npm_config_user_agent which looks like
|
# Grabs the major version of node from $npm_config_user_agent which looks like
|
||||||
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
|
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
|
||||||
@@ -68,8 +64,8 @@ main() {
|
|||||||
echo "USE AT YOUR OWN RISK!"
|
echo "USE AT YOUR OWN RISK!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
|
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-18}" ]; then
|
||||||
echo "ERROR: code-server currently requires node v16."
|
echo "ERROR: code-server currently requires node v18."
|
||||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||||
fi
|
fi
|
||||||
@@ -113,29 +109,40 @@ install_with_yarn_or_npm() {
|
|||||||
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
|
# HACK: NPM's use of semver doesn't like resolving some peerDependencies that vscode (upstream) brings in the form of pre-releases.
|
||||||
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
|
# The legacy behavior doesn't complain about pre-releases being used, falling back to that for now.
|
||||||
# See https://github.com//pull/5071
|
# See https://github.com//pull/5071
|
||||||
npm install --unsafe-perm --legacy-peer-deps --omit=dev
|
if ! npm install --unsafe-perm --legacy-peer-deps --omit=dev; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
yarn*)
|
yarn*)
|
||||||
yarn --production --frozen-lockfile --no-default-rc
|
if ! yarn --production --frozen-lockfile --no-default-rc; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Could not determine which package manager is being used to install code-server"
|
echo "Could not determine which package manager is being used to install code-server"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
vscode_install() {
|
vscode_install() {
|
||||||
echo 'Installing Code dependencies...'
|
echo 'Installing Code dependencies...'
|
||||||
cd lib/vscode
|
cd lib/vscode
|
||||||
install_with_yarn_or_npm
|
if ! install_with_yarn_or_npm; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
symlink_asar
|
symlink_asar
|
||||||
symlink_bin_script remote-cli code code-server
|
symlink_bin_script remote-cli code code-server
|
||||||
symlink_bin_script helpers browser browser .sh
|
symlink_bin_script helpers browser browser .sh
|
||||||
|
|
||||||
cd extensions
|
cd extensions
|
||||||
install_with_yarn_or_npm
|
if ! install_with_yarn_or_npm; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
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.11.0
|
version: 3.12.1
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
appVersion: 4.15.0
|
appVersion: 4.16.1
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
||||||
{{- if .Values.hostnameOverride }}
|
{{- if .Values.hostnameOverride }}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- if not .Values.existingSecret }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -11,8 +12,9 @@ metadata:
|
|||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
{{ if .Values.password }}
|
{{- if .Values.password }}
|
||||||
password: "{{ .Values.password | b64enc }}"
|
password: "{{ .Values.password | b64enc }}"
|
||||||
{{ else }}
|
{{- else }}
|
||||||
password: "{{ randAlphaNum 24 | b64enc }}"
|
password: "{{ randAlphaNum 24 | b64enc }}"
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
|||||||
|
|
||||||
image:
|
image:
|
||||||
repository: codercom/code-server
|
repository: codercom/code-server
|
||||||
tag: '4.15.0'
|
tag: '4.16.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
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ for [VS
|
|||||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
Here is what is needed:
|
Here is what is needed:
|
||||||
|
|
||||||
- `node` v16.x
|
- `node` v18.x
|
||||||
- `git` v2.x or greater
|
- `git` v2.x or greater
|
||||||
- [`git-lfs`](https://git-lfs.github.com)
|
- [`git-lfs`](https://git-lfs.github.com)
|
||||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||||
@@ -63,7 +63,7 @@ Here is what is needed:
|
|||||||
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3
|
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev python-is-python3
|
||||||
```
|
```
|
||||||
|
|
||||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
|
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
|
||||||
|
|||||||
17
docs/FAQ.md
17
docs/FAQ.md
@@ -14,6 +14,7 @@
|
|||||||
- [How do I install an extension manually?](#how-do-i-install-an-extension-manually)
|
- [How do I install an extension manually?](#how-do-i-install-an-extension-manually)
|
||||||
- [How do I use my own extensions marketplace?](#how-do-i-use-my-own-extensions-marketplace)
|
- [How do I use my own extensions marketplace?](#how-do-i-use-my-own-extensions-marketplace)
|
||||||
- [Where are extensions stored?](#where-are-extensions-stored)
|
- [Where are extensions stored?](#where-are-extensions-stored)
|
||||||
|
- [Where is VS Code configuration stored?](#where-is-vs-code-configuration-stored)
|
||||||
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
|
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
|
||||||
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
|
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
|
||||||
- [How do I access my Documents/Downloads/Desktop folders in code-server on macOS?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-macos)
|
- [How do I access my Documents/Downloads/Desktop folders in code-server on macOS?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-macos)
|
||||||
@@ -192,10 +193,20 @@ docs](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions--marke
|
|||||||
|
|
||||||
## Where are extensions stored?
|
## Where are extensions stored?
|
||||||
|
|
||||||
Extensions are store, by default, to `~/.local/share/code-server/extensions`.
|
Extensions are stored in `~/.local/share/code-server/extensions` by default.
|
||||||
|
|
||||||
If you set the `XDG_DATA_HOME` environment variable, the data directory will be
|
On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the
|
||||||
`$XDG_DATA_HOME/code-server/extensions`. In general, we try to follow the XDG directory spec.
|
extensions directory will be `$XDG_DATA_HOME/code-server/extensions`. In
|
||||||
|
general, we try to follow the XDG directory spec.
|
||||||
|
|
||||||
|
## Where is VS Code configuration stored?
|
||||||
|
|
||||||
|
VS Code configuration such as settings and keybindings are stored in
|
||||||
|
`~/.local/share/code-server` by default.
|
||||||
|
|
||||||
|
On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the data
|
||||||
|
directory will be `$XDG_DATA_HOME/code-server`. In general, we try to follow the
|
||||||
|
XDG directory spec.
|
||||||
|
|
||||||
## How can I reuse my VS Code configuration?
|
## How can I reuse my VS Code configuration?
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
||||||
access it in the browser.
|
access it in the browser.
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
## Highlights
|
## Highlights
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|||||||
```
|
```
|
||||||
|
|
||||||
6. Exit the terminal using `exit` and then reopen the terminal
|
6. Exit the terminal using `exit` and then reopen the terminal
|
||||||
7. Install and use Node.js 16:
|
7. Install and use Node.js 18:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nvm install 16
|
nvm install 18
|
||||||
nvm use 16
|
nvm use 18
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`
|
8. Install code-server globally on device with: `npm install --global code-server --unsafe-perm`
|
||||||
|
|||||||
BIN
docs/assets/screenshot-1.png
Normal file
BIN
docs/assets/screenshot-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
BIN
docs/assets/screenshot-2.png
Normal file
BIN
docs/assets/screenshot-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 267 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 357 KiB |
@@ -139,9 +139,9 @@ sudo apt install caddy
|
|||||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
mydomain.com
|
mydomain.com {
|
||||||
|
reverse_proxy 127.0.0.1:8080
|
||||||
reverse_proxy 127.0.0.1:8080
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to serve code-server from a sub-path, you can do so as follows:
|
If you want to serve code-server from a sub-path, you can do so as follows:
|
||||||
|
|||||||
@@ -103,10 +103,9 @@ _exact_ same commands presented in the rest of this document.
|
|||||||
We recommend installing with `npm` when:
|
We recommend installing with `npm` when:
|
||||||
|
|
||||||
1. You aren't using a machine with `amd64` or `arm64`.
|
1. You aren't using a machine with `amd64` or `arm64`.
|
||||||
1. You are installing code-server on Windows
|
2. You are installing code-server on Windows.
|
||||||
1. You're on Linux with `glibc` < v2.17, `glibcxx` < v3.4.18 on `amd64`, `glibc`
|
3. You're on Linux with `glibc` < v2.28 or `glibcxx` < v3.4.21.
|
||||||
< v2.23, or `glibcxx` < v3.4.21 on `arm64`.
|
4. You're running Alpine Linux or are using a non-glibc libc. See
|
||||||
1. You're running Alpine Linux or are using a non-glibc libc. See
|
|
||||||
[#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198)
|
[#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
@@ -123,8 +122,8 @@ node binary and node modules.
|
|||||||
We create the standalone releases using the [npm package](#npm), and we
|
We create the standalone releases using the [npm package](#npm), and we
|
||||||
then create the remaining releases using the standalone version.
|
then create the remaining releases using the standalone version.
|
||||||
|
|
||||||
The only requirement to use the standalone release is `glibc` >= 2.17 and
|
The only requirement to use the standalone release is `glibc` >= 2.28 and
|
||||||
`glibcxx` >= v3.4.18 on Linux (for macOS, there is no minimum system
|
`glibcxx` >= v3.4.21 on Linux (for macOS, there is no minimum system
|
||||||
requirement).
|
requirement).
|
||||||
|
|
||||||
To use a standalone release:
|
To use a standalone release:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ includes installing instructions based on your operating system.
|
|||||||
## Node.js version
|
## Node.js version
|
||||||
|
|
||||||
We use the same major version of Node.js shipped with Code's remote, which is
|
We use the same major version of Node.js shipped with Code's remote, which is
|
||||||
currently `16.x`. VS Code also [lists Node.js
|
currently `18.x`. VS Code also [lists Node.js
|
||||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
|
|
||||||
Using other versions of Node.js [may lead to unexpected
|
Using other versions of Node.js [may lead to unexpected
|
||||||
@@ -79,7 +79,7 @@ Proceed to [installing](#installing)
|
|||||||
## FreeBSD
|
## FreeBSD
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pkg install -y git python npm-node16 pkgconf
|
pkg install -y git python npm-node18 pkgconf
|
||||||
pkg install -y libinotify
|
pkg install -y libinotify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ npm config set python python3
|
|||||||
node -v
|
node -v
|
||||||
```
|
```
|
||||||
|
|
||||||
you will get node version `v16.15.0`
|
you will get Node version `v18`
|
||||||
|
|
||||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,14 @@
|
|||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
let pkgs = nixpkgs.legacyPackages.${system};
|
||||||
nodejs = pkgs.nodejs-16_x;
|
nodejs = pkgs.nodejs-18_x;
|
||||||
yarn' = pkgs.yarn.override { inherit nodejs; };
|
yarn' = pkgs.yarn.override { inherit nodejs; };
|
||||||
in {
|
in {
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats
|
nodejs yarn' python3 pkg-config git rsync jq moreutils quilt bats openssl
|
||||||
];
|
];
|
||||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret ]
|
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
|
||||||
++ (with xorg; [ libX11 libxkbfile ])
|
++ (with xorg; [ libX11 libxkbfile ])
|
||||||
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||||
AppKit Cocoa CoreServices Security xcbuild
|
AppKit Cocoa CoreServices Security xcbuild
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ install_npm() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echoerr "Please install npm to install code-server!"
|
echoerr "Please install npm to install code-server!"
|
||||||
echoerr "You will need at least node v12 and a few C dependencies."
|
echoerr "You will need at least node v18 and a few C dependencies."
|
||||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Submodule lib/vscode updated: 74f6148eb9...abd2f3db4b
105
package.json
105
package.json
@@ -38,75 +38,62 @@
|
|||||||
},
|
},
|
||||||
"main": "out/node/entry.js",
|
"main": "out/node/entry.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@schemastore/package": "^0.0.6",
|
"@schemastore/package": "^0.0.10",
|
||||||
"@types/compression": "^1.7.0",
|
"@types/compression": "^1.7.3",
|
||||||
"@types/cookie-parser": "^1.4.2",
|
"@types/cookie-parser": "^1.4.4",
|
||||||
"@types/express": "^4.17.8",
|
"@types/express": "^4.17.17",
|
||||||
"@types/http-proxy": "^1.17.4",
|
"@types/http-proxy": "1.17.7",
|
||||||
"@types/js-yaml": "^4.0.0",
|
"@types/js-yaml": "^4.0.6",
|
||||||
"@types/node": "^16.0.0",
|
"@types/node": "^18.0.0",
|
||||||
"@types/pem": "^1.9.5",
|
"@types/pem": "^1.14.1",
|
||||||
"@types/proxy-from-env": "^1.0.1",
|
"@types/proxy-from-env": "^1.0.1",
|
||||||
"@types/safe-compare": "^1.1.0",
|
"@types/safe-compare": "^1.1.0",
|
||||||
"@types/semver": "^7.1.0",
|
"@types/semver": "^7.5.2",
|
||||||
"@types/trusted-types": "^2.0.2",
|
"@types/trusted-types": "^2.0.4",
|
||||||
"@types/ws": "^8.5.3",
|
"@types/ws": "^8.5.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||||
"@typescript-eslint/parser": "^5.41.0",
|
"@typescript-eslint/parser": "^6.7.2",
|
||||||
"audit-ci": "^6.0.0",
|
"audit-ci": "^6.6.1",
|
||||||
"doctoc": "2.2.1",
|
"doctoc": "^2.2.1",
|
||||||
"eslint": "^8.26.0",
|
"eslint": "^8.49.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-import-resolver-typescript": "^3.5.2",
|
"eslint-import-resolver-typescript": "^3.6.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.28.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"prettier": "2.8.0",
|
"prettier": "^3.0.3",
|
||||||
"prettier-plugin-sh": "^0.12.8",
|
"prettier-plugin-sh": "^0.13.1",
|
||||||
"ts-node": "^10.0.0",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.2.2"
|
||||||
},
|
|
||||||
"resolutions": {
|
|
||||||
"ansi-regex": "^5.0.1",
|
|
||||||
"normalize-package-data": "^5.0.0",
|
|
||||||
"doctoc/underscore": "^1.13.1",
|
|
||||||
"doctoc/**/trim": "^1.0.0",
|
|
||||||
"postcss": "^8.2.1",
|
|
||||||
"browserslist": "^4.16.5",
|
|
||||||
"safe-buffer": "^5.1.1",
|
|
||||||
"vfile-message": "^2.0.2",
|
|
||||||
"tar": "^6.1.9",
|
|
||||||
"path-parse": "^1.0.7",
|
|
||||||
"vm2": "^3.9.11",
|
|
||||||
"follow-redirects": "^1.14.8",
|
|
||||||
"node-fetch": "^2.6.7",
|
|
||||||
"nanoid": "^3.1.31",
|
|
||||||
"minimist": "npm:minimist-lite@2.2.1",
|
|
||||||
"glob-parent": "^6.0.1",
|
|
||||||
"@types/node": "^16.0.0",
|
|
||||||
"qs": "^6.7.3"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@coder/logger": "^3.0.0",
|
"@coder/logger": "^3.0.1",
|
||||||
"argon2": "0.30.3",
|
"argon2": "^0.31.1",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"cookie-parser": "^1.4.5",
|
"cookie-parser": "^1.4.6",
|
||||||
"env-paths": "^2.2.0",
|
"env-paths": "^2.2.1",
|
||||||
"express": "5.0.0-alpha.8",
|
"express": "5.0.0-alpha.8",
|
||||||
"http-proxy": "^1.18.0",
|
"http-proxy": "^1.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
"httpolyglot": "^0.1.2",
|
||||||
"i18next": "^23.2.11",
|
"i18next": "^23.5.1",
|
||||||
"js-yaml": "^4.0.0",
|
"js-yaml": "^4.1.0",
|
||||||
"limiter": "^2.1.0",
|
"limiter": "^2.1.0",
|
||||||
"pem": "^1.14.2",
|
"pem": "^1.14.8",
|
||||||
"proxy-agent": "^6.2.1",
|
"proxy-agent": "^6.3.1",
|
||||||
"qs": "6.11.0",
|
"qs": "6.9.7",
|
||||||
"rotating-file-stream": "^3.0.0",
|
"rotating-file-stream": "^3.1.1",
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.2.1",
|
||||||
"safe-compare": "^1.1.4",
|
"safe-compare": "^1.1.4",
|
||||||
"semver": "^7.1.3",
|
"semver": "^7.5.4",
|
||||||
"ws": "^8.0.0",
|
"ws": "^8.14.2",
|
||||||
"xdg-basedir": "^4.0.0"
|
"xdg-basedir": "^4.0.0"
|
||||||
},
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"@types/node": "^18.0.0",
|
||||||
|
"qs": "6.9.7"
|
||||||
|
},
|
||||||
|
"overrides": {
|
||||||
|
"qs": "6.9.7"
|
||||||
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"code-server": "out/node/entry.js"
|
"code-server": "out/node/entry.js"
|
||||||
},
|
},
|
||||||
@@ -120,7 +107,7 @@
|
|||||||
"remote-development"
|
"remote-development"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "16"
|
"node": "18"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"transform": {
|
"transform": {
|
||||||
|
|||||||
@@ -111,7 +111,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
|
||||||
@@ -268,16 +268,15 @@ export class WebClientServer {
|
@@ -269,16 +269,15 @@ export class WebClientServer {
|
||||||
return void res.end();
|
return void res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
);
|
);
|
||||||
if (!remoteAuthority) {
|
if (!remoteAuthority) {
|
||||||
return serveError(req, res, 400, `Bad request.`);
|
return serveError(req, res, 400, `Bad request.`);
|
||||||
@@ -304,8 +303,12 @@ export class WebClientServer {
|
@@ -305,8 +304,12 @@ export class WebClientServer {
|
||||||
scopes: [['user:email'], ['repo']]
|
scopes: [['user:email'], ['repo']]
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||||
...this._productService.extensionsGallery,
|
...this._productService.extensionsGallery,
|
||||||
@@ -340,8 +343,10 @@ export class WebClientServer {
|
@@ -341,8 +344,10 @@ export class WebClientServer {
|
||||||
const values: { [key: string]: string } = {
|
const values: { [key: string]: string } = {
|
||||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||||
@@ -159,7 +159,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (useTestResolver) {
|
if (useTestResolver) {
|
||||||
@@ -366,7 +371,7 @@ export class WebClientServer {
|
@@ -367,7 +372,7 @@ export class WebClientServer {
|
||||||
'default-src \'self\';',
|
'default-src \'self\';',
|
||||||
'img-src \'self\' https: data: blob:;',
|
'img-src \'self\' https: data: blob:;',
|
||||||
'media-src \'self\';',
|
'media-src \'self\';',
|
||||||
@@ -168,7 +168,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
'child-src \'self\';',
|
'child-src \'self\';',
|
||||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||||
'worker-src \'self\' data: blob:;',
|
'worker-src \'self\' data: blob:;',
|
||||||
@@ -439,3 +444,70 @@ export class WebClientServer {
|
@@ -440,3 +445,70 @@ export class WebClientServer {
|
||||||
return void res.end(data);
|
return void res.end(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -255,23 +255,25 @@ 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
|
||||||
@@ -484,6 +484,7 @@ function doCreateUri(path: string, query
|
@@ -304,7 +304,8 @@ class LocalStorageURLCallbackProvider ex
|
||||||
});
|
this.startListening();
|
||||||
|
}
|
||||||
|
|
||||||
|
- return URI.parse(window.location.href).with({ path: this._callbackRoute, query: queryParams.join('&') });
|
||||||
|
+ const path = (window.location.pathname + "/" + this._callbackRoute).replace(/\/\/+/g, "/");
|
||||||
|
+ return URI.parse(window.location.href).with({ path: path, query: queryParams.join('&') });
|
||||||
}
|
}
|
||||||
|
|
||||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
private startListening(): void {
|
||||||
return URI.parse(window.location.href).with({ path, query });
|
@@ -569,7 +570,7 @@ function readCookie(name: string): strin
|
||||||
}
|
|
||||||
|
|
||||||
@@ -495,7 +496,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');
|
||||||
}
|
}
|
||||||
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
|
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
|
||||||
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
||||||
|
const secretStorageKeyPath = readCookie('vscode-secret-key-path');
|
||||||
// Create workbench
|
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
|
||||||
create(document.body, {
|
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
|
||||||
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -103,10 +103,14 @@ class RemoteTerminalBackend extends Base
|
@@ -104,10 +104,14 @@ class RemoteTerminalBackend extends Base
|
||||||
}
|
}
|
||||||
const reqId = e.reqId;
|
const reqId = e.reqId;
|
||||||
const commandId = e.commandId;
|
const commandId = e.commandId;
|
||||||
|
|||||||
62
patches/dependencies.diff
Normal file
62
patches/dependencies.diff
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
Modify VS Code dependencies
|
||||||
|
|
||||||
|
1. Kerberos: this is not building in our cross-compile step. It does not look
|
||||||
|
like something code-server uses right now anyway.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/remote/package.json
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/remote/package.json
|
||||||
|
+++ code-server/lib/vscode/remote/package.json
|
||||||
|
@@ -18,7 +18,6 @@
|
||||||
|
"http-proxy-agent": "^2.1.0",
|
||||||
|
"https-proxy-agent": "^2.2.3",
|
||||||
|
"jschardet": "3.0.0",
|
||||||
|
- "kerberos": "^2.0.1",
|
||||||
|
"keytar": "7.9.0",
|
||||||
|
"minimist": "^1.2.6",
|
||||||
|
"native-watchdog": "^1.4.1",
|
||||||
|
Index: code-server/lib/vscode/remote/yarn.lock
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/remote/yarn.lock
|
||||||
|
+++ code-server/lib/vscode/remote/yarn.lock
|
||||||
|
@@ -454,15 +454,6 @@ jschardet@3.0.0:
|
||||||
|
resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-3.0.0.tgz#898d2332e45ebabbdb6bf2feece9feea9a99e882"
|
||||||
|
integrity sha512-lJH6tJ77V8Nzd5QWRkFYCLc13a3vADkh3r/Fi8HupZGWk2OVVDfnZP8V/VgQgZ+lzW0kG2UGb5hFgt3V3ndotQ==
|
||||||
|
|
||||||
|
-kerberos@^2.0.1:
|
||||||
|
- version "2.0.1"
|
||||||
|
- resolved "https://registry.yarnpkg.com/kerberos/-/kerberos-2.0.1.tgz#663b0b46883b4da84495f60f2e9e399a43a33ef5"
|
||||||
|
- integrity sha512-O/jIgbdGK566eUhFwIcgalbqirYU/r76MW7/UFw06Fd9x5bSwgyZWL/Vm26aAmezQww/G9KYkmmJBkEkPk5HLw==
|
||||||
|
- dependencies:
|
||||||
|
- bindings "^1.5.0"
|
||||||
|
- node-addon-api "^4.3.0"
|
||||||
|
- prebuild-install "7.1.1"
|
||||||
|
-
|
||||||
|
keytar@7.9.0:
|
||||||
|
version "7.9.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb"
|
||||||
|
@@ -604,24 +595,6 @@ picomatch@^2.3.1:
|
||||||
|
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
||||||
|
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
||||||
|
|
||||||
|
-prebuild-install@7.1.1:
|
||||||
|
- version "7.1.1"
|
||||||
|
- resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45"
|
||||||
|
- integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==
|
||||||
|
- dependencies:
|
||||||
|
- detect-libc "^2.0.0"
|
||||||
|
- expand-template "^2.0.3"
|
||||||
|
- github-from-package "0.0.0"
|
||||||
|
- minimist "^1.2.3"
|
||||||
|
- mkdirp-classic "^0.5.3"
|
||||||
|
- napi-build-utils "^1.0.1"
|
||||||
|
- node-abi "^3.3.0"
|
||||||
|
- pump "^3.0.0"
|
||||||
|
- rc "^1.2.7"
|
||||||
|
- simple-get "^4.0.0"
|
||||||
|
- tar-fs "^2.0.0"
|
||||||
|
- tunnel-agent "^0.6.0"
|
||||||
|
-
|
||||||
|
prebuild-install@^7.0.1:
|
||||||
|
version "7.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.1.tgz#c10075727c318efe72412f333e0ef625beaf3870"
|
||||||
@@ -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
|
||||||
@@ -243,6 +243,10 @@ export class Extension implements IExten
|
@@ -244,6 +244,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,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
|
||||||
@@ -14,6 +14,7 @@ export const serverOptions: OptionDescri
|
@@ -16,6 +16,7 @@ export const serverOptions: OptionDescri
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
@@ -66,7 +66,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ export interface ServerParsedArgs {
|
@@ -97,6 +98,7 @@ export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string
|
'auth'?: string
|
||||||
@@ -78,7 +78,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
|
||||||
@@ -331,6 +331,7 @@ export class WebClientServer {
|
@@ -332,6 +332,7 @@ export class WebClientServer {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
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,
|
||||||
@@ -94,9 +94,9 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } 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, 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, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } 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';
|
||||||
@@ -105,7 +105,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
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, isTemporaryWorkspace } 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';
|
||||||
@@ -80,7 +80,7 @@ export class WorkbenchContextKeysHandler
|
@@ -79,7 +79,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,
|
||||||
@@ -114,7 +114,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,
|
||||||
@@ -210,6 +210,9 @@ export class WorkbenchContextKeysHandler
|
@@ -209,6 +209,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));
|
||||||
|
|
||||||
@@ -165,7 +165,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
|
||||||
@@ -35,6 +35,8 @@ export const HasWebFileSystemAccess = ne
|
@@ -38,6 +38,8 @@ export const HasWebFileSystemAccess = ne
|
||||||
|
|
||||||
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,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
|
||||||
@@ -230,6 +230,9 @@ export async function setupServerService
|
@@ -231,6 +231,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);
|
||||||
|
|
||||||
@@ -89,10 +89,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
|||||||
<!-- Workbench Icon/Manifest/CSS -->
|
<!-- Workbench Icon/Manifest/CSS -->
|
||||||
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||||
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||||
@@ -46,15 +49,26 @@
|
@@ -48,15 +51,26 @@
|
||||||
// Set up nls if the user is not using the default language (English)
|
// Normalize locale to lowercase because translationServiceUrl is case-sensitive.
|
||||||
const nlsConfig = {};
|
// ref: https://github.com/microsoft/vscode/issues/187795
|
||||||
const locale = window.localStorage.getItem('vscode.nls.locale') || navigator.language;
|
const locale = window.localStorage.getItem('vscode.nls.locale') || navigator.language.toLowerCase();
|
||||||
- if (!locale.startsWith('en')) {
|
- if (!locale.startsWith('en')) {
|
||||||
- nlsConfig['vs/nls'] = {
|
- nlsConfig['vs/nls'] = {
|
||||||
- availableLanguages: {
|
- availableLanguages: {
|
||||||
@@ -203,7 +203,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
|
||||||
@@ -26,6 +26,7 @@ import { URI } from 'vs/base/common/uri'
|
@@ -27,6 +27,7 @@ import { URI } from 'vs/base/common/uri'
|
||||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||||
import { IProductConfiguration } from 'vs/base/common/product';
|
import { IProductConfiguration } from 'vs/base/common/product';
|
||||||
import { isString } from 'vs/base/common/types';
|
import { isString } from 'vs/base/common/types';
|
||||||
@@ -211,7 +211,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
import { CharCode } from 'vs/base/common/charCode';
|
import { CharCode } from 'vs/base/common/charCode';
|
||||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||||
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
|
||||||
@@ -343,6 +344,8 @@ export class WebClientServer {
|
@@ -344,6 +345,8 @@ export class WebClientServer {
|
||||||
callbackRoute: this._callbackRoute
|
callbackRoute: this._callbackRoute
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
|
||||||
const values: { [key: string]: string } = {
|
const values: { [key: string]: string } = {
|
||||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||||
@@ -351,6 +354,7 @@ export class WebClientServer {
|
@@ -352,6 +355,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,
|
||||||
@@ -232,7 +232,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -15,6 +15,7 @@ export const serverOptions: OptionDescri
|
@@ -17,6 +17,7 @@ export const serverOptions: OptionDescri
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
@@ -240,7 +240,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ export interface ServerParsedArgs {
|
@@ -99,6 +100,7 @@ export interface ServerParsedArgs {
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
'auth'?: string
|
'auth'?: string
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
@@ -339,7 +339,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||||
@@ -337,9 +337,6 @@ export class InstallAction extends Exten
|
@@ -321,9 +321,6 @@ export class InstallAction extends Exten
|
||||||
if (this.extension.isBuiltin) {
|
if (this.extension.isBuiltin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -349,7 +349,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
||||||
this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
this.enabled = this.options.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
||||||
this.updateLabel();
|
this.updateLabel();
|
||||||
@@ -607,7 +604,7 @@ export abstract class InstallInOtherServ
|
@@ -591,7 +588,7 @@ export abstract class InstallInOtherServ
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||||
@@ -358,7 +358,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prefers to run on UI
|
// Prefers to run on UI
|
||||||
@@ -1695,17 +1692,6 @@ export class SetLanguageAction extends E
|
@@ -1683,17 +1680,6 @@ export class SetLanguageAction extends E
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = SetLanguageAction.DisabledClass;
|
this.class = SetLanguageAction.DisabledClass;
|
||||||
@@ -376,7 +376,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
}
|
}
|
||||||
|
|
||||||
override async run(): Promise<any> {
|
override async run(): Promise<any> {
|
||||||
@@ -1722,7 +1708,6 @@ export class ClearLanguageAction extends
|
@@ -1710,7 +1696,6 @@ export class ClearLanguageAction extends
|
||||||
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
private static readonly DisabledClass = `${ClearLanguageAction.EnabledClass} disabled`;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -384,7 +384,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||||||
@ILocaleService private readonly localeService: ILocaleService,
|
@ILocaleService private readonly localeService: ILocaleService,
|
||||||
) {
|
) {
|
||||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||||
@@ -1732,17 +1717,6 @@ export class ClearLanguageAction extends
|
@@ -1720,17 +1705,6 @@ export class ClearLanguageAction extends
|
||||||
update(): void {
|
update(): void {
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.class = ClearLanguageAction.DisabledClass;
|
this.class = ClearLanguageAction.DisabledClass;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
import { OpenFolderAction, OpenFileFolderAction, OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions';
|
import { OpenFolderAction, OpenFileFolderAction, 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';
|
||||||
@@ -782,6 +782,72 @@ export class GettingStartedPage extends
|
@@ -783,6 +783,72 @@ export class GettingStartedPage extends
|
||||||
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
|
|||||||
const leftColumn = $('.categories-column.categories-column-left', {},);
|
const leftColumn = $('.categories-column.categories-column-left', {},);
|
||||||
const rightColumn = $('.categories-column.categories-column-right', {},);
|
const rightColumn = $('.categories-column.categories-column-right', {},);
|
||||||
|
|
||||||
@@ -831,6 +897,9 @@ export class GettingStartedPage extends
|
@@ -832,6 +898,9 @@ export class GettingStartedPage extends
|
||||||
recentList.setLimit(5);
|
recentList.setLimit(5);
|
||||||
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -16,6 +16,7 @@ export const serverOptions: OptionDescri
|
@@ -18,6 +18,7 @@ export const serverOptions: OptionDescri
|
||||||
'auth': { type: 'string' },
|
'auth': { type: 'string' },
|
||||||
'disable-file-downloads': { type: 'boolean' },
|
'disable-file-downloads': { type: 'boolean' },
|
||||||
'locale': { type: 'string' },
|
'locale': { type: 'string' },
|
||||||
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ export interface ServerParsedArgs {
|
@@ -101,6 +102,7 @@ export interface ServerParsedArgs {
|
||||||
'auth'?: string
|
'auth'?: string
|
||||||
'disable-file-downloads'?: boolean;
|
'disable-file-downloads'?: boolean;
|
||||||
'locale'?: string
|
'locale'?: string
|
||||||
@@ -201,7 +201,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -334,6 +334,7 @@ export class WebClientServer {
|
@@ -335,6 +335,7 @@ export class WebClientServer {
|
||||||
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,
|
||||||
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||||
@@ -217,12 +217,12 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
|||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } 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, 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, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
|
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
|
||||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted, ActiveEditorCanToggleReadonlyContext } from 'vs/workbench/common/contextkeys';
|
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, IsEnabledFileDownloads, IsEnabledCoderGettingStarted, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds } from 'vs/workbench/common/contextkeys';
|
||||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
|
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } 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';
|
||||||
@@ -212,6 +212,7 @@ export class WorkbenchContextKeysHandler
|
@@ -211,6 +211,7 @@ export class WorkbenchContextKeysHandler
|
||||||
|
|
||||||
// code-server
|
// code-server
|
||||||
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||||
@@ -234,7 +234,7 @@ Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||||
@@ -36,6 +36,7 @@ export const HasWebFileSystemAccess = ne
|
@@ -39,6 +39,7 @@ export const HasWebFileSystemAccess = ne
|
||||||
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
export const EmbedderIdentifierContext = new RawContextKey<string | undefined>('embedderIdentifier', undefined, localize('embedderIdentifier', 'The identifier of the embedder according to the product service, if one is defined'));
|
||||||
|
|
||||||
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||||
|
|||||||
@@ -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';
|
||||||
@@ -127,6 +128,9 @@ export class BrowserMain extends Disposa
|
@@ -132,6 +133,9 @@ export class BrowserMain extends Disposa
|
||||||
// Startup
|
// Startup
|
||||||
const instantiationService = workbench.startup();
|
const instantiationService = workbench.startup();
|
||||||
|
|
||||||
@@ -264,7 +264,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
|
||||||
@@ -305,6 +305,7 @@ export class WebClientServer {
|
@@ -306,6 +306,7 @@ export class WebClientServer {
|
||||||
} : undefined;
|
} : undefined;
|
||||||
|
|
||||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -326,6 +326,7 @@ export class WebClientServer {
|
@@ -327,6 +327,7 @@ export class WebClientServer {
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -13,6 +13,7 @@ import { IEnvironmentService, INativeEnv
|
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri'
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check': { type: 'boolean' },
|
'disable-update-check': { type: 'boolean' },
|
||||||
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -93,6 +94,7 @@ export const serverOptions: OptionDescri
|
@@ -95,6 +96,7 @@ export const serverOptions: OptionDescri
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
/* ----- code-server ----- */
|
/* ----- code-server ----- */
|
||||||
'disable-update-check'?: boolean;
|
'disable-update-check'?: boolean;
|
||||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -310,6 +310,7 @@ export class WebClientServer {
|
@@ -311,6 +311,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
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,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -112,7 +112,7 @@ export class WebClientServer {
|
@@ -113,7 +113,7 @@ export class WebClientServer {
|
||||||
const serverRootPath = getRemoteServerRootPath(_productService);
|
const serverRootPath = getRemoteServerRootPath(_productService);
|
||||||
this._staticRoute = `${serverRootPath}/static`;
|
this._staticRoute = `${serverRootPath}/static`;
|
||||||
this._callbackRoute = `${serverRootPath}/callback`;
|
this._callbackRoute = `${serverRootPath}/callback`;
|
||||||
@@ -49,7 +49,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -310,14 +310,7 @@ export class WebClientServer {
|
@@ -311,14 +311,7 @@ export class WebClientServer {
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
embedderIdentifier: 'server-distro',
|
embedderIdentifier: 'server-distro',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -311,6 +311,7 @@ export class WebClientServer {
|
@@ -312,6 +312,7 @@ export class WebClientServer {
|
||||||
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,
|
||||||
@@ -96,20 +96,18 @@ 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
|
||||||
@@ -21,6 +21,7 @@ import type { ICredentialsProvider } fro
|
@@ -19,6 +19,7 @@ import { isFolderToOpen, isWorkspaceToOp
|
||||||
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
|
||||||
import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api';
|
import type { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api';
|
||||||
|
import { AuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService';
|
||||||
import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService';
|
import type { IWorkspace, IWorkspaceProvider } from 'vs/workbench/services/host/browser/browserHostService';
|
||||||
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
+import { extractLocalHostUriMetaDataForPortMapping, TunnelOptions, TunnelCreationOptions } from 'vs/platform/tunnel/common/tunnel';
|
||||||
|
import type { IURLCallbackProvider } from 'vs/workbench/services/url/browser/urlService';
|
||||||
|
import { create } from 'vs/workbench/workbench.web.main';
|
||||||
|
|
||||||
interface ICredential {
|
@@ -582,6 +583,39 @@ function readCookie(name: string): strin
|
||||||
service: string;
|
|
||||||
@@ -505,6 +506,39 @@ function doCreateUri(path: string, query
|
|
||||||
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
settingsSyncOptions: config.settingsSyncOptions ? { enabled: config.settingsSyncOptions.enabled, } : undefined,
|
||||||
workspaceProvider: WorkspaceProvider.create(config),
|
workspaceProvider: WorkspaceProvider.create(config),
|
||||||
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
|
||||||
- credentialsProvider: config.remoteAuthority ? undefined /* with a remote, we don't use a local credentials provider */ : new LocalStorageCredentialsProvider()
|
|
||||||
+ credentialsProvider: config.remoteAuthority ? undefined /* with a remote, we don't use a local credentials provider */ : new LocalStorageCredentialsProvider(),
|
|
||||||
+ resolveExternalUri: (uri: URI): Promise<URI> => {
|
+ resolveExternalUri: (uri: URI): Promise<URI> => {
|
||||||
+ let resolvedUri = uri
|
+ let resolvedUri = uri
|
||||||
+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(resolvedUri)
|
+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(resolvedUri)
|
||||||
@@ -142,19 +140,20 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
|||||||
+ }
|
+ }
|
||||||
+ })
|
+ })
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ },
|
||||||
});
|
secretStorageProvider: config.remoteAuthority && !secretStorageKeyPath
|
||||||
})();
|
? undefined /* with a remote without embedder-preferred storage, store on the remote */
|
||||||
|
: new LocalStorageSecretStorageProvider(secretStorageCrypto),
|
||||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
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.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
|
||||||
@@ -74,7 +74,7 @@ export class ForwardedPortsView extends
|
@@ -76,7 +76,7 @@ export class ForwardedPortsView extends
|
||||||
this.contextKeyListener = undefined;
|
this.contextKeyListener = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
- const viewEnabled: boolean = !!forwardedPortsViewEnabled.getValue(this.contextKeyService);
|
||||||
+ const viewEnabled: boolean = true;
|
+ const viewEnabled: boolean = true;
|
||||||
|
|
||||||
if (this.environmentService.remoteAuthority && viewEnabled) {
|
if (viewEnabled) {
|
||||||
const viewContainer = await this.getViewContainer();
|
const viewContainer = await this.getViewContainer();
|
||||||
|
|||||||
68
patches/safari.diff
Normal file
68
patches/safari.diff
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
Revert back to es2020
|
||||||
|
|
||||||
|
es2022 outputs static blocks when using static properties that are not
|
||||||
|
compatible with Safari, or at least not older versions of Safari.
|
||||||
|
|
||||||
|
Index: code-server/lib/vscode/src/tsconfig.base.json
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/src/tsconfig.base.json
|
||||||
|
+++ code-server/lib/vscode/src/tsconfig.base.json
|
||||||
|
@@ -17,9 +17,30 @@
|
||||||
|
"./vs/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
- "target": "es2022",
|
||||||
|
- "useDefineForClassFields": false,
|
||||||
|
+ "target": "es2020",
|
||||||
|
"lib": [
|
||||||
|
+ "ES2016",
|
||||||
|
+ "ES2017.Object",
|
||||||
|
+ "ES2017.String",
|
||||||
|
+ "ES2017.Intl",
|
||||||
|
+ "ES2017.TypedArrays",
|
||||||
|
+ "ES2018.AsyncIterable",
|
||||||
|
+ "ES2018.AsyncGenerator",
|
||||||
|
+ "ES2018.Promise",
|
||||||
|
+ "ES2018.Regexp",
|
||||||
|
+ "ES2018.Intl",
|
||||||
|
+ "ES2019.Array",
|
||||||
|
+ "ES2019.Object",
|
||||||
|
+ "ES2019.String",
|
||||||
|
+ "ES2019.Symbol",
|
||||||
|
+ "ES2020.BigInt",
|
||||||
|
+ "ES2020.Promise",
|
||||||
|
+ "ES2020.String",
|
||||||
|
+ "ES2020.Symbol.WellKnown",
|
||||||
|
+ "ES2020.Intl",
|
||||||
|
+ "ES2021.Promise",
|
||||||
|
+ "ES2021.String",
|
||||||
|
+ "ES2021.WeakRef",
|
||||||
|
"ES2022",
|
||||||
|
"DOM",
|
||||||
|
"DOM.Iterable",
|
||||||
|
Index: code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
+++ code-server/lib/vscode/build/lib/tsb/transpiler.js
|
||||||
|
@@ -293,7 +293,7 @@ class SwcTranspiler {
|
||||||
|
tsx: false,
|
||||||
|
decorators: true
|
||||||
|
},
|
||||||
|
- target: 'es2022',
|
||||||
|
+ target: 'es2020',
|
||||||
|
loose: false,
|
||||||
|
minify: {
|
||||||
|
compress: false,
|
||||||
|
Index: code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
===================================================================
|
||||||
|
--- code-server.orig/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
+++ code-server/lib/vscode/build/lib/tsb/transpiler.ts
|
||||||
|
@@ -376,7 +376,7 @@ export class SwcTranspiler implements IT
|
||||||
|
tsx: false,
|
||||||
|
decorators: true
|
||||||
|
},
|
||||||
|
- target: 'es2022',
|
||||||
|
+ target: 'es2020',
|
||||||
|
loose: false,
|
||||||
|
minify: {
|
||||||
|
compress: false,
|
||||||
@@ -19,3 +19,4 @@ telemetry.diff
|
|||||||
display-language.diff
|
display-language.diff
|
||||||
cli-window-open.diff
|
cli-window-open.diff
|
||||||
getting-started.diff
|
getting-started.diff
|
||||||
|
safari.diff
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -312,6 +312,10 @@ export class WebClientServer {
|
@@ -313,6 +313,10 @@ export class WebClientServer {
|
||||||
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: process.env.VSCODE_PROXY_URI ?? base + '/proxy/{{port}}/',
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -242,8 +242,7 @@ function packageTask(type, platform, arc
|
@@ -238,8 +238,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) => {
|
||||||
@@ -282,9 +281,9 @@ function packageTask(type, platform, arc
|
@@ -278,9 +277,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;
|
||||||
@@ -431,7 +430,7 @@ function tweakProductForServerWeb(produc
|
@@ -427,7 +426,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`),
|
||||||
|
|||||||
@@ -20,22 +20,18 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
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';
|
import { LoggerService } from 'vs/platform/log/node/loggerService';
|
||||||
@@ -149,10 +150,13 @@ export async function setupServerService
|
@@ -150,7 +151,10 @@ export async function setupServerService
|
||||||
let oneDsAppender: ITelemetryAppender = NullAppender;
|
let oneDsAppender: ITelemetryAppender = NullAppender;
|
||||||
const isInternal = isInternalTelemetry(productService, configurationService);
|
const isInternal = isInternalTelemetry(productService, configurationService);
|
||||||
if (supportsTelemetry(productService, environmentService)) {
|
if (supportsTelemetry(productService, environmentService)) {
|
||||||
- if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
- if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
||||||
+ const telemetryEndpoint = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
|
+ const telemetryEndpoint = process.env.CS_TELEMETRY_URL || "https://v1.telemetry.coder.com/track";
|
||||||
+ if (telemetryEndpoint) {
|
+ if (telemetryEndpoint) {
|
||||||
+ oneDsAppender = new OneDataSystemAppender(false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint));
|
+ oneDsAppender = new OneDataSystemAppender(requestService, false, eventPrefix, null, () => new TelemetryClient(telemetryEndpoint));
|
||||||
+ } else if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
+ } else if (productService.aiConfig && productService.aiConfig.ariaKey) {
|
||||||
oneDsAppender = new OneDataSystemAppender(isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
oneDsAppender = new OneDataSystemAppender(requestService, isInternal, eventPrefix, null, productService.aiConfig.ariaKey);
|
||||||
- disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
||||||
}
|
}
|
||||||
+ disposables.add(toDisposable(() => oneDsAppender?.flush())); // Ensure the AI appender is disposed so that it flushes remaining data
|
|
||||||
|
|
||||||
const config: ITelemetryServiceConfig = {
|
|
||||||
appenders: [oneDsAppender],
|
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
Index: code-server/lib/vscode/src/vs/server/node/telemetryClient.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
@@ -94,7 +90,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
|
||||||
@@ -316,6 +316,7 @@ export class WebClientServer {
|
@@ -317,6 +317,7 @@ export class WebClientServer {
|
||||||
scope: vscodeBase + '/',
|
scope: vscodeBase + '/',
|
||||||
path: base + '/_static/out/browser/serviceWorker.js',
|
path: base + '/_static/out/browser/serviceWorker.js',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -105,7 +105,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
|
||||||
@@ -309,6 +309,7 @@ export class WebClientServer {
|
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||||
const productConfiguration = <Partial<IProductConfiguration>>{
|
const productConfiguration = <Partial<IProductConfiguration>>{
|
||||||
codeServerVersion: this._productService.codeServerVersion,
|
codeServerVersion: this._productService.codeServerVersion,
|
||||||
rootEndpoint: base,
|
rootEndpoint: base,
|
||||||
@@ -117,8 +117,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||||
@@ -11,6 +11,8 @@ import { refineServiceDecorator } from '
|
@@ -13,6 +13,8 @@ import { memoize } from 'vs/base/common/
|
||||||
import { IEnvironmentService, INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
import { URI } from 'vs/base/common/uri';
|
||||||
|
|
||||||
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
|
||||||
+ /* ----- code-server ----- */
|
+ /* ----- code-server ----- */
|
||||||
@@ -126,7 +126,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
|||||||
|
|
||||||
/* ----- server setup ----- */
|
/* ----- server setup ----- */
|
||||||
|
|
||||||
@@ -89,6 +91,8 @@ export const serverOptions: OptionDescri
|
@@ -91,6 +93,8 @@ export const serverOptions: OptionDescri
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface ServerParsedArgs {
|
export interface ServerParsedArgs {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
@@ -322,6 +322,7 @@ export class WebClientServer {
|
@@ -323,6 +323,7 @@ export class WebClientServer {
|
||||||
|
|
||||||
const workbenchWebConfiguration = {
|
const workbenchWebConfiguration = {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
@@ -70,12 +70,12 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
|
||||||
<meta http-equiv="Content-Security-Policy"
|
<meta http-equiv="Content-Security-Policy"
|
||||||
- content="default-src 'none'; script-src 'sha256-7Y08cqii1UgeZbSST9r8UPSownOSMa3/PiKe77avh7I=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
- content="default-src 'none'; script-src 'sha256-QA1gXilHYAUFCvp7MpjgcmyBCFzSKV0SpiecMU8aUVc=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
+ content="default-src 'none'; script-src 'sha256-h057XKGlOvyFweE9mchggtfdly92LQuQ9vKfYvNy7us=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
+ content="default-src 'none'; script-src 'sha256-5X5RiKYn8NTJVx919WStPrAmsV80rIIBbePhKquPcAQ=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
|
||||||
|
|
||||||
<!-- Disable pinch zooming -->
|
<!-- Disable pinch zooming -->
|
||||||
<meta name="viewport"
|
<meta name="viewport"
|
||||||
@@ -334,6 +334,12 @@
|
@@ -335,6 +335,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- 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
|
||||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html
|
||||||
@@ -333,6 +333,12 @@
|
@@ -334,6 +334,12 @@
|
||||||
|
|
||||||
const hostname = location.hostname;
|
const hostname = location.hostname;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ button {
|
|||||||
.card-box {
|
.card-box {
|
||||||
background-color: rgb(250, 253, 258);
|
background-color: rgb(250, 253, 258);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: rgba(60, 66, 87, 0.117647) 0px 7px 14px 0px, rgba(0, 0, 0, 0.117647) 0px 3px 6px 0px;
|
box-shadow:
|
||||||
|
rgba(60, 66, 87, 0.117647) 0px 7px 14px 0px,
|
||||||
|
rgba(0, 0, 0, 0.117647) 0px 3px 6px 0px;
|
||||||
max-width: 650px;
|
max-width: 650px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ export enum HttpCode {
|
|||||||
* used in the HTTP response.
|
* used in the HTTP response.
|
||||||
*/
|
*/
|
||||||
export class HttpError extends Error {
|
export class HttpError extends Error {
|
||||||
public constructor(message: string, public readonly statusCode: HttpCode, public readonly details?: object) {
|
public constructor(
|
||||||
|
message: string,
|
||||||
|
public readonly statusCode: HttpCode,
|
||||||
|
public readonly details?: object,
|
||||||
|
) {
|
||||||
super(message)
|
super(message)
|
||||||
this.name = this.constructor.name
|
this.name = this.constructor.name
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
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 { load } from "js-yaml"
|
||||||
import * as os from "os"
|
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { generateCertificate, generatePassword, humanPath, paths, splitOnFirstEquals } from "./util"
|
import { generateCertificate, generatePassword, paths, splitOnFirstEquals } from "./util"
|
||||||
import { EditorSessionManagerClient } from "./vscodeSocket"
|
import { EditorSessionManagerClient } from "./vscodeSocket"
|
||||||
|
|
||||||
export enum Feature {
|
export enum Feature {
|
||||||
@@ -663,7 +662,7 @@ export async function readConfigFile(configPath?: string): Promise<ConfigArgs> {
|
|||||||
await fs.writeFile(configPath, defaultConfigFile(generatedPassword), {
|
await fs.writeFile(configPath, defaultConfigFile(generatedPassword), {
|
||||||
flag: "wx", // wx means to fail if the path exists.
|
flag: "wx", // wx means to fail if the path exists.
|
||||||
})
|
})
|
||||||
logger.info(`Wrote default config file to ${humanPath(os.homedir(), configPath)}`)
|
logger.info(`Wrote default config file to ${configPath}`)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
// EEXIST is fine; we don't want to overwrite existing configurations.
|
// EEXIST is fine; we don't want to overwrite existing configurations.
|
||||||
if (error.code !== "EEXIST") {
|
if (error.code !== "EEXIST") {
|
||||||
@@ -733,6 +732,9 @@ export function bindAddrFromArgs(addr: Addr, args: UserProvidedArgs): Addr {
|
|||||||
if (args["bind-addr"]) {
|
if (args["bind-addr"]) {
|
||||||
addr = parseBindAddr(args["bind-addr"])
|
addr = parseBindAddr(args["bind-addr"])
|
||||||
}
|
}
|
||||||
|
if (process.env.CODE_SERVER_HOST) {
|
||||||
|
addr.host = process.env.CODE_SERVER_HOST
|
||||||
|
}
|
||||||
if (args.host) {
|
if (args.host) {
|
||||||
addr.host = args.host
|
addr.host = args.host
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ export class Heart {
|
|||||||
private heartbeatInterval = 60000
|
private heartbeatInterval = 60000
|
||||||
public lastHeartbeat = 0
|
public lastHeartbeat = 0
|
||||||
|
|
||||||
public constructor(private readonly heartbeatPath: string, private readonly isActive: () => Promise<boolean>) {
|
public constructor(
|
||||||
|
private readonly heartbeatPath: string,
|
||||||
|
private readonly isActive: () => Promise<boolean>,
|
||||||
|
) {
|
||||||
this.beat = this.beat.bind(this)
|
this.beat = this.beat.bind(this)
|
||||||
this.alive = this.alive.bind(this)
|
this.alive = this.alive.bind(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import i18next, { init } from "i18next"
|
import i18next, { init } from "i18next"
|
||||||
import * as en from "./locales/en.json"
|
import * as en from "./locales/en.json"
|
||||||
import * as zhCn from "./locales/zh-cn.json"
|
import * as ja from "./locales/ja.json"
|
||||||
import * as th from "./locales/th.json"
|
import * as th from "./locales/th.json"
|
||||||
|
import * as zhCn from "./locales/zh-cn.json"
|
||||||
init({
|
init({
|
||||||
lng: "en",
|
lng: "en",
|
||||||
fallbackLng: "en", // language to use if translations in user language are not available.
|
fallbackLng: "en", // language to use if translations in user language are not available.
|
||||||
@@ -18,6 +19,9 @@ init({
|
|||||||
th: {
|
th: {
|
||||||
translation: th,
|
translation: th,
|
||||||
},
|
},
|
||||||
|
ja: {
|
||||||
|
translation: ja,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
13
src/node/i18n/locales/ja.json
Normal file
13
src/node/i18n/locales/ja.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"LOGIN_TITLE": "{{app}} ログイン",
|
||||||
|
"LOGIN_BELOW": "以下によりログインしてください。",
|
||||||
|
"WELCOME": "ようこそ {{app}} へ!",
|
||||||
|
"LOGIN_PASSWORD": "パスワードは設定ファイル( {{configFile}} )を確認してください。",
|
||||||
|
"LOGIN_USING_ENV_PASSWORD": "パスワードは環境変数 $PASSWORD で設定されています。",
|
||||||
|
"LOGIN_USING_HASHED_PASSWORD": "パスワードは環境変数 $HASHED_PASSWORD で設定されています。",
|
||||||
|
"SUBMIT": "実行",
|
||||||
|
"PASSWORD_PLACEHOLDER": "パスワード",
|
||||||
|
"LOGIN_RATE_LIMIT": "ログイン制限を超えました!",
|
||||||
|
"MISS_PASSWORD": "パスワードを入力してください。",
|
||||||
|
"INCORRECT_PASSWORD": "パスワードが間違っています。"
|
||||||
|
}
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
import { field, logger } from "@coder/logger"
|
import { field, logger } from "@coder/logger"
|
||||||
import http from "http"
|
import http from "http"
|
||||||
import * as os from "os"
|
|
||||||
import { Disposable } from "../common/emitter"
|
import { Disposable } from "../common/emitter"
|
||||||
import { plural } from "../common/util"
|
import { plural } from "../common/util"
|
||||||
import { createApp, ensureAddress } from "./app"
|
import { createApp, ensureAddress } from "./app"
|
||||||
import { AuthType, DefaultedArgs, Feature, SpawnCodeCli, toCodeArgs, UserProvidedArgs } from "./cli"
|
import { AuthType, DefaultedArgs, Feature, SpawnCodeCli, toCodeArgs, UserProvidedArgs } from "./cli"
|
||||||
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 { isDirectory, 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.
|
||||||
@@ -109,8 +108,8 @@ export const runCodeServer = async (
|
|||||||
): Promise<{ dispose: Disposable["dispose"]; server: http.Server }> => {
|
): Promise<{ dispose: Disposable["dispose"]; server: http.Server }> => {
|
||||||
logger.info(`code-server ${version} ${commit}`)
|
logger.info(`code-server ${version} ${commit}`)
|
||||||
|
|
||||||
logger.info(`Using user-data-dir ${humanPath(os.homedir(), args["user-data-dir"])}`)
|
logger.info(`Using user-data-dir ${args["user-data-dir"]}`)
|
||||||
logger.trace(`Using extensions-dir ${humanPath(os.homedir(), args["extensions-dir"])}`)
|
logger.trace(`Using extensions-dir ${args["extensions-dir"]}`)
|
||||||
|
|
||||||
if (args.auth === AuthType.Password && !args.password && !args["hashed-password"]) {
|
if (args.auth === AuthType.Password && !args.password && !args["hashed-password"]) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@@ -123,7 +122,7 @@ export const runCodeServer = async (
|
|||||||
const serverAddress = ensureAddress(app.server, protocol)
|
const serverAddress = ensureAddress(app.server, protocol)
|
||||||
const disposeRoutes = await register(app, args)
|
const disposeRoutes = await register(app, args)
|
||||||
|
|
||||||
logger.info(`Using config file ${humanPath(os.homedir(), args.config)}`)
|
logger.info(`Using config file ${args.config}`)
|
||||||
logger.info(`${protocol.toUpperCase()} server listening on ${serverAddress.toString()}`)
|
logger.info(`${protocol.toUpperCase()} server listening on ${serverAddress.toString()}`)
|
||||||
if (args.auth === AuthType.Password) {
|
if (args.auth === AuthType.Password) {
|
||||||
logger.info(" - Authentication is enabled")
|
logger.info(" - Authentication is enabled")
|
||||||
@@ -132,14 +131,14 @@ export const runCodeServer = async (
|
|||||||
} else if (args.usingEnvHashedPassword) {
|
} else if (args.usingEnvHashedPassword) {
|
||||||
logger.info(" - Using password from $HASHED_PASSWORD")
|
logger.info(" - Using password from $HASHED_PASSWORD")
|
||||||
} else {
|
} else {
|
||||||
logger.info(` - Using password from ${humanPath(os.homedir(), args.config)}`)
|
logger.info(` - Using password from ${args.config}`)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(" - Authentication is disabled")
|
logger.info(" - Authentication is disabled")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.cert) {
|
if (args.cert) {
|
||||||
logger.info(` - Using certificate for HTTPS: ${humanPath(os.homedir(), args.cert.value)}`)
|
logger.info(` - Using certificate for HTTPS: ${args.cert.value}`)
|
||||||
} else {
|
} else {
|
||||||
logger.info(" - Not serving HTTPS")
|
logger.info(" - Not serving HTTPS")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { Router, Request } from "express"
|
import { Router, Request } from "express"
|
||||||
import { promises as fs } from "fs"
|
import { promises as fs } from "fs"
|
||||||
import { RateLimiter as Limiter } from "limiter"
|
import { RateLimiter as Limiter } from "limiter"
|
||||||
import * as os from "os"
|
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { CookieKeys } from "../../common/http"
|
import { CookieKeys } from "../../common/http"
|
||||||
import { rootPath } from "../constants"
|
import { rootPath } from "../constants"
|
||||||
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
|
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
|
||||||
import { getPasswordMethod, handlePasswordValidation, humanPath, sanitizeString, escapeHtml } from "../util"
|
|
||||||
import i18n from "../i18n"
|
import i18n from "../i18n"
|
||||||
|
import { getPasswordMethod, handlePasswordValidation, sanitizeString, escapeHtml } from "../util"
|
||||||
|
|
||||||
// RateLimiter wraps around the limiter library for logins.
|
// RateLimiter wraps around the limiter library for logins.
|
||||||
// It allows 2 logins every minute plus 12 logins every hour.
|
// It allows 2 logins every minute plus 12 logins every hour.
|
||||||
@@ -33,7 +32,7 @@ const getRoot = async (req: Request, error?: Error): Promise<string> => {
|
|||||||
i18n.changeLanguage(locale)
|
i18n.changeLanguage(locale)
|
||||||
const appName = req.args["app-name"] || "code-server"
|
const appName = req.args["app-name"] || "code-server"
|
||||||
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: appName }) as string)
|
const welcomeText = req.args["welcome-text"] || (i18n.t("WELCOME", { app: appName }) as string)
|
||||||
let passwordMsg = i18n.t("LOGIN_PASSWORD", { configFile: humanPath(os.homedir(), req.args.config) })
|
let passwordMsg = i18n.t("LOGIN_PASSWORD", { configFile: req.args.config })
|
||||||
if (req.args.usingEnvPassword) {
|
if (req.args.usingEnvPassword) {
|
||||||
passwordMsg = i18n.t("LOGIN_USING_ENV_PASSWORD")
|
passwordMsg = i18n.t("LOGIN_USING_ENV_PASSWORD")
|
||||||
} else if (req.args.usingEnvHashedPassword) {
|
} else if (req.args.usingEnvHashedPassword) {
|
||||||
|
|||||||
@@ -87,20 +87,6 @@ export function getEnvPaths(platform = process.platform): Paths {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* humanPath replaces the home directory in path with ~.
|
|
||||||
* Makes it more readable.
|
|
||||||
*
|
|
||||||
* @param homedir - the home directory(i.e. `os.homedir()`)
|
|
||||||
* @param path - a file path
|
|
||||||
*/
|
|
||||||
export function humanPath(homedir: string, path?: string): string {
|
|
||||||
if (!path) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return path.replace(homedir, "~")
|
|
||||||
}
|
|
||||||
|
|
||||||
export const generateCertificate = async (hostname: string): Promise<{ cert: string; certKey: string }> => {
|
export const generateCertificate = async (hostname: string): Promise<{ cert: string; certKey: string }> => {
|
||||||
const certPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.crt`)
|
const certPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.crt`)
|
||||||
const certKeyPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.key`)
|
const certKeyPath = path.join(paths.data, `${hostname.replace(/\./g, "_")}.key`)
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ type ChildMessage = RelaunchMessage | ChildHandshakeMessage
|
|||||||
type ParentMessage = ParentHandshakeMessage
|
type ParentMessage = ParentHandshakeMessage
|
||||||
|
|
||||||
class ProcessError extends Error {
|
class ProcessError extends Error {
|
||||||
public constructor(message: string, public readonly code: number | undefined) {
|
public constructor(
|
||||||
|
message: string,
|
||||||
|
public readonly code: number | undefined,
|
||||||
|
) {
|
||||||
super(message)
|
super(message)
|
||||||
this.name = this.constructor.name
|
this.name = this.constructor.name
|
||||||
Error.captureStackTrace(this, this.constructor)
|
Error.captureStackTrace(this, this.constructor)
|
||||||
|
|||||||
@@ -269,7 +269,10 @@ export class CodeServer {
|
|||||||
export class CodeServerPage {
|
export class CodeServerPage {
|
||||||
private readonly editorSelector = "div.monaco-workbench"
|
private readonly editorSelector = "div.monaco-workbench"
|
||||||
|
|
||||||
constructor(private readonly codeServer: CodeServer, public readonly page: Page) {
|
constructor(
|
||||||
|
private readonly codeServer: CodeServer,
|
||||||
|
public readonly page: Page,
|
||||||
|
) {
|
||||||
this.page.on("console", (message) => {
|
this.page.on("console", (message) => {
|
||||||
this.codeServer.logger.debug(message.text())
|
this.codeServer.logger.debug(message.text())
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, test, expect } from "./baseFixture"
|
|
||||||
import { clean, getMaybeProxiedPathname } from "../utils/helpers"
|
import { clean, getMaybeProxiedPathname } from "../utils/helpers"
|
||||||
|
import { describe, test, expect } from "./baseFixture"
|
||||||
|
|
||||||
const routes = ["/", "/vscode", "/vscode/"]
|
const routes = ["/", "/vscode", "/vscode/"]
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ describe("VS Code Routes with no workspace or folder", ["--disable-workspace-tru
|
|||||||
|
|
||||||
// Closing the folder should stop the redirecting.
|
// Closing the folder should stop the redirecting.
|
||||||
await codeServerPage.navigate("/?ew=true")
|
await codeServerPage.navigate("/?ew=true")
|
||||||
let url = new URL(codeServerPage.page.url())
|
const url = new URL(codeServerPage.page.url())
|
||||||
const pathname = getMaybeProxiedPathname(url)
|
const pathname = getMaybeProxiedPathname(url)
|
||||||
expect(pathname).toBe("/")
|
expect(pathname).toBe("/")
|
||||||
expect(url.search).toBe("?ew=true")
|
expect(url.search).toBe("?ew=true")
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ describe("createApp", () => {
|
|||||||
app.dispose()
|
app.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
expect(() => masterBall()).rejects.toThrow(`listen EACCES: permission denied 127.0.0.1:${port}`)
|
expect(() => masterBall()).rejects.toThrow("listen EACCES: permission denied")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should unlink a socket before listening on the socket", async () => {
|
it("should unlink a socket before listening on the socket", async () => {
|
||||||
|
|||||||
@@ -789,6 +789,50 @@ describe("bindAddrFromArgs", () => {
|
|||||||
expect(actual).toStrictEqual(expected)
|
expect(actual).toStrictEqual(expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should use process.env.CODE_SERVER_HOST if set", () => {
|
||||||
|
const [setValue, resetValue] = useEnv("CODE_SERVER_HOST")
|
||||||
|
setValue("coder")
|
||||||
|
|
||||||
|
const args: UserProvidedArgs = {}
|
||||||
|
|
||||||
|
const addr = {
|
||||||
|
host: "localhost",
|
||||||
|
port: 8080,
|
||||||
|
}
|
||||||
|
|
||||||
|
const actual = bindAddrFromArgs(addr, args)
|
||||||
|
const expected = {
|
||||||
|
host: "coder",
|
||||||
|
port: 8080,
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(actual).toStrictEqual(expected)
|
||||||
|
resetValue()
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should use the args.host over process.env.CODE_SERVER_HOST if both set", () => {
|
||||||
|
const [setValue, resetValue] = useEnv("CODE_SERVER_HOST")
|
||||||
|
setValue("coder")
|
||||||
|
|
||||||
|
const args: UserProvidedArgs = {
|
||||||
|
host: "123.123.123.123",
|
||||||
|
}
|
||||||
|
|
||||||
|
const addr = {
|
||||||
|
host: "localhost",
|
||||||
|
port: 8080,
|
||||||
|
}
|
||||||
|
|
||||||
|
const actual = bindAddrFromArgs(addr, args)
|
||||||
|
const expected = {
|
||||||
|
host: "123.123.123.123",
|
||||||
|
port: 8080,
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(actual).toStrictEqual(expected)
|
||||||
|
resetValue()
|
||||||
|
})
|
||||||
|
|
||||||
it("should use process.env.PORT if set", () => {
|
it("should use process.env.PORT if set", () => {
|
||||||
const [setValue, resetValue] = useEnv("PORT")
|
const [setValue, resetValue] = useEnv("PORT")
|
||||||
setValue("8000")
|
setValue("8000")
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import * as bodyParser from "body-parser"
|
|
||||||
import * as express from "express"
|
import * as express from "express"
|
||||||
import * as http from "http"
|
import * as http from "http"
|
||||||
import nodeFetch from "node-fetch"
|
import nodeFetch from "node-fetch"
|
||||||
@@ -110,7 +109,7 @@ describe("proxy", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("should allow post bodies", async () => {
|
it("should allow post bodies", async () => {
|
||||||
e.use(bodyParser.json({ strict: false }))
|
e.use(express.json({ strict: false }))
|
||||||
e.post("/wsup", (req, res) => {
|
e.post("/wsup", (req, res) => {
|
||||||
res.json(req.body)
|
res.json(req.body)
|
||||||
})
|
})
|
||||||
@@ -127,7 +126,7 @@ describe("proxy", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("should handle bad requests", async () => {
|
it("should handle bad requests", async () => {
|
||||||
e.use(bodyParser.json({ strict: false }))
|
e.use(express.json({ strict: false }))
|
||||||
e.post("/wsup", (req, res) => {
|
e.post("/wsup", (req, res) => {
|
||||||
res.json(req.body)
|
res.json(req.body)
|
||||||
})
|
})
|
||||||
@@ -154,7 +153,7 @@ describe("proxy", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("should handle errors", async () => {
|
it("should handle errors", async () => {
|
||||||
e.use(bodyParser.json({ strict: false }))
|
e.use(express.json({ strict: false }))
|
||||||
e.post("/wsup", (req, res) => {
|
e.post("/wsup", (req, res) => {
|
||||||
throw new Error("BROKEN")
|
throw new Error("BROKEN")
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
import { mockLogger } from "../../../utils/helpers"
|
||||||
import * as httpserver from "../../../utils/httpserver"
|
import * as httpserver from "../../../utils/httpserver"
|
||||||
import * as integration from "../../../utils/integration"
|
import * as integration from "../../../utils/integration"
|
||||||
import { mockLogger } from "../../../utils/helpers"
|
|
||||||
|
|
||||||
describe("vscode", () => {
|
describe("vscode", () => {
|
||||||
let codeServer: httpserver.HttpServer | undefined
|
let codeServer: httpserver.HttpServer | undefined
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { logger } from "@coder/logger"
|
import { logger } from "@coder/logger"
|
||||||
import * as http from "http"
|
import * as http from "http"
|
||||||
import { AddressInfo } from "net"
|
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
|
import { ensureAddress } from "../../../src/node/app"
|
||||||
import { SettingsProvider, UpdateSettings } from "../../../src/node/settings"
|
import { SettingsProvider, UpdateSettings } from "../../../src/node/settings"
|
||||||
import { LatestResponse, UpdateProvider } from "../../../src/node/update"
|
import { LatestResponse, UpdateProvider } from "../../../src/node/update"
|
||||||
import { clean, isAddressInfo, mockLogger, tmpdir } from "../../utils/helpers"
|
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
|
||||||
|
|
||||||
describe("update", () => {
|
describe("update", () => {
|
||||||
let version = "1.0.0"
|
let version = "1.0.0"
|
||||||
@@ -79,7 +79,6 @@ describe("update", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _provider: UpdateProvider | undefined
|
let _provider: UpdateProvider | undefined
|
||||||
let _address: string | AddressInfo | null
|
|
||||||
const provider = (): UpdateProvider => {
|
const provider = (): UpdateProvider => {
|
||||||
if (!_provider) {
|
if (!_provider) {
|
||||||
throw new Error("Update provider has not been created")
|
throw new Error("Update provider has not been created")
|
||||||
@@ -87,6 +86,7 @@ describe("update", () => {
|
|||||||
return _provider
|
return _provider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let address = new URL("http://localhost")
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
mockLogger()
|
mockLogger()
|
||||||
|
|
||||||
@@ -105,12 +105,13 @@ describe("update", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
_address = server.address()
|
const addr = ensureAddress(server, "http")
|
||||||
if (!isAddressInfo(_address)) {
|
if (typeof addr === "string") {
|
||||||
throw new Error("unexpected address")
|
throw new Error("unable to run update tests with unix sockets")
|
||||||
}
|
}
|
||||||
|
address = addr
|
||||||
_provider = new UpdateProvider(`http://${_address?.address}:${_address?.port}/latest`, _settings)
|
address.pathname = "/latest"
|
||||||
|
_provider = new UpdateProvider(address.toString(), _settings)
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
@@ -220,59 +221,51 @@ describe("update", () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it("should reject if response has status code 500", async () => {
|
it("should reject if response has status code 500", async () => {
|
||||||
if (isAddressInfo(_address)) {
|
address.pathname = "/reject-status-code"
|
||||||
const mockURL = `http://${_address.address}:${_address.port}/reject-status-code`
|
const provider = new UpdateProvider(address.toString(), settings())
|
||||||
const provider = new UpdateProvider(mockURL, settings())
|
const update = await provider.getUpdate(true)
|
||||||
const update = await provider.getUpdate(true)
|
|
||||||
|
|
||||||
expect(update.version).toBe("unknown")
|
expect(update.version).toBe("unknown")
|
||||||
expect(logger.error).toHaveBeenCalled()
|
expect(logger.error).toHaveBeenCalled()
|
||||||
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
||||||
identifier: "error",
|
identifier: "error",
|
||||||
value: `${mockURL}: 500`,
|
value: `${address.toString()}: 500`,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should reject if no location header provided", async () => {
|
it("should reject if no location header provided", async () => {
|
||||||
if (isAddressInfo(_address)) {
|
address.pathname = "/no-location-header"
|
||||||
const mockURL = `http://${_address.address}:${_address.port}/no-location-header`
|
const provider = new UpdateProvider(address.toString(), settings())
|
||||||
const provider = new UpdateProvider(mockURL, settings())
|
const update = await provider.getUpdate(true)
|
||||||
const update = await provider.getUpdate(true)
|
|
||||||
|
|
||||||
expect(update.version).toBe("unknown")
|
expect(update.version).toBe("unknown")
|
||||||
expect(logger.error).toHaveBeenCalled()
|
expect(logger.error).toHaveBeenCalled()
|
||||||
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
||||||
identifier: "error",
|
identifier: "error",
|
||||||
value: `received redirect with no location header`,
|
value: `received redirect with no location header`,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should resolve the request with response.headers.location", async () => {
|
it("should resolve the request with response.headers.location", async () => {
|
||||||
version = "4.1.1"
|
version = "4.1.1"
|
||||||
if (isAddressInfo(_address)) {
|
address.pathname = "/with-location-header"
|
||||||
const mockURL = `http://${_address.address}:${_address.port}/with-location-header`
|
const provider = new UpdateProvider(address.toString(), settings())
|
||||||
const provider = new UpdateProvider(mockURL, settings())
|
const update = await provider.getUpdate(true)
|
||||||
const update = await provider.getUpdate(true)
|
|
||||||
|
|
||||||
expect(logger.error).not.toHaveBeenCalled()
|
expect(logger.error).not.toHaveBeenCalled()
|
||||||
expect(update.version).toBe("4.1.1")
|
expect(update.version).toBe("4.1.1")
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should reject if more than 10 redirects", async () => {
|
it("should reject if more than 10 redirects", async () => {
|
||||||
if (isAddressInfo(_address)) {
|
address.pathname = "/redirect/11"
|
||||||
const mockURL = `http://${_address.address}:${_address.port}/redirect/11`
|
const provider = new UpdateProvider(address.toString(), settings())
|
||||||
const provider = new UpdateProvider(mockURL, settings())
|
const update = await provider.getUpdate(true)
|
||||||
const update = await provider.getUpdate(true)
|
|
||||||
|
|
||||||
expect(update.version).toBe("unknown")
|
expect(update.version).toBe("unknown")
|
||||||
expect(logger.error).toHaveBeenCalled()
|
expect(logger.error).toHaveBeenCalled()
|
||||||
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
expect(logger.error).toHaveBeenCalledWith("Failed to get latest version", {
|
||||||
identifier: "error",
|
identifier: "error",
|
||||||
value: `reached max redirects`,
|
value: `reached max redirects`,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -491,22 +491,6 @@ describe("isDirectory", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("humanPath", () => {
|
|
||||||
it("should return an empty string if no path provided", () => {
|
|
||||||
const mockHomedir = "/home/coder"
|
|
||||||
const actual = util.humanPath(mockHomedir)
|
|
||||||
const expected = ""
|
|
||||||
expect(actual).toBe(expected)
|
|
||||||
})
|
|
||||||
it("should replace the homedir with ~", () => {
|
|
||||||
const mockHomedir = "/home/coder"
|
|
||||||
const path = `${mockHomedir}/code-server`
|
|
||||||
const actual = util.humanPath(mockHomedir, path)
|
|
||||||
const expected = "~/code-server"
|
|
||||||
expect(actual).toBe(expected)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("isWsl", () => {
|
describe("isWsl", () => {
|
||||||
const testName = "wsl"
|
const testName = "wsl"
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { promises as fs } from "fs"
|
||||||
|
import * as path from "path"
|
||||||
import { workspaceDir } from "./constants"
|
import { workspaceDir } from "./constants"
|
||||||
import { clean, tmpdir } from "./helpers"
|
import { clean, tmpdir } from "./helpers"
|
||||||
import * as wtfnode from "./wtfnode"
|
import * as wtfnode from "./wtfnode"
|
||||||
import * as path from "path"
|
|
||||||
import { promises as fs } from "fs"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform workspace cleanup and authenticate. This should be ran before e2e
|
* Perform workspace cleanup and authenticate. This should be ran before e2e
|
||||||
|
|||||||
@@ -108,20 +108,6 @@ export function idleTimer(message: string, reject: (error: Error) => void, delay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* A helper function which returns a boolean indicating whether
|
|
||||||
* the given address is AddressInfo and has .address
|
|
||||||
* and a .port property.
|
|
||||||
*/
|
|
||||||
export function isAddressInfo(address: unknown): address is net.AddressInfo {
|
|
||||||
return (
|
|
||||||
address !== null &&
|
|
||||||
typeof address !== "string" &&
|
|
||||||
(address as net.AddressInfo).port !== undefined &&
|
|
||||||
(address as net.AddressInfo).address !== undefined
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If using a proxy, return the address of the proxy.
|
* If using a proxy, return the address of the proxy.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class HttpServer {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.hs.on("error", reject)
|
this.hs.on("error", reject)
|
||||||
|
|
||||||
this.hs.listen(0, "localhost", () => {
|
this.hs.listen(0, "127.0.0.1", () => {
|
||||||
this.hs.off("error", reject)
|
this.hs.off("error", reject)
|
||||||
resolve()
|
resolve()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user