jbboehr/tor-check

This package is abandoned and no longer maintained. No replacement package was suggested.

TOR check database

v0.2.0 2016-03-17 00:20 UTC

This package is not auto-updated.

Last update: 2019-05-03 20:35:18 UTC


README

TOR exit address database builder

Installs a cron that progressively downloads the TOR exit address database and generates a summary file. Care is taken in ensuring database file is always a valid PHP file. Keeps the last three days of data.

Installation

Ubuntu:

sudo apt-get install git-core devscripts debhelper adduser cdbs php5-cli php5-curl
git clone https://github.com/jbboehr/php-tor-check.git
cd php-tor-check
debuild -us -uc
sudo dpkg -i ../php-tor-check_0.1.1_all.deb

Manual:

Script usage:

Will download the TOR exit address database and summarize addresses in outputdir/exit-addresses (plaintext) and outputdir/exit-addresses.php (returns PHP array)

build.php -o <outputdir> [-f]

Example crontab:

    0   0   *   *   *   /path/to/build.php -o /path/to/data/dir

Usage

Access the database:

$addresses = include '/var/lib/php-tor-check/exit-addresses.php';
$isTor = $addresses ? !empty($addresses[$_SERVER['REMOTE_ADDR']]) : null;