From 9e1056f810f855e4a88479cb23fecdbc6be7e0a9 Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Sat, 17 Jan 2015 15:22:25 -0600 Subject: [PATCH] Easier setup: auto-detect tracker address if no config file found. This commit adds a simple configuration file in PHP `.ini` syntax that makes it easier to configure the tracker address and the database path. The result is that no edits to the source code are required to use this. --- .gitignore | 1 + README.txt | 11 ++++++----- index.php | 12 ++++++++++-- ipmagnet.ini.php-sample | 19 +++++++++++++++++++ 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 ipmagnet.ini.php-sample diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..04a9adc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ipmagnet.ini.php diff --git a/README.txt b/README.txt index 5d523ac..1b82e69 100644 --- a/README.txt +++ b/README.txt @@ -22,13 +22,14 @@ Requirements Setup Clone the repo into a folder that is available by the httpd. - Edit index.php - Change the tracker URL (line 2) to point to the public + Optionally, copy the sample config file (ipmagnet.ini.php-sample) + to ipmagnet.ini.php and change its settings. Options include: + Change the tracker URL to point to the public location of the index.php file. - Optionally edit the database path (line 3) if you do not - want to have the database in the same folder for security - reasons. + Change the database path to point to the location of the + ipmagnet.db3 file if you want to have the database in a + different folder than index.php for security reasons. If you'd like to set a timeout after which clients should recheck their IP against the tracking link, set $enableInterval to true on line 4. diff --git a/index.php b/index.php index 6a5b395..333d353 100755 --- a/index.php +++ b/index.php @@ -1,6 +1,14 @@