-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Use upstream server #4414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Use upstream server #4414
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3c10163
Flesh out fixes to align with upstream.
GirlBossRush 0e7eb7e
Update route handlers to better reflect fallback behavior.
GirlBossRush ad787bb
Bump vendor.
GirlBossRush 19c9c23
Touch up build, tests.
GirlBossRush 062ce32
bump vscode.
GirlBossRush 2481711
Add platform to vscode-reh-web task
code-asher dde9a08
Fix issue where workspace args are not parsed.
GirlBossRush 26733fd
Update CLI test.
GirlBossRush 059893f
Update CLI tests.
GirlBossRush 9945428
Fix issues surrounding opening files within code-server's terminal.
GirlBossRush 93adec7
Bump vendor.
GirlBossRush 28e0d78
Update VS Code
code-asher 4cf13f4
Merge remote-tracking branch 'origin/main' into upstream-server-fixes
code-asher 76e6ccc
Readd parent wrapper for hot reload.
GirlBossRush efada23
Allow more errors.
GirlBossRush 1f7e8a1
Bump vscode.
GirlBossRush 914aad2
Fix issues surrounding Coder link.
GirlBossRush a413abf
Add dir creation and fix cli
code-asher 55d878e
Remove hardcoded VSCODE_DEV=1
code-asher d03c9f5
Fix mismatching commit between client and server
code-asher 8244463
Mostly restore command-line parity
code-asher d5ed30f
Fix static endpoint not emitting 404s
code-asher 30b9923
Update VS Code
code-asher a281ccd
Import missing logError
code-asher 7d48b82
Fix 403 errors
code-asher fc94ac9
Add code-server version to about dialog
code-asher 89cc5a9
Use user settings to disable welcome page
code-asher e022788
Update VS Code cache step with new build directories
code-asher c8f2b12
Merge branch 'main' into upstream-server-fixes
code-asher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Flesh out fixes to align with upstream.
- Loading branch information
commit 3c101634526ba6b2ec0caf7e205d6930893129b4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,27 +31,7 @@ export enum LogLevel { | |
|
|
||
| export class OptionalString extends Optional<string> {} | ||
|
|
||
| export interface Args | ||
| extends Pick< | ||
| CodeServerLib.NativeParsedArgs, | ||
| | "_" | ||
| | "user-data-dir" | ||
| | "enable-proposed-api" | ||
| | "extensions-dir" | ||
| | "builtin-extensions-dir" | ||
| | "extra-extensions-dir" | ||
| | "extra-builtin-extensions-dir" | ||
| | "ignore-last-opened" | ||
| | "locale" | ||
| | "log" | ||
| | "verbose" | ||
| | "install-source" | ||
| | "list-extensions" | ||
| | "install-extension" | ||
| | "uninstall-extension" | ||
| | "locate-extension" | ||
| // | "telemetry" | ||
| > { | ||
| export interface Args extends CodeServerLib.ServerParsedArgs { | ||
jsjoeio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| config?: string | ||
| auth?: AuthType | ||
| password?: string | ||
|
|
@@ -67,7 +47,6 @@ export interface Args | |
| json?: boolean | ||
| log?: LogLevel | ||
| open?: boolean | ||
| port?: number | ||
jsjoeio marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "bind-addr"?: string | ||
| socket?: string | ||
| version?: boolean | ||
|
|
@@ -76,6 +55,7 @@ export interface Args | |
| "proxy-domain"?: string[] | ||
| "reuse-window"?: boolean | ||
| "new-window"?: boolean | ||
| verbose?: boolean | ||
|
|
||
| link?: OptionalString | ||
| } | ||
|
|
@@ -169,7 +149,7 @@ const options: Options<Required<Args>> = { | |
|
|
||
| // These two have been deprecated by bindAddr. | ||
| host: { type: "string", description: "" }, | ||
| port: { type: "number", description: "" }, | ||
| port: { type: "string", description: "" }, | ||
GirlBossRush marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| socket: { type: "string", path: true, description: "Path to a socket (bind-addr will be ignored)." }, | ||
| version: { type: "boolean", short: "v", description: "Display version information." }, | ||
|
|
@@ -178,31 +158,18 @@ const options: Options<Required<Args>> = { | |
| "user-data-dir": { type: "string", path: true, description: "Path to the user data directory." }, | ||
| "extensions-dir": { type: "string", path: true, description: "Path to the extensions directory." }, | ||
| "builtin-extensions-dir": { type: "string", path: true }, | ||
| "extra-extensions-dir": { type: "string[]", path: true }, | ||
| "extra-builtin-extensions-dir": { type: "string[]", path: true }, | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "list-extensions": { type: "boolean", description: "List installed VS Code extensions." }, | ||
| force: { type: "boolean", description: "Avoid prompts when installing VS Code extensions." }, | ||
| "install-source": { type: "string" }, | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "locate-extension": { type: "string[]" }, | ||
| "install-extension": { | ||
| type: "string[]", | ||
| description: | ||
| "Install or update a VS Code extension by id or vsix. The identifier of an extension is `${publisher}.${name}`.\n" + | ||
| "To install a specific version provide `@${version}`. For example: '[email protected]'.", | ||
| }, | ||
| "enable-proposed-api": { | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: "string[]", | ||
| description: | ||
| "Enable proposed API features for extensions. Can receive one or more extension IDs to enable individually.", | ||
| }, | ||
| "uninstall-extension": { type: "string[]", description: "Uninstall a VS Code extension by id." }, | ||
| "show-versions": { type: "boolean", description: "Show VS Code extension versions." }, | ||
| "proxy-domain": { type: "string[]", description: "Domain used for proxying ports." }, | ||
| "ignore-last-opened": { | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: "boolean", | ||
| short: "e", | ||
| description: "Ignore the last opened directory or workspace in favor of an empty window.", | ||
| }, | ||
| "new-window": { | ||
| type: "boolean", | ||
| short: "n", | ||
|
|
@@ -214,7 +181,6 @@ const options: Options<Required<Args>> = { | |
| description: "Force to open a file or folder in an already opened window.", | ||
| }, | ||
|
|
||
| locale: { type: "string" }, | ||
code-asher marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| log: { type: LogLevel }, | ||
| verbose: { type: "boolean", short: "vvv", description: "Enable verbose logging." }, | ||
|
|
||
|
|
@@ -227,6 +193,43 @@ const options: Options<Required<Args>> = { | |
| `, | ||
| beta: true, | ||
| }, | ||
|
|
||
| connectionToken: { type: "string" }, | ||
| "connection-secret": { | ||
| type: "string", | ||
| description: | ||
| "Path to file that contains the connection token. This will require that all incoming connections know the secret.", | ||
| }, | ||
| "socket-path": { type: "string" }, | ||
| driver: { type: "string" }, | ||
| "start-server": { type: "boolean" }, | ||
| "print-startup-performance": { type: "boolean" }, | ||
| "print-ip-address": { type: "boolean" }, | ||
| "disable-websocket-compression": { type: "boolean" }, | ||
|
|
||
| fileWatcherPolling: { type: "string" }, | ||
|
|
||
| "enable-remote-auto-shutdown": { type: "boolean" }, | ||
| "remote-auto-shutdown-without-delay": { type: "boolean" }, | ||
|
|
||
| "without-browser-env-var": { type: "boolean" }, | ||
| "extensions-download-dir": { type: "string" }, | ||
| "install-builtin-extension": { type: "string[]" }, | ||
|
|
||
| category: { | ||
| type: "string", | ||
| description: "Filters installed extensions by provided category, when using --list-extensions.", | ||
| }, | ||
| "do-not-sync": { type: "boolean" }, | ||
| "force-disable-user-env": { type: "boolean" }, | ||
|
|
||
| folder: { type: "string" }, | ||
| workspace: { type: "string" }, | ||
| "web-user-data-dir": { type: "string" }, | ||
| "use-host-proxy": { type: "string" }, | ||
| "enable-sync": { type: "boolean" }, | ||
| "github-auth": { type: "string" }, | ||
| logsPath: { type: "string" }, | ||
| } | ||
|
|
||
| export const optionDescriptions = (): string[] => { | ||
|
|
@@ -271,6 +274,14 @@ export function splitOnFirstEquals(str: string): string[] { | |
| return split | ||
| } | ||
|
|
||
| const createDefaultArgs = (): Args => { | ||
| return { | ||
| _: [], | ||
| workspace: "", | ||
| folder: "", | ||
| } | ||
| } | ||
|
|
||
| export const parse = ( | ||
| argv: string[], | ||
| opts?: { | ||
|
|
@@ -285,7 +296,8 @@ export const parse = ( | |
| return new Error(msg) | ||
| } | ||
|
|
||
| const args: Args = { _: [] } | ||
| // TODO: parse workspace and folder. | ||
| const args: Args = createDefaultArgs() | ||
| let ended = false | ||
|
|
||
| for (let i = 0; i < argv.length; ++i) { | ||
|
|
@@ -403,7 +415,7 @@ export interface DefaultedArgs extends ConfigArgs { | |
| value: string | ||
| } | ||
| host: string | ||
| port: number | ||
| port: string | ||
| "proxy-domain": string[] | ||
| verbose: boolean | ||
| usingEnvPassword: boolean | ||
|
|
@@ -472,15 +484,15 @@ export async function setDefaults(cliArgs: Args, configArgs?: ConfigArgs): Promi | |
| args.auth = AuthType.Password | ||
| } | ||
|
|
||
| const addr = bindAddrFromAllSources(configArgs || { _: [] }, cliArgs) | ||
| const addr = bindAddrFromAllSources(configArgs || createDefaultArgs(), cliArgs) | ||
| args.host = addr.host | ||
| args.port = addr.port | ||
| args.port = addr.port.toString() | ||
|
|
||
| // If we're being exposed to the cloud, we listen on a random address and | ||
| // disable auth. | ||
| if (args.link) { | ||
| args.host = "localhost" | ||
| args.port = 0 | ||
| args.port = "0" | ||
| args.socket = undefined | ||
| args.cert = undefined | ||
| args.auth = AuthType.None | ||
|
|
@@ -581,7 +593,7 @@ export async function readConfigFile(configPath?: string): Promise<ConfigArgs> { | |
| */ | ||
| export function parseConfigFile(configFile: string, configPath: string): ConfigArgs { | ||
| if (!configFile) { | ||
| return { _: [], config: configPath } | ||
| return { ...createDefaultArgs(), config: configPath } | ||
| } | ||
|
|
||
| const config = yaml.load(configFile, { | ||
|
|
@@ -641,7 +653,7 @@ export function bindAddrFromArgs(addr: Addr, args: Args): Addr { | |
| addr.port = parseInt(process.env.PORT, 10) | ||
| } | ||
| if (args.port !== undefined) { | ||
| addr.port = args.port | ||
| addr.port = parseInt(args.port, 10) | ||
| } | ||
| return addr | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.