From 4d6de1e2a80edfea95783fa9b09aaedf74dfe2c7 Mon Sep 17 00:00:00 2001 From: Pancakes Date: Wed, 27 Nov 2024 19:41:18 -0500 Subject: [PATCH] Add new S3_SYSTEM_BUCKET_NAME env --- api/daily/common.go | 4 ++-- db/savedata.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/daily/common.go b/api/daily/common.go index 84b8167..fa2604a 100644 --- a/api/daily/common.go +++ b/api/daily/common.go @@ -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) @@ -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), }) diff --git a/db/savedata.go b/db/savedata.go index 8855c2e..3765bc2 100644 --- a/db/savedata.go +++ b/db/savedata.go @@ -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), }) @@ -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), }