The code and data behind xeiaso.net
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(sponsor-panel): set public-read ACL on S3 uploads for Tigris

Uploaded sponsor logos need to be publicly accessible via
t3.storage.dev, which requires the object ACL to be set to public-read.

Xe Iaso a39268a8 a6f33fd5

+4 -1
+4 -1
cmd/sponsor-panel/handlers.go
··· 12 12 "strings" 13 13 14 14 "github.com/aws/aws-sdk-go-v2/service/s3" 15 + "github.com/aws/aws-sdk-go-v2/service/s3/types" 15 16 "github.com/google/go-github/v82/github" 16 17 "github.com/google/uuid" 17 18 ··· 197 198 "key", s3Key, 198 199 "content_type", contentType) 199 200 201 + acl := types.ObjectCannedACLPublicRead 200 202 putInput := &s3.PutObjectInput{ 201 203 Bucket: &s.bucketName, 202 204 Key: &s3Key, 203 205 Body: bytes.NewReader(fileData), 204 206 ContentType: &contentType, 207 + ACL: acl, 205 208 } 206 209 207 210 _, err := s.s3Client.PutObject(r.Context(), putInput) ··· 211 214 return 212 215 } 213 216 214 - logoURL = fmt.Sprintf("https://%s.s3.amazonaws.com/%s", s.bucketName, s3Key) 217 + logoURL = fmt.Sprintf("https://%s.t3.storage.dev/%s", s.bucketName, s3Key) 215 218 slog.Info("logoHandler: uploaded to S3", 216 219 "user_id", user.ID, 217 220 "url", logoURL,