feat: add CODER_WORKSPACE_HOSTNAME_SUFFIX (#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.
This commit is contained in:
Spike Curtis
2025-04-07 11:35:47 +04:00
committed by GitHub
parent 8f665e364a
commit 87d9ff0973
10 changed files with 52 additions and 4 deletions
+13 -1
View File
@@ -393,6 +393,7 @@ type DeploymentValues struct {
TermsOfServiceURL serpent.String `json:"terms_of_service_url,omitempty" typescript:",notnull"`
Notifications NotificationsConfig `json:"notifications,omitempty" typescript:",notnull"`
AdditionalCSPPolicy serpent.StringArray `json:"additional_csp_policy,omitempty" typescript:",notnull"`
WorkspaceHostnameSuffix serpent.String `json:"workspace_hostname_suffix,omitempty" typescript:",notnull"`
Config serpent.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
WriteConfig serpent.Bool `json:"write_config,omitempty" typescript:",notnull"`
@@ -944,7 +945,7 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
deploymentGroupClient = serpent.Group{
Name: "Client",
Description: "These options change the behavior of how clients interact with the Coder. " +
"Clients include the coder cli, vs code extension, and the web UI.",
"Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.",
YAML: "client",
}
deploymentGroupConfig = serpent.Group{
@@ -2549,6 +2550,17 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
Hidden: false,
Default: "coder.",
},
{
Name: "Workspace Hostname Suffix",
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.",
Flag: "workspace-hostname-suffix",
Env: "CODER_WORKSPACE_HOSTNAME_SUFFIX",
YAML: "workspaceHostnameSuffix",
Group: &deploymentGroupClient,
Value: &c.WorkspaceHostnameSuffix,
Hidden: false,
Default: "coder",
},
{
Name: "SSH Config Options",
Description: "These SSH config options will override the default SSH config options. " +