diff options
author | jaseg <git@jaseg.net> | 2019-06-26 16:36:20 +0900 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2019-06-26 16:36:20 +0900 |
commit | bf86e740bd1f025af3158ffdaaa05c25d7a2a37a (patch) | |
tree | 0afe889adfc23becb64dab14e9c5950e6e9772b4 /server.py | |
parent | fb2f3bcc2a6ec010e1ffc33b78833234f57da11a (diff) | |
download | secure-download-bf86e740bd1f025af3158ffdaaa05c25d7a2a37a.tar.gz secure-download-bf86e740bd1f025af3158ffdaaa05c25d7a2a37a.tar.bz2 secure-download-bf86e740bd1f025af3158ffdaaa05c25d7a2a37a.zip |
Improve encrypt command line interface, add progress bar
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8,6 +8,7 @@ from flask import Flask, abort, request, Response import filecrypt app = Flask(__name__) +app.config.from_envvar('SECURE_DOWNLOAD_SETTINGS') BASE64_RE = re.compile('^[A-Za-z0-9+-_]+=*$') @app.route('/<file_id>/<token>/<filename>') @@ -17,7 +18,7 @@ def download(file_id, token, filename): if not BASE64_RE.match(token) or len(token) != filecrypt.TOKEN_LENGTH: abort(400, 'Invalid token format') - path = f'{file_id}.enc' + path = f'{app.config["SERVE_PATH"]}/{file_id}.enc' if not os.path.isfile(path): abort(403) # forbidden |