Giter Club home page Giter Club logo

Comments (14)

grigio avatar grigio commented on September 27, 2024

+1 .ssh/config is already ok http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/ and duplication is a risk. (but i understand json parsing is easier)

from shuttle.

jtymes avatar jtymes commented on September 27, 2024

I did a quick search and couldn't find anything about it -- maybe one of you can answer it, but can the SSH config file do what the json file does for organizing into submenus?

from shuttle.

grigio avatar grigio commented on September 27, 2024

yes, look at the Host part

Host namespace-server1
HostName server1.com
..
Host namespace-server2

from shuttle.

tjk avatar tjk commented on September 27, 2024

Well, there is no built-in hierarchy in ssh config that I know of, however @grigio's solution could work if you group by namespace after parsing out the hosts.

Not-so-great thing about this solution is that you would have to use the 'fully qualified' host alias when ssh'ing manually but if this tool works nicely enough, you shouldn't have to. :)

from shuttle.

fitztrev avatar fitztrev commented on September 27, 2024

The main issue, like @jtymes mentions, is organizing hosts into submenus. @grigio's approach of prefixing the Hosts with the group name is interesting.

Within the .ssh/config file, would there be a way to assign each of the hosts a friendlier name to appear in the menu, instead of the host alias?

from shuttle.

Pym avatar Pym commented on September 27, 2024

πŸ‘ for this feature.

Actually, I don't really see the point of such an app without .ssh/config support.

I mean: I always have iTerm2 open and all I have to do to is type 'ssh ' in, press tab to list my configured hosts and press enter to connect to the selected one. Why would anybody with a great .ssh/config file will want to use this app if he have to manually rewrite all his settings in a non-standard json file?

from shuttle.

grigio avatar grigio commented on September 27, 2024

@fitztrev what do you mean with "..a friendlier name to appear.." ? I tried with my sshconfig and Host can have dots and / . So using this convention there shouldn't be limitations.

# ~/.ssh/config
Host work/example.com # format: namespace/HostName
     HostName example.com
     User deploy
     Port 8202
Host work/other-site.com
     HostName other-site.com
     User deploy
     IdentityFile ~/.ssh/id_rsa

Which could be rendered as:

β”œβ”€ work
  β”œβ”€ example.com # this can be the the splitted "/" part of `Host` or `HostName` 
  └─ other-site.com

and of course you're still able to access to that website with:

$ ssh work/other-site.com

What do you think of this Unix-y convention over configuration?

from shuttle.

grundprinzip avatar grundprinzip commented on September 27, 2024

πŸ‘ for automatic parsing of the ssh config file.

By the way the Host definition can be any identifier and is not required to be a fully qualified domain name.

from shuttle.

fitztrev avatar fitztrev commented on September 27, 2024

@grigio I meant allowing for the label to be "My Awesome Host" instead of "myawesomehost.com", like the current JSON configuration allows. But now that I think about, I don't see that as necessary.

I do really like your proposal. I think that's a good way to go. It would probably also add support for 10.6 as a byproduct.

from shuttle.

grigio avatar grigio commented on September 27, 2024

@fitztrev space isn't allowed as Host character, but you could do:

Host work/My_Awesome_Host # format: `namespace/label`
     HostName other-site.com
     User deploy
     IdentityFile ~/.ssh/id_rsa

but I like more to have the Host as namespace/HostName so it is also easy to remember it via a plain ssh command in the terminal.

The unique thing to parse is the row which starts with "Host .." and split('/') to build the data structure with "namespace" and "HostName". I'd open a pull request if I'd know objective-c :)

from shuttle.

grundprinzip avatar grundprinzip commented on September 27, 2024

The current PR supports nesting for SSH Config Values.

from shuttle.

pjkix avatar pjkix commented on September 27, 2024

πŸ‘

from shuttle.

fitztrev avatar fitztrev commented on September 27, 2024

Released in v1.1.0.

from shuttle.

grigio avatar grigio commented on September 27, 2024

I tried to delete my .shuttle.json and now i get "Error parsing config". I've the same error also with the default one

from shuttle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.