Skip to content

Commit 88cb7cc

Browse files
authored
Merge pull request coder#1 from codercom/master
test
2 parents 0535fd5 + 60937c6 commit 88cb7cc

File tree

15 files changed

+76
-31
lines changed

15 files changed

+76
-31
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug Report
33
about: Report problems and unexpected behavior.
44
title: ''
5-
labels: ''
5+
labels: 'bug'
66
assignees: ''
77
---
88

@@ -12,7 +12,11 @@ assignees: ''
1212
- `code-server` version: <!-- The version of code-server -->
1313
- OS Version: <!-- OS version, cloud provider, -->
1414

15-
#### Steps to Reproduce
15+
## Description
1616

17-
1.
18-
2.
17+
<!-- Describes the problem here -->
18+
19+
## Steps to Reproduce
20+
21+
1. <!-- step 1: click ... -->
22+
1. <!-- step 2: ... -->

.github/ISSUE_TEMPLATE/extension_bug.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ assignees: ''
1212
- OS Version: <!-- OS version, cloud provider, -->
1313
- Extension: <!-- Link to extension -->
1414

15-
#### Steps to Reproduce
15+
## Description
1616

17-
1.
18-
2.
17+
<!-- Describes the problem here -->
18+
19+
## Steps to Reproduce
20+
21+
1. <!-- step 1: click ... -->
22+
1. <!-- step 2: ... -->

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature Request
33
about: Suggest an idea for this project.
44
title: ''
5-
labels: ''
5+
labels: 'feature'
66
assignees: ''
77
---
88

.github/ISSUE_TEMPLATE/question.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
name: Question
33
about: Ask a question.
44
title: ''
5-
labels: ''
5+
labels: 'question'
66
assignees: ''
77
---
88

99
<!-- Please search existing issues to avoid creating duplicates. -->
1010

11-
#### Description
11+
## Description
1212

1313
<!-- A description of the the question. -->
1414

15-
#### Related Issues
15+
## Related Issues
1616

1717
<!-- Any issues related to your question. -->

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ COPY . .
1515
# directly which should be fast as it is slow because it populates its own cache every time.
1616
RUN yarn && yarn task build:server:binary
1717

18-
# We deploy with ubuntu so that devs have a familiar environemnt.
18+
# We deploy with ubuntu so that devs have a familiar environment.
1919
FROM ubuntu:18.10
2020
WORKDIR /root/project
2121
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
@@ -28,5 +28,5 @@ RUN apt-get install -y locales && \
2828
# We unfortunately cannot use update-locale because docker will not use the env variables
2929
# configured in /etc/default/locale so we need to set it manually.
3030
ENV LANG=en_US.UTF-8
31-
# Unfortunately `.` does not work with code-server.
32-
CMD code-server $PWD
31+
ENTRYPOINT code-server
32+
CMD ["."]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
Try it out:
1111
```bash
12-
docker run -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-server code-server --allow-http --no-auth
12+
docker run -t -p 127.0.0.1:8443:8443 -v "${PWD}:/root/project" codercom/code-server --allow-http --no-auth
1313
```
1414

1515
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.

build/tasks.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +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";
1314

1415
const buildServerBinary = register("build:server:binary", async (runner) => {
1516
await ensureInstalled();
@@ -219,17 +220,11 @@ const ensureCloned = register("vscode:clone", async (runner) => {
219220
} else {
220221
fse.mkdirpSync(libPath);
221222
runner.cwd = libPath;
222-
const clone = await runner.execute("git", ["clone", "https://github.com/microsoft/vscode"]);
223+
const clone = await runner.execute("git", ["clone", "https://github.com/microsoft/vscode", "--branch", `release/${vscodeVersion}`, "--single-branch", "--depth=1"]);
223224
if (clone.exitCode !== 0) {
224225
throw new Error(`Failed to clone: ${clone.exitCode}`);
225226
}
226227
}
227-
228-
runner.cwd = vscodePath;
229-
const checkout = await runner.execute("git", ["checkout", "tags/1.32.0"]);
230-
if (checkout.exitCode !== 0) {
231-
throw new Error(`Failed to checkout: ${checkout.stderr}`);
232-
}
233228
});
234229

235230
const ensureClean = register("vscode:clean", async (runner) => {
@@ -246,6 +241,10 @@ const ensureClean = register("vscode:clean", async (runner) => {
246241
throw new Error(`Failed to remove unstaged files: ${removeUnstaged.stderr}`);
247242
}
248243
}
244+
const fetch = await runner.execute("git", ["fetch", "--prune"]);
245+
if (fetch.exitCode !== 0) {
246+
throw new Error(`Failed to fetch latest changes: ${fetch.stderr}`);
247+
}
249248
});
250249

251250
const ensurePatched = register("vscode:patch", async (runner) => {

doc/self-hosted/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,20 @@ OPTIONS
7474
7575
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
7676
77+
### Nginx Reverse Proxy
78+
Nginx is for reverse proxy. Here is a example virtual host that works with code-server. Please also pass --allow-http. You can also use certbot by EFF to get a ssl certificates for free.
79+
```
80+
server {
81+
listen 80;
82+
listen [::]:80;
83+
server_name code.example.com code.example.org;
84+
location / {
85+
proxy_pass http://localhost:8443/;
86+
proxy_set_header Upgrade $http_upgrade;
87+
proxy_set_header Connection upgrade;
88+
}
89+
}
90+
```
91+
7792
### Help
7893
Use `code-server -h` or `code-server --help` to view the usage for the cli. This is also shown at the beginning of this section.

packages/ide/src/fill/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ class WebsocketConnection implements ReadWriteConnection {
9191
*/
9292
private async openSocket(): Promise<WebSocket> {
9393
this.dispose();
94+
const wsProto = location.protocol === "https:" ? "wss" : "ws";
9495
const socket = new WebSocket(
95-
`${location.protocol === "https:" ? "wss" : "ws"}://${location.host}`,
96+
`${wsProto}://${location.host}${location.pathname}`,
9697
);
9798
socket.binaryType = "arraybuffer";
9899
this.activeSocket = socket;

packages/server/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"node-netstat": "^1.6.0",
2020
"pem": "^1.14.1",
2121
"promise.prototype.finally": "^3.1.0",
22+
"safe-compare": "^1.1.4",
2223
"ws": "^6.1.2",
2324
"xhr2": "^0.1.4"
2425
},
@@ -28,6 +29,7 @@
2829
"@types/mime-types": "^2.1.0",
2930
"@types/opn": "^5.1.0",
3031
"@types/pem": "^1.9.4",
32+
"@types/safe-compare": "^1.1.0",
3133
"@types/ws": "^6.0.1",
3234
"fs-extra": "^7.0.1",
3335
"nexe": "^2.0.0-rc.34",

0 commit comments

Comments
 (0)