Skip to content

[Fix] Change S3 logger to accept more authorization methods for AWS #4114

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2025
Merged
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
17 changes: 13 additions & 4 deletions packages/server/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ if (process.env.STORAGE_TYPE === 's3') {
const customURL = process.env.S3_ENDPOINT_URL
const forcePathStyle = process.env.S3_FORCE_PATH_STYLE === 'true'

if (!region || !s3Bucket) {
throw new Error('S3 storage configuration is missing')
}

let credentials: S3ClientConfig['credentials'] | undefined
if (accessKeyId && secretAccessKey) {
credentials = {
accessKeyId,
secretAccessKey
}
}

const s3Config: S3ClientConfig = {
region: region,
endpoint: customURL,
forcePathStyle: forcePathStyle,
credentials: {
accessKeyId: accessKeyId as string,
secretAccessKey: secretAccessKey as string
}
credentials: credentials
}

s3ServerStream = new S3StreamLogger({
Expand Down