-
Notifications
You must be signed in to change notification settings - Fork 130
Fix S3/Backblaze upload failure by enabling path-style addressing #141
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
base: main
Are you sure you want to change the base?
Fix S3/Backblaze upload failure by enabling path-style addressing #141
Conversation
- Add UsePathStyle option to S3 client configuration - Required for S3-compatible services like Backblaze B2 - Restores functionality lost in AWS SDK v1 to v2 migration - Compatible with Amazon S3, Backblaze, and arm64 architecture Fixes eduardolat#140 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
WalkthroughUpdated S3 client initialization to enable path-style addressing by adding an option to s3.NewFromConfig. No other logic, error handling, or control flow changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal/integration/storage/s3.go (1)
46-50: LGTM! Fix addresses the reported S3 upload failure.The change correctly enables path-style addressing, which is required for S3-compatible services like Backblaze B2. This restores functionality lost in the AWS SDK v1 to v2 migration, as v2 defaults to virtual-hosted-style addressing while v1 used path-style by default. AWS S3 supports both addressing styles, so this change maintains compatibility with standard S3 while fixing Backblaze uploads.
Consider making path-style addressing configurable.
While hardcoding
UsePathStyle = truefixes the immediate issue and works with both AWS S3 and Backblaze, consider adding a configuration option for future flexibility. Some users might prefer virtual-hosted-style for AWS S3 (e.g., for CloudFront compatibility or to match bucket policies), while others need path-style for S3-compatible services.Example approach:
func createS3Client( accessKey, secretKey, region, endpoint string, usePathStyle bool, ) (*s3.Client, error) { // ... existing code ... s3Client := s3.NewFromConfig(conf, func(o *s3.Options) { o.UsePathStyle = usePathStyle }) return s3Client, nil }This would require updating all callers and adding a configuration field, but provides better flexibility for diverse S3-compatible services.
|
Hi, my issue #145 seems to be related to this PR. Thanks for merging. |
Fixes #140
Summary by CodeRabbit