Skip to content

Commit 1c39dff

Browse files
authored
Merge pull request #1 from cdr/master
Update master
2 parents f25a614 + bb46e80 commit 1c39dff

File tree

310 files changed

+5752
-39614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+5752
-39614
lines changed

.dockerignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
Dockerfile
2-
# Docs
3-
doc/
4-
# GitHub stuff
2+
build
3+
deployment
4+
doc
55
.github
66
.gitignore
7+
.node-version
78
.travis.yml
89
LICENSE
910
README.md
1011
node_modules
12+
release

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/lib
21
node_modules
3-
dist
4-
out
5-
.DS_Store
2+
build
63
release
7-
.vscode
8-
.cache

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.15.1
1+
10.16.0

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
scripts-prepend-node-path=true

.travis.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
language: node_js
22
node_js:
3-
- 10.15.1
3+
- 10.16.0
44
services:
55
- docker
66
matrix:
77
include:
88
- os: linux
99
dist: trusty
1010
env:
11-
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION" TARGET="centos"
11+
- VSCODE_VERSION="1.38.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="linux"
1212
- os: linux
1313
dist: trusty
1414
env:
15-
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION" TARGET="alpine"
15+
- VSCODE_VERSION="1.38.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER" TARGET="alpine"
1616
- os: osx
1717
env:
18-
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
18+
- VSCODE_VERSION="1.38.1" MAJOR_VERSION="2" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER"
1919
before_install:
20-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libxkbfile-dev
21-
libsecret-1-dev; fi
22-
- npm install -g [email protected]
20+
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export MINIFY="true"; fi
21+
- if [[ "$TRAVIS_BRANCH" == "master" ]]; then export PACKAGE="true"; fi
2322
script:
24-
- scripts/build.sh
23+
- travis_wait 30 scripts/ci.bash
2524
before_deploy:
26-
- echo "$VERSION" "$TRAVIS_COMMIT"
25+
- echo "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
2726
- git config --local user.name "$USER_NAME"
2827
- git config --local user.email "$USER_EMAIL"
29-
- git tag "$VERSION" "$TRAVIS_COMMIT"
28+
- git tag "$VERSION-vsc$VSCODE_VERSION" "$TRAVIS_COMMIT"
3029
deploy:
3130
provider: releases
3231
file_glob: true
3332
draft: true
34-
tag_name: "$VERSION"
33+
tag_name: "$VERSION-vsc$VSCODE_VERSION"
3534
target_commitish: "$TRAVIS_COMMIT"
36-
name: "$VERSION"
35+
name: "$VERSION-vsc$VSCODE_VERSION"
3736
skip_cleanup: true
3837
api_key:
3938
secure: YL/x24KjYjgYXPcJWk3FV7FGxI79Mh6gBECQEcdlf3fkLEoKFVgzHBoUNWrFPzyR4tgLyWNAgcpD9Lkme1TRWTom7UPjXcwMNyLcLa+uec7ciSAnYD9ntLTpiCuPDD1u0LtRGclSi/EHQ+F8YVq+HZJpXTsJeAmOmihma3GVbGKSZr+BRum+0YZSG4w+o4TOlYzw/4bLWS52MogZcwpjd+hemBbgXLuGU2ziKv2vEKCZFbEeA16II4x1WLI4mutDdCeh7+3aLzGLwDa49NxtsVYNjyNFF75JhCTCNA55e2YMiLz9Uq69IXe/mi5F7xUaFfhIqqLNyKBnKeEOzu3dYnc+8n3LjnQ+00PmkF05nx9kBn3UfV1kwQGh6QbyDmTtBP07rtUMyI14aeQqHjxsaVRdMnwj9Q2DjXRr8UDqESZF0rmK3pHCXS2fBhIzLE8tLVW5Heiba2pQRFMHMZW+KBE97FzcFh7is90Ait3T8enfcd/PWFPYoBejDAdjwxwOkezh5N5ZkYquEfDYuWrFi6zRFCktsruaAcA+xGtTf9oilBBzUqu8Ie+YFWH5me83xakcblJWdaW/D2rLJAJH3m6LFm8lBqyUgDX5t/etob6CpDuYHu5D1J3XINOj/+aLAcadq6qlh70PMZS3zYffUu3JlzaD2amlSHIT8b5YXFc=

Dockerfile

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM node:10.15.1
1+
FROM node:10.16.0
2+
ARG codeServerVersion=docker
3+
ARG vscodeVersion
24

35
# Install VS Code's deps. These are the only two it seems we need.
46
RUN apt-get update && apt-get install -y \
@@ -11,9 +13,12 @@ RUN npm install -g [email protected]
1113
WORKDIR /src
1214
COPY . .
1315

14-
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules
15-
# directly which should be fast as it is slow because it populates its own cache every time.
16-
RUN yarn && NODE_ENV=production yarn task build:server:binary
16+
RUN yarn \
17+
&& MINIFY=true yarn build "${vscodeVersion}" "${codeServerVersion}" \
18+
&& yarn binary "${vscodeVersion}" "${codeServerVersion}" \
19+
&& mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64-built/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x86_64" /src/build/code-server \
20+
&& rm -r /src/build/vscode-* \
21+
&& rm -r /src/build/code-server*-linux-*
1722

1823
# We deploy with ubuntu so that devs have a familiar environment.
1924
FROM ubuntu:18.04
@@ -30,24 +35,25 @@ RUN apt-get update && apt-get install -y \
3035
wget
3136

3237
RUN locale-gen en_US.UTF-8
33-
# We unfortunately cannot use update-locale because docker will not use the env variables
38+
# We cannot use update-locale because docker will not use the env variables
3439
# configured in /etc/default/locale so we need to set it manually.
3540
ENV LC_ALL=en_US.UTF-8
3641

3742
RUN adduser --gecos '' --disabled-password coder && \
3843
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
3944

4045
USER coder
41-
# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
46+
# We create first instead of just using WORKDIR as when WORKDIR creates, the
47+
# user is root.
4248
RUN mkdir -p /home/coder/project
4349

4450
WORKDIR /home/coder/project
4551

46-
# This assures we have a volume mounted even if the user forgot to do bind mount.
47-
# So that they do not lose their data if they delete the container.
52+
# This ensures we have a volume mounted even if the user forgot to do bind
53+
# mount. So that they do not lose their data if they delete the container.
4854
VOLUME [ "/home/coder/project" ]
4955

50-
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
51-
EXPOSE 8443
56+
COPY --from=0 /src/build/code-server /usr/local/bin/code-server
57+
EXPOSE 8080
5258

53-
ENTRYPOINT ["dumb-init", "code-server"]
59+
ENTRYPOINT ["dumb-init", "code-server", "--host", "0.0.0.0"]

README.md

Lines changed: 98 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,134 @@
1-
# code-server
1+
# code-server · [![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/cdr/code-server/blob/master/LICENSE) [!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest) [![Build Status](https://img.shields.io/travis/com/cdr/code-server/master)](https://github.com/cdr/code-server)
22

3-
[!["Open Issues"](https://img.shields.io/github/issues-raw/cdr/code-server.svg)](https://github.com/cdr/code-server/issues)
4-
[!["Latest Release"](https://img.shields.io/github/release/cdr/code-server.svg)](https://github.com/cdr/code-server/releases/latest)
5-
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cdr/code-server/blob/master/LICENSE)
6-
[![Discord](https://img.shields.io/discord/463752820026376202.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/zxSwN8Z)
7-
8-
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser.
3+
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a
4+
remote server, accessible through the browser.
95

106
Try it out:
117
```bash
12-
docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth
8+
docker run -it -p 127.0.0.1:8080:8080 -v "${HOME}/.local/share/code-server:/home/coder/.local/share/code-server" -v "$PWD:/home/coder/project" codercom/code-server
139
```
1410

15-
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
16-
- If you have a Windows or Mac workstation, more easily develop for Linux.
17-
- Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
18-
- Preserve battery life when you're on the go.
19-
- All intensive computation runs on your server.
20-
- You're no longer running excess instances of Chrome.
11+
- **Consistent environment:** Code on your Chromebook, tablet, and laptop with a
12+
consistent dev environment. develop more easily for Linux if you have a
13+
Windows or Mac, and pick up where you left off when switching workstations.
14+
- **Server-powered:** Take advantage of large cloud servers to speed up tests,
15+
compilations, downloads, and more. Preserve battery life when you're on the go
16+
since all intensive computation runs on your server.
2117

22-
![Screenshot](/doc/assets/ide.png)
18+
![Screenshot](/doc/assets/ide.gif)
2319

2420
## Getting Started
25-
2621
### Run over SSH
27-
2822
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
2923

3024
### Docker
25+
See the Docker one-liner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
3126

32-
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
33-
34-
### Binaries
35-
36-
1. [Download a binary](https://github.com/cdr/code-server/releases) (Linux and OS X supported. Windows coming soon)
37-
2. Start the binary with the project directory as the first argument
38-
39-
```
40-
code-server <initial directory to open>
41-
```
42-
> You will be prompted to enter the password shown in the CLI
43-
`code-server` should now be running at https://localhost:8443.
44-
45-
> code-server uses a self-signed SSL certificate that may prompt your browser to ask you some additional questions before you proceed. Please [read here](doc/self-hosted/index.md) for more information.
46-
47-
For detailed instructions and troubleshooting, see the [self-hosted quick start guide](doc/self-hosted/index.md).
48-
49-
Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md), [AWS](doc/admin/install/aws.md), and [DigitalOcean](doc/admin/install/digitalocean.md).
27+
To debug Golang using the
28+
[ms-vscode-go extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go),
29+
you need to add `--security-opt seccomp=unconfined` to your `docker run`
30+
arguments when launching code-server with Docker. See
31+
[#725](https://github.com/cdr/code-server/issues/725) for details.
5032

51-
How to [secure your setup](/doc/security/ssl.md).
52-
53-
## Development
54-
55-
### Known Issues
33+
### Digital Ocean
34+
[![Create a Droplet](./doc/assets/droplet.svg)](https://marketplace.digitalocean.com/apps/code-server?action=deploy)
5635

36+
### Binaries
37+
1. [Download a binary](https://github.com/cdr/code-server/releases). (Linux and
38+
OS X supported. Windows coming soon)
39+
2. Unpack the downloaded file then run the binary.
40+
3. In your browser navigate to `localhost:8080`.
41+
42+
- For self-hosting and other information see [doc/quickstart.md](doc/quickstart.md).
43+
- For hosting on cloud platforms see [doc/deploy.md](doc/deploy.md).
44+
45+
### Build
46+
- If you also plan on developing, set the `OUT` environment variable. Otherwise
47+
it will build in this directory which will cause issues because `yarn watch`
48+
will try to compile the build directory as well.
49+
- Run `yarn build ${vscodeVersion} ${codeServerVersion}` in this directory (for
50+
example: `yarn build 1.36.0 development`).
51+
- If you target the same VS Code version our Travis builds do everything will
52+
work but if you target some other version it might not (we have to do some
53+
patching to VS Code so different versions aren't always compatible).
54+
- You can run the built code with `node path/to/build/out/vs/server/main.js` or run
55+
`yarn binary` with the same arguments in the previous step to package the
56+
code into a single binary.
57+
58+
## Known Issues
5759
- Creating custom VS Code extensions and debugging them doesn't work.
58-
- To debug Golang using [ms-vscode-go extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go), you need to add `--security-opt seccomp=unconfined` to your `docker run` arguments when launching code-server with Docker. See [#725](https://github.com/cdr/code-server/issues/725) for details.
60+
- Extension profiling and tips are currently disabled.
5961

60-
### Future
62+
## Future
6163
- **Stay up to date!** Get notified about new releases of code-server.
6264
![Screenshot](/doc/assets/release.gif)
6365
- Windows support.
6466
- Electron and Chrome OS applications to bridge the gap between local<->remote.
6567
- Run VS Code unit tests against our builds to ensure features work as expected.
6668

67-
### Extensions
68-
69-
At the moment we can't use the official VSCode Marketplace. We've created a custom extension marketplace focused around open-sourced extensions. However, if you have access to the `.vsix` file, you can manually install the extension.
69+
## Extensions
70+
At the moment we can't use the official VS Code Marketplace. We've created a
71+
custom extension marketplace focused around open-sourced extensions. However,
72+
you can manually download the extension to your extensions directory. It's also
73+
possible to set your own marketplace URLs by setting the `SERVICE_URL` and
74+
`ITEM_URL` environment variables.
7075

7176
## Telemetry
72-
73-
Use the `--disable-telemetry` flag or set `DISABLE_TELEMETRY=true` to disable tracking ENTIRELY.
74-
75-
We use data collected to improve code-server.
77+
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
78+
data collected to improve code-server.
7679

7780
## Contributing
81+
### Development
82+
```shell
83+
git clone https://github.com/microsoft/vscode
84+
cd vscode
85+
git checkout <see travis.yml for the VS Code version to use here>
86+
git clone https://github.com/cdr/code-server src/vs/server
87+
cd src/vs/server
88+
yarn patch:apply
89+
yarn
90+
yarn watch
91+
# Wait for the initial compilation to complete (it will say "Finished compilation").
92+
# Run the next command in another shell.
93+
yarn start
94+
# Visit http://localhost:8080
95+
```
7896

79-
Development guides are coming soon.
97+
If you run into issues about a different version of Node being used, try running
98+
`npm rebuild` in the VS Code directory and ignore the error at the end from
99+
`vscode-ripgrep`.
100+
101+
### Upgrading VS Code
102+
We patch VS Code to provide and fix some functionality. As the web portion of VS
103+
Code matures, we'll be able to shrink and maybe even entirely eliminate our
104+
patch. In the meantime, however, upgrading the VS Code version requires ensuring
105+
that the patch still applies and has the intended effects.
106+
107+
To generate a new patch, **stage all the changes** you want to be included in
108+
the patch in the VS Code source, then run `yarn patch:generate` in this
109+
directory.
110+
111+
Our changes include:
112+
- Change the remote schema to `code-server`.
113+
- Allow multiple extension directories (both user and built-in).
114+
- Modify the loader, websocket, webview, service worker, and asset requests to
115+
use the URL of the page as a base (and TLS if necessary for the websocket).
116+
- Send client-side telemetry through the server and get the initial log level
117+
from the server.
118+
- Add an upload service for use in editor windows and the explorer along with a
119+
file prefix to ignore for temporary files created during upload.
120+
- Make changing the display language work.
121+
- Make hiding or toggling the menu bar possible.
122+
- Make it possible for us to load code on the client.
123+
- Modify the build process to include our code.
80124

81125
## License
82-
83126
[MIT](LICENSE)
84127

85128
## Enterprise
86-
87-
Visit [our enterprise page](https://coder.com/enterprise) for more information about our enterprise offering.
129+
Visit [our enterprise page](https://coder.com/enterprise) for more information
130+
about our enterprise offering.
88131

89132
## Commercialization
90-
91-
If you would like to commercialize code-server, please contact [email protected].
133+
If you would like to commercialize code-server, please contact
134+

build/platform.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)