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

Is there really a need for a shuttle.json ? #14

Closed
tjk opened this issue Jul 11, 2013 · 14 comments
Closed

Is there really a need for a shuttle.json ? #14

tjk opened this issue Jul 11, 2013 · 14 comments

Comments

@tjk
Copy link

tjk commented Jul 11, 2013

Why not use ~/.ssh/config to generate hosts and other ssh options (including username + password or specific identify file, etc.)?

And I know next-to-nothing about Objective C and Apple Dev, but I would also suggest looking for the proper "terminal" app using something like LaunchServices if possible.

@grigio
Copy link

grigio commented Jul 11, 2013

+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)

@jtymes
Copy link

jtymes commented Jul 11, 2013

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?

@grigio
Copy link

grigio commented Jul 11, 2013

yes, look at the Host part

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

@tjk
Copy link
Author

tjk commented Jul 11, 2013

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. :)

@fitztrev
Copy link
Owner

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?

@Pym
Copy link

Pym commented Jul 12, 2013

👍 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?

@grigio
Copy link

grigio commented Jul 12, 2013

@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?

@grundprinzip
Copy link
Contributor

👍 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.

@fitztrev
Copy link
Owner

@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.

@grigio
Copy link

grigio commented Jul 12, 2013

@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 :)

grundprinzip added a commit to grundprinzip/shuttle that referenced this issue Jul 12, 2013
already configured in the ssh config file. Currently namespaces
identified with "/" are supported with one level of nesting.

Let's discuss.
@grundprinzip
Copy link
Contributor

The current PR supports nesting for SSH Config Values.

@pjkix
Copy link

pjkix commented Jul 12, 2013

👍

@fitztrev
Copy link
Owner

Released in v1.1.0.

@grigio
Copy link

grigio commented Jul 17, 2013

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

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

No branches or pull requests

7 participants