5.0.2 Overview
Console - TOR Nodes is a Joomla CLI plugin that fetches and maintains a current list of TOR exit nodes, making it simple to query IP addresses against known TOR traffic. It is designed for developers to integrate into their extensions—whether for security (like System - AdminExile), analytics (like System - Google Tag Manager), or custom solutions. This page covers installation, usage, and integration.
Installation
- Download: Grab the latest version of Console - TOR Nodes from richeyweb.com.
- Install: Log in to your Joomla administrator area, navigate to System > Install > Extensions, and upload the plugin package.
- Enable: Go to System > Manage > Plugins, search for "Console - TOR Nodes," and enable it.
The plugin is now installed but requires an initial fetch to populate the TOR exit node list.
Usage
Console - TOR Nodes operates as a Joomla CLI application. Its sole command, fetch, retrieves the latest TOR exit node list.
Running the Fetch Command
From your server’s command line, navigate to your Joomla CLI directory and execute:
php /path/to/joomla/cli/joomla.php tornodes:fetch
- Replace /path/to/joomla/ with your Joomla root directory.
- The command fetches the list from the TOR project, validates each IP, and stores it as an array in a local file.
- A 24-hour throttle prevents refetching within the same day, avoiding unnecessary requests.
Automating Updates with Cron
To keep the list current, set up a cron job. Edit your server’s crontab and add:
0 0 * * * php /path/to/joomla/cli/joomla.php tornodes:fetch
- This runs fetch daily at midnight (server time).
- Adjust the schedule (e.g., 0 12 * * * for noon) or path as needed.
Integration
Console - TOR Nodes provides a helper class to query IPs against the fetched list. Use it in your extensions to detect TOR traffic.
Checking Class Availability
Before using the class, verify that the file exists:
$testFile = JPATH_PLUGINS . '/console/tornodes/src/Extension/Test.php';
if (file_exists($testFile)) {
require_once $testFile;
} else {
// Handle the error—e.g., log it or skip TOR checks
return false;
}
This confirms the class is available before proceeding.
Querying an IP
Check an IP address directly with the full namespace:
$ip = '192.168.1.1'; // Example IP
$isTor = \Joomla\Plugins\Console\TORNodes\Extension\Test::TOR($ip);
if ($isTor) {
// IP is a TOR exit node—handle it your way
} else {
// IP is not a TOR exit node
}
- \Joomla\Plugins\Console\TORNodes\Extension\Test::TOR($ip) returns true if the IP matches a known TOR exit node, false otherwise.
- The method assumes a valid IP; invalid inputs may return false.
Example Use Cases
- System - AdminExile: Blocks access if the method returns true, enhancing its blacklist.
- System - Google Tag Manager: Sends a signal to GTM when the method flags a TOR node, enabling tracking.
Your extension can use the result for anything—security, logging, or unique applications.
Notes
- File Location: The TOR node list is stored in a local file managed by the plugin. Check /plugins/console/tornodes/data/nodes.php for specifics if needed.
- Update Frequency: The 24-hour limit is enforced to respect TOR’s servers and maintain efficiency.
- Error Handling: If fetch fails (e.g., no internet), the existing list persists until the next successful run.