fix(worker,index-builder): use us-east-1 region for S3-compatible endpoints
The AWS SDK requires a valid AWS region name even when using custom S3-compatible endpoints (ARMOR/B2). Using "auto" as the region causes an error: "Invalid region: region was not a valid DNS name." This fixes the replay upload pipeline which was failing with the invalid region error. Replays should now upload successfully to B2 via the ARMOR proxy. Related to ai-code-battle-o43: Replay viewer verification task.
This commit is contained in:
parent
1dda4ab125
commit
09fced7dfe
2 changed files with 4 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ func NewS3Client(endpoint, accessKey, secretKey, bucket string) (*S3Client, erro
|
|||
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(
|
||||
accessKey, secretKey, "",
|
||||
)),
|
||||
config.WithRegion("auto"),
|
||||
config.WithRegion("us-east-1"),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to load AWS config: %w", err)
|
||||
|
|
|
|||
|
|
@ -22,14 +22,15 @@ type B2Client struct {
|
|||
// NewB2Client creates a new B2 client.
|
||||
func NewB2Client(cfg *Config) *B2Client {
|
||||
// Load AWS config with B2 credentials
|
||||
// Use region "auto" for custom S3-compatible endpoints (ARMOR/B2)
|
||||
// For S3-compatible endpoints (ARMOR/B2), use us-east-1 as a placeholder region
|
||||
// The actual endpoint is overridden via BaseEndpoint in the S3 client
|
||||
awsCfg, err := config.LoadDefaultConfig(context.TODO(),
|
||||
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(
|
||||
cfg.B2AccessKey,
|
||||
cfg.B2SecretKey,
|
||||
"",
|
||||
)),
|
||||
config.WithRegion("auto"),
|
||||
config.WithRegion("us-east-1"),
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to load AWS config: %v", err))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue