Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87d9ff0

Browse files
authored
feat: add CODER_WORKSPACE_HOSTNAME_SUFFIX (coder#17268)
Adds deployment option `CODER_WORKSPACE_HOSTNAME_SUFFIX`. This will eventually replace `CODER_SSH_HOSTNAME_PREFIX`, but we will do this slowly and support both for `coder ssh` for some time. Note that the name is changed to "workspace" hostname, since this suffix will also be used for Coder Connect on Coder Desktop, which is not limited to SSH.
1 parent 8f665e3 commit 87d9ff0

File tree

10 files changed

+52
-4
lines changed

10 files changed

+52
-4
lines changed

cli/testdata/coder_server_--help.golden

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ OPTIONS:
7878

7979
CLIENT OPTIONS:
8080
These options change the behavior of how clients interact with the Coder.
81-
Clients include the coder cli, vs code extension, and the web UI.
81+
Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.
8282

8383
--cli-upgrade-message string, $CODER_CLI_UPGRADE_MESSAGE
8484
The upgrade message to display to users when a client/server mismatch
@@ -98,6 +98,11 @@ Clients include the coder cli, vs code extension, and the web UI.
9898
The renderer to use when opening a web terminal. Valid values are
9999
'canvas', 'webgl', or 'dom'.
100100

101+
--workspace-hostname-suffix string, $CODER_WORKSPACE_HOSTNAME_SUFFIX (default: coder)
102+
Workspace hostnames use this suffix in SSH config and Coder Connect on
103+
Coder Desktop. By default it is coder, resulting in names like
104+
myworkspace.coder.
105+
101106
CONFIG OPTIONS:
102107
Use a YAML configuration file when your server launch become unwieldy.
103108

cli/testdata/server-config.yaml.golden

+5-1
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,15 @@ disablePathApps: false
490490
# (default: <unset>, type: bool)
491491
disableOwnerWorkspaceAccess: false
492492
# These options change the behavior of how clients interact with the Coder.
493-
# Clients include the coder cli, vs code extension, and the web UI.
493+
# Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.
494494
client:
495495
# The SSH deployment prefix is used in the Host of the ssh config.
496496
# (default: coder., type: string)
497497
sshHostnamePrefix: coder.
498+
# Workspace hostnames use this suffix in SSH config and Coder Connect on Coder
499+
# Desktop. By default it is coder, resulting in names like myworkspace.coder.
500+
# (default: coder, type: string)
501+
workspaceHostnameSuffix: coder
498502
# These SSH config options will override the default SSH config options. Provide
499503
# options in "key=value" or "key value" format separated by commas.Using this
500504
# incorrectly can break SSH to your deployment, use cautiously.

coderd/apidoc/docs.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/deployment.go

+13-1
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ type DeploymentValues struct {
393393
TermsOfServiceURL serpent.String `json:"terms_of_service_url,omitempty" typescript:",notnull"`
394394
Notifications NotificationsConfig `json:"notifications,omitempty" typescript:",notnull"`
395395
AdditionalCSPPolicy serpent.StringArray `json:"additional_csp_policy,omitempty" typescript:",notnull"`
396+
WorkspaceHostnameSuffix serpent.String `json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`
396397

397398
Config serpent.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
398399
WriteConfig serpent.Bool `json:"write_config,omitempty" typescript:",notnull"`
@@ -944,7 +945,7 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
944945
deploymentGroupClient = serpent.Group{
945946
Name: "Client",
946947
Description: "These options change the behavior of how clients interact with the Coder. " +
947-
"Clients include the coder cli, vs code extension, and the web UI.",
948+
"Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.",
948949
YAML: "client",
949950
}
950951
deploymentGroupConfig = serpent.Group{
@@ -2549,6 +2550,17 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
25492550
Hidden: false,
25502551
Default: "coder.",
25512552
},
2553+
{
2554+
Name: "Workspace Hostname Suffix",
2555+
Description: "Workspace hostnames use this suffix in SSH config and Coder Connect on Coder Desktop. By default it is coder, resulting in names like myworkspace.coder.",
2556+
Flag: "workspace-hostname-suffix",
2557+
Env: "CODER_WORKSPACE_HOSTNAME_SUFFIX",
2558+
YAML: "workspaceHostnameSuffix",
2559+
Group: &deploymentGroupClient,
2560+
Value: &c.WorkspaceHostnameSuffix,
2561+
Hidden: false,
2562+
Default: "coder",
2563+
},
25522564
{
25532565
Name: "SSH Config Options",
25542566
Description: "These SSH config options will override the default SSH config options. " +

docs/reference/api/general.md

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/api/schemas.md

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/cli/server.md

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

enterprise/cli/testdata/coder_server_--help.golden

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ OPTIONS:
7979

8080
CLIENT OPTIONS:
8181
These options change the behavior of how clients interact with the Coder.
82-
Clients include the coder cli, vs code extension, and the web UI.
82+
Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.
8383

8484
--cli-upgrade-message string, $CODER_CLI_UPGRADE_MESSAGE
8585
The upgrade message to display to users when a client/server mismatch
@@ -99,6 +99,11 @@ Clients include the coder cli, vs code extension, and the web UI.
9999
The renderer to use when opening a web terminal. Valid values are
100100
'canvas', 'webgl', or 'dom'.
101101

102+
--workspace-hostname-suffix string, $CODER_WORKSPACE_HOSTNAME_SUFFIX (default: coder)
103+
Workspace hostnames use this suffix in SSH config and Coder Connect on
104+
Coder Desktop. By default it is coder, resulting in names like
105+
myworkspace.coder.
106+
102107
CONFIG OPTIONS:
103108
Use a YAML configuration file when your server launch become unwieldy.
104109

site/src/api/typesGenerated.ts

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)