From 4186d954470ece6934a81b1be645401c03281c02 Mon Sep 17 00:00:00 2001 From: kovakmedya Date: Thu, 21 May 2026 21:24:11 +0300 Subject: [PATCH] feat(upload): bump per-file cap to 200MB end-to-end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cluster: Appwrite container _APP_STORAGE_LIMIT 30000000 → 209715200 (200MB) in /root/services/appwrite/.env on kovaksoft-coolify, then docker compose up -d to roll the worker pool with the new value. Backup of the .env left at .env.bak.. Bucket: job-files maximumFileSize updated to 209715200 via Appwrite MCP (storage_update_bucket). App: MAX_FILE_BYTES in both the upload API route and the original server action raised to 200MB. Client-side panel guard relaxed accordingly — one large file is now allowed to fill the entire batch (the 200MB proxy/serverActions cap is the bottleneck, not the per-file rule). Error copy updated. isletmem and any other tenants on the cluster also get the new limit, which is the desired behaviour — old 30MB ceiling was a relic of an Appwrite default that no DLS workflow can actually live with. --- .../jobs/[jobId]/components/job-files-panel.tsx | 10 +++++----- src/app/api/jobs/[jobId]/files/route.ts | 4 ++-- src/lib/appwrite/job-file-actions.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx b/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx index 52f3743..91d5d36 100644 --- a/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx +++ b/src/app/(dashboard)/jobs/[jobId]/components/job-files-panel.tsx @@ -61,8 +61,8 @@ export function JobFilesPanel({ ); } -const MAX_FILE_BYTES = 30 * 1024 * 1024; -const MAX_BATCH_BYTES = 180 * 1024 * 1024; // headroom under the 200MB proxy cap +const MAX_FILE_BYTES = 200 * 1024 * 1024; +const MAX_BATCH_BYTES = 200 * 1024 * 1024; // proxy cap; one large file fills the whole batch function UploadForm({ jobId }: { jobId: string }) { const router = useRouter(); @@ -166,11 +166,11 @@ function UploadForm({ jobId }: { jobId: string }) { {selected.length > 0 ? ( overSize ? ( - {overSize.name} 30MB'tan büyük (her dosya maksimum 30MB). + {overSize.name} 200MB'tan büyük (her dosya maksimum 200MB). ) : overBatch ? ( - Toplam {formatSize(totalBytes)} — 180MB sınırını aşıyor. Daha az dosya seçin. + Toplam {formatSize(totalBytes)} — 200MB sınırını aşıyor. Daha az dosya seçin. ) : ( <> @@ -178,7 +178,7 @@ function UploadForm({ jobId }: { jobId: string }) { ) ) : ( - "Tarama (STL/OBJ), görsel veya PDF — max 30MB / dosya, batch 180MB" + "Tarama (STL/OBJ), görsel veya PDF — max 200MB / dosya" )} {uploading ? ( diff --git a/src/app/api/jobs/[jobId]/files/route.ts b/src/app/api/jobs/[jobId]/files/route.ts index 44d0efa..3ecaa39 100644 --- a/src/app/api/jobs/[jobId]/files/route.ts +++ b/src/app/api/jobs/[jobId]/files/route.ts @@ -14,7 +14,7 @@ import { import { createAdminClient } from "@/lib/appwrite/server"; import { requireRole, requireTenant } from "@/lib/appwrite/tenant-guard"; -const MAX_FILE_BYTES = 30 * 1024 * 1024; +const MAX_FILE_BYTES = 200 * 1024 * 1024; function classifyFile(mimeType: string | undefined, name: string): JobFileKind { const lower = (mimeType || name).toLowerCase(); @@ -100,7 +100,7 @@ export async function POST( for (const f of files) { if (f.size > MAX_FILE_BYTES) { return NextResponse.json( - { ok: false, error: `${f.name} 30MB sınırını aşıyor.` }, + { ok: false, error: `${f.name} 200MB sınırını aşıyor.` }, { status: 400 }, ); } diff --git a/src/lib/appwrite/job-file-actions.ts b/src/lib/appwrite/job-file-actions.ts index 9a1e7a0..2eafcbf 100644 --- a/src/lib/appwrite/job-file-actions.ts +++ b/src/lib/appwrite/job-file-actions.ts @@ -20,7 +20,7 @@ import type { JobFileUploadState, } from "./job-file-types"; -const MAX_FILE_BYTES = 30 * 1024 * 1024; // 30MB — bucket limit +const MAX_FILE_BYTES = 200 * 1024 * 1024; // 200MB — bucket limit function appwriteError(e: unknown, fallback = "Beklenmeyen bir hata oluştu."): string { if (e instanceof AppwriteException) return e.message || fallback; @@ -89,7 +89,7 @@ export async function uploadJobFilesAction( for (const f of files) { if (f.size > MAX_FILE_BYTES) { - return { ok: false, error: `${f.name} 30MB sınırını aşıyor.` }; + return { ok: false, error: `${f.name} 200MB sınırını aşıyor.` }; } }