Skip to content

unStatiK/TorrentBOX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TorrentBOX

This is a web-based torrent archive where you can upload torrent files. It allows to view, search through and download any file (including ones uploaded by other users) at any time.

Used technology:

  • Flask micro framework
  • SQLAlchemy
  • Tornado http server
  • WTForms
  • Bootstrap grid v2
  • PostgreSQL/MySQL/MariaDB

Full UTF-8 support.

Python3 compatibility only.

Compatibility with PyPy3.

Screenshots

main screen: tb1

torrent info page: tb2 tb3

user page: tb4

Installation

  • System package dependencies:
    • libpq-dev // for PostgreSQL
    • libmariadbd-dev // for MariaDB
    • libmysqlclient-dev // for MySQL
    • python-dev
  1. Install all python dependencies:

pip install -r deps/requirements.txt

For PostgreSQL support pip install -r deps/pg.txt

For MySQL/MariaDB support pip install -r deps/mysql.txt

  1. Edit config section in pg_config.py or mysql_config.py and main.py. Strongly recommend changed default salt for password!

  2. Create database and run sql script:

For PostgreSQL psql -U db_user -h db_host db_name < sql/create_pg.sql

For MySQL/MariaDB myql -u db_user -h db_host db_name < sql/create_mysql.sql

  1. Generate admin account

python generate_account.py -n account_name -p password > /tmp/create_admin.sql

  1. Insert admin account into db

For PostgreSQL psql -U db_user -h db_host db_name < /tmp/create_admin.sql

For MySQL/MariaDB myql -u db_user -h db_host db_name < /tmp/create_admin.sql

  1. Run it!

python run.py

open http://localhost:8080/ for profit!

start with http://localhost:8080/login login page!

Installation for PyPy

  1. Install pip module

./pypy-xxx/bin/pypy -m ensurepip

  1. Upgrade pip to latest version

./pypy-xxx/bin/pypy -mpip install -U pip wheel

  1. Install all python dependencies:

./pypy-xxx/bin/pypy -mpip install -r deps/requirements.txt

For PostgreSQL ./pypy-xxx/bin/pypy -mpip install -r deps/pg.txt

For MySQL/MariaDB ./pypy-xxx/bin/pypy -mpip install -r deps/mysql.txt

  1. Repeat 2-5 steps installation instruction

  2. Run it!

./pypy-xxx/bin/pypy run.py

Deploy

Example command for start service:

nohup python run.py > /dev/null 2>&1