Skip to content
Permalink
Browse files

IP addresses can now be redacted automatically from telemetry

  • Loading branch information...
adolfintel committed Sep 28, 2019
1 parent 247b9c0 commit a50fcfe56614154ee76c88f8831790df859f8fdd
Showing with 9 additions and 0 deletions.
  1. +2 −0 doc.md
  2. +6 −0 results/telemetry.php
  3. +1 −0 results/telemetry_settings.php
2 doc.md
@@ -101,6 +101,8 @@ To enable ID obfuscation, edit `results/telemetry_settings.php` and set `$enable

__Important:__ ID obfuscation currently only works on 64-bit PHP!

While you're editing `results/telemetry_settings.php`, you might want to set `$redact_ip_addresses` to `true`, this way, all IP addresses will be removed from the telemetry for better privacy. This is disabled by default.

##### Seeing the results
A basic front-end for visualizing and searching tests by ID is available in `results/stats.php`.

@@ -13,6 +13,12 @@
$jitter=($_POST["jitter"]);
$log=($_POST["log"]);
if($redact_ip_addresses){
$ip="0.0.0.0";
$ispinfo=preg_replace('/((2[0-4]|1\d|[1-9])?\d|25[0-5])(\.(?1)){3}/',"0.0.0.0",preg_replace('/(((?=(?>.*?(::))(?!.+\3)))\3?|([\dA-F]{1,4}(\3|:(?!$)|$)|\2))(?4){5}((?4){2}|((2[0-4]|1\d|[1-9])?\d|25[0-5])(\.(?7)){3})/i',"0.0.0.0",$ispinfo));
$log=preg_replace('/((2[0-4]|1\d|[1-9])?\d|25[0-5])(\.(?1)){3}/',"0.0.0.0",preg_replace('/(((?=(?>.*?(::))(?!.+\3)))\3?|([\dA-F]{1,4}(\3|:(?!$)|$)|\2))(?4){5}((?4){2}|((2[0-4]|1\d|[1-9])?\d|25[0-5])(\.(?7)){3})/i',"0.0.0.0",$log));
}
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0, s-maxage=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
@@ -3,6 +3,7 @@
$db_type="mysql"; //Type of db: "mysql", "sqlite" or "postgresql"
$stats_password="PASSWORD"; //password to login to stats.php. Change this!!!
$enable_id_obfuscation=false; //if set to true, test IDs will be obfuscated to prevent users from guessing URLs of other tests
$redact_ip_addresses=false; //if set to true, IP addresses will be redacted from IP and ISP info fields, as well as the log
// Sqlite3 settings
$Sqlite_db_file = "../../speedtest_telemetry.sql";

0 comments on commit a50fcfe

Please sign in to comment.
You can’t perform that action at this time.