Rainfall BT – A Fansub-oriented Frontend for XBT

Rainfall BT – A Fansub-oriented Frontend for XBT

Rainfall is a XBT front-end I wrote from the ground up because I wanted to experiment with running a torrent tracker. I started with mod_bt for Apache originally, but, well, that didn’t scale very well at all. So I did some research and came up with XBT, which I’ve been quite pleased with. I’m providing the source here because I probably won’t be running my tracker in the future due to disinterest, and also because I’ve had people ask for the source. I provide no warranty that it’s secure, or won’t delete your hard drive, or whatever; but so far neither of those have been issues for me. Also, if you use it, the only thing I ask is that you send me a quick note to the email listed on my homepage saying you deployed it at http://whatever. I’m just curious if anyone will actually use it. If you make drastic changes, I wouldn’t mind seeing them as well. I won’t incorporate them into the mainstream if you don’t want me to, so don’t fret. Also, don’t ask me for features. If you want a new feature, add it yourself.

###Features Etc
* Pretty much runs itself, very little admin work required once setup
* Multiple user accounts under one group
* Multiple site hosting linked to groups via url alias used
* Intelligent metadata parser
* Easy to add/remove torrents
* Shows gets (torrent retrievals) as well as completes (reported by the tracker)
* Torrent status views (see who (ip.ip.ip.xxx), what country, seed/leecher, upload ratio, estimated speed, etc) per torrent
* Easy to use for end-users

###Dependencies
* PEAR MDB2 + #mysqli (or) #mysql Drivers
* [Smarty Template Engine](http://smarty.php.net/)
* PEAR File::Bittorrent2
* PEAR Net::GeoIP + local GeoIP database (free)
* mod_rewrite enabled / for .htaccess OR use the .htaccess rewrite rules and set them up for your alternate server (nginx/lighttpd, etc)
* Some brains – I’m going to give you the general setup points, the rest is up to you.

###Downloading
Current version is 0.9 and works with the latest XBT. You can download it [here](http://files.radicand.org/rainfall-0.9.tar.gz).

###Fundamental Setup
NB. There is no backport script. This means if you already have stuff in your XBT table, then you’ll have to manage on your own to fill in the new tables we’re adding for the front-end.

First thing to do is use the supplied rainfall.sql file to add the three new “mod” tables to your xbt database. Afterward, edit inc/config.var.php in your favorite editor. At the top, there are a few things to edit:

define("SITE_ALL", "MAIN FQDN HOSTNAME HERE");
...
if ($host == SITE_ALL) { $show_all = true; }
define("SQL_STR", "mysqli://SQL_USER:SQL_PASS@localhost/SQL_DB_NAME");
...
define("SITE_ADMIN", "MAIN_ADMIN_ACCT");
...
$geoip = Net_GeoIP::getInstance("/usr/share/GeoIP/GeoIP.dat");

Change them to whatever you need to. The SITE_ADMIN parameter is your main admin login (the account that can do anything). SITE_ALL you can leave blank if you don’t want one of your sites to have a list of all public torrents on the system. You’ll also need to edit inc/pre.inc.php:

$s->compile_dir = $r . "../templates_c";
$s->cache_dir = $r . "../cache";

Change to whatever paths you can that are writable by the webserver/cgi process.

###DB Setup
Now for the fun part. Use your favorite SQL tool to dive into your newly added mod_* tables. First, add a row in mod_group. “name” is just for the database, but is used to represent the group name for that section. Say you want to make a section for Linux ISOs. You would create a row with: name:linuxiso, url:bt.yourdomain.com, title:MyLinux Isos, filter:

Filter is deprecated and should be left empty.

Next, jump into the mod_admin table. Here, add a row where name this time is the name of the login. pass is a SHA1 encrypted password string, and group is the group name you just created in the prior step. Example: name:gentoo, pass:sha1(mypass), group:linuxiso.

Also keep in mind to make an account that has a username of the one you put for the SITE_ADMIN parameter. You can use this to login with and administrate any torrent on your system.

That’s it now. You can login to the admin page via /admin and start adding stuff. Remember, Rainfall at the moment is geared towards fansubs, so a lot of the metadata information is for that. If you’re smart though it’s not hard at all to make changes to suit your needs.

###Troubleshooting
Do not email me for help or feature requests. I’m providing the source with no warranty, disclaimer, support contract, whatever. It’s for people to use if they want it. That said, if you’re having trouble, the best thing to do is probably to enable errors, which can be done at the top of inc/config.var.php.

Leave a Reply

Your email address will not be published. Required fields are marked *