Skip to content
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

Configuration is case sensitive but many ssh versions aren't #51

Closed
davidpelaez opened this issue Sep 8, 2015 · 8 comments
Closed

Configuration is case sensitive but many ssh versions aren't #51

davidpelaez opened this issue Sep 8, 2015 · 8 comments
Assignees
Labels

Comments

@davidpelaez
Copy link

Loving this tool, thanks for releasing it! However, it did give me a minor headache when I started because it's case sensitive and doesn't complain about error. I suggest that the tool either complains about unknown keys or downcases all of them before using them. In my regular config file Hostname worked, but in assh you have to write it HostName (capital N) or it won't work. This small mismatch with how things are handled by some versions of ssh could be annoying and unneeded friction.

What do you think?

@moul
Copy link
Owner

moul commented Sep 8, 2015

Yes, I completely agree, I also made the mistake myself :)

I will try to support insensitive keys or at least display warnings

@moul moul added the Bug label Sep 8, 2015
@moul moul self-assigned this Sep 8, 2015
@davidpelaez
Copy link
Author

Awesome 👍

@moul
Copy link
Owner

moul commented Sep 8, 2015

I opened an issue here: go-yaml/yaml#123

Depending on the resolution of this issue, I found an interesting alternative YAML library: https://github.com/BurntSushi/toml with case-insensitivity and more features

@davidpelaez
Copy link
Author

YAML is case sensitive by spec, so I don't think they will accept it if they want to provide the smallest library parsing Yaml. Maybe they could offer it as a helper or something but seems unlikely I'd say. I'll keep in tune to see how it goes. Now, Toml is way way better for this case. I was thinking about it when I saw the error. It's not space sensitive and hence is less error prone, I'd give it a +10!

@moul
Copy link
Owner

moul commented Sep 10, 2015

I'm not fully convinced with the TOML alternative, see: https://github.com/moul/advanced-ssh-config/pull/62/files, especially https://github.com/moul/advanced-ssh-config/blob/fix-51/README.md#configuration

What I suggest now is :

  • Handling multiple files: Yaml, TOML, json
  • Later: try to fix the Yaml parser (or fork it) to fix the key sensitivity

@moul
Copy link
Owner

moul commented Sep 12, 2015

Here is another pull-request which add a yaml proxy: flexyaml

  • for each lines in the yaml configuration
  • split the line on ":"
  • lowercase the left part

This is trivial but seems to work quite well

I think I can merge it for now, and remove this later

@davidpelaez: what do you think/prefer ?

moul added a commit that referenced this issue Sep 26, 2015
@moul moul closed this as completed in #67 Sep 26, 2015
@moul moul removed the in progress label Sep 26, 2015
@moul
Copy link
Owner

moul commented Sep 26, 2015

I choose the flexyaml solution, it works nicely for the moment, I hope it won't create new problems with case-insensitive hosts

@davidpelaez
Copy link
Author

@moul it works fine for me. It's simple yet clear. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants