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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
extends:
2-
- stylelint-config-standard
2+
- stylelint-config-recommended

.travis.yml

Lines changed: 6 additions & 17 deletions
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

Lines changed: 5 additions & 91 deletions
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

Lines changed: 12 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 5 deletions
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

0 commit comments

Comments
 (0)