Skip to content

Commit 0c96ddb

Browse files
author
Hikari Kibo
authored
Merge branch 'master' into docker-user
2 parents 559e329 + 03ad2a1 commit 0c96ddb

Some content is hidden

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

97 files changed

+6960
-6700
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
* @coderasher @kylecarbs
1+
* @code-asher @kylecarbs
22
Dockerfile @nhooyr

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.15.0

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
node_js:
33
- 8.15.0
44
env:
5-
- VERSION="1.32.0-$TRAVIS_BUILD_NUMBER"
5+
- VSCODE_VERSION="1.32.0" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
66
matrix:
77
include:
88
- os: linux

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ RUN yarn && yarn task build:server:binary
1919
FROM ubuntu:18.10
2020
# We unfortunately cannot use update-locale because docker will not use the env variables
2121
# configured in /etc/default/locale so we need to set it manually.
22-
ENV LANG=en_US.UTF-8
22+
ENV LANG=en_US.UTF-8 \
23+
LC_ALL=en_US.UTF-8;
2324

2425
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
2526
RUN apt-get update && apt-get install -y \
2627
sudo \
27-
openssl \
28-
locales \
29-
net-tools;
28+
openssl \
29+
locales \
30+
net-tools;
3031

3132
RUN adduser --disabled-password --ingroup sudo --gecos '' coder && \
3233
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
[!["Open Issues"](https://img.shields.io/github/issues-raw/codercom/code-server.svg)](https://github.com/codercom/code-server/issues)
44
[!["Latest Release"](https://img.shields.io/github/release/codercom/code-server.svg)](https://github.com/codercom/code-server/releases/latest)
5-
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](#)
6-
[![Discord](https://discordapp.com/api/guilds/463752820026376202/widget.png)](https://discord.gg/zxSwN8Z)
5+
[![MIT license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/codercom/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)
77

88
`code-server` is [VS Code](https://github.com/Microsoft/vscode) running on a remote server, accessible through the browser.
99

@@ -57,11 +57,16 @@ How to [secure your setup](/doc/security/ssl.md).
5757
- Creating custom VS Code extensions and debugging them doesn't work.
5858
5959
### Future
60-
60+
- **Stay up to date!** Get notified about new releases of code-server.
61+
![Screenshot](/doc/assets/release.gif)
6162
- Windows support.
6263
- Electron and Chrome OS applications to bridge the gap between local<->remote.
6364
- Run VS Code unit tests against our builds to ensure features work as expected.
6465
66+
### Notes
67+
68+
- 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+
6570
## Contributing
6671
6772
Development guides are coming soon.

build/tasks.ts

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const libPath = path.join(__dirname, "../lib");
1010
const vscodePath = path.join(libPath, "vscode");
1111
const pkgsPath = path.join(__dirname, "../packages");
1212
const defaultExtensionsPath = path.join(libPath, "VSCode-linux-x64/resources/app/extensions");
13-
const vscodeVersion = "1.32.0";
13+
const vscodeVersion = process.env.VSCODE_VERSION || "1.32.0";
1414

1515
const buildServerBinary = register("build:server:binary", async (runner) => {
1616
await ensureInstalled();
@@ -33,50 +33,12 @@ const buildServerBinaryPackage = register("build:server:binary:package", async (
3333
throw new Error("Cannot build binary without server bundle built");
3434
}
3535
await buildServerBinaryCopy();
36-
await dependencyNexeBinary();
37-
const resp = await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:nexe"]);
36+
const resp = await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:binary"]);
3837
if (resp.exitCode !== 0) {
3938
throw new Error(`Failed to package binary: ${resp.stderr}`);
4039
}
4140
});
4241

43-
const dependencyNexeBinary = register("dependency:nexe", async (runner) => {
44-
if (os.platform() === "linux" && process.env.COMPRESS === "true") {
45-
// Download the nexe binary so we can compress it before nexe runs. If we
46-
// don't want compression we don't need to do anything since nexe will take
47-
// care of getting the binary.
48-
const nexeDir = path.join(os.homedir(), ".nexe");
49-
const targetBinaryName = `${os.platform()}-${os.arch()}-${process.version.substr(1)}`;
50-
const targetBinaryPath = path.join(nexeDir, targetBinaryName);
51-
if (!fs.existsSync(targetBinaryPath)) {
52-
fse.mkdirpSync(nexeDir);
53-
runner.cwd = nexeDir;
54-
await runner.execute("wget", [`https://github.com/nexe/nexe/releases/download/v3.0.0-beta.15/${targetBinaryName}`]);
55-
await runner.execute("chmod", ["+x", targetBinaryPath]);
56-
}
57-
// Compress with upx if it doesn't already look compressed.
58-
if (fs.statSync(targetBinaryPath).size >= 20000000) {
59-
// It needs to be executable for upx to work, which it might not be if
60-
// nexe downloaded it.
61-
fs.chmodSync(targetBinaryPath, "755");
62-
const upxFolder = path.join(os.tmpdir(), "upx");
63-
const upxBinary = path.join(upxFolder, "upx");
64-
if (!fs.existsSync(upxBinary)) {
65-
fse.mkdirpSync(upxFolder);
66-
runner.cwd = upxFolder;
67-
const upxExtract = await runner.execute("bash", ["-c", "curl -L https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz | tar xJ --strip-components=1"]);
68-
if (upxExtract.exitCode !== 0) {
69-
throw new Error(`Failed to extract upx: ${upxExtract.stderr}`);
70-
}
71-
}
72-
if (!fs.existsSync(upxBinary)) {
73-
throw new Error("Not sure how, but the UPX binary does not exist");
74-
}
75-
await runner.execute(upxBinary, [targetBinaryPath]);
76-
}
77-
}
78-
});
79-
8042
const buildServerBinaryCopy = register("build:server:binary:copy", async (runner) => {
8143
const cliPath = path.join(pkgsPath, "server");
8244
const cliBuildPath = path.join(cliPath, "build");
@@ -274,7 +236,7 @@ register("package", async (runner, releaseTag) => {
274236

275237
const releasePath = path.resolve(__dirname, "../release");
276238

277-
const archiveName = `code-server-${releaseTag}-${os.platform()}-${os.arch()}`;
239+
const archiveName = `code-server${releaseTag}-${os.platform()}-${os.arch()}`;
278240
const archiveDir = path.join(releasePath, archiveName);
279241
fse.removeSync(archiveDir);
280242
fse.mkdirpSync(archiveDir);

deployment/aws/deployment.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: code-server
5+
---
6+
apiVersion: v1
7+
kind: Service
8+
metadata:
9+
name: code-server
10+
namespace: code-server
11+
spec:
12+
ports:
13+
- port: 8443
14+
name: https
15+
protocol: TCP
16+
selector:
17+
app: code-server
18+
type: ClusterIP
19+
---
20+
kind: StorageClass
21+
apiVersion: storage.k8s.io/v1
22+
metadata:
23+
name: gp2
24+
annotations:
25+
storageclass.kubernetes.io/is-default-class: "true"
26+
provisioner: kubernetes.io/aws-ebs
27+
parameters:
28+
type: gp2
29+
fsType: ext4
30+
---
31+
kind: PersistentVolumeClaim
32+
apiVersion: v1
33+
metadata:
34+
name: code-store
35+
namespace: code-server
36+
spec:
37+
accessModes:
38+
- ReadWriteOnce
39+
resources:
40+
requests:
41+
storage: 60Gi
42+
---
43+
apiVersion: extensions/v1beta1
44+
kind: Deployment
45+
metadata:
46+
labels:
47+
app: code-server
48+
name: code-server
49+
namespace: code-server
50+
spec:
51+
selector:
52+
matchLabels:
53+
app: code-server
54+
replicas: 1
55+
template:
56+
metadata:
57+
labels:
58+
app: code-server
59+
spec:
60+
containers:
61+
- image: codercom/code-server
62+
imagePullPolicy: Always
63+
name: code-servery
64+
ports:
65+
- containerPort: 8443
66+
name: https
67+
volumeMounts:
68+
- name: code-server-storage
69+
mountPath: /go/src
70+
volumes:
71+
- name: code-server-storage
72+
persistentVolumeClaim:
73+
claimName: code-store
74+

deployment/deployment.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: code-server
5+
---
6+
apiVersion: v1
7+
kind: Service
8+
metadata:
9+
name: code-server
10+
namespace: code-server
11+
spec:
12+
ports:
13+
- port: 8443
14+
name: https
15+
protocol: TCP
16+
selector:
17+
app: code-server
18+
type: ClusterIP
19+
---
20+
apiVersion: extensions/v1beta1
21+
kind: Deployment
22+
metadata:
23+
labels:
24+
app: code-server
25+
name: code-server
26+
namespace: code-server
27+
spec:
28+
selector:
29+
matchLabels:
30+
app: code-server
31+
replicas: 1
32+
template:
33+
metadata:
34+
labels:
35+
app: code-server
36+
spec:
37+
containers:
38+
- image: codercom/code-server
39+
imagePullPolicy: Always
40+
name: code-server
41+
ports:
42+
- containerPort: 8443
43+
name: https

doc/admin/install/aws.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,31 @@ If you're just starting out, we recommend [installing code-server locally](../..
3232
```
3333
>example: `ssh -i "/Users/John/Downloads/TestInstance.pem" ubuntu@ec2-3-45-678-910.compute-1.amazonaws.co`
3434
- You should see a prompt for your EC2 instance like so<img src="../../assets/aws_ubuntu.png">
35-
- At this point it is time to download the `code-server` binary. We will of course want the linux version. Make sure you copy the link for the latest linux version on our [releases page](https://github.com/codercom/code-server/releases)
36-
- With the URL in the clipboard, run:
35+
- At this point it is time to download the `code-server` binary. We will of course want the linux version.
36+
- Find the latest Linux release from this URL:
3737
```
38-
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
38+
https://github.com/codercom/code-server/releases/latest
39+
```
40+
- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page):
41+
```
42+
wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz
43+
```
44+
- Extract the downloaded tar.gz file with this command, for example:
45+
```
46+
tar -xvzf code-server-{version}-linux-x64.tar.gz
47+
```
48+
- Navigate to extracted directory with this command:
49+
```
50+
cd code-server-{version}-linux-x64
3951
```
4052
- If you run into any permission errors, make the binary executable by running:
4153
```
42-
chmod +x code-server-linux
54+
chmod +x code-server
4355
```
44-
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
56+
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md)
4557
- Finally, run
4658
```
47-
sudo ./code-server-linux -p 80
59+
sudo ./code-server -p 80
4860
```
4961
- When you visit the public IP for your AWS instance, you will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
5062
- Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">

doc/admin/install/digitalocean.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,27 @@ If you're just starting out, we recommend [installing code-server locally](../..
1616
- Open a terminal on your computer and SSH into your instance
1717
> example: ssh root@203.0.113.0
1818
- Once in the SSH session, visit code-server [releases page](https://github.com/codercom/code-server/releases/) and copy the link to the download for the latest linux release
19-
- In the shell run the below command with the URL from your clipboard
19+
- Find the latest Linux release from this URL:
2020
```
21-
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
21+
https://github.com/codercom/code-server/releases/latest
22+
```
23+
- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page):
24+
```
25+
wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz
26+
```
27+
- Extract the downloaded tar.gz file with this command, for example:
28+
```
29+
tar -xvzf code-server-{version}-linux-x64.tar.gz
30+
```
31+
- Navigate to extracted directory with this command:
32+
```
33+
cd code-server-{version}-linux-x64
2234
```
2335
- If you run into any permission errors when attempting to run the binary:
2436
```
25-
chmod +x code-server-linux
37+
chmod +x code-server
2638
```
27-
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
39+
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md)
2840
- Finally start the code-server
2941
```
3042
sudo ./code-server-linux -p 80

doc/admin/install/google_cloud.md

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,59 @@ If you're just starting out, we recommend [installing code-server locally](../..
1313
- Choose an appropriate machine type (we recommend 2 vCPU and 7.5 GB RAM, more depending on team size and number of repositories/languages enabled)
1414
- Choose Ubuntu 16.04 LTS as your boot disk
1515
- Check the boxes for **Allow HTTP traffic** and **Allow HTTPS traffic** in the **Firewall** section
16-
- Create your VM, and **take note** of it's public IP address.
16+
- Create your VM, and **take note** of its public IP address.
1717
- Copy the link to download the latest Linux binary from our [releases page](https://github.com/codercom/code-server/releases)
1818

1919
---
2020

2121
## Final Steps
2222

23-
1. SSH into your Google Cloud VM
23+
- SSH into your Google Cloud VM
2424
```
2525
gcloud compute ssh --zone [region] [instance name]
2626
```
27-
2. Download the binary using the link we copied to clipboard
27+
28+
- Find the latest Linux release from this URL:
29+
```
30+
https://github.com/codercom/code-server/releases/latest
31+
```
32+
33+
- Replace {version} in the following command with the version found on the releases page and run it (or just copy the download URL from the releases page):
34+
```
35+
wget https://github.com/codercom/code-server/releases/download/{version}/code-server-{version}-linux-x64.tar.gz
2836
```
29-
wget https://github.com/codercom/code-server/releases/download/0.1.4/code-server-linux
37+
38+
- Extract the downloaded tar.gz file with this command, for example:
3039
```
31-
3. Make the binary executable if you run into any errors regarding permission:
32-
```
33-
chmod +x code-server-linux
34-
```
40+
tar -xvzf code-server-{version}-linux-x64.tar.gz
41+
```
42+
43+
- Navigate to extracted directory with this command:
44+
```
45+
cd code-server-{version}-linux-x64
46+
```
47+
48+
- Make the binary executable if you run into any errors regarding permission:
49+
```
50+
chmod +x code-server
51+
```
52+
3553
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
36-
4. Start the code-server
54+
55+
- Start the code-server
3756
```
3857
sudo ./code-server-linux -p 80
3958
```
59+
4060
> For instructions on how to keep the server running after you end your SSH session please checkout [how to use systemd](https://www.linode.com/docs/quick-answers/linux/start-service-at-boot/) to start linux based services if they are killed
41-
5. Access code-server from the public IP of your Google Cloud instance we noted earlier in your browser.
61+
62+
- Access code-server from the public IP of your Google Cloud instance we noted earlier in your browser.
4263
> example: 32.32.32.234
43-
6. You will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
44-
7. Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">
64+
65+
- You will be greeted with this page. Code-server is using a self-signed SSL certificate for easy setup. To proceed to the IDE, click **"Advanced"**<img src ="../../assets/chrome_warning.png">
66+
67+
- Then click **"proceed anyway"**<img src="../../assets/chrome_confirm.png">
68+
4569
---
46-
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).
70+
71+
> NOTE: If you get stuck or need help, [file an issue](https://github.com/codercom/code-server/issues/new?&title=Improve+self-hosted+quickstart+guide), [tweet (@coderhq)](https://twitter.com/coderhq) or [email](mailto:support@coder.com?subject=Self-hosted%20quickstart%20guide).

doc/assets/cros.png

121 KB
Loading

doc/assets/release.gif

65.9 KB
Loading

0 commit comments

Comments
 (0)