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

reported internal ip address / docker #70

Open
mo8Zomo0 opened this issue Mar 15, 2021 · 4 comments
Open

reported internal ip address / docker #70

mo8Zomo0 opened this issue Mar 15, 2021 · 4 comments

Comments

@mo8Zomo0
Copy link

Hi!

Piaware reports back the internal IP address and exposes that as a link on the users flightaware page.

https://flightaware.com/adsb/stats/user/ shows the internal IP and port of the local webinterface
under "site information": "Web Interface: View live data (requires local network connection)"
which show something like: http://172.17.0.6:8080/

Especially with using docker this internal address might not even be accessible.

It would be nice if the behaviour could be set / overwritten.

Like behaviour:
default export any internal address)
manual (configure protocol (http/https), host/ip, port as whatever you like)
auto-docker (get the hosts ip/port if this is even possible

@mutability
Copy link
Contributor

mutability commented Mar 15, 2021

Here's the existing logic: https://github.com/flightaware/piaware/blob/master/package/fa_sysinfo.tcl#L292
(tl;dr: parse the output of ip -o route get to 70.42.6.191)
What's the equivalent for detecting a docker environment and extracting the right address?

@resuna
Copy link
Member

resuna commented Mar 15, 2021

I just went over this, and there's three things you can do, all of them "not recommended" or "not reliable".

  1. Set the docker hostname to the real hostname instead of a container ID, and do a DNS lookup on that. I've done this in a couple places. Not reliable because it assumes you control the docker.
  2. Tunnel it into docker using an environment variable. Not reliable for the same reason.
  3. Exposing the docker management API inside the container, which basically gives you root on the host. Not recommended.

Oh, I suppose once IPv6 is everywhere it will be a non-issue.

@mo8Zomo0
Copy link
Author

As said, an option to define the behaviour and one to define a manual value for the URI could be a fix.

I agree IPv6 would most likely be the most handy thing, though a question would be even if you
use v6 in containers if you would expose it there or concentrated at an other point.

@resuna
Copy link
Member

resuna commented Mar 16, 2021

Not doing address translation is kind of a religion for v6 promoters.

Anyway, yeh, just making it some parameter or setting you pass to the program to override the ip address is the way to go. That way it doesn't matter if it's docker or some other NAT/PAT system that's hiding the address from you.

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

3 participants