diff --git a/src/lib/config/read.ts b/src/lib/config/read.ts index 59ec37240..e1a251a96 100755 --- a/src/lib/config/read.ts +++ b/src/lib/config/read.ts @@ -155,6 +155,7 @@ export const PROP_TO_ENV = { 'datasource.s3.secretAccessKey': 'DATASOURCE_S3_SECRET_ACCESS_KEY', 'datasource.s3.region': 'DATASOURCE_S3_REGION', 'datasource.s3.bucket': 'DATASOURCE_S3_BUCKET', + 'datasource.s3.endpoint': 'DATASOURCE_S3_ENDPOINT', 'datasource.local.directory': 'DATASOURCE_LOCAL_DIRECTORY', @@ -319,6 +320,7 @@ export function readEnv() { env('datasource.s3.secretAccessKey', 'string'), env('datasource.s3.region', 'string'), env('datasource.s3.bucket', 'string'), + env('datasource.s3.endpoint', 'string'), env('datasource.local.directory', 'string'), diff --git a/src/lib/config/validate.ts b/src/lib/config/validate.ts index 519997ffa..e6a77e804 100755 --- a/src/lib/config/validate.ts +++ b/src/lib/config/validate.ts @@ -110,6 +110,7 @@ export const schema = z.object({ secretAccessKey: z.string(), region: z.string(), bucket: z.string(), + endpoint: z.string().nullable().default(null), }) .optional(), local: z diff --git a/src/lib/datasource/S3.ts b/src/lib/datasource/S3.ts index c835ad76a..ee39096b4 100644 --- a/src/lib/datasource/S3.ts +++ b/src/lib/datasource/S3.ts @@ -23,16 +23,20 @@ export class S3Datasource extends Datasource { secretAccessKey: string; region?: string; bucket: string; + endpoint?: string | null; }, ) { super(); + console.log(options); + this.client = new S3Client({ credentials: { accessKeyId: this.options.accessKeyId, secretAccessKey: this.options.secretAccessKey, }, region: this.options.region ?? undefined, + endpoint: this.options.endpoint ?? undefined, }); this.ensureBucketExists(); diff --git a/src/lib/datasource/index.ts b/src/lib/datasource/index.ts index f3bedd4b0..19359a47a 100755 --- a/src/lib/datasource/index.ts +++ b/src/lib/datasource/index.ts @@ -26,6 +26,7 @@ function getDatasource(conf?: typeof config): void { secretAccessKey: config.datasource.s3!.secretAccessKey, region: config.datasource.s3?.region, bucket: config.datasource.s3!.bucket, + endpoint: config.datasource.s3?.endpoint, }); break; default: diff --git a/src/server/index.ts b/src/server/index.ts index 769cc2cfb..490929c2a 100755 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -225,10 +225,3 @@ declare module 'fastify' { tasks: Tasks; } } - -process.on('unhandledRejection', (reason, promise) => { - console.log('AAA', reason, promise); -}); -process.on('uncaughtException', (reason) => { - console.log('aaa', reason); -});