Skip to content

Commit a8ac88e

Browse files
committed
feat: add --disable-getting-started-override
This adds a new CLI flag to code-server called `--disable-getting-started` which will be used in Code to not use Coder's custom Getting Started text.
1 parent e241659 commit a8ac88e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/node/cli.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface UserProvidedCodeArgs {
5151
"disable-update-check"?: boolean
5252
"disable-file-downloads"?: boolean
5353
"disable-workspace-trust"?: boolean
54+
"disable-getting-started-override"?: boolean
5455
}
5556

5657
/**
@@ -170,6 +171,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
170171
type: "boolean",
171172
description: "Disable Workspace Trust feature. This switch only affects the current session.",
172173
},
174+
"disable-getting-started-override": {
175+
type: "boolean",
176+
description: "Disable the coder/coder override in the Help: Getting Started page.",
177+
},
173178
// --enable can be used to enable experimental features. These features
174179
// provide no guarantees.
175180
enable: { type: "string[]" },
@@ -563,6 +568,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
563568
args["disable-file-downloads"] = true
564569
}
565570

571+
if (process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE?.match(/^(1|true)$/)) {
572+
args["disable-getting-started-override"] = true
573+
}
574+
566575
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
567576
if (process.env.HASHED_PASSWORD) {
568577
args["hashed-password"] = process.env.HASHED_PASSWORD

test/unit/node/cli.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ describe("parser", () => {
4343
delete process.env.LOG_LEVEL
4444
delete process.env.PASSWORD
4545
delete process.env.CS_DISABLE_FILE_DOWNLOADS
46+
delete process.env.CS_GETTING_STARTED_OVERRIDE
4647
console.log = jest.fn()
4748
})
4849

@@ -114,6 +115,7 @@ describe("parser", () => {
114115
value: path.resolve("path/to/cert"),
115116
},
116117
"disable-file-downloads": true,
118+
"disable-getting-started-override": true,
117119
enable: ["feature1", "feature2"],
118120
help: true,
119121
host: "0.0.0.0",

0 commit comments

Comments
 (0)