chore: ♻️ Better S3 env var format
This commit is contained in:
@@ -17,10 +17,10 @@ NEXT_PUBLIC_EMAIL_NOTIFICATIONS_FROM_EMAIL=
|
|||||||
|
|
||||||
# Storage
|
# Storage
|
||||||
# Used for uploading images, videos, etc...
|
# Used for uploading images, videos, etc...
|
||||||
S3_UPLOAD_KEY=
|
S3_ACCESS_KEY=
|
||||||
S3_UPLOAD_SECRET=
|
S3_SECRET_KEY=
|
||||||
S3_UPLOAD_REGION=
|
S3_REGION=
|
||||||
S3_UPLOAD_BUCKET=
|
S3_BUCKET=
|
||||||
|
|
||||||
# Auth
|
# Auth
|
||||||
# (Optional) Used to login using GitHub
|
# (Optional) Used to login using GitHub
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ const handler = async (
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
aws.config.update({
|
aws.config.update({
|
||||||
accessKeyId: process.env.S3_UPLOAD_KEY,
|
accessKeyId: process.env.S3_ACCESS_KEY,
|
||||||
secretAccessKey: process.env.S3_UPLOAD_SECRET,
|
secretAccessKey: process.env.S3_SECRET_KEY,
|
||||||
region: process.env.S3_UPLOAD_REGION,
|
region: process.env.S3_REGION,
|
||||||
signatureVersion: 'v4',
|
signatureVersion: 'v4',
|
||||||
})
|
})
|
||||||
|
|
||||||
const s3 = new aws.S3()
|
const s3 = new aws.S3()
|
||||||
const post = s3.createPresignedPost({
|
const post = s3.createPresignedPost({
|
||||||
Bucket: process.env.S3_UPLOAD_BUCKET,
|
Bucket: process.env.S3_BUCKET,
|
||||||
Fields: {
|
Fields: {
|
||||||
ACL: 'public-read',
|
ACL: 'public-read',
|
||||||
key: req.query.key,
|
key: req.query.key,
|
||||||
|
|||||||
Reference in New Issue
Block a user