Skip to content

Commit 76831f1

Browse files
committed
Merge branch 'fix-ci' into restructure
2 parents 46d6e17 + b6aa0cb commit 76831f1

File tree

15 files changed

+127
-142
lines changed

15 files changed

+127
-142
lines changed

.stylelintrc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
extends:
2-
- stylelint-config-standard
2+
- stylelint-config-recommended

.travis.yml

+6-17
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,26 @@ language: minimal
22

33
jobs:
44
include:
5-
- stage: Code
6-
name: Format
7-
script: ./ci/image/run.sh "yarn && yarn vscode && yarn fmt"
8-
- name: Lint
9-
script: ./ci/image/run.sh "yarn && yarn vscode && yarn lint"
105
- name: Test
11-
script: ./ci/image/run.sh "yarn && yarn vscode && yarn test"
12-
13-
- stage: Release
14-
name: Linux Release
6+
script: ./ci/image/run.sh "yarn && yarn vscode && ./ci/ci.sh"
7+
deploy: null
8+
- name: Linux Release
9+
if: tag IS present
1510
script:
1611
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
1712
- ./ci/release-image/push.sh
1813
- name: Linux ARM64 Release
14+
if: tag IS present
1915
script:
2016
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
2117
- ./ci/release-image/push.sh
2218
arch: arm64
2319
- name: MacOS Release
20+
if: tag IS present
2421
os: osx
2522
language: node_js
2623
node_js: 12
2724
script: yarn && yarn vscode && travis_wait 60 ci/release.sh
28-
- name: Docker Release
29-
script: ./ci/release-image/push.sh
30-
31-
stages:
32-
- name: Code
33-
- name: Release
34-
if: env(TRAVIS_TAG) IS present
3525

3626
deploy:
3727
- provider: releases
@@ -45,7 +35,6 @@ deploy:
4535
- release/*.zip
4636
on:
4737
tags: true
48-
condition: $TRAVIS_BUILD_STAGE_NAME == Release
4938

5039
cache:
5140
timeout: 600

README.md

+5-91
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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)
1+
# code-server
22

33
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a
44
remote server, accessible through the browser.
@@ -16,12 +16,7 @@ docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" codercom/cod
1616
compilations, downloads, and more. Preserve battery life when you're on the go
1717
since all intensive computation runs on your server.
1818

19-
![Screenshot](/doc/assets/ide.gif)
20-
21-
## VS Code
22-
23-
- See [our VS Code readme](./src/vscode) for more information about how
24-
code-server and VS Code work together.
19+
![Example gif](/doc/assets/ide.gif)
2520

2621
## Getting Started
2722

@@ -33,16 +28,11 @@ docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" codercom/cod
3328
- Secure connection over HTTPS or localhost (required for service workers and
3429
clipboard support).
3530
- For Linux: GLIBC 2.17 or later and GLIBCXX 3.4.15 or later.
36-
- Docker (for Docker versions of `code-server`).
3731

3832
### Run over SSH
3933

4034
Use [sshcode](https://github.com/codercom/sshcode) for a simple setup.
4135

42-
### Docker
43-
44-
See the Docker one-liner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).
45-
4636
### Digital Ocean
4737

4838
[![Create a Droplet](./doc/assets/droplet.svg)](https://marketplace.digitalocean.com/apps/code-server?action=deploy)
@@ -57,87 +47,11 @@ See the Docker one-liner mentioned above. Dockerfile is at [/Dockerfile](/Docker
5747
- For self-hosting and other information see [doc/quickstart.md](doc/quickstart.md).
5848
- For hosting on cloud platforms see [doc/deploy.md](doc/deploy.md).
5949

60-
### Build
61-
62-
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
63-
64-
```shell
65-
yarn
66-
yarn build
67-
node build/out/entry.js # You can run the built JavaScript with Node.
68-
yarn binary # Or you can package it into a binary.
69-
```
70-
71-
If changes are made to the patch and you've built previously you must manually
72-
reset VS Code then run `yarn patch:apply`.
73-
74-
## Security
75-
76-
### Authentication
77-
78-
By default `code-server` enables password authentication using a randomly
79-
generated password. You can set the `PASSWORD` environment variable to use your
80-
own instead or use `--auth none` to disable password authentication.
81-
82-
Do not expose `code-server` to the open internet without some form of
83-
authentication.
84-
85-
### Encrypting traffic with HTTPS
86-
87-
If you aren't doing SSL termination elsewhere you can directly give
88-
`code-server` a certificate with `code-server --cert` followed by the path to
89-
your certificate. Additionally, you can use certificate keys with `--cert-key`
90-
followed by the path to your key. If you pass `--cert` without any path
91-
`code-server` will generate a self-signed certificate.
92-
93-
If `code-server` has been passed a certificate it will also respond to HTTPS
94-
requests and will redirect all HTTP requests to HTTPS. Otherwise it will respond
95-
only to HTTP requests.
96-
97-
You can use [Let's Encrypt](https://letsencrypt.org/) to get an SSL certificate
98-
for free.
50+
## FAQ
9951

100-
Do not expose `code-server` to the open internet without SSL, whether built-in
101-
or through a proxy.
102-
103-
## Future
104-
105-
- **Stay up to date!** Get notified about new releases of `code-server`.
106-
![Screenshot](/doc/assets/release.gif)
107-
- Electron and Chrome OS applications to bridge the gap between local<->remote.
108-
109-
## Telemetry
110-
111-
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
112-
data collected to improve code-server.
113-
114-
## Contributing
115-
116-
### Development
117-
118-
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
119-
120-
```shell
121-
yarn
122-
yarn watch # Visit http://localhost:8080 once completed.
123-
```
124-
125-
If you run into issues about a different version of Node being used, try running
126-
`npm rebuild` in the VS Code directory.
127-
128-
If changes are made to the patch and you've built previously you must manually
129-
reset VS Code then run `yarn patch:apply`.
130-
131-
## License
132-
133-
[MIT](LICENSE)
52+
See [./doc/FAQ.md](./doc/FAQ.md).
13453

13554
## Enterprise
13655

13756
Visit [our enterprise page](https://coder.com) for more information about our
138-
enterprise offering.
139-
140-
## Commercialization
141-
142-
If you would like to commercialize code-server, please contact
143-
57+
enterprise offerings.

ci/ci.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
main() {
5+
cd "$(dirname "$0")/.."
6+
7+
yarn fmt
8+
yarn lint
9+
yarn test
10+
}
11+
12+
main "$@"

ci/image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12
1+
FROM node:12.14.0
22

33
RUN apt-get update && apt-get install -y \
44
libxkbfile-dev \

ci/lib.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
set_version() {
5+
local code_server_version=${VERSION:-${TRAVIS_TAG:-}}
6+
if [[ -z $code_server_version ]]; then
7+
code_server_version=$(grep version ./package.json | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[:space:]')
8+
fi
9+
export VERSION=$code_server_version
10+
}

ci/lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -euo pipefail
44

55
main() {
66
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js")
7-
stylelint --fix $(git ls-files "*.css")
7+
stylelint $(git ls-files "*.css")
88
tsc --noEmit
99
}
1010

ci/release-image/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ RUN rm -rf /var/lib/apt/lists/*
3333
EXPOSE 8080
3434
USER coder
3535
WORKDIR /home/coder
36-
ENTRYPOINT ["dumb-init", "fixuid", "-q", "code-server", "--host", "0.0.0.0"]
36+
ENTRYPOINT ["dumb-init", "fixuid", "-q", "code-server", "--host=0.0.0.0", "--auth=none"]

ci/release-image/push.sh

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ set -euo pipefail
44

55
main() {
66
cd "$(dirname "$0")/../.."
7+
soruce ./ci/lib.sh
8+
set_version
79

810
if [[ ${CI:-} ]]; then
911
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin

ci/release.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ set -euo pipefail
66
# This script assumes that yarn has already ran.
77
function main() {
88
cd "$(dirname "${0}")/.."
9+
source ./ci/lib.sh
910

10-
local code_server_version=${VERSION:-${TRAVIS_TAG:-}}
11-
if [[ -z $code_server_version ]]; then
12-
code_server_version=$(grep version ./package.json | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[:space:]')
13-
fi
14-
export VERSION=$code_server_version
11+
set_version
1512

1613
# Always minify and package on CI since that's when releases are pushed.
1714
if [[ ${CI:-} ]]; then

doc/CONTRIBUTING.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing
2+
3+
## Development Workflow
4+
5+
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
6+
7+
```shell
8+
yarn
9+
yarn vscode
10+
yarn watch # Visit http://localhost:8080 once completed.
11+
```
12+
13+
Any changes made to the source will be live reloaded.
14+
15+
If you run into issues about a different version of Node being used, try running
16+
`npm rebuild` in the VS Code directory.
17+
18+
If changes are made to the patch and you've built previously you must manually
19+
reset VS Code then run `yarn vscode:patch`.
20+
21+
Some docs are available at [../src/node/app](../src/node/app) on how code-server
22+
works internally.
23+
24+
## Build
25+
26+
- [VS Code prerequisites](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites)
27+
28+
```shell
29+
yarn
30+
yarn build
31+
node build/out/entry.js # You can run the built JavaScript with Node.
32+
yarn binary # Or you can package it into a binary.
33+
```

doc/FAQ.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# FAQ
2+
3+
## What's the deal with extensions?
4+
5+
Unfortunately, the Microsoft VS Code Marketplace is
6+
7+
## How is this different from VS Code Online?
8+
9+
VS Code Online is a closed source managed service by Microsoft and only runs on Azure.
10+
11+
code-server is open source and can be freely ran on any machine.
12+
13+
## How should I expose code-server to the internet?
14+
15+
By far the most secure method of using code-server is via
16+
[sshcode](https://github.com/codercom/sshcode) as it runs code-server and then forwards
17+
its port over SSH and requires no setup on your part other than having a working SSH server.
18+
19+
If you cannot use sshcode, then you will need to ensure there is some sort of authorization in
20+
front of code-server and that you are using HTTPS to secure all connections.
21+
22+
By default when listening externally, code-server enables password authentication using a
23+
randomly generated password so you can use that. You can set the `PASSWORD` environment variable
24+
to use your own instead. If you want to handle authentication yourself, use `--auth none`
25+
to disable password authentication.
26+
27+
For HTTPS, you can use a self signed certificate by passing in just `--cert` or pass in an existing
28+
certificate by providing the path to `--cert` and the path to its key with `--cert-key`.
29+
30+
If `code-server` has been passed a certificate it will also respond to HTTPS
31+
requests and will redirect all HTTP requests to HTTPS. Otherwise it will respond
32+
only to HTTP requests.
33+
34+
You can use [Let's Encrypt](https://letsencrypt.org/) to get an SSL certificate
35+
for free.
36+
37+
## Why are there x86 releases?
38+
39+
32 bit releases have been
40+
41+
## Multi Tenancy
42+
43+
If you want to run multiple code-server's on shared infrastructure, we recommend using
44+
something like kubernetes and the code-server docker image.
45+
46+
## How can I disable telemetry?
47+
48+
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
49+
data collected only to improve code-server.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"parcel-bundler": "^1.12.4",
4040
"prettier": "^1.18.2",
4141
"stylelint": "^13.0.0",
42-
"stylelint-config-standard": "^19.0.0",
42+
"stylelint-config-recommended": "^3.0.0",
4343
"ts-node": "^8.4.1",
4444
"typescript": "3.7.2"
4545
},

src/browser/pages/global.css

+2-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,8 @@ body {
1010
background: #272727;
1111
color: #f4f4f4;
1212
margin: 0;
13-
font-family:
14-
-apple-system,
15-
BlinkMacSystemFont,
16-
"Segoe UI",
17-
Roboto,
18-
Helvetica,
19-
Arial,
20-
sans-serif,
21-
"Apple Color Emoji",
22-
"Segoe UI Emoji",
23-
"Segoe UI Symbol";
13+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
14+
"Segoe UI Emoji", "Segoe UI Symbol";
2415
overflow: hidden;
2516
}
2617

yarn.lock

+1-13
Original file line numberDiff line numberDiff line change
@@ -1848,12 +1848,7 @@ chokidar@^2.1.5:
18481848
optionalDependencies:
18491849
fsevents "^1.2.7"
18501850

1851-
chownr@^1.1.1:
1852-
version "1.1.4"
1853-
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
1854-
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
1855-
1856-
chownr@^1.1.3:
1851+
chownr@^1.1.1, chownr@^1.1.3:
18571852
version "1.1.4"
18581853
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
18591854
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
@@ -6847,13 +6842,6 @@ stylelint-config-recommended@^3.0.0:
68476842
resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-3.0.0.tgz#e0e547434016c5539fe2650afd58049a2fd1d657"
68486843
integrity sha512-F6yTRuc06xr1h5Qw/ykb2LuFynJ2IxkKfCMf+1xqPffkxh0S09Zc902XCffcsw/XMFq/OzQ1w54fLIDtmRNHnQ==
68496844

6850-
stylelint-config-standard@^19.0.0:
6851-
version "19.0.0"
6852-
resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-19.0.0.tgz#66f0cf13f33b8a9e34965881493b38fc1313693a"
6853-
integrity sha512-VvcODsL1PryzpYteWZo2YaA5vU/pWfjqBpOvmeA8iB2MteZ/ZhI1O4hnrWMidsS4vmEJpKtjdhLdfGJmmZm6Cg==
6854-
dependencies:
6855-
stylelint-config-recommended "^3.0.0"
6856-
68576845
stylelint@^13.0.0:
68586846
version "13.2.0"
68596847
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.2.0.tgz#b6f5b67b9a9a51f1fd105ab916952456d93826b4"

0 commit comments

Comments
 (0)