chore: ♻️ Better S3 env var format
This commit is contained in:
@ -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
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user