-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Plugin to exclude the webmaster based on IP or IP range #5463
Comments
There's a special case where the IP (or IP range) to be excluded falls within these reserved ranges:
I'm going to roll the requirements in from #567. Visitors with HTTP_CLIENT_IP or HTTP_X_FORWARDED_FOR, IP addresses in the private IP address ranges should instead use the first public address in the list, falling back to $_SERVER!['REMOTE_ADDR']. Also, it looks like there are a couple of unreachable codepaths in the current implementation of getIp() which should be reviewed. |
In http://forum.piwik.org/index.php?showtopic=1540 there's a mod to Provider to map local IP addresses to internal "provider" names, eg "net1", "net2", ... |
this has become by far the most requested feature - receiving messages twice a day asking for this feature. We should push it in the product. |
(In [1970]) Fixes #5463
|
Known limitations
|
I see the code uses ip2long() and <= => for comparisons. This smells like a latent bug. Since longs are signed, we have to make sure IPs in the range of 128.0.0.0-255.255.255.255 are handled correctly. Re-opening so we can add isVisitorIpExcluded() testable via unit tests. re: #comment:10, I've re-opened #567. |
ouch you're right, thanks for the review! |
(In [1972]) Fixes #5463 |
(In [1977]) refs #5463 - getIp() returns a stringified, unsigned number; changed unit test to match getIp()'s behaviour; SitesManager converts min/max to non-negative numbers |
We want to be able to exclude a list of IPs, and/or a list of IP ranges (using ..123.34 notation) from being tracked by Piwik.
The list of IPs to exclude would be stored in the website cache file (where goals and alias URLs are stored).
In the UI, the feature should be available
- general exclusion list (only available to the super user): would apply to all website registered in Piwik, would need their own cache file (that applies to all websites)
- for each website, we can define a list of IPs. All IPs in this list + in the general list are checked at each Piwik request.
As an inline help, the UI would show the user current IP that he could copy paste in the list.
The UI would call the API in JSON (like the existing screens).
The UI for this feature should be designed to be part of a “preference page” for a website, as we need to add several new preferences for each website: #41, #42, #43, #56. Ideally, all the UI would be ajax (very quick to go from the list of websites in the admin UI, to load one website details page, to come back to the list of websites).
Outstanding question: should it be in the SiteManager plugin, or a new plugin? Should it be part of the core (to minimize overhead of loading plugins at Tracker time…)
The text was updated successfully, but these errors were encountered: