feat: Add deployment side config-ssh options (#6613)

* feat: Allow setting deployment wide ssh config settings
* feat: config-ssh respects deployment ssh config
* The '.' is now configurable
* Move buildinfo into deployment.go
This commit is contained in:
Steven Masley
2023-03-16 13:03:37 -05:00
committed by GitHub
parent 25e8abd63e
commit fe247c86eb
18 changed files with 642 additions and 49 deletions

View File

@ -155,6 +155,10 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"browser_only": true,
"cache_directory": "string",
"config": "string",
"config_ssh": {
"deploymentName": "string",
"sshconfigOptions": ["string"]
},
"dangerous": {
"allow_path_app_sharing": true,
"allow_path_app_site_owner_access": true
@ -398,6 +402,41 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## SSH Config
### Code samples
```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/deployment/ssh \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`GET /deployment/ssh`
### Example responses
> 200 Response
```json
{
"hostname_prefix": "string",
"ssh_config_options": {
"property1": "string",
"property2": "string"
}
}
```
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.SSHConfigResponse](schemas.md#codersdksshconfigresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get deployment stats
### Code samples

View File

@ -1687,6 +1687,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a
"browser_only": true,
"cache_directory": "string",
"config": "string",
"config_ssh": {
"deploymentName": "string",
"sshconfigOptions": ["string"]
},
"dangerous": {
"allow_path_app_sharing": true,
"allow_path_app_site_owner_access": true
@ -2027,6 +2031,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a
"browser_only": true,
"cache_directory": "string",
"config": "string",
"config_ssh": {
"deploymentName": "string",
"sshconfigOptions": ["string"]
},
"dangerous": {
"allow_path_app_sharing": true,
"allow_path_app_site_owner_access": true
@ -2238,6 +2246,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `browser_only` | boolean | false | | |
| `cache_directory` | string | false | | |
| `config` | string | false | | |
| `config_ssh` | [codersdk.SSHConfig](#codersdksshconfig) | false | | |
| `dangerous` | [codersdk.DangerousConfig](#codersdkdangerousconfig) | false | | |
| `derp` | [codersdk.DERP](#codersdkderp) | false | | |
| `disable_password_auth` | boolean | false | | |
@ -3318,6 +3327,42 @@ Parameter represents a set value for the scope.
| `display_name` | string | false | | |
| `name` | string | false | | |
## codersdk.SSHConfig
```json
{
"deploymentName": "string",
"sshconfigOptions": ["string"]
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | --------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------- |
| `deploymentName` | string | false | | Deploymentname is the config-ssh Hostname prefix |
| `sshconfigOptions` | array of string | false | | Sshconfigoptions are additional options to add to the ssh config file. This will override defaults. |
## codersdk.SSHConfigResponse
```json
{
"hostname_prefix": "string",
"ssh_config_options": {
"property1": "string",
"property2": "string"
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| -------------------- | ------ | -------- | ------------ | ----------- |
| `hostname_prefix` | string | false | | |
| `ssh_config_options` | object | false | | |
| » `[any property]` | string | false | | |
## codersdk.ServiceBannerConfig
```json

View File

@ -42,6 +42,13 @@ Specifies the path to an SSH config.
| Consumes | <code>$CODER_SSH_CONFIG_FILE</code> |
| Default | <code>~/.ssh/config</code> |
### --ssh-host-prefix
Override the default host prefix.
<br/>
| | |
| --- | --- |
### --ssh-option, -o
Specifies additional SSH options to embed in each host stanza.