Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1339,13 +1339,14 @@ export class GraphQLServer {

const buffer = Buffer.from(base64, "base64");

const MAX_FILE_BYTES = 50 * 1024 * 1024; // 50 MB
const MAX_FILE_BYTES = 250 * 1024 * 1024; // 250 MB
if (buffer.length > MAX_FILE_BYTES) {
const maxMb = Math.round(MAX_FILE_BYTES / (1024 * 1024));
return {
errors: [
{
field: "content",
message: "File exceeds the 50 MB upload limit",
message: `File exceeds the ${maxMb} MB upload limit`,
code: "FILE_TOO_LARGE",
},
],
Expand Down
6 changes: 5 additions & 1 deletion infrastructure/evault-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ const initializeEVault = async (

fastifyServer = fastify({
logger: true,
bodyLimit: 20 * 1024 * 1024, // 20MB (default is 1MB; needed for createMetaEnvelope etc.)
// 350MB. Files are uploaded base64-encoded inside the GraphQL JSON body,
// which inflates the raw request ~1.37x, so the body limit must exceed the
// base64-encoded size of the largest allowed file (250MB binary ≈ 343MB
// base64 + JSON overhead). Keep in sync with MAX_FILE_BYTES in graphql-server.ts.
bodyLimit: 350 * 1024 * 1024,
});

// Register CORS plugin with relaxed settings
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/evault-core/src/test-utils/e2e-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export async function setupE2ETestServer(
// Setup Fastify server
const fastifyServer = fastify({
logger: false,
bodyLimit: 20 * 1024 * 1024, // 20MB, match production limit
bodyLimit: 350 * 1024 * 1024, // 350MB, match production limit
});
await registerHttpRoutes(fastifyServer, evaultInstance, provisioningService, dbService);

Expand Down
2 changes: 1 addition & 1 deletion platforms/esigner/api/src/controllers/FileController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FileService, ReservedFileNameError } from "../services/FileService";
import multer from "multer";
import { v4 as uuidv4 } from "uuid";

export const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB limit
export const MAX_FILE_SIZE = 250 * 1024 * 1024; // 250MB limit

const upload = multer({
limits: { fileSize: MAX_FILE_SIZE },
Expand Down
4 changes: 2 additions & 2 deletions platforms/esigner/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ app.use(
credentials: true,
}),
);
app.use(express.json({ limit: "20mb" }));
app.use(express.urlencoded({ limit: "20mb", extended: true }));
app.use(express.json({ limit: "250mb" }));
app.use(express.urlencoded({ limit: "250mb", extended: true }));

// Controllers
const authController = new AuthController();
Expand Down
2 changes: 1 addition & 1 deletion platforms/esigner/client/src/lib/stores/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const fetchDocuments = async () => {
// Keep fetchFiles alias for backward compatibility
export const fetchFiles = fetchDocuments;

const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB limit
const MAX_FILE_SIZE = 250 * 1024 * 1024; // 250MB limit

export class FileSizeError extends Error {
constructor(
Expand Down
Loading