From 0fa16724fd9d1bffb085214846bd5437ca7b7dd2 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Tue, 21 Apr 2020 23:47:54 +0200 Subject: Have configurable values --- Filer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Filer.py b/Filer.py index b7defd8..ddafd08 100755 --- a/Filer.py +++ b/Filer.py @@ -29,7 +29,8 @@ app.config['DROPZONE_DEFAULT_MESSAGE'] = 'Ziehe die Dateien hier hin, um sie hoc dropzone = Dropzone(app) -basedir = 'Daten' +basedir = os.getenv('FILER_BASEDIR', './Daten') +filettl = int(os.getenv('FILER_FILETTL', 10)) #### ADMIN FACING DIRECTORY LISTS #### #### @@ -151,7 +152,7 @@ def make_tree(rel, path): if os.path.isdir(os.path.join(rel,fn)): tree['children'].append(make_tree(rel, fn)) else: - ttl = 10 - int((time.time() - os.path.getmtime(os.path.join(rel,fn))) / (24*3600)) + ttl = filettl - int((time.time() - os.path.getmtime(os.path.join(rel,fn))) / (24*3600)) tree['children'].append(dict(name=fn, download=name, ttl = ttl)) return tree -- cgit v1.2.3