Skip to content

feat: Add deployment side config-ssh options #6613

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 34 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
79535d0
feat: Allow setting deployment wide ssh config settings
Emyrk Mar 14, 2023
f0eb123
feat: config-ssh respects deployment ssh config
Emyrk Mar 15, 2023
4beeb62
Catch early parse error
Emyrk Mar 15, 2023
08f5d3d
Add to unit test
Emyrk Mar 15, 2023
c8c5189
fix typo
Emyrk Mar 15, 2023
96ad4bc
Add unit test
Emyrk Mar 15, 2023
f9f4a8f
Fix output
Emyrk Mar 15, 2023
ebf9eb9
Make gen
Emyrk Mar 15, 2023
119695b
Simplify if/else
Emyrk Mar 15, 2023
b8f3242
Fix AutorizeAllEndpoints
Emyrk Mar 15, 2023
b082a5a
Fic swager docs
Emyrk Mar 15, 2023
4a1e3c2
Make gen
Emyrk Mar 15, 2023
01ea08f
The '.' is now configurable
Emyrk Mar 15, 2023
7074f50
CODER env prefix is automatic
Emyrk Mar 15, 2023
952c591
Renames
Emyrk Mar 15, 2023
dae091a
Make gen
Emyrk Mar 15, 2023
a1dd7d4
Fix AutorizeAllEndpoints
Emyrk Mar 15, 2023
4f42634
Rename to drop 'CLI'
Emyrk Mar 15, 2023
c218edd
Prefix requires .
Emyrk Mar 15, 2023
a752fc8
Use constant in test
Emyrk Mar 15, 2023
d328d97
Linting
Emyrk Mar 15, 2023
a4b9620
Formatting
Emyrk Mar 15, 2023
78fbda8
Allow the user to override the host prefix
Emyrk Mar 16, 2023
d28b850
Fix doc messages
Emyrk Mar 16, 2023
617d987
Make gen
Emyrk Mar 16, 2023
eb4bb7b
Fix comment
Emyrk Mar 16, 2023
123ce02
Remove "CLI" part of naming
Emyrk Mar 16, 2023
ca41cce
Update golden files
Emyrk Mar 16, 2023
efcbc29
Fix 404 logic
Emyrk Mar 16, 2023
3c1c87f
remove 1 error check
Emyrk Mar 16, 2023
4586b11
Move buildinfo into deployment.go
Emyrk Mar 16, 2023
0f2ef97
fixup! Move buildinfo into deployment.go
Emyrk Mar 16, 2023
a5aac50
make gen
Emyrk Mar 16, 2023
a3254cd
Golden files
Emyrk Mar 16, 2023
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
Prev Previous commit
Next Next commit
Make gen
  • Loading branch information
Emyrk committed Mar 16, 2023
commit 617d987ec56bf5317f181d8e3912c322b301021e
6 changes: 3 additions & 3 deletions cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ func configSSH() *cobra.Command {
for _, wc := range workspaceConfigs {
sort.Strings(wc.Hosts)
// Write agent configuration.
for _, hostname := range wc.Hosts {
sshHostname := fmt.Sprintf("%s%s", coderdConfig.HostnamePrefix, hostname)
for _, workspaceHostname := range wc.Hosts {
sshHostname := fmt.Sprintf("%s%s", coderdConfig.HostnamePrefix, workspaceHostname)
var configOptions sshConfigOptions
// Add standard options.
err := configOptions.addOptions(
Expand All @@ -370,7 +370,7 @@ func configSSH() *cobra.Command {
if !skipProxyCommand {
err := configOptions.addOptions(fmt.Sprintf(
"ProxyCommand %s --global-config %s ssh --stdio %s",
escapedCoderBinary, escapedGlobalConfig, hostname,
escapedCoderBinary, escapedGlobalConfig, workspaceHostname,
))
if err != nil {
return err
Expand Down
7 changes: 7 additions & 0 deletions docs/cli/coder_config-ssh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/>
| | |
| --- | --- |
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, is this a bug in gen?

Copy link
Member Author

Choose a reason for hiding this comment

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

Uh,I guess if the default is "", it doesn't put anything?


### --ssh-option, -o

Specifies additional SSH options to embed in each host stanza.
Expand Down