From d67bd3f60479c4f425a7a04875e517d45a76e86f Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Fri, 9 Oct 2020 12:57:20 -0400 Subject: [PATCH 1/2] cloud: Rename --coder-bind to --link --- src/node/cli.ts | 4 ++-- src/node/coder-cloud.ts | 2 +- src/node/entry.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index 5e9e7153..b723417d 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -48,7 +48,7 @@ export interface Args extends VsArgs { readonly "reuse-window"?: boolean readonly "new-window"?: boolean - readonly "coder-bind"?: OptionalString + readonly link?: OptionalString } interface Option { @@ -164,7 +164,7 @@ const options: Options> = { log: { type: LogLevel }, verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." }, - "coder-bind": { + link: { type: OptionalString, description: ` Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like diff --git a/src/node/coder-cloud.ts b/src/node/coder-cloud.ts index f8038cbe..570d9cc6 100644 --- a/src/node/coder-cloud.ts +++ b/src/node/coder-cloud.ts @@ -33,7 +33,7 @@ function runAgent(...args: string[]): Promise { } export function coderCloudBind(csAddr: string, serverName = ""): Promise { - logger.info("Remember --coder-bind is a beta feature and requires being accepted for testing") + logger.info("Remember --link is a beta feature and requires being accepted for testing") logger.info("See https://github.com/cdr/code-server/discussions/2137") // addr needs to be in host:port format. // So we trim the protocol. diff --git a/src/node/entry.ts b/src/node/entry.ts index d05d5d55..5869ae46 100644 --- a/src/node/entry.ts +++ b/src/node/entry.ts @@ -36,7 +36,7 @@ const version = pkg.version || "development" const commit = pkg.commit || "development" const main = async (args: Args, configArgs: Args): Promise => { - if (args["coder-bind"]) { + if (args.link) { // If we're being exposed to the cloud, we listen on a random address and disable auth. args = { ...args, @@ -46,7 +46,7 @@ const main = async (args: Args, configArgs: Args): Promise => { socket: undefined, cert: undefined, } - logger.info("coder-bind: disabling auth and listening on random localhost port") + logger.info("link: disabling auth and listening on random localhost port for cloud agent") } if (!args.auth) { @@ -143,9 +143,9 @@ const main = async (args: Args, configArgs: Args): Promise => { logger.info(`Opened ${openAddress}`) } - if (args["coder-bind"]) { + if (args.link) { try { - await coderCloudBind(serverAddress!, args["coder-bind"].value) + await coderCloudBind(serverAddress!, args.link.value) } catch (err) { logger.error(err.message) ipcMain().exit(1) From fcfb03382acb9ac307c04a3647b076038d2ba06d Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Fri, 9 Oct 2020 12:57:48 -0400 Subject: [PATCH 2/2] cloud: Add mention of cloud repo --- src/node/coder-cloud.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/coder-cloud.ts b/src/node/coder-cloud.ts index 570d9cc6..1241bc90 100644 --- a/src/node/coder-cloud.ts +++ b/src/node/coder-cloud.ts @@ -3,6 +3,7 @@ import { spawn } from "child_process" import path from "path" import split2 from "split2" +// https://github.com/cdr/coder-cloud const coderCloudAgent = path.resolve(__dirname, "../../lib/coder-cloud-agent") function runAgent(...args: string[]): Promise {