diff --git a/packages/s3/src/index.ts b/packages/s3/src/index.ts index 43e3cf4b7..37a0d961f 100644 --- a/packages/s3/src/index.ts +++ b/packages/s3/src/index.ts @@ -2,7 +2,9 @@ declare module "@dzangolab/fastify-config" { interface ApiConfig { s3: { accessKey: string; + bucket: string | Record; endPoint?: string; + fileSizeLimit?: number; forcePathStyle?: boolean; secretKey: string; region?: string; diff --git a/packages/s3/src/plugin.ts b/packages/s3/src/plugin.ts index 33cf51931..cb9a1b37b 100644 --- a/packages/s3/src/plugin.ts +++ b/packages/s3/src/plugin.ts @@ -19,7 +19,7 @@ const plugin = async ( addToBody: true, sharedSchemaId: "fileSchema", limits: { - fileSize: Number.POSITIVE_INFINITY, + fileSize: config.s3.fileSizeLimit || Number.POSITIVE_INFINITY, }, });