diff --git a/app/server/lib/MinIOExternalStorage.ts b/app/server/lib/MinIOExternalStorage.ts index 1d667dd8..dafa738a 100644 --- a/app/server/lib/MinIOExternalStorage.ts +++ b/app/server/lib/MinIOExternalStorage.ts @@ -35,6 +35,7 @@ export class MinIOExternalStorage implements ExternalStorage { useSSL?: boolean, accessKey: string, secretKey: string, + region: string }, private _batchSize?: number) { this._s3 = new minio.Client(options) as MinIOClient; } diff --git a/app/server/lib/configureMinIOExternalStorage.ts b/app/server/lib/configureMinIOExternalStorage.ts index 87f88c57..c34a4755 100644 --- a/app/server/lib/configureMinIOExternalStorage.ts +++ b/app/server/lib/configureMinIOExternalStorage.ts @@ -19,6 +19,11 @@ export function checkMinIOExternalStorage() { preferredEnvVar: 'GRIST_DOCS_MINIO_BUCKET', }); if (!bucket) { return undefined; } + const region = settings.flag('bucketRegion').requireString({ + envVar: ['GRIST_DOCS_MINIO_BUCKET_REGION'], + preferredEnvVar: 'GRIST_DOCS_MINIO_BUCKET_REGION', + defaultValue: 'us-east-1' + }); const prefix = settings.flag('prefix').requireString({ envVar: ['GRIST_DOCS_MINIO_PREFIX'], preferredEnvVar: 'GRIST_DOCS_MINIO_PREFIX', @@ -52,5 +57,6 @@ export function checkMinIOExternalStorage() { useSSL, accessKey, secretKey, + region }; }