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
Identify visits from Tor exit nodes #3284
Comments
I think it would be a good candidate for a plugin, because adding the Reverse DNS lookup will be too costly to do by default. It's a fun idea to do. Maybe the plugin could set a Custom Variable to identify the user as Tor? eg. name=Tor User value=IP ? |
There is a list of Tor exit nodes, so you don't need a reverse DNS lookup. Piwik would just need to check if the visitor IP matches of one of the exit node IPs and then display a little onion logo and skip whatever other checks don't make sense when the user is browsing via Tor. |
That is pretty much how I do it atm:
This could be made into a plugin, but I imagine it could affect performance in a bad way on larger projects processing many hits per second. Reading the whole list each time is not ideal. For only a isTor() function of course only the IPs need to be saved, but I use the other data too. |
There is no need to pull the list 4 times a day, the Tor network doesn't move that fast. Once a day, or every 3 days, is enough. Also, please randomize the download time, so piwik instances won't DDoS the service by downloading the file at the same time. There is no need to read the file each time, there are currently something like 1000 exit nodes, you can just keep this in a hash table in memory. |
Would be great to make this into a plugin @fvdm 👍 If you store the list in a PHP array in a file, it would be very fast. But even better, you can use our Cache mechanism. It's very fast too. See the docs https://github.com/piwik/component-cache and examples in many places in the code, eg. https://github.com/piwik/piwik/blob/3.x-dev/plugins/SitesManager/SiteUrls.php#L133-L146 |
Does someone already has a plugin for this? |
From forum http://forum.piwik.org/read.php?2,91715:
Also, if a visit is suspected to be from a Tor node, perhaps Piwik could skip geolocation and provider lookup.
The text was updated successfully, but these errors were encountered: