Skip to content

Restore ability to specify SSH Configuration property#1688

Merged
djmb merged 4 commits intobasecamp:mainfrom
mike-weiner:fix-1686-allow-ssh-config-to-be-file-paths
Nov 7, 2025
Merged

Restore ability to specify SSH Configuration property#1688
djmb merged 4 commits intobasecamp:mainfrom
mike-weiner:fix-1686-allow-ssh-config-to-be-file-paths

Conversation

@mike-weiner
Copy link
Contributor

Fixes #1686.

This PR fixes a gap in functionality where the .ssh.config property was not being passed to SSHKit (and thus Net:SSH) at all.

I did confirm that Net:SSH has support for this property:

https://net-ssh.github.io/net-ssh/Net/SSH.html#method-c-start

:config => set to true to load the default OpenSSH config files (~/.ssh/config, /etc/ssh_config), or to false to not load them, or to a file-name (or array of file-names) to load those specific configuration files. Defaults to true.


def type_error(*expected_types)
error "should be #{expected_types.map { |type| type_description(type) }.join(" or ")}"
descriptions = expected_types.map { |type| type_description(type) }.uniq
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to uniq the types here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calls like validate_type! value, TrueClass, FalseClass, Hash or type_error(TrueClass, FalseClass, String, Array) would result in this:

ERROR (Kamal::ConfigurationError): ssh/config: should be a boolean or a boolean or a string or an array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a fan of having boolean listed twice.

@djmb
Copy link
Collaborator

djmb commented Oct 27, 2025

Thanks for this @mike-weiner! I've made a few notes.

Looking at the git history, also I don't think this has actually ever worked.

@mike-weiner
Copy link
Contributor Author

Thanks for this @mike-weiner! I've made a few notes.

Looking at the git history, also I don't think this has actually ever worked.

@djmb - Agree. Don't think this ever worked.

Requested changes have been made. Should be good to add back to your review list.

@djmb djmb merged commit e7bf0f5 into basecamp:main Nov 7, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssh/config can't be set to a file path

2 participants