Skip to content

Commit 9d16448

Browse files
committed
Merge branch 'master' of github.com:codercom/code-server
2 parents 190f6d5 + c5400b4 commit 9d16448

File tree

18 files changed

+130
-53
lines changed

18 files changed

+130
-53
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ dist
44
out
55
.DS_Store
66
release
7-
.cache
7+
.vscode
8+
.cache

.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-
- VSCODE_VERSION="1.33.0" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
5+
- VSCODE_VERSION="1.33.1" MAJOR_VERSION="1" VERSION="$MAJOR_VERSION.$TRAVIS_BUILD_NUMBER-vsc$VSCODE_VERSION"
66
matrix:
77
include:
88
- os: linux

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ RUN apt-get update && apt-get install -y \
2424
git \
2525
locales \
2626
sudo \
27-
dumb-init
27+
dumb-init \
28+
vim \
29+
curl \
30+
wget
2831

2932
RUN locale-gen en_US.UTF-8
3033
# We unfortunately cannot use update-locale because docker will not use the env variables

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/c
2323

2424
## Getting Started
2525

26-
### Hosted
27-
28-
[Try `code-server` now](https://coder.com/signup) for free at coder.com.
29-
3026
### Docker
3127

3228
See docker oneliner mentioned above. Dockerfile is at [/Dockerfile](/Dockerfile).

build/tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const libPath = path.join(__dirname, "../lib");
1212
const vscodePath = path.join(libPath, "vscode");
1313
const defaultExtensionsPath = path.join(libPath, "extensions");
1414
const pkgsPath = path.join(__dirname, "../packages");
15-
const vscodeVersion = process.env.VSCODE_VERSION || "1.33.0";
15+
const vscodeVersion = process.env.VSCODE_VERSION || "1.33.1";
1616
const vsSourceUrl = `https://codesrv-ci.cdr.sh/vstar-${vscodeVersion}.tar.gz`;
1717

1818
const buildServerBinary = register("build:server:binary", async (runner) => {

doc/admin/install/digitalocean.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If you're just starting out, we recommend [installing code-server locally](../..
3939
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md)
4040
- Finally start the code-server
4141
```
42-
sudo ./code-server-linux -p 80
42+
sudo ./code-server -p 80
4343
```
4444
> 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
4545
- When you visit the public IP for your Digital Ocean 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">

doc/self-hosted/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ OPTIONS
6262
> Example: `code-server -h 127.0.0.1`
6363
6464
### Open
65-
You can have the server automatically open the VS Code in your browser on startup by using the `code server -o` or `code-server --open` flags
65+
You can have the server automatically open the VS Code in your browser on startup by using the `code-server -o` or `code-server --open` flags
6666

6767
### Port
6868
By default, code-server will use `8443` as its port. This can be changed by using `code-server -p` or `code-server --port=` followed by the port you want to use.

packages/app/browser/src/app.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77
</head>
88

99
<body>
10-
<div class="login">
11-
<div class="back"> <- Back </div>
12-
<h4 class="title">code-server</h4>
13-
<h2 class="subtitle">
14-
Enter server password
15-
</h2>
16-
<div class="mdc-text-field">
17-
<input type="password" id="password" class="mdc-text-field__input" required>
18-
<label class="mdc-floating-label" for="password">Password</label>
19-
<div class="mdc-line-ripple"></div>
20-
</div>
21-
<button id="submit" class="mdc-button mdc-button--unelevated">
22-
<span class="mdc-button__label">Enter IDE</span>
23-
</button>
24-
<div id="error-display"></div>
25-
</div>
10+
<form id="login-form">
11+
<div class="login">
12+
<div class="back">
13+
<- Back </div> <h4 class="title">code-server</h4>
14+
<h2 class="subtitle">
15+
Enter server password
16+
</h2>
17+
<div class="mdc-text-field">
18+
<input type="password" id="password" class="mdc-text-field__input" required>
19+
<label class="mdc-floating-label" for="password">Password</label>
20+
<div class="mdc-line-ripple"></div>
21+
</div>
22+
<button id="submit" class="mdc-button mdc-button--unelevated">
23+
<span class="mdc-button__label">Enter IDE</span>
24+
</button>
25+
<div id="error-display"></div>
26+
</div>
27+
</form>
2628
</body>
2729

2830
</html>

packages/app/browser/src/app.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ window.addEventListener("message", (event) => {
2020
});
2121

2222
const password = document.getElementById("password") as HTMLInputElement;
23-
const submit = document.getElementById("submit") as HTMLButtonElement;
24-
if (!submit) {
25-
throw new Error("No submit button found");
23+
const form = document.getElementById("login-form") as HTMLFormElement;
24+
25+
if (!form) {
26+
throw new Error("No password form found");
2627
}
27-
submit.addEventListener("click", () => {
28+
29+
form.addEventListener("submit", (e) => {
30+
e.preventDefault();
2831
document.cookie = `password=${password.value}`;
2932
location.reload();
3033
});
@@ -38,4 +41,4 @@ const errorDisplay = document.getElementById("error-display") as HTMLDivElement;
3841

3942
if (document.referrer === document.location.href && matches) {
4043
errorDisplay.innerText = "Password is incorrect!";
41-
}
44+
}

packages/ide/src/fill/electron.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
4545
},
4646
set: (value: string): void => {
4747
if (value) {
48-
value = value.replace(/file:\/\//g, "/resource");
48+
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
49+
value = value.replace(/file:\/\//g, resourceBaseUrl);
4950
}
5051
oldSrc!.set!.call(img, value);
5152
},
@@ -66,7 +67,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
6667
},
6768
set: (value: string): void => {
6869
if (value) {
69-
value = value.replace(/file:\/\//g, "/resource");
70+
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
71+
value = value.replace(/file:\/\//g, resourceBaseUrl);
7072
}
7173
oldInnerHtml!.set!.call(style, value);
7274
},
@@ -80,7 +82,8 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
8082
if (sheet && !overridden) {
8183
const oldInsertRule = sheet.insertRule;
8284
sheet.insertRule = (rule: string, index?: number): void => {
83-
rule = rule.replace(/file:\/\//g, "/resource");
85+
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
86+
rule = rule.replace(/file:\/\//g, resourceBaseUrl);
8487
oldInsertRule.call(sheet, rule, index);
8588
};
8689
overridden = true;
@@ -145,8 +148,9 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
145148
(view as any).send = (channel: string, ...args: any[]): void => { // tslint:disable-line no-any
146149
if (args[0] && typeof args[0] === "object" && args[0].contents) {
147150
// TODO
148-
args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"/resource${m1}"`);
149-
args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"/resource${m1}"`);
151+
const resourceBaseUrl = location.pathname.replace(/\/$/, "") + "/resource";
152+
args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"${resourceBaseUrl}${m1}"`);
153+
args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"${resourceBaseUrl}${m1}"`);
150154
args[0].contents = (args[0].contents as string).replace(/style-src vscode-core-resource:/g, "style-src 'self'");
151155
}
152156
if (view.contentWindow) {

0 commit comments

Comments
 (0)