fix: harden week-two ordering, artwork and operations
This commit is contained in:
13
app/core/limits.py
Normal file
13
app/core/limits.py
Normal file
@@ -0,0 +1,13 @@
|
||||
"""Limits shared by upload admission and the malware scanner."""
|
||||
import os
|
||||
|
||||
CLAMAV_STREAM_MAX_BYTES = 128 * 1024 * 1024 # infra/clamd.conf
|
||||
|
||||
|
||||
def scan_limit_bytes():
|
||||
return min(CLAMAV_STREAM_MAX_BYTES, int(os.environ.get('SCAN_MAX_BYTES', '134217728')))
|
||||
|
||||
|
||||
def upload_limit_bytes():
|
||||
transport = int(os.environ.get('MAX_UPLOAD_BYTES', '5368709120'))
|
||||
return min(transport, scan_limit_bytes())
|
||||
Reference in New Issue
Block a user