2
0

chore: ♻️ Better S3 env var format

This commit is contained in:
Baptiste Arnaud
2022-02-14 07:52:12 +01:00
parent 1033e42b60
commit 9c20ef00b9
2 changed files with 8 additions and 8 deletions

View File

@ -17,10 +17,10 @@ NEXT_PUBLIC_EMAIL_NOTIFICATIONS_FROM_EMAIL=
# Storage
# Used for uploading images, videos, etc...
S3_UPLOAD_KEY=
S3_UPLOAD_SECRET=
S3_UPLOAD_REGION=
S3_UPLOAD_BUCKET=
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_REGION=
S3_BUCKET=
# Auth
# (Optional) Used to login using GitHub

View File

@ -16,15 +16,15 @@ const handler = async (
return
}
aws.config.update({
accessKeyId: process.env.S3_UPLOAD_KEY,
secretAccessKey: process.env.S3_UPLOAD_SECRET,
region: process.env.S3_UPLOAD_REGION,
accessKeyId: process.env.S3_ACCESS_KEY,
secretAccessKey: process.env.S3_SECRET_KEY,
region: process.env.S3_REGION,
signatureVersion: 'v4',
})
const s3 = new aws.S3()
const post = s3.createPresignedPost({
Bucket: process.env.S3_UPLOAD_BUCKET,
Bucket: process.env.S3_BUCKET,
Fields: {
ACL: 'public-read',
key: req.query.key,