Companion: change default S3 expiry from 300 to 800 seconds (#4206)

This commit is contained in:
Merlijn Vos 2022-11-10 11:55:31 -03:00 committed by GitHub
parent a2a265af02
commit dcfec2570c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View file

@ -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"

View file

@ -1,4 +1,3 @@
const ms = require('ms')
const fs = require('node:fs')
const { isURL } = require('validator')
const logger = require('../server/logger')
@ -15,7 +14,7 @@ const defaultOptions = {
conditions: [],
useAccelerateEndpoint: false,
getKey: defaultGetKey,
expires: ms('5 minutes') / 1000,
expires: 800, // seconds
},
allowLocalUrls: false,
logClientVersion: true,

View file

@ -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: {

View file

@ -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"