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

Wrong IP address in info panel #416

Closed
petrparolek opened this issue Apr 15, 2020 · 5 comments
Closed

Wrong IP address in info panel #416

petrparolek opened this issue Apr 15, 2020 · 5 comments

Comments

@petrparolek
Copy link

petrparolek commented Apr 15, 2020

Version: 2.7.4

Bug Description

obrazek

I tested standalone Tracy on Vagrant / Laravel Homestead.

Expected Behavior

obrazek

Possible Solution

revert commit ce31ae5

@dg
Copy link
Member

dg commented Apr 15, 2020

cc @janbarasek

@janbarasek
Copy link
Contributor

@dg @petrparolek I am not sure which solution is ok.

In case of production server is this behavior ok, because function php_uname('n') return homestead and gethostbyname() return 127.0.1.1 (what is not good IP address).

But in case of production server, function gethostbyname() should return real IP address by reverse DNS check.

Possible solution

Tracy should detect current environment and in case of local environment use old IP detection method by $_SERVER['SERVER_ADDR'].

petrparolek added a commit to petrparolek/nette-tracy that referenced this issue Apr 15, 2020
@petrparolek
Copy link
Author

petrparolek commented Apr 15, 2020

what do you @dg @janbarasek think about my solution in #417 ? I combined original code from version 2.7.3 with code in 2.7.4 from @janbarasek

@janbarasek
Copy link
Contributor

@petrparolek I'm not sure your solution is safe. The IP address through the proxy may be spoofed.

See my article for more information (czech language): https://php.baraja.cz/ip-adresa

First you should fix your failing tests: https://travis-ci.org/github/nette/tracy/builds/675458839

Thanks.

petrparolek added a commit to petrparolek/nette-tracy that referenced this issue Apr 16, 2020
petrparolek added a commit to petrparolek/nette-tracy that referenced this issue Apr 16, 2020
petrparolek added a commit to petrparolek/nette-tracy that referenced this issue Apr 16, 2020
@dg dg closed this as completed in 6bba05f Apr 18, 2020
@petrparolek
Copy link
Author

thx

dg added a commit that referenced this issue Apr 21, 2020
dg added a commit that referenced this issue Apr 23, 2020
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

Successfully merging a pull request may close this issue.

3 participants