diff --git a/app.py b/app.py index c0613f9..3896593 100644 --- a/app.py +++ b/app.py @@ -9,7 +9,7 @@ app.config['MAX_CONTENT_LENGTH'] = int(os.environ.get('MAX_CONTENT_LENGTH', '5') VALID_FILENAME_REGEX = r'^[a-zA-Z0-9\-_\.]+$' -UPLOAD_TOKEN = os.environ.get('UPLOAD_TOKEN', 'myuploadotken') +AUTH_TOKEN = os.environ.get('AUTH_TOKEN', 'myauthtoken') def is_valid_filename(filename): return bool(re.match(VALID_FILENAME_REGEX, filename)) @@ -22,7 +22,7 @@ def upload_file(): if 'token' not in request.headers: return jsonify({'error': 'No token supplied'}), 401 - if request.headers['token'] != UPLOAD_TOKEN: + if request.headers['token'] != AUTH_TOKEN: return jsonify({'error': 'Invalid token supplied'}), 401 file = request.files['file'] diff --git a/docker-compose.yml b/docker-compose.yml index c3949ed..541bc9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,4 +10,4 @@ services: FLASK_DEBUG: 1 FLASK_APP: app UPLOAD_DIRECTORY: /uploads - UPLOAD_TOKEN: myuploadtoken + AUTH_TOKEN: myuploadtoken