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
+6 -1
View File
@@ -78,7 +78,7 @@ OPTIONS:
CLIENT OPTIONS:
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.
--cli-upgrade-message string, $CODER_CLI_UPGRADE_MESSAGE
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.
The renderer to use when opening a web terminal. Valid values are
'canvas', 'webgl', or 'dom'.
--workspace-hostname-suffix string, $CODER_WORKSPACE_HOSTNAME_SUFFIX (default: coder)
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.
CONFIG OPTIONS:
Use a YAML configuration file when your server launch become unwieldy.
+5 -1
View File
@@ -490,11 +490,15 @@ disablePathApps: false
# (default: <unset>, type: bool)
disableOwnerWorkspaceAccess: false
# 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.
client:
# The SSH deployment prefix is used in the Host of the ssh config.
# (default: coder., type: string)
sshHostnamePrefix: coder.
# 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.
# (default: coder, type: string)
workspaceHostnameSuffix: coder
# These SSH config options will override the default SSH config options. Provide
# options in "key=value" or "key value" format separated by commas.Using this
# incorrectly can break SSH to your deployment, use cautiously.
+3
View File
@@ -12019,6 +12019,9 @@ const docTemplate = `{
"wildcard_access_url": {
"type": "string"
},
"workspace_hostname_suffix": {
"type": "string"
},
"write_config": {
"type": "boolean"
}
+3
View File
@@ -10759,6 +10759,9 @@
"wildcard_access_url": {
"type": "string"
},
"workspace_hostname_suffix": {
"type": "string"
},
"write_config": {
"type": "boolean"
}
+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. " +
+1
View File
@@ -515,6 +515,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"web_terminal_renderer": "string",
"wgtunnel_host": "string",
"wildcard_access_url": "string",
"workspace_hostname_suffix": "string",
"write_config": true
},
"options": [
+3
View File
@@ -2204,6 +2204,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"web_terminal_renderer": "string",
"wgtunnel_host": "string",
"wildcard_access_url": "string",
"workspace_hostname_suffix": "string",
"write_config": true
},
"options": [
@@ -2680,6 +2681,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"web_terminal_renderer": "string",
"wgtunnel_host": "string",
"wildcard_access_url": "string",
"workspace_hostname_suffix": "string",
"write_config": true
}
```
@@ -2748,6 +2750,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `web_terminal_renderer` | string | false | | |
| `wgtunnel_host` | string | false | | |
| `wildcard_access_url` | string | false | | |
| `workspace_hostname_suffix` | string | false | | |
| `write_config` | boolean | false | | |
## codersdk.DisplayApp
+11
View File
@@ -1133,6 +1133,17 @@ Specify a YAML file to load configuration from.
The SSH deployment prefix is used in the Host of the ssh config.
### --workspace-hostname-suffix
| | |
|-------------|-----------------------------------------------|
| Type | <code>string</code> |
| Environment | <code>$CODER_WORKSPACE_HOSTNAME_SUFFIX</code> |
| YAML | <code>client.workspaceHostnameSuffix</code> |
| Default | <code>coder</code> |
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.
### --ssh-config-options
| | |
+6 -1
View File
@@ -79,7 +79,7 @@ OPTIONS:
CLIENT OPTIONS:
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.
--cli-upgrade-message string, $CODER_CLI_UPGRADE_MESSAGE
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.
The renderer to use when opening a web terminal. Valid values are
'canvas', 'webgl', or 'dom'.
--workspace-hostname-suffix string, $CODER_WORKSPACE_HOSTNAME_SUFFIX (default: coder)
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.
CONFIG OPTIONS:
Use a YAML configuration file when your server launch become unwieldy.
+1
View File
@@ -684,6 +684,7 @@ export interface DeploymentValues {
readonly terms_of_service_url?: string;
readonly notifications?: NotificationsConfig;
readonly additional_csp_policy?: string;
readonly workspace_hostname_suffix?: string;
readonly config?: string;
readonly write_config?: boolean;
readonly address?: string;