GithubHelp home page GithubHelp logo

Comments (11)

crschnick avatar crschnick commented on June 13, 2024 1

Furthermore, now that the XPipe 1.5 staging version supports importing hosts from ssh configs, would such a solution work for you: https://unix.stackexchange.com/a/454743

from xpipe.

crschnick avatar crschnick commented on June 13, 2024 1

So I will see what I can come up with in the future. Out of all the things that I currently have on my to do list, this isn't very high right now though.

from xpipe.

crschnick avatar crschnick commented on June 13, 2024

Ok, so just that I understand the problem correctly, you messed up your DNS and want to use IPs instead of host names for your ssh connections?

But you don't want change manually between IPs and host names in the configuration window and instead want to be able to provide fallback IPs/host names that will be tried when the previous ones don't work? I.e. instead of having a single text field for the host entry, have one that allows to provide multiple entries?

from xpipe.

Lockszmith-GH avatar Lockszmith-GH commented on June 13, 2024

You understood my request correctly.

That's intersting, I can play with it - this does make configuration more cumbersome. Compared to my idea where XPipe keeps track of the latest IP address, and auto-updates it.

Thanks for the quick response, and for the tip.

from xpipe.

crschnick avatar crschnick commented on June 13, 2024

The technical implementation for such a thing would be quite difficult:

  • How do we check whether DNS resolution fails (which command) on all supported operating systems?
  • How do we define a failure? What if the DNS points to a wrong server which can be resolved? What if it points to the correct server but that one is currently not reachable via SSH?

Now I haven't tested this, but due to XPipe just straight a passing your configured command to your shell, you can in theory embed shell expressions into your hostname. If you are using a posix shell and pass $(...) in the host argument, this can dynamically evaluate the expression. So if you use such an expression to evaluate to either the host name if it can be resolved or the IP otherwise, this should properly build the ssh command and achieve what you're looking for.

from xpipe.

Lockszmith-GH avatar Lockszmith-GH commented on June 13, 2024

...you can in theory embed shell expressions into your hostname...

That's a problematic idea - sanitation of values is an important security topic, and allowing that should be diswaded.

I get your point, about the comlpexity, and I thank you for entertaining the notion.

How about just fetching an IP address if the 'additional addresses' is empty.
No need for a specific command, just use a Java call.

This should remove the complexity of detection later on.

from xpipe.

crschnick avatar crschnick commented on June 13, 2024

I understand your concern about the sanitation of inputs. The reason this is currently allowed is that the user should be in full control over what values are entered in there. If somehow an adversary is able to modify your own configuration and embed expressions in it, you might have bigger problems. All inputs are properly sanitized at other locations, e.g. the file browser, I just left that in to give users more flexibility.

The problem with DNS resolution via a Java method is that it would always resolve that using your local configuration. If your SSH connections have set a proxy/gateway, that DNS resolution does not match the one on the proxy machine.

It would be nice if SSH would be able to provide the IP it last resolved when connecting via a hostname, but I don't think it can tell you that.

from xpipe.

Lockszmith-GH avatar Lockszmith-GH commented on June 13, 2024

I see your point. So if you chose this, you'll need to implement at least 3 separate methods:
Linux - dig or nslookup
Windows - powershell resolve-dnsname or nslookup.ex
MacOS - #... I have no experience#

figuring out what is avialable, parsing the output - and dealing with this as these systems evolve.

Better drop the auto-detection part.

from xpipe.

Lockszmith-GH avatar Lockszmith-GH commented on June 13, 2024

Really appreciate you entertaining my idea, even on a low priority.
Thanks for making this tool a thing.

from xpipe.

crschnick avatar crschnick commented on June 13, 2024

I was thinking about adding a system information button for connections to display basic information, including things like the IP address. That information would be kept from the last successful connection attempt, this would also make solving your problem easier as you then could just copy that IP and it temporarily use it as the host address for the connection. Would that work?

from xpipe.

Lockszmith-GH avatar Lockszmith-GH commented on June 13, 2024

yes, that's not bad at all. Although it would still mean editing or creating a separate connection, but at least the detail is preserved somewhere. Thanks for thinking about solving this.

from xpipe.

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.