Skip to content

Commit

Permalink
Companion: change default S3 expiry from 300 to 800 seconds (#4206)
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon authored Nov 10, 2022
1 parent a2a265a commit dcfec25
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ COMPANION_AWS_BUCKET="YOUR AWS S3 BUCKET"
COMPANION_AWS_REGION="AWS REGION"
# to enable S3 Transfer Acceleration (default: false)
# COMPANION_AWS_USE_ACCELERATE_ENDPOINT="false"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 300)
# COMPANION_AWS_EXPIRES="300"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 800)
# COMPANION_AWS_EXPIRES="800"
# to set a canned ACL for uploaded objects: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
# COMPANION_AWS_ACL="public-read"

Expand Down
3 changes: 1 addition & 2 deletions packages/@uppy/companion/src/config/companion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const ms = require('ms')
const fs = require('node:fs')
const { isURL } = require('validator')
const logger = require('../server/logger')
Expand All @@ -15,7 +14,7 @@ const defaultOptions = {
conditions: [],
useAccelerateEndpoint: false,
getKey: defaultGetKey,
expires: ms('5 minutes') / 1000,
expires: 800, // seconds
},
allowLocalUrls: false,
logClientVersion: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion/src/standalone/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const getConfigFromEnv = () => {
region: process.env.COMPANION_AWS_REGION,
useAccelerateEndpoint:
process.env.COMPANION_AWS_USE_ACCELERATE_ENDPOINT === 'true',
expires: parseInt(process.env.COMPANION_AWS_EXPIRES || '300', 10),
expires: parseInt(process.env.COMPANION_AWS_EXPIRES || '800', 10),
acl: process.env.COMPANION_AWS_ACL,
},
server: {
Expand Down
4 changes: 2 additions & 2 deletions website/src/docs/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ export COMPANION_AWS_BUCKET="YOUR AWS S3 BUCKET"
export COMPANION_AWS_REGION="AWS REGION"
# to enable S3 Transfer Acceleration (default: false)
export COMPANION_AWS_USE_ACCELERATE_ENDPOINT="false"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 300)
export COMPANION_AWS_EXPIRES="300"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 800)
export COMPANION_AWS_EXPIRES="800"
# to set a canned ACL for uploaded objects: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
export COMPANION_AWS_ACL="private"

Expand Down

0 comments on commit dcfec25

Please sign in to comment.