-
Notifications
You must be signed in to change notification settings - Fork 62
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
BUG: IP Address Formatting in DB #153
Comments
The reason we want to fix this ASAP is so that we can start doing Geo IP lookups for #27 🗺️ |
from: https://elixirforum.com/t/how-to-show-clients-ipv4-on-page/41110
Could be due to https://fly.io/docs/about/pricing/#anycast-ip-addresses maybe |
Good detective work! 🔍 👍 |
Looking at https://fly.io/docs/reference/runtime-environment/#request-headers and |
I've added some logs to see the requests headers and deploy the application ( This hit is me trying to see my ip address, however the We can see the useragent is see https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-anonymized-urls We can see the image src is different: Visiting the badge url directly without using the Github (eg https://hits.dwyl.com/dwyl/hits.svg), in this case I can see my ip address correctly in the |
@SimonLab good detective work. Makes sense. So GitHub is proxying requests for all externally hosted images. 👍 |
Yes unfortunately I don't think it's possible to get the locations as I guess most of the badge are viewed via Github.
We already save the useragent in the database with
or do you mean something else to add? |
Yeah, that's probably enough. I was just thinking that they might have a block of IP addresses that |
I just checked which request header values we get visiting https://tachyons-bootstrap.dwyl.com/ and the ip address matches correctly. I'll create a PR to extract the ip address from x-forwarded-for header. see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For |
@SimonLab nice one. Thanks. 👍 |
On our catch up call, @SimonLab noted that the IP addresses are not being stored correctly.
Ref: https://en.wikipedia.org/wiki/0.0.0.0
I suspect this might be a Fly.io thing ...
Todo
sdout
(IO.inspect
) so that we can simply tail the logs and see if the issue is at the database level.The text was updated successfully, but these errors were encountered: