diff --git a/.env.example b/.env.example index 3c916c2..ab1d905 100644 --- a/.env.example +++ b/.env.example @@ -52,7 +52,7 @@ TINY_ADAPTER=fake # SMTP_PASSWORD=... STORAGE_ADAPTER=s3-local MOCK_FREIGHT_CENTS=1500 -MAX_UPLOAD_BYTES=1073741824 +MAX_UPLOAD_BYTES=4294967296 UPLOAD_PART_BYTES=8388608 STORAGE_QUOTA_BYTES=53687091200 OWNER_UPLOAD_QUOTA_BYTES=10737418240 diff --git a/app/core/limits.py b/app/core/limits.py index 544da46..33a9917 100644 --- a/app/core/limits.py +++ b/app/core/limits.py @@ -10,4 +10,4 @@ def scan_limit_bytes(): def upload_limit_bytes(): - return int(os.environ.get('MAX_UPLOAD_BYTES', '1073741824')) + return int(os.environ.get('MAX_UPLOAD_BYTES', str(4 * 1024 ** 3))) diff --git a/compose.local.yaml b/compose.local.yaml index 73ecfc3..3a12c29 100644 --- a/compose.local.yaml +++ b/compose.local.yaml @@ -91,12 +91,12 @@ x-app: &app SMTP_PASSWORD: ${SMTP_PASSWORD:-} STORAGE_ADAPTER: s3-local MOCK_FREIGHT_CENTS: ${MOCK_FREIGHT_CENTS:-1500} - MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-1073741824} + MAX_UPLOAD_BYTES: ${MAX_UPLOAD_BYTES:-4294967296} UPLOAD_PART_BYTES: ${UPLOAD_PART_BYTES:-8388608} STORAGE_QUOTA_BYTES: ${STORAGE_QUOTA_BYTES:-53687091200} OWNER_UPLOAD_QUOTA_BYTES: ${OWNER_UPLOAD_QUOTA_BYTES:-10737418240} MAX_PENDING_UPLOADS: ${MAX_PENDING_UPLOADS:-10} - SCAN_MAX_BYTES: ${SCAN_MAX_BYTES:-1073741824} + SCAN_MAX_BYTES: ${SCAN_MAX_BYTES:-2097152000} networks: [local] init: true security_opt: [no-new-privileges:true] diff --git a/deploy/portainer.env.example b/deploy/portainer.env.example index 58c2dec..d52dc40 100644 --- a/deploy/portainer.env.example +++ b/deploy/portainer.env.example @@ -56,7 +56,7 @@ SMTP_PASSWORD=TBD STORAGE_QUOTA_BYTES=TBD OWNER_UPLOAD_QUOTA_BYTES=TBD MAX_PENDING_UPLOADS=10 -MAX_UPLOAD_BYTES=1073741824 +MAX_UPLOAD_BYTES=4294967296 UPLOAD_PART_BYTES=8388608 SCAN_MAX_BYTES=134217728 # Daily encrypted database backup to its own bucket (docs/BACKUP.md). diff --git a/docker-compose.yml b/docker-compose.yml index ed50ff6..9ae1838 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -132,17 +132,17 @@ x-app-environment: &app-environment ALLOWED_HOSTS: ${SITE_DOMAIN:?set SITE_DOMAIN},${KANBAN_DOMAIN:?set KANBAN_DOMAIN} ALLOWED_ORIGINS: https://${SITE_DOMAIN:?set SITE_DOMAIN},https://${KANBAN_DOMAIN:?set KANBAN_DOMAIN} COOKIE_SECURE: "true" - # 1 GB per file (Dropstar, 2026-10-21): a 57 cm x 5 m sheet at 300 DPI is - # 200 to 300 MB, and much more takes an hour to send on a common connection. - MAX_UPLOAD_BYTES: "1073741824" + # 4 GB per file (Dropstar, 2026-10-28; it was 5 GB, then 1 GB from 2026-10-21). + MAX_UPLOAD_BYTES: "4294967296" UPLOAD_PART_BYTES: "8388608" # Sheets of several GB are the normal order, so room for many of them. STORAGE_QUOTA_BYTES: "${STORAGE_QUOTA_BYTES:-536870912000}" OWNER_UPLOAD_QUOTA_BYTES: "${OWNER_UPLOAD_QUOTA_BYTES:-53687091200}" MAX_PENDING_UPLOADS: "10" - # ClamAV scans up to this, so every file up to MAX_UPLOAD_BYTES is scanned; - # a larger one would be released after a file-format check (app/scanning.py). - SCAN_MAX_BYTES: "1073741824" + # ClamAV scans up to its own limit, 2000 MiB (infra/clamd.conf); a larger + # file, up to the 4 GB above, is released after the file-format check + # (app/scanning.py, check_large). + SCAN_MAX_BYTES: "2097152000" services: db: diff --git a/docs/CONTEXT.md b/docs/CONTEXT.md index 4646f97..e228711 100644 --- a/docs/CONTEXT.md +++ b/docs/CONTEXT.md @@ -387,7 +387,8 @@ the machine form); a linked operator sees only those machines' orders. Dropstar's corrections of 2026-10-21 already done: the home example priced as a ready sheet; opening hours 7h to 18h with "send your art any time"; uploads -up to 1 GB (MAX_UPLOAD_BYTES, scanned whole by ClamAV); a Designer profile +up to 1 GB (MAX_UPLOAD_BYTES; Dropstar moved it to 4 GB on 2026-10-28: ClamAV scans +up to its 2000 MiB, a larger file passes by the format check); a Designer profile (artwork stages only, every order, no machine, queue or cancelling; MOVES in app/core/auth.py, the "print" capability for the room's side); Números by date range, per machine (metres finished, metres per hour in Imprimindo, last finished, now) and orders apart from passages. A machine's diff --git a/tests/artwork_browser_test.mjs b/tests/artwork_browser_test.mjs index e8e995f..6aaaf48 100644 --- a/tests/artwork_browser_test.mjs +++ b/tests/artwork_browser_test.mjs @@ -167,9 +167,9 @@ try{ assert.deepEqual(await evaluate(`({shown:!$('tipoEnvio').hidden, on:[...document.querySelectorAll('#tipoEnvio .cam.on')].map(b=>b.dataset.tipo)})`), {shown:true,on:['folha']}); - await evaluate(`(()=>{const f=new File(['x'],'oversize.cdr');Object.defineProperty(f,'size',{value:1073741824+1});return sel([f]);})()`); - assert.equal(await evaluate(`folhas.length===0 && $('recusa').textContent.includes('1 GB')`),true, - 'files beyond the 1 GB upload limit are rejected before browser analysis'); + await evaluate(`(()=>{const f=new File(['x'],'oversize.cdr');Object.defineProperty(f,'size',{value:4294967296+1});return sel([f]);})()`); + assert.equal(await evaluate(`folhas.length===0 && $('recusa').textContent.includes('4 GB')`),true, + 'files beyond the 4 GB upload limit are rejected before browser analysis'); // A large sheet (here 900 MB) is the normal order: graded from the pixel size in its // header, never decoded. 6732 x 35433 px across 57 cm is 3 m at 300 DPI. await evaluate(`(()=>{const h=new Uint8Array(33);h.set([0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0,0,0,13,0x49,0x48,0x44,0x52]); diff --git a/tests/smoke_test.py b/tests/smoke_test.py index 2e2994e..2ab9ba8 100644 --- a/tests/smoke_test.py +++ b/tests/smoke_test.py @@ -117,8 +117,8 @@ def run(): client=Client();other=Client() config=client.call('/session');other.call('/session') assert client.call('/health')['integrations']=='fake' - # 1 GB per file: a 57 cm x 5 m sheet at 300 DPI is 200 to 300 MB. - assert config['max_upload_bytes'] == 1024 ** 3 + # 4 GB per file (Dropstar, 2026-10-28). + assert config['max_upload_bytes'] == 4 * 1024 ** 3 client.call('/uploads',{'name':'too-large.cdr', 'size':config['max_upload_bytes']+1},expected=413) cancelled=client.call('/uploads',{'name':'CANCELLED-PART.cdr','size':3})['id'] diff --git a/web/index.html b/web/index.html index 24ddbdf..94e5245 100644 --- a/web/index.html +++ b/web/index.html @@ -839,7 +839,7 @@ h2 em{font-style:normal;color:var(--laranja)}