mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(media): ✨ Add path_style and path configuration to S3
This commit is contained in:
parent
5bb4e967a7
commit
404d63f6d0
3 changed files with 13 additions and 1 deletions
|
|
@ -159,11 +159,15 @@ export class Media extends BaseInterface<typeof Medias> {
|
|||
bucket: config.s3.bucket_name,
|
||||
accessKeyId: config.s3.access_key,
|
||||
secretAccessKey: config.s3.secret_access_key,
|
||||
virtualHostedStyle: !config.s3.path_style,
|
||||
});
|
||||
|
||||
await client.write(path, file);
|
||||
const finalPath = config.s3.path
|
||||
? join(config.s3.path, path)
|
||||
: path;
|
||||
|
||||
return { path };
|
||||
return { path: finalPath };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue