Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: allow disabling tus-s3-tags for better compatibility #604

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
tusPath: string
tusPartSize: number
tusUseFileVersionSeparator: boolean
tusAllowS3Tags: boolean
defaultMetricsEnabled: boolean
s3ProtocolEnabled: boolean
s3ProtocolPrefix: string
Expand Down Expand Up @@ -251,6 +252,7 @@
),
tusUseFileVersionSeparator:
getOptionalConfigFromEnv('TUS_USE_FILE_VERSION_SEPARATOR') === 'true',
tusAllowS3Tags: getOptionalConfigFromEnv('TUS_ALLOW_S3_TAGS') !== 'false',

// S3 Protocol
s3ProtocolEnabled: getOptionalConfigFromEnv('S3_PROTOCOL_ENABLED') !== 'false',
Expand Down Expand Up @@ -449,7 +451,7 @@
try {
const parsed = JSON.parse(jwtJWKS)
config.jwtJWKS = parsed
} catch (e: any) {

Check warning on line 454 in src/config.ts

View workflow job for this annotation

GitHub Actions / Test / OS ubuntu-20.04 / Node 20

'e' is defined but never used

Check warning on line 454 in src/config.ts

View workflow job for this annotation

GitHub Actions / Test / OS ubuntu-20.04 / Node 20

Unexpected any. Specify a different type
throw new Error('Unable to parse JWT_JWKS value to JSON')
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/http/routes/tus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const {
tusPath,
tusPartSize,
tusMaxConcurrentUploads,
tusAllowS3Tags,
uploadFileSizeLimit,
storageBackendType,
storageFilePath,
Expand All @@ -66,6 +67,7 @@ function createTusStore(agent: { httpsAgent: https.Agent; httpAgent: http.Agent
expirationPeriodInMilliseconds: tusUrlExpiryMs,
cache: new AlsMemoryKV(),
maxConcurrentPartUploads: tusMaxConcurrentUploads,
useTags: tusAllowS3Tags,
s3ClientConfig: {
requestHandler: new NodeHttpHandler({
...agent,
Expand Down
Loading