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

Create default settings file, and ignore used file #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
results/idObfuscation_salt.php
results/telemetry_settings.php
backend/getIP_serverLocation.php
1 change: 1 addition & 0 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ This step is only required for MySQL and PostgreSQL. If you want to use SQLite,
Log into your database using phpMyAdmin or a similar software and create a new database. Inside the `results` folder you will find `telemetry_mysql.sql` and `telemetry_postgresql.sql`, which are templates for MySQL and PostgreSQL respectively. Import the one you need, and you will see a `speedtest_users` table in the database. You can delete the templates afterwards.

##### Configuring telemetry
If it does not exist already, copy `results/telemetry_settings.default.php` to `results/telemetry_settings.php`.
Open `results/telemetry_settings.php` in a text editor. Set `$db_type` to either `mysql`,`postgresql` or `sqlite`.

If you chose to use SQLite, you might want to change `$Sqlite_db_file` to another path where you want the database to be stored. Just make sure that the file cannot be downloaded by users. Sqlite doesn't require any additional configuration, you can skip the rest of this section.
Expand Down
1 change: 1 addition & 0 deletions results/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function format($d){
$MS_TEXT="ms";

$id=$_GET["id"];
if(!file_exists('./telemetry_settings.php')) copy('./telemetry_settings.default.php', './telemetry_settings.php');
include_once('telemetry_settings.php');
require 'idObfuscation.php';
if($enable_id_obfuscation) $id=deobfuscateId($id);
Expand Down
1 change: 1 addition & 0 deletions results/stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<body>
<h1>LibreSpeed - Stats</h1>
<?php
if(!file_exists('./telemetry_settings.php')) copy('./telemetry_settings.default.php', './telemetry_settings.php');
include_once("telemetry_settings.php");
require "idObfuscation.php";
if($stats_password=="PASSWORD"){
Expand Down
1 change: 1 addition & 0 deletions results/telemetry.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
if(!file_exists('./telemetry_settings.php')) copy('./telemetry_settings.default.php', './telemetry_settings.php');
include_once('telemetry_settings.php');
require 'idObfuscation.php';

Expand Down
20 changes: 20 additions & 0 deletions results/telemetry_settings.default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$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

// Sqlite3 settings
$Sqlite_db_file = "../../speedtest_telemetry.sql";

// Mysql settings
$MySql_username="USERNAME";
$MySql_password="PASSWORD";
$MySql_hostname="DB_HOSTNAME";
$MySql_databasename="DB_NAME";

// Postgresql settings
$PostgreSql_username="USERNAME";
$PostgreSql_password="PASSWORD";
$PostgreSql_hostname="DB_HOSTNAME";
$PostgreSql_databasename="DB_NAME";
4 changes: 0 additions & 4 deletions results/telemetry_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@
$PostgreSql_password="PASSWORD";
$PostgreSql_hostname="DB_HOSTNAME";
$PostgreSql_databasename="DB_NAME";


//IMPORTANT: DO NOT ADD ANYTHING BELOW THIS PHP CLOSING TAG, NOT EVEN EMPTY LINES!
?>