Skip to content

Commit

Permalink
Add new S3_SYSTEM_BUCKET_NAME env
Browse files Browse the repository at this point in the history
  • Loading branch information
patapancakes committed Nov 28, 2024
1 parent 5480c2e commit 4d6de1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/daily/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func S3SaveMigration() error {
})

_, err := svc.CreateBucket(context.Background(), &s3.CreateBucketInput{
Bucket: aws.String("pokerogue-system"),
Bucket: aws.String(os.Getenv("S3_SYSTEM_BUCKET_NAME")),
})
if err != nil {
log.Printf("error while creating bucket (already exists?): %s", err)
Expand Down Expand Up @@ -154,7 +154,7 @@ func S3SaveMigration() error {
}

_, err = svc.PutObject(context.Background(), &s3.PutObjectInput{
Bucket: aws.String("pokerogue-system"),
Bucket: aws.String(os.Getenv("S3_SYSTEM_BUCKET_NAME")),
Key: aws.String(username),
Body: bytes.NewReader(json),
})
Expand Down
4 changes: 2 additions & 2 deletions db/savedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func StoreSystemSaveData(uuid []byte, data defs.SystemSaveData) error {
}

_, err = client.PutObject(context.Background(), &s3.PutObjectInput{
Bucket: aws.String("pokerogue-system"),
Bucket: aws.String(os.Getenv("S3_SYSTEM_BUCKET_NAME")),
Key: aws.String(username),
Body: bytes.NewReader(json),
})
Expand Down Expand Up @@ -241,7 +241,7 @@ func GetSystemSaveFromS3(uuid []byte) (defs.SystemSaveData, error) {
client := s3.NewFromConfig(cfg)

s3Object := s3.GetObjectInput{
Bucket: aws.String("pokerogue-system"),
Bucket: aws.String(os.Getenv("S3_SYSTEM_BUCKET_NAME")),
Key: aws.String(username),
}

Expand Down

0 comments on commit 4d6de1e

Please sign in to comment.