mirror of
https://github.com/coder/coder.git
synced 2026-09-22 05:05:20 +08:00
feat: add host suffix to /api/v2/deployment/ssh (#17269)
Adds `HostnameSuffix` to ssh config API and deprecates `HostnamePrefix`. We will still support setting and using the prefix for some time.
This commit is contained in:
@@ -653,6 +653,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
|
||||
SSHConfig: codersdk.SSHConfigResponse{
|
||||
HostnamePrefix: vals.SSHConfig.DeploymentName.String(),
|
||||
SSHConfigOptions: configSSHOptions,
|
||||
HostnameSuffix: vals.WorkspaceHostnameSuffix.String(),
|
||||
},
|
||||
AllowWorkspaceRenames: vals.AllowWorkspaceRenames.Value(),
|
||||
Entitlements: entitlements.New(),
|
||||
|
||||
Generated
+5
@@ -14754,6 +14754,11 @@ const docTemplate = `{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostname_prefix": {
|
||||
"description": "HostnamePrefix is the prefix we append to workspace names for SSH hostnames.\nDeprecated: use HostnameSuffix instead.",
|
||||
"type": "string"
|
||||
},
|
||||
"hostname_suffix": {
|
||||
"description": "HostnameSuffix is the suffix to append to workspace names for SSH hostnames.",
|
||||
"type": "string"
|
||||
},
|
||||
"ssh_config_options": {
|
||||
|
||||
Generated
+5
@@ -13384,6 +13384,11 @@
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"hostname_prefix": {
|
||||
"description": "HostnamePrefix is the prefix we append to workspace names for SSH hostnames.\nDeprecated: use HostnameSuffix instead.",
|
||||
"type": "string"
|
||||
},
|
||||
"hostname_suffix": {
|
||||
"description": "HostnameSuffix is the suffix to append to workspace names for SSH hostnames.",
|
||||
"type": "string"
|
||||
},
|
||||
"ssh_config_options": {
|
||||
|
||||
@@ -3393,7 +3393,12 @@ type DeploymentStats struct {
|
||||
}
|
||||
|
||||
type SSHConfigResponse struct {
|
||||
HostnamePrefix string `json:"hostname_prefix"`
|
||||
// HostnamePrefix is the prefix we append to workspace names for SSH hostnames.
|
||||
// Deprecated: use HostnameSuffix instead.
|
||||
HostnamePrefix string `json:"hostname_prefix"`
|
||||
|
||||
// HostnameSuffix is the suffix to append to workspace names for SSH hostnames.
|
||||
HostnameSuffix string `json:"hostname_suffix"`
|
||||
SSHConfigOptions map[string]string `json:"ssh_config_options"`
|
||||
}
|
||||
|
||||
|
||||
Generated
+1
@@ -582,6 +582,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/ssh \
|
||||
```json
|
||||
{
|
||||
"hostname_prefix": "string",
|
||||
"hostname_suffix": "string",
|
||||
"ssh_config_options": {
|
||||
"property1": "string",
|
||||
"property2": "string"
|
||||
|
||||
Generated
+7
-5
@@ -5748,6 +5748,7 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith
|
||||
```json
|
||||
{
|
||||
"hostname_prefix": "string",
|
||||
"hostname_suffix": "string",
|
||||
"ssh_config_options": {
|
||||
"property1": "string",
|
||||
"property2": "string"
|
||||
@@ -5757,11 +5758,12 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|----------------------|--------|----------|--------------|-------------|
|
||||
| `hostname_prefix` | string | false | | |
|
||||
| `ssh_config_options` | object | false | | |
|
||||
| » `[any property]` | string | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
|----------------------|--------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------|
|
||||
| `hostname_prefix` | string | false | | Hostname prefix is the prefix we append to workspace names for SSH hostnames. Deprecated: use HostnameSuffix instead. |
|
||||
| `hostname_suffix` | string | false | | Hostname suffix is the suffix to append to workspace names for SSH hostnames. |
|
||||
| `ssh_config_options` | object | false | | |
|
||||
| » `[any property]` | string | false | | |
|
||||
|
||||
## codersdk.ServerSentEvent
|
||||
|
||||
|
||||
Generated
+1
@@ -2219,6 +2219,7 @@ export interface SSHConfig {
|
||||
// From codersdk/deployment.go
|
||||
export interface SSHConfigResponse {
|
||||
readonly hostname_prefix: string;
|
||||
readonly hostname_suffix: string;
|
||||
readonly ssh_config_options: Record<string, string>;
|
||||
}
|
||||
|
||||
|
||||
@@ -3032,6 +3032,7 @@ export const MockDeploymentStats: TypesGen.DeploymentStats = {
|
||||
export const MockDeploymentSSH: TypesGen.SSHConfigResponse = {
|
||||
hostname_prefix: " coder.",
|
||||
ssh_config_options: {},
|
||||
hostname_suffix: "coder",
|
||||
};
|
||||
|
||||
export const MockWorkspaceAgentLogs: TypesGen.WorkspaceAgentLog[] = [
|
||||
|
||||
Reference in New Issue
Block a user