Compare commits

...

25 Commits

Author SHA1 Message Date
Anmol Sethi
d3773c11f1 Merge pull request #1766 from cdr/v3.4.1
v3.4.1
2020-06-04 12:30:34 -04:00
Anmol Sethi
48f7c27248 v3.4.1 2020-06-04 06:24:24 -04:00
Anmol Sethi
06b387fe98 Merge pull request #1765 from cdr/global-storage
Always create globalStorageHome
2020-06-04 05:52:21 -04:00
Anmol Sethi
4cf81d88a7 Always create globalStorageHome
Closes #1693
2020-06-04 05:33:27 -04:00
Anmol Sethi
79d1e179f8 Merge pull request #1761 from cdr/static
Stop bundling libraries in release
2020-06-04 04:38:57 -04:00
Anmol Sethi
c00f931500 Remove zip library dependency 2020-06-03 18:24:59 -04:00
Anmol Sethi
fd5c5960c2 Fixes for release 2020-06-03 16:22:59 -04:00
Anmol Sethi
ab081cd522 Add warning when using outdated code-server script 2020-06-03 15:45:17 -04:00
Anmol Sethi
e2789608b2 Fix autoupdates for Darwin 2020-06-03 15:45:17 -04:00
Anmol Sethi
85ad7e4fb4 Remove duplicate log
Also confirmed that #1750 is fixed.
2020-06-03 15:45:17 -04:00
Anmol Sethi
cb9c5b2d49 Fix typos 2020-06-03 15:45:16 -04:00
Anmol Sethi
d4ef7c1412 Remove colons from image filenames 2020-06-03 15:45:16 -04:00
Anmol Sethi
5815b4a0c0 Rename dev/container -> dev/image 2020-06-03 15:45:16 -04:00
Anmol Sethi
bdb670e852 Rename container and release-container to images and release-image 2020-06-03 15:45:16 -04:00
Anmol Sethi
11d7932968 Stop bundling libraries in release
- Instead we now use CentOS 7 for the static build to guarantee
  that we only depend on libc v2.17

- For macOS we now pull in a static node binary and bundle that instead.
2020-06-03 15:45:16 -04:00
Anmol Sethi
02a77b528b Support recursive symlinks in release script
See
https://github.com/cdr/code-server/issues/1746#issuecomment-637830396
2020-06-03 15:45:16 -04:00
Anmol Sethi
206f195c1c Minor grammar fixes in FAQ 2020-06-03 15:45:16 -04:00
Anmol Sethi
2c2a6498af Parse config file in entry
This way setting --data-dir and --extension-dir in the config file
will work for --install--extension and whatnot.
2020-06-03 15:45:16 -04:00
Anmol Sethi
7ab47b3d83 Trim LD_LIBRARY_PATH on startup 2020-06-03 15:45:16 -04:00
Anmol Sethi
9a3b9fcac2 Fix install script to trim leading v from version
Updates #1746
2020-06-02 17:22:24 -04:00
Anmol Sethi
b88163392c Merge pull request #1736 from cdr/faq-updates
More questions in the FAQ
2020-05-27 21:39:56 -04:00
Anmol Sethi
c7cad402b4 Cleanup FAQ
Prominently explain how code-server is different from VS Code

Closes #1718
2020-05-27 21:39:19 -04:00
Anmol Sethi
8dfac0fb65 More questions in the FAQ
Closes #1732
2020-05-27 20:45:11 -04:00
Anmol Sethi
90caca3336 Minor fixes 2020-05-27 20:38:29 -04:00
Anmol Sethi
80bcfd918b Merge pull request #1701 from cdr/auto-install
Add auto install script
2020-05-27 20:35:52 -04:00
36 changed files with 211 additions and 274 deletions

View File

@@ -1,4 +1,4 @@
<!--
Please file all questions and support requests at https://www.reddit.com/r/codeserver/
The issue tracker is only for bugs.
The issue tracker is only for bugs and features.
-->

View File

@@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/fmt.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/fmt.sh
@@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/lint.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/lint.sh
@@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/test.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/test.sh
@@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/release.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/release.sh
- name: Upload npm package artifact
@@ -55,7 +55,7 @@ jobs:
name: npm-package
path: ./release-npm-package
- name: Run ./ci/steps/release-packages.sh
uses: ./ci/container
uses: ./ci/images/centos7
with:
args: ./ci/steps/release-packages.sh
- name: Upload release artifacts
@@ -75,7 +75,7 @@ jobs:
name: npm-package
path: ./release-npm-package
- name: Run ./ci/steps/release-packages.sh
uses: ./ci/container/arm64
uses: ./ci/images/centos7
with:
args: ./ci/steps/release-packages.sh
- name: Upload release artifacts
@@ -94,8 +94,6 @@ jobs:
with:
name: npm-package
path: ./release-npm-package
- run: brew unlink node@12
- run: brew install node
- run: ./ci/steps/release-packages.sh
env:
# Otherwise we get rate limited when fetching the ripgrep binary.
@@ -118,7 +116,7 @@ jobs:
name: release-packages
path: ./release-packages
- name: Run ./ci/steps/build-docker-image.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/build-docker-image.sh
- name: Upload release image
@@ -138,7 +136,7 @@ jobs:
name: release-packages
path: ./release-packages
- name: Run ./ci/steps/build-docker-image.sh
uses: ./ci/container/arm64
uses: ./ci/images/centos7
with:
args: ./ci/steps/build-docker-image.sh
- name: Upload release image

View File

@@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/publish-npm.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/publish-npm.sh
env:
@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Run ./ci/steps/push-docker-manifest.sh
uses: ./ci/container
uses: ./ci/images/debian8
with:
args: ./ci/steps/push-docker-manifest.sh
env:

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ release-packages/
release-gcp/
release-images/
node_modules
node-*

1
.ignore Normal file
View File

@@ -0,0 +1 @@
lib

View File

@@ -42,6 +42,8 @@ If you believe an install script used with `curl | sh` is insecure, please give
Docs on the install script, manual installation and docker image are at [./doc/install.md](./doc/install.md).
We also highly recommend reading the [FAQ](./doc/FAQ.md) on the [Differences compared to VS Code](./doc/FAQ.md#differences-compared-to-vs-code).
## FAQ
See [./doc/FAQ.md](./doc/FAQ.md).

View File

@@ -16,7 +16,7 @@ Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub)
1. Update the version of code-server and make a PR.
1. Update in `package.json`
2. Update in [install.sh](../install.sh)
2. Update in [./doc/install.md](../doc/install.md)
2. GitHub actions will generate the `npm-package`, `release-packages` and `release-images` artifacts.
3. Run `yarn release:github-draft` to create a GitHub draft release from the template with
the updated version.
@@ -35,12 +35,13 @@ Make sure you have `$GITHUB_TOKEN` set and [hub](https://github.com/github/hub)
10. Wait for the npm package to be published.
11. Update the homebrew package.
- Send a pull request to [homebrew-core](https://github.com/Homebrew/homebrew-core) with the URL in the [formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/code-server.rb) updated.
12. Make sure to add a release without the `v` prefix for autoupdate from `3.2.0`.
## dev
This directory contains scripts used for the development of code-server.
- [./ci/dev/container](./dev/container)
- [./ci/dev/image](./dev/image)
- See [./doc/CONTRIBUTING.md](../doc/CONTRIBUTING.md) for docs on the development container.
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
- Runs formatters.
@@ -104,17 +105,17 @@ You can disable minification by setting `MINIFY=`.
- Post install script for the npm package.
- Bundled by`yarn release`.
## release-container
## release-image
This directory contains the release docker container.
This directory contains the release docker container image.
- [./release-container/build.sh](./release-container/build.sh)
- [./release-image/build.sh](./release-image/build.sh)
- Builds the release container with the tag `codercom/code-server-$ARCH:$VERSION`.
- Assumes debian releases are ready in `./release-packages`.
## container
## images
This directory contains the container for CI.
This directory contains the images for CI.
## steps

View File

@@ -30,9 +30,16 @@ release_archive() {
local release_name="code-server-$VERSION-$OS-$ARCH"
if [[ $OS == "linux" ]]; then
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
elif [[ $OS == "darwin" && $ARCH == "x86_64" ]]; then
# Just exists to make autoupdating from 3.2.0 work again.
mv ./release-standalone "./$release_name"
zip -r "release-packages/$release_name.zip" "./$release_name"
mv "./$release_name" ./release-standalone
return
else
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-standalone/$release_name/" release-standalone
fi
echo "done (release-packages/$release_name)"
release_gcp

View File

@@ -17,14 +17,6 @@ main() {
mkdir -p "$RELEASE_PATH/bin"
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
rsync "$node_path" "$RELEASE_PATH/lib/node"
if [[ $OS == "linux" ]]; then
bundle_dynamic_lib libstdc++
bundle_dynamic_lib libgcc_s
elif [[ $OS == "macos" ]]; then
bundle_dynamic_lib libicui18n
bundle_dynamic_lib libicuuc
bundle_dynamic_lib libicudata
fi
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
ln -s "./lib/node" "$RELEASE_PATH/node"
@@ -33,17 +25,4 @@ main() {
yarn --production --frozen-lockfile
}
bundle_dynamic_lib() {
local lib_name="$1"
local lib_path
if [[ $OS == "linux" ]]; then
lib_path="$(ldd "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $3 }')"
elif [[ $OS == "macos" ]]; then
lib_path="$(otool -L "$RELEASE_PATH/lib/node" | grep "$lib_name" | awk '{print $1 }')"
fi
cp "$lib_path" "$RELEASE_PATH/lib"
}
main "$@"

View File

@@ -1,25 +1,36 @@
#!/bin/sh
set -eu
# This script is intended to be bundled into the standalone releases.
# Runs code-server with the bundled node binary.
# More complicated than readlink -f or realpath to support macOS.
# See https://github.com/cdr/code-server/issues/1537
bin_dir() {
# We read the symlink, which may be relative from $0.
dst="$(readlink "$0")"
# We cd into the $0 directory.
cd "$(dirname "$0")" || exit 1
# Now we can cd into the dst directory.
cd "$(dirname "$dst")" || exit 1
# Finally we use pwd -P to print the absolute path of the directory of $dst.
pwd -P || exit 1
_realpath() {
# See https://github.com/cdr/code-server/issues/1537 on why no realpath or readlink -f.
script="$1"
cd "$(dirname "$script")"
while [ -L "$(basename "$script")" ]; do
if [ -L "./node" ] && [ -L "./code-server" ] &&
[ -f "package.json" ] &&
cat package.json | grep -q '^ "name": "code-server",$'; then
echo "***** Please use the script in bin/code-server instead!" >&2
echo "***** This script will soon be removed!" >&2
echo "***** See the release notes at https://github.com/cdr/code-server/releases/tag/v3.4.0" >&2
fi
script="$(readlink "$(basename "$script")")"
cd "$(dirname "$script")"
done
echo "$PWD/$(basename "$script")"
}
BIN_DIR=$(bin_dir)
if [ "$(uname)" = "Linux" ]; then
export LD_LIBRARY_PATH="$BIN_DIR/../lib${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
elif [ "$(uname)" = "Darwin" ]; then
export DYLD_LIBRARY_PATH="$BIN_DIR/../lib${DYLD_LIBRARY_PATH+:$DYLD_LIBRARY_PATH}"
fi
exec "$BIN_DIR/../lib/node" "$BIN_DIR/.." "$@"
root() {
script="$(_realpath "$0")"
bin_dir="$(dirname "$script")"
dirname "$bin_dir"
}
ROOT="$(root)"
exec "$ROOT/lib/node" "$ROOT" "$@"

View File

@@ -11,7 +11,7 @@ main() {
source ./ci/lib.sh
download_artifact release-packages ./release-packages
local assets=(./release-packages/*)
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm})
for i in "${!assets[@]}"; do
assets[$i]="--attach=${assets[$i]}"
done

View File

@@ -15,7 +15,8 @@ main() {
./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension ms-python.python
local installed_extensions
installed_extensions="$(./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
if [[ $installed_extensions != "ms-python.python" ]]; then
if [[ $installed_extensions != "info Using config file ~/.config/code-server/config.yaml
ms-python.python" ]]; then
echo "Unexpected output from listing extensions:"
echo "$installed_extensions"
exit 1

View File

@@ -1,53 +0,0 @@
FROM debian:9
RUN apt-get update
# Needed for debian repositories added below.
RUN apt-get install -y curl gnupg
# Installs node.
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# Installs yarn.
RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y yarn
# Installs VS Code build deps.
RUN apt-get install -y build-essential \
libsecret-1-dev \
libx11-dev \
libxkbfile-dev
# Installs envsubst.
RUN apt-get install -y gettext-base
# Misc build dependencies.
RUN apt-get install -y git rsync unzip
# We need latest jq from debian buster for date support.
RUN ARCH="$(dpkg --print-architecture)" && \
curl -fsSOL http://http.us.debian.org/debian/pool/main/libo/libonig/libonig5_6.9.1-1_$ARCH.deb && \
dpkg -i libonig*.deb && \
curl -fsSOL http://http.us.debian.org/debian/pool/main/j/jq/libjq1_1.5+dfsg-2+b1_$ARCH.deb && \
dpkg -i libjq*.deb && \
curl -fsSOL http://http.us.debian.org/debian/pool/main/j/jq/jq_1.5+dfsg-2+b1_$ARCH.deb && \
dpkg -i jq*.deb && rm *.deb
# Installs shellcheck.
# Unfortunately coredumps on debian:8 so disabled for now.
#RUN curl -fsSL https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \
# tar -xJ && \
# mv shellcheck*/shellcheck /usr/local/bin && \
# rm -R shellcheck*
# Install Go dependencies
RUN ARCH="$(dpkg --print-architecture)" && \
curl -fsSL "https://dl.google.com/go/go1.14.3.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
ENV GO111MODULE=on
RUN go get mvdan.cc/sh/v3/cmd/shfmt
RUN go get github.com/goreleaser/nfpm/cmd/nfpm
RUN curl -fsSL https://get.docker.com | sh

View File

@@ -1,6 +0,0 @@
# arm64
Unfortunately there is no arm64 build of `debian:8` so
we need to use `debian:9` instead.
This is just an exact copy of [../Dockerfile](../Dockerfile) with the base image change.

View File

@@ -4,7 +4,7 @@ set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
shfmt -i 2 -w -s -sr $(git ls-files "*.sh")
shfmt -i 2 -w -sr $(git ls-files "*.sh")
local prettierExts
prettierExts=(
@@ -24,6 +24,8 @@ main() {
doctoc --title '# FAQ' doc/FAQ.md > /dev/null
doctoc --title '# Setup Guide' doc/guide.md > /dev/null
doctoc --title '# Install' doc/install.md > /dev/null
doctoc --title '# npm Install Requirements' doc/npm.md > /dev/null
doctoc --title '# Contributing' doc/CONTRIBUTING.md > /dev/null
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
echo "Files need generation or are formatted incorrectly:"

View File

@@ -42,7 +42,7 @@ run() {
build() {
echo "--- Building $container_name"
docker build -t $container_name ./ci/dev/container > /dev/null
docker build -t $container_name ./ci/dev/image > /dev/null
}
main "$@"

View File

@@ -7,9 +7,9 @@ main() {
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
stylelint $(git ls-files "*.css")
tsc --noEmit
# See comment in ./ci/container/Dockerfile
# See comment in ./ci/image/debian8
if [[ ! ${CI-} ]]; then
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090 $(git ls-files "*.sh")
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh")
fi
}

View File

@@ -212,7 +212,7 @@ index 0000000000..0170b47241
+ common.minifyTask("out-vscode")
+));
diff --git a/package.json b/package.json
index 4c7342cbd8..4c287f6c1a 100644
index d150d539ae..33078416d9 100644
--- a/package.json
+++ b/package.json
@@ -37,6 +37,9 @@
@@ -226,7 +226,7 @@ index 4c7342cbd8..4c287f6c1a 100644
"chokidar": "3.2.3",
"graceful-fs": "4.2.3",
diff --git a/product.json b/product.json
index 91b3b92678..f76f2c1548 100644
index 335caa71f6..47607a3eb8 100644
--- a/product.json
+++ b/product.json
@@ -18,7 +18,7 @@
@@ -2532,12 +2532,13 @@ index 0000000000..3c74512192
+}
diff --git a/src/vs/server/node/server.ts b/src/vs/server/node/server.ts
new file mode 100644
index 0000000000..8abb9a8e31
index 0000000000..8b82854426
--- /dev/null
+++ b/src/vs/server/node/server.ts
@@ -0,0 +1,273 @@
@@ -0,0 +1,277 @@
+import * as net from 'net';
+import * as path from 'path';
+import * as fs from 'fs';
+import { Emitter } from 'vs/base/common/event';
+import { Schemas } from 'vs/base/common/network';
+import { URI } from 'vs/base/common/uri';
@@ -2737,6 +2738,9 @@ index 0000000000..8abb9a8e31
+
+ private async initializeServices(args: ParsedArgs): Promise<void> {
+ const environmentService = new EnvironmentService(args, process.execPath);
+ // https://github.com/cdr/code-server/issues/1693
+ fs.mkdirSync(environmentService.globalStorageHome, { recursive: true });
+
+ const logService = new SpdLogService(RemoteExtensionLogFileName, environmentService.logsPath, getLogLevel(environmentService));
+ const fileService = new FileService(logService);
+ fileService.registerProvider(Schemas.file, new DiskFileSystemProvider(logService));
@@ -2841,7 +2845,7 @@ index 3f2de2c738..a967d8df69 100644
import './mainThreadAuthentication';
import './mainThreadTimeline';
diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts
index db72957372..4514a56754 100644
index 260b6468e9..882d3e442f 100644
--- a/src/vs/workbench/api/common/extHost.api.impl.ts
+++ b/src/vs/workbench/api/common/extHost.api.impl.ts
@@ -68,6 +68,7 @@ import { IURITransformerService } from 'vs/workbench/api/common/extHostUriTransf
@@ -2869,7 +2873,7 @@ index db72957372..4514a56754 100644
// automatically create and register addressable instances
diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts
index c6b3c31999..08e413e7d1 100644
index 7e1233484e..0f36de9496 100644
--- a/src/vs/workbench/api/common/extHost.protocol.ts
+++ b/src/vs/workbench/api/common/extHost.protocol.ts
@@ -748,6 +748,16 @@ export interface MainThreadLabelServiceShape extends IDisposable {
@@ -3093,13 +3097,13 @@ index 4781f22676..86c9246f51 100644
+import { joinPath } from 'vs/base/common/resources';
+import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
+import { loadCommonJSModule } from 'vs/server/browser/worker';
class WorkerRequireInterceptor extends RequireInterceptor {
@@ -41,7 +44,14 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
await this._fakeModules.install();
}
- protected async _loadCommonJSModule<T>(module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {
+ protected async _loadCommonJSModule<T>(module: URI | IExtensionDescription, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {
+ if (!URI.isUri(module) && module.extensionKind !== 'web') {
@@ -3109,7 +3113,7 @@ index 4781f22676..86c9246f51 100644
+ if (!URI.isUri(module)) {
+ module = joinPath(module.extensionLocation, module.main!);
+ }
module = module.with({ path: ensureSuffix(module.path, '.js') });
const response = await fetch(module.toString(true));
@@ -57,7 +67,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
@@ -3184,10 +3188,10 @@ index 5ea3fd924b..de61b7fd17 100644
.scm-viewlet .monaco-list .monaco-list-row .resource-group > .actions,
.scm-viewlet .monaco-list .monaco-list-row .resource > .name > .monaco-icon-label > .actions {
diff --git a/src/vs/workbench/contrib/webview/browser/pre/main.js b/src/vs/workbench/contrib/webview/browser/pre/main.js
index f2ca5011dd..4683e80a68 100644
index e21d86575c..22aa99c0f8 100644
--- a/src/vs/workbench/contrib/webview/browser/pre/main.js
+++ b/src/vs/workbench/contrib/webview/browser/pre/main.js
@@ -364,7 +364,8 @@
@@ -351,7 +351,8 @@
if (data.endpoint) {
try {
const endpointUrl = new URL(data.endpoint);
@@ -3478,7 +3482,7 @@ index 2fda5eddd8..721cfdfd3e 100644
import 'vs/workbench/services/credentials/browser/credentialsService';
import 'vs/workbench/services/url/browser/urlService';
diff --git a/yarn.lock b/yarn.lock
index 458909e2b2..68f1a7e609 100644
index 1bc94693ea..afd34e6b80 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -140,6 +140,23 @@

View File

@@ -0,0 +1,26 @@
FROM centos:7
RUN ARCH="$(uname -m | sed 's/86_64/64/; s/aarch64/arm64/')" && \
curl -fsSL "https://nodejs.org/dist/v14.4.0/node-v14.4.0-linux-$ARCH.tar.xz" | tar -C /usr/local -xJ && \
mv /usr/local/node-v14.4.0-linux-$ARCH /usr/local/node-v14.4.0
ENV PATH=/usr/local/node-v14.4.0/bin:$PATH
RUN npm install -g yarn
RUN yum groupinstall -y 'Development Tools'
RUN yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel
RUN npm config set python python2
RUN yum install -y epel-release && yum install -y jq
RUN yum install -y rsync
# Copied from ../debian8/Dockerfile
# Install Go dependencies
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')" && \
curl -fsSL "https://dl.google.com/go/go1.14.3.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
ENV GO111MODULE=on
RUN go get mvdan.cc/sh/v3/cmd/shfmt
RUN go get github.com/goreleaser/nfpm/cmd/nfpm
RUN curl -fsSL https://get.docker.com | sh

View File

@@ -43,7 +43,7 @@ RUN ARCH="$(dpkg --print-architecture)" && \
# rm -R shellcheck*
# Install Go dependencies
RUN ARCH="$(dpkg --print-architecture)" && \
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/; s/aarch64/arm64/')" && \
curl -fsSL "https://dl.google.com/go/go1.14.3.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
ENV GO111MODULE=on

View File

@@ -5,7 +5,7 @@ main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
docker build -t "codercom/code-server-$ARCH:$VERSION" -f ./ci/release-container/Dockerfile .
docker build -t "codercom/code-server-$ARCH:$VERSION" -f ./ci/release-image/Dockerfile .
}
main "$@"

View File

@@ -5,7 +5,7 @@ main() {
cd "$(dirname "$0")/../.."
source ./ci/lib.sh
./ci/release-container/build.sh
./ci/release-image/build.sh
mkdir -p release-images
docker save "codercom/code-server-$ARCH:$VERSION" > "release-images/code-server-$ARCH-$VERSION.tar"

View File

@@ -4,6 +4,11 @@ set -euo pipefail
main() {
cd "$(dirname "$0")/../.."
if [[ $OSTYPE == darwin* ]]; then
curl -L https://nodejs.org/dist/v14.4.0/node-v14.4.0-darwin-x64.tar.gz | tar -xz
PATH="$PATH:node-v14.4.0-darwin-x64/bin"
fi
# https://github.com/actions/upload-artifact/issues/38
tar -xzf release-npm-package/package.tar.gz

View File

@@ -1,5 +1,15 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# Contributing
- [Requirements](#requirements)
- [Development Workflow](#development-workflow)
- [Build](#build)
- [Structure](#structure)
- [VS Code Patch](#vs-code-patch)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
- [Detailed CI and build process docs](../ci)
## Requirements
@@ -11,7 +21,7 @@ Differences:
- We require a minimum of node v12 but later versions should work.
- We use [fnpm](https://github.com/goreleaser/nfpm) to build `.deb` and `.rpm` packages.
- We use [jq](https://stedolan.github.io/jq/) to build code-server releases.
- The [CI container](../ci/container/Dockerfile) is a useful reference for all our dependencies.
- The [CI container](../ci/images/debian8/Dockerfile) is a useful reference for all our dependencies.
## Development Workflow
@@ -25,7 +35,7 @@ yarn watch
To develop inside of an isolated docker container:
```shell
./ci/dev/container/exec.sh
./ci/dev/image/exec.sh
root@12345:/code-server# yarn
root@12345:/code-server# yarn vscode

View File

@@ -3,7 +3,9 @@
# FAQ
- [Questions?](#questions)
- [What's the deal with extensions?](#whats-the-deal-with-extensions)
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
- [Differences compared to VS Code?](#differences-compared-to-vs-code)
- [How can I request a missing extension?](#how-can-i-request-a-missing-extension)
- [Where are extensions stored?](#where-are-extensions-stored)
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
@@ -12,7 +14,6 @@
- [Sub-domains](#sub-domains)
- [Multi-tenancy](#multi-tenancy)
- [Docker in code-server container?](#docker-in-code-server-container)
- [Collaboration](#collaboration)
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
- [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 debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
@@ -21,7 +22,6 @@
- [Blank screen on iPad?](#blank-screen-on-ipad)
- [Isn't an install script piped into sh insecure?](#isnt-an-install-script-piped-into-sh-insecure)
- [How do I make my keyboard shortcuts work?](#how-do-i-make-my-keyboard-shortcuts-work)
- [Why can't I use VS Code's Remote extensions?](#why-cant-i-use-vs-codes-remote-extensions)
- [Enterprise](#enterprise)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -30,28 +30,47 @@
Please file all questions and support requests at https://www.reddit.com/r/codeserver/.
The issue tracker is **only** for bugs.
The issue tracker is **only** for bugs and features.
## What's the deal with extensions?
## How can I reuse my VS Code configuration?
Unfortunately, the Microsoft VS Code Marketplace license prohibits use with any non Microsoft
product.
The very popular [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) extension works.
See https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf
You can also pass `--data-dir ~/.vscode` to reuse your existing VS Code extensions and configuration.
Or copy `~/.vscode` into `~/.local/share/code-server`.
## Differences compared to VS Code?
`code-server` takes the open source core of VS Code and allows you to run it in the browser.
However, it is not entirely equivalent to Microsoft's VS Code.
While the core of VS Code is open source, the marketplace and many published Microsoft extensions are not.
Furthermore, Microsoft prohibits the use of any non-Microsoft VS Code from accessing their marketplace.
See the [TOS](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf).
> Marketplace Offerings are intended for use only with Visual Studio Products and Services
> and you may only install and use Marketplace Offerings with Visual Studio Products and Services.
As a result, we have created our own marketplace for open source extensions.
As a result, we cannot offer any extensions on the Microsoft marketplace. Instead,
we have created our own marketplace for open source extensions.
It works by scraping GitHub for VS Code extensions and building them. It's not perfect but getting
better by the day with more and more extensions.
Issue [#1299](https://github.com/cdr/code-server/issues/1299) is a big one in making the experience here
better by allowing the community to submit extensions and repos to avoid waiting until the scraper finds
an extension.
These are the closed source extensions presently unavailable:
To request an extension for the code-server marketplace, please open a new issue
and select the `Extension request` template.
1. [Live Share](https://visualstudio.microsoft.com/services/live-share)
- We may implement something similar, see [#33](https://github.com/cdr/code-server/issues/33)
1. [Remote Extensions (SSH, Containers, WSL)](https://github.com/microsoft/vscode-remote-release)
- We may reimplement these at some point, see [#1315](https://github.com/cdr/code-server/issues/1315)
For more about the closed source parts of VS Code, see [vscodium/vscodium](https://github.com/VSCodium/vscodium#why-does-this-exist).
## How can I request a missing extension?
Please open a new issue and select the `Extension request` template.
If an extension is not available or does not work, you can grab its VSIX from its Github releases or
build it yourself. Then run the `Extensions: Install from VSIX` command in the Command Palette and
@@ -160,12 +179,6 @@ You can even make volume mounts work. Lets say you want to run a container and m
the docker daemon's `/home/coder/myproject` is the same as the one mounted inside the `code-server`
container and the mount will just work.
## Collaboration
We understand the high demand but the team is swamped right now.
You can subscribe to [#33](https://github.com/cdr/code-server/issues/33) for updates.
## How can I disable telemetry?
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
@@ -259,16 +272,6 @@ This will install a Chrome PWA and now all keybindings will work!
For other browsers you'll have to remap keybindings unfortunately.
## Why can't I use VS Code's Remote extensions?
Unfortunately, Microsoft has opted to make [VS Code's Remote SSH and Container
extensions closed source](https://github.com/microsoft/vscode-remote-release) and
it is against their TOS to use the published extensions so we are unable to
add them to our marketplace.
We may reimplement them at some point.
You can subscribe to [#1315](https://github.com/cdr/code-server/issues/1315) for updates.
## Enterprise
Visit [our enterprise page](https://coder.com) for more information about our

View File

@@ -77,8 +77,8 @@ commands presented in the rest of this document.
## Debian, Ubuntu
```bash
curl -fOL https://github.com/cdr/code-server/releases/download/v3.4.0/code-server_3.4.0_amd64.deb
sudo dpkg -i code-server_3.4.0_amd64.deb
curl -fOL https://github.com/cdr/code-server/releases/download/v3.4.1/code-server_3.4.1_amd64.deb
sudo dpkg -i code-server_3.4.1_amd64.deb
systemctl --user enable --now code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
@@ -86,8 +86,8 @@ systemctl --user enable --now code-server
## Fedora, CentOS, RHEL, SUSE
```bash
curl -fOL https://github.com/cdr/code-server/releases/download/v3.4.0/code-server-3.4.0-amd64.rpm
sudo rpm -i code-server-3.4.0-amd64.rpm
curl -fOL https://github.com/cdr/code-server/releases/download/v3.4.1/code-server-3.4.1-amd64.rpm
sudo rpm -i code-server-3.4.1-amd64.rpm
systemctl --user enable --now code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
```
@@ -115,7 +115,7 @@ systemctl --user enable --now code-server
We recommend installing with `yarn` or `npm` when:
1. You aren't on `amd64` or `arm64`.
2. If you're on Linux with glibc < v2.17
2. If you're on Linux with glibc < v2.17 or glibcxx < v3.4.18
**note:** Installing via `yarn` or `npm` builds native modules on install and so requires C dependencies.
See [./npm.md](./npm.md) for installing these dependencies.
@@ -143,7 +143,7 @@ We publish self contained `.tar.gz` archives for every release on [github](https
They bundle the node binary and `node_modules`.
These are created from the [npm package](#yarn-npm) and the rest of the releases are created from these.
Only requirement is glibc >= 2.17 on Linux and for macOS there is no minimum system requirement.
Only requirement is glibc >= 2.17 && glibcxx >= v3.4.18 on Linux and for macOS there is no minimum system requirement.
1. Download the latest release archive for your system from [github](https://github.com/cdr/code-server/releases).
2. Unpack the release.
@@ -156,10 +156,10 @@ Here is an example script for installing and using a standalone `code-server` re
```bash
mkdir -p ~/.local/lib ~/.local/bin
curl -fL https://github.com/cdr/code-server/releases/download/v3.4.0/code-server-3.4.0-linux-amd64.tar.gz \
curl -fL https://github.com/cdr/code-server/releases/download/v3.4.1/code-server-3.4.1-linux-amd64.tar.gz \
| tar -C ~/.local/lib -xz
mv ~/.local/lib/code-server-3.4.0-linux-amd64 ~/.local/lib/code-server-3.4.0
ln -s ~/.local/lib/code-server-3.4.0/bin/code-server ~/.local/bin/code-server
mv ~/.local/lib/code-server-3.4.1-linux-amd64 ~/.local/lib/code-server-3.4.1
ln -s ~/.local/lib/code-server-3.4.1/bin/code-server ~/.local/bin/code-server
PATH="~/.local/bin:$PATH"
code-server
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml

View File

@@ -1,5 +1,13 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# npm Install Requirements
- [Ubuntu, Debian](#ubuntu-debian)
- [Fedora, CentOS, RHEL](#fedora-centos-rhel)
- [macOS](#macos)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
If you're installing the npm module you'll need certain dependencies to build
the native modules used by VS Code.
@@ -20,7 +28,7 @@ sudo apt-get install -y \
```bash
sudo yum groupinstall -y 'Development Tools'
sudo yum config-manager --set-enabled PowerTools
sudo yum config-manager --set-enabled PowerTools # unnecessary on CentOS 7
sudo yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel
npm config set python python2
```

View File

@@ -62,7 +62,8 @@ EOF
echo_latest_version() {
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/cdr/code-server/releases/latest)"
version="${version#https://github.com/cdr/code-server/releases/tag/v}"
version="${version#https://github.com/cdr/code-server/releases/tag/}"
version="${version#v}"
echo "$version"
}
@@ -298,7 +299,7 @@ install_aur() {
}
install_standalone() {
echoh "Installing standalone release archive v$VERSION"
echoh "Installing standalone release archive v$VERSION from GitHub releases."
echoh
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-$OS-$ARCH.tar.gz" \

View File

@@ -1,7 +1,7 @@
{
"name": "code-server",
"license": "MIT",
"version": "3.4.0",
"version": "3.4.1",
"description": "Run VS Code on a remote server.",
"homepage": "https://github.com/cdr/code-server",
"bugs": {
@@ -30,7 +30,6 @@
},
"main": "out/node/entry.js",
"devDependencies": {
"@types/adm-zip": "^0.4.32",
"@types/fs-extra": "^8.0.1",
"@types/http-proxy": "^1.17.4",
"@types/js-yaml": "^3.12.3",
@@ -66,7 +65,6 @@
},
"dependencies": {
"@coder/logger": "1.1.11",
"adm-zip": "^0.4.14",
"env-paths": "^2.2.0",
"fs-extra": "^8.1.0",
"http-proxy": "^1.18.0",

View File

@@ -1,5 +1,4 @@
import { field, logger } from "@coder/logger"
import zip from "adm-zip"
import * as cp from "child_process"
import * as fs from "fs-extra"
import * as http from "http"
@@ -213,11 +212,7 @@ export class UpdateHttpProvider extends HttpProvider {
const response = await this.requestResponse(url)
try {
if (downloadPath.endsWith(".tar.gz")) {
downloadPath = await this.extractTar(response, downloadPath)
} else {
downloadPath = await this.extractZip(response, downloadPath)
}
downloadPath = await this.extractTar(response, downloadPath)
logger.debug("Downloaded update", field("path", downloadPath))
// The archive should have a directory inside at the top level with the
@@ -275,40 +270,6 @@ export class UpdateHttpProvider extends HttpProvider {
return downloadPath
}
private async extractZip(response: Readable, downloadPath: string): Promise<string> {
logger.debug("Downloading zip", field("path", downloadPath))
response.pause()
await fs.remove(downloadPath)
const write = fs.createWriteStream(downloadPath)
response.pipe(write)
response.on("error", (error) => write.destroy(error))
response.on("close", () => write.end())
await new Promise((resolve, reject) => {
write.on("error", reject)
write.on("close", resolve)
response.resume
})
const zipPath = downloadPath
downloadPath = downloadPath.replace(/\.zip$/, "")
await fs.remove(downloadPath)
logger.debug("Extracting zip", field("path", zipPath))
await new Promise((resolve, reject) => {
new zip(zipPath).extractAllToAsync(downloadPath, true, (error) => {
return error ? reject(error) : resolve()
})
})
await fs.remove(zipPath)
return downloadPath
}
/**
* Given an update return the name for the packaged archived.
*/
@@ -329,7 +290,7 @@ export class UpdateHttpProvider extends HttpProvider {
if (arch === "x64") {
arch = "x86_64"
}
return `code-server-${update.version}-${target}-${arch}.${target === "darwin" ? "zip" : "tar.gz"}`
return `code-server-${update.version}-${target}-${arch}.tar.gz`
}
private async request(uri: string): Promise<Buffer> {

View File

@@ -348,7 +348,9 @@ export async function readConfigFile(configPath?: string): Promise<Args> {
logger.info(`Wrote default config file to ${humanPath(configPath)}`)
}
logger.info(`Using config file ${humanPath(configPath)}`)
if (!process.env.CODE_SERVER_PARENT_PID) {
logger.info(`Using config file ${humanPath(configPath)}`)
}
const configFile = await fs.readFile(configPath)
const config = yaml.safeLoad(configFile.toString(), {

View File

@@ -31,11 +31,7 @@ try {
const version = pkg.version || "development"
const commit = pkg.commit || "development"
const main = async (cliArgs: Args): Promise<void> => {
const configArgs = await readConfigFile(cliArgs.config)
// This prioritizes the flags set in args over the ones in the config file.
let args = Object.assign(configArgs, cliArgs)
const main = async (args: Args, cliArgs: Args, configArgs: Args): Promise<void> => {
if (!args.auth) {
args = {
...args,
@@ -127,18 +123,21 @@ const main = async (cliArgs: Args): Promise<void> => {
}
async function entry(): Promise<void> {
const tryParse = async (): Promise<Args> => {
const tryParse = async (): Promise<[Args, Args, Args]> => {
try {
let args = parse(process.argv.slice(2))
const cliArgs = parse(process.argv.slice(2))
const configArgs = await readConfigFile(cliArgs.config)
// This prioritizes the flags set in args over the ones in the config file.
let args = Object.assign(configArgs, cliArgs)
args = await setDefaults(args)
return args
return [args, cliArgs, configArgs]
} catch (error) {
console.error(error.message)
process.exit(1)
}
}
const args = await tryParse()
const [args, cliArgs, configArgs] = await tryParse()
if (args.help) {
console.log("code-server", version, commit)
console.log("")
@@ -182,7 +181,7 @@ async function entry(): Promise<void> {
})
vscode.on("exit", (code) => process.exit(code || 0))
} else {
wrap(() => main(args))
wrap(() => main(args, cliArgs, configArgs))
}
}

View File

@@ -1,8 +1,6 @@
import zip from "adm-zip"
import * as assert from "assert"
import * as fs from "fs-extra"
import * as http from "http"
import * as os from "os"
import * as path from "path"
import * as tar from "tar-fs"
import * as zlib from "zlib"
@@ -88,28 +86,18 @@ describe("update", () => {
fs.writeFile(path.join(archivePath, archiveName, "node"), `NODE BINARY`),
])
if (os.platform() === "darwin") {
await new Promise((resolve, reject) => {
const zipFile = new zip()
zipFile.addLocalFolder(archivePath)
zipFile.writeZip(archivePath + ".zip", (error) => {
return error ? reject(error) : resolve(error)
})
await new Promise((resolve, reject) => {
const write = fs.createWriteStream(archivePath + ".tar.gz")
const compress = zlib.createGzip()
compress.pipe(write)
compress.on("error", (error) => compress.destroy(error))
compress.on("close", () => write.end())
tar.pack(archivePath).pipe(compress)
write.on("close", reject)
write.on("finish", () => {
resolve()
})
} else {
await new Promise((resolve, reject) => {
const write = fs.createWriteStream(archivePath + ".tar.gz")
const compress = zlib.createGzip()
compress.pipe(write)
compress.on("error", (error) => compress.destroy(error))
compress.on("close", () => write.end())
tar.pack(archivePath).pipe(compress)
write.on("close", reject)
write.on("finish", () => {
resolve()
})
})
}
})
})
after(() => {

View File

@@ -910,13 +910,6 @@
traverse "^0.6.6"
unified "^6.1.6"
"@types/adm-zip@^0.4.32":
version "0.4.33"
resolved "https://registry.yarnpkg.com/@types/adm-zip/-/adm-zip-0.4.33.tgz#ea5b94f771443f655613b64f920c0555867200dd"
integrity sha512-WM0DCWFLjXtddl0fu0+iN2ZF+qz8RF9RddG5OSy/S90AQz01Fu8lHn/3oTIZDxvG8gVcnBLAHMHOdBLbV6m6Mw==
dependencies:
"@types/node" "*"
"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@@ -1130,11 +1123,6 @@ acorn@^7.1.1:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf"
integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==
adm-zip@^0.4.14:
version "0.4.14"
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.14.tgz#2cf312bcc9f8875df835b0f6040bd89be0a727a9"
integrity sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==
ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5:
version "6.12.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd"