From de568d446beba423c0e4787ec22401fcdeb76394 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 4 Aug 2020 15:01:18 -0500 Subject: [PATCH 1/7] Add cookie domain debug logs To help debug login issues. --- src/node/http.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node/http.ts b/src/node/http.ts index bcd464bd..5c8346f7 100644 --- a/src/node/http.ts +++ b/src/node/http.ts @@ -868,6 +868,7 @@ export class HttpServer { // isn't setting the host header to match the access domain. host === "localhost" ) { + logger.debug("no valid cookie doman", field("host", host)) return undefined } @@ -877,6 +878,7 @@ export class HttpServer { } }) + logger.debug("got cookie doman", field("host", host)) return host ? `Domain=${host}` : undefined } From 751a5ea3ad6bec3e32201a37cfccdc0c2f31f462 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 4 Aug 2020 15:03:11 -0500 Subject: [PATCH 2/7] Move login JS to a separate file Mostly so the base URL resolution code can be shared. --- ci/build/build-code-server.sh | 1 + ci/dev/watch.ts | 6 +++++- src/browser/pages/login.html | 7 +------ src/browser/pages/login.ts | 7 +++++++ 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/browser/pages/login.ts diff --git a/ci/build/build-code-server.sh b/ci/build/build-code-server.sh index f0e4ddc3..1d2942d9 100755 --- a/ci/build/build-code-server.sh +++ b/ci/build/build-code-server.sh @@ -21,6 +21,7 @@ main() { --public-url "." \ --out-dir dist \ $([[ $MINIFY ]] || echo --no-minify) \ + src/browser/login.ts \ src/browser/register.ts \ src/browser/serviceWorker.ts } diff --git a/ci/dev/watch.ts b/ci/dev/watch.ts index ba386b75..7e56c186 100644 --- a/ci/dev/watch.ts +++ b/ci/dev/watch.ts @@ -164,7 +164,11 @@ class Watcher { private createBundler(out = "dist"): Bundler { return new Bundler( - [path.join(this.rootPath, "src/browser/register.ts"), path.join(this.rootPath, "src/browser/serviceWorker.ts")], + [ + path.join(this.rootPath, "src/browser/login.ts"), + path.join(this.rootPath, "src/browser/register.ts"), + path.join(this.rootPath, "src/browser/serviceWorker.ts"), + ], { outDir: path.join(this.rootPath, out), cacheDir: path.join(this.rootPath, ".cache"), diff --git a/src/browser/pages/login.html b/src/browser/pages/login.html index 586c9c66..f2b26299 100644 --- a/src/browser/pages/login.html +++ b/src/browser/pages/login.html @@ -47,10 +47,5 @@ - + diff --git a/src/browser/pages/login.ts b/src/browser/pages/login.ts new file mode 100644 index 00000000..c7fc92d4 --- /dev/null +++ b/src/browser/pages/login.ts @@ -0,0 +1,7 @@ +import { getOptions } from "../../common/util" + +const options = getOptions() +const el = document.getElementById("base") as HTMLInputElement +if (el) { + el.value = options.base +} From d6d24966be4cf51b2860751db9e4842ca7cc4038 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 4 Aug 2020 15:03:22 -0500 Subject: [PATCH 3/7] Move vscode JS to a separate file Mostly to match everything else. --- ci/build/build-code-server.sh | 5 ++-- ci/dev/watch.ts | 3 +- src/browser/pages/vscode.html | 49 +------------------------------- src/browser/pages/vscode.ts | 53 +++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 src/browser/pages/vscode.ts diff --git a/ci/build/build-code-server.sh b/ci/build/build-code-server.sh index 1d2942d9..e1bb0558 100755 --- a/ci/build/build-code-server.sh +++ b/ci/build/build-code-server.sh @@ -21,9 +21,10 @@ main() { --public-url "." \ --out-dir dist \ $([[ $MINIFY ]] || echo --no-minify) \ - src/browser/login.ts \ src/browser/register.ts \ - src/browser/serviceWorker.ts + src/browser/serviceWorker.ts \ + src/browser/pages/login.ts \ + src/browser/pages/vscode.ts } main "$@" diff --git a/ci/dev/watch.ts b/ci/dev/watch.ts index 7e56c186..73823d03 100644 --- a/ci/dev/watch.ts +++ b/ci/dev/watch.ts @@ -165,9 +165,10 @@ class Watcher { private createBundler(out = "dist"): Bundler { return new Bundler( [ - path.join(this.rootPath, "src/browser/login.ts"), path.join(this.rootPath, "src/browser/register.ts"), path.join(this.rootPath, "src/browser/serviceWorker.ts"), + path.join(this.rootPath, "src/browser/pages/login.ts"), + path.join(this.rootPath, "src/browser/pages/vscode.ts"), ], { outDir: path.join(this.rootPath, out), diff --git a/src/browser/pages/vscode.html b/src/browser/pages/vscode.html index 4653698b..e846ec0d 100644 --- a/src/browser/pages/vscode.html +++ b/src/browser/pages/vscode.html @@ -43,47 +43,7 @@ - +