Add QE setup tool support for BitTorrent downloads

Fixes #1871
This commit is contained in:
Joseph Schorr 2016-09-26 11:13:59 +02:00
parent 343d293001
commit 681f975df5
5 changed files with 84 additions and 2 deletions

View file

@ -1,4 +1,5 @@
from random import SystemRandom
from uuid import uuid4
def generate_secret_key():
cryptogen = SystemRandom()
@ -52,6 +53,10 @@ def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
if not 'SECRET_KEY' in config_obj:
config_obj['SECRET_KEY'] = current_secret_key
# Default torrent pepper.
if not 'BITTORRENT_FILENAME_PEPPER' in config_obj:
config_obj['BITTORRENT_FILENAME_PEPPER'] = str(uuid4())
# Default storage configuration.
if not 'DISTRIBUTED_STORAGE_CONFIG' in config_obj:
config_obj['DISTRIBUTED_STORAGE_PREFERENCE'] = ['default']