all
This commit is contained in:
19
Securite/Linkwarden/lib/api/storage/s3Client.ts
Normal file
19
Securite/Linkwarden/lib/api/storage/s3Client.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { S3 } from "@aws-sdk/client-s3";
|
||||
|
||||
const s3Client: S3 | undefined =
|
||||
process.env.SPACES_ENDPOINT &&
|
||||
process.env.SPACES_REGION &&
|
||||
process.env.SPACES_KEY &&
|
||||
process.env.SPACES_SECRET
|
||||
? new S3({
|
||||
forcePathStyle: !!process.env.SPACES_FORCE_PATH_STYLE,
|
||||
endpoint: process.env.SPACES_ENDPOINT,
|
||||
region: process.env.SPACES_REGION,
|
||||
credentials: {
|
||||
accessKeyId: process.env.SPACES_KEY,
|
||||
secretAccessKey: process.env.SPACES_SECRET,
|
||||
},
|
||||
})
|
||||
: undefined;
|
||||
|
||||
export default s3Client;
|
Reference in New Issue
Block a user