Skip to content
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor/
config/.env
public/assets/css/styles.css
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
# phplinuxtrack
PHPlinuxTrack is a simple PHP torrent statistics script designed to ease and beautify the display of the torrent files of a linux distro or other software project. It allows visitors to see important information about your project's torrents at a glance using its icon-based interface. It was created by [John Cave](https://johncave.co.nz) of the [OpenMandriva](https://www.openmandriva.org) project.

Basically, PHPlinuxTrack makes a pretty display of the seeders, downloaders and total transfers of your torrent files. It does this using Bootstrap as the frontend, PHP as the scripting language, as Redis as a caching data store.
PHPlinuxTrack is a simple PHP torrent statistics script designed to ease and beautify the display of the torrent files of a linux distro or other software project.

It allows visitors to see important information about your project's torrents at a glance using its icon-based interface. It was created by [John Cave](https://johncave.co.nz) of the [OpenMandriva](https://www.openmandriva.org) project.

Basically, PHPlinuxTrack makes a pretty display of the seeders, downloaders and total transfers of your torrent files. It does this using [Bootstrap] for the frontend, [PHP] as the scripting language, and [Redis] as a caching data store.

## Features
- Attractive, icon-based interface.
- Doesn't look like it's seen multiple decades.
- Magnet link generation.
- Asynchronous loading of the torrent data table.
- Very easy to add new torrents.
- All assets served by CDNJS or my own CDN.
- All assets served by CDNs
- Easy to translate (if you feel the icon-based interface needs translating).
- Composer compatible
- PSR-2 and PSR-4 compliant

The requirements are:
- redis
- PHP5
- Consider installing [phpredis](https://github.com/phpredis/phpredis) to get an extra speed boost.
- PHP5+
- (optional) [PhpRedis] for a speed boost

## Installation
- Unzip the files to your webroot, or a subdirectory thereof.
- Upload your torrent files to the torrents/ subdirectory of the PHPlinuxTrack directory.
- Set a suitable header message in inc/lang/en.php.
- Set colours in inc/config.php that fit with your project's website colour scheme.
- If using Redis on localhost:6379, setup should now be complete. If not, you'll have to update the relevant settings in inc/config.php.
- If you want to use a funky directory for your torrents, you'll have to set this up in config.php, along with giving PHPlinuxTrack a suitable web path to link to downloads of the torrent files.
- Unzip the files to your web root, or a subdirectory thereof.
- Upload your torrent files to the `torrents/` subdirectory of the `public` directory.
- Set a suitable header message in `resources/languages/.
- If using Redis on `localhost:6379`, setup should now be complete. If not, you'll have to update the relevant settings in `config/.env`.
- If you want to use a different directory for your torrents, you'll have to set this up in `config/.env`, along with giving PHPlinuxTrack a suitable web path to link to downloads of the torrent files.
- You can adjust caching parameters as you see fit. However, I recommend setting a value higher than 300 for the scrapeCache directive, to save the bandwidth of the generous tracker providers out there.

## Wishlist
## To Do
- Support for Memcache as well as Redis.
- Changing the link in the Name column (between .torrent file or magnet link) based on number of seeders.
- Changing the link in the Name column (between `.torrent` file or [magnet] link) based on number of seeders.
- Prettier loading animation.

## Note
Placing non .torrent files in the torrent directory will cause no end of errors. I consider this software to be a beta, but as it does no writing, it shouldn't corrupt any data.
[PhpRedis]: https://github.com/phpredis/phpredis
[Bootstrap]: https://getbootstrap.com
[PHP]: https://php.net
[Redis]: https://redis.io
[magnet]: https://en.wikipedia.org/wiki/Magnet_URI_scheme
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "johncave/phplinuxtrack",
"description": "A simple PHP torrent display mechanism designed to ease and beautify managing the torrent files of a linux distro or other software project.",
"minimum-stability": "stable",
"type": "project",
"license": "GPL-2.0",
"autoload": {
"psr-4": {
"johncave\\PhpLinuxTrack\\": "src/"
}
},
"require": {
"vlucas/phpdotenv": "2.4.*",
"coldwinds/torrent-rw": "^1.1",
"johannes85/php-torrent-scraper": "1.0.*"
}
}
15 changes: 15 additions & 0 deletions config/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Project Configuration
PROJECT_TITLE = "OpenMandriva Project - BitTorrent Tracker"
LANGUAGE = "en"

# Torrent File Configuration
TORRENT_DIRECTORY = "torrents/" # Location of the torrents directory
TORRENT_WEB_DIRECTORY = "/torrents/" # Location of the torrents dir, for use in links

# Redis Configuration
REDIS_HOST = "127.0.0.1" # The IP of your Redis instance
REDIS_PORT = 6379 # The port that Redis is running on

# Caching Configuration
CACHE_SCRAPE = 900
CACHE_TABLE = 180 # Time to keep the torrent table cached in Redis
229 changes: 0 additions & 229 deletions inc/bdecode.old.php

This file was deleted.

16 changes: 0 additions & 16 deletions inc/config.php

This file was deleted.

Loading