feat: customize getting started page (#5707)
* feat: add getting-started patch This modifies the text on the Getting Started page to promote coder/coder. * 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. * refactor: conditionally show coder getting started This modifies the getting started patch changes to work with the new `--disable-getting-started-override`. The flag is false by default meaning the Coder getting started is shown. By passing the flag to code-server, it will not be shown. * docs: update faq for getting started override * docs: update getting-started patch description * fixup!: update patch * fixup!: unit test * feat: add more tests * fixup!: use correct env var in tests Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@ -51,6 +51,7 @@ export interface UserProvidedCodeArgs {
|
||||
"disable-update-check"?: boolean
|
||||
"disable-file-downloads"?: boolean
|
||||
"disable-workspace-trust"?: boolean
|
||||
"disable-getting-started-override"?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,6 +171,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
|
||||
type: "boolean",
|
||||
description: "Disable Workspace Trust feature. This switch only affects the current session.",
|
||||
},
|
||||
"disable-getting-started-override": {
|
||||
type: "boolean",
|
||||
description: "Disable the coder/coder override in the Help: Getting Started page.",
|
||||
},
|
||||
// --enable can be used to enable experimental features. These features
|
||||
// provide no guarantees.
|
||||
enable: { type: "string[]" },
|
||||
@ -563,6 +568,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
|
||||
args["disable-file-downloads"] = true
|
||||
}
|
||||
|
||||
if (process.env.CS_DISABLE_GETTING_STARTED_OVERRIDE?.match(/^(1|true)$/)) {
|
||||
args["disable-getting-started-override"] = true
|
||||
}
|
||||
|
||||
const usingEnvHashedPassword = !!process.env.HASHED_PASSWORD
|
||||
if (process.env.HASHED_PASSWORD) {
|
||||
args["hashed-password"] = process.env.HASHED_PASSWORD
|
||||
|
Reference in New Issue
Block a user