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

Allow port fallback similar to gatways #126

Open
rothgar opened this issue Mar 14, 2016 · 3 comments
Open

Allow port fallback similar to gatways #126

rothgar opened this issue Mar 14, 2016 · 3 comments

Comments

@rothgar
Copy link

rothgar commented Mar 14, 2016

For some hosts I am able to connect directly to them when I'm on my lan and need to use a non-standard port when going through the wan (firewall port mapping) It'd be nice to have something like this in my assh.yml to allow me to connect to the same host no matter where I am.

host:
    Hostname: host1
    Port:
        - 22
        - 2222

Maybe this is already possible with gateways but I haven't tested it yet and may be more confusing when setting up.

@moul
Copy link
Owner

moul commented Mar 14, 2016

I like the idea, but I would push it to the next level by allowing a "meta hosts" which have a full configuration fallback:

hosts:
  hosta:
    configs:
    - hosta.local
    - hosta.remote
    - hosta.gateway
  hosta.local:
    hostname: host1
    port: 22
  hosta.remote:
    hostname: host1
    port: 2222
  hosta.gateway:
    hostname: 1.2.3.4
    port: 22
    gateway: my-gateway

@moul moul self-assigned this Mar 14, 2016
@rothgar
Copy link
Author

rothgar commented Mar 14, 2016

I'm not sure I like all of the duplication when few thing needs to be changed but understand you don't want to have every config be a list of items to iterate through.

I could only think of Port, Gateway, and Inherits that would probably need to be lists. Other items don't usually change on the host (IdentityFile, User, etc) but met hosts would probably allow for more flexibility for all users and config options.

@moul
Copy link
Owner

moul commented Mar 14, 2016

Ok :)

In my opinion, a list of ports for the same host is already something not so common, that's why I wanted to create something that handle every "rare cases" with a list of hosts, so your case is natively handled as a maximum of other ones

If I found a clean way in Golang to configure the yaml parser to accept lists or strings automatically, I can consider adding the Port listing + the same thing for Hostname, for now, I need to use hard-typed fields, so it is also a lot easier for me to just add this new "Configs" list field

@moul moul modified the milestones: v2.3.0, Proposal Mar 21, 2016
@moul moul modified the milestones: Proposal, v2.5.0 Jul 14, 2016
@moul moul added the ready label Dec 6, 2016
@moul moul modified the milestones: v2.5.0, v2.6.0 Jan 5, 2017
@moul moul modified the milestones: v2.6.0, v2.7.0 Feb 3, 2017
@moul moul removed their assignment Sep 18, 2017
@moul moul modified the milestones: v2.7.0, v2 ✌ Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants