add torrent options to config

This commit is contained in:
Jimmy Zelinskie 2015-12-31 14:35:06 -05:00
parent c780572e69
commit a0e5de8f29
2 changed files with 6 additions and 3 deletions

View file

@ -276,3 +276,6 @@ class DefaultConfig(object):
# Torrent management flags
TORRENT_PIECE_SIZE = 512 * 1024
TORRENT_ANNOUNCE_URL = 'https://localhost:6881/announce'
TORRENT_NAMING_SALT = '3ae93fef-c30a-427e-9ba0-eea0fd710419'

View file

@ -7,8 +7,8 @@ import resumablehashlib
from app import app
TRACKER_ANNOUNCE_URL = app.config.get('BT_TRACKER_ANNOUNCE_URL')
NAMING_SALT = app.config.get('BT_NAMING_SALT')
ANNOUNCE_URL = app.config.get('TORRENT_ANNOUNCE_URL')
NAMING_SALT = app.config.get('TORRENT_NAMING_SALT')
def public_torrent_filename(blob_uuid):
return hashlib.sha256(blob_uuid).hexdigest()
@ -19,7 +19,7 @@ def per_user_torrent_filename(user_uuid, blob_uuid):
def make_torrent(name, webseed, length, piece_length, pieces):
return bencode.bencode({
'announce': TRACKER_ANNOUNCE_URL,
'announce': ANNOUNCE_URL,
'url-list': webseed,
'encoding': 'UTF-8',
'created by': 'Quay Container Registry',