Skip to content

feat: add CODER_WORKSPACE_HOSTNAME_SUFFIX #17268

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 1 commit into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
6 changes: 5 additions & 1 deletion cli/testdata/server-config.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion codersdk/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.",
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.",

Suggestion: To differentiate the value from the text.

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. " +
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/general.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/reference/api/schemas.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions docs/reference/cli/server.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion enterprise/cli/testdata/coder_server_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
1 change: 1 addition & 0 deletions site/src/api/typesGenerated.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading