refactor: refactoring of code, update docs

This commit is contained in:
2024-01-21 15:32:59 +01:00
parent db3c3873c3
commit 41c4dd7ba6
7 changed files with 46 additions and 28 deletions

View File

@@ -26,11 +26,14 @@ func S3Mount() {
func MountS3Storage(s3Path string) {
accessKey = os.Getenv("ACCESS_KEY")
secretKey = os.Getenv("SECRET_KEY")
bucketName = os.Getenv("BUCKETNAME")
bucketName = os.Getenv("BUCKET_NAME")
if bucketName == "" {
bucketName = os.Getenv("BUCKETNAME")
}
s3Endpoint = os.Getenv("S3_ENDPOINT")
if accessKey == "" || secretKey == "" || bucketName == "" {
utils.Fatal("Please make sure all environment variables are set")
utils.Fatal("Please make sure all environment variables are set for S3")
} else {
storagePath := fmt.Sprintf("%s%s", s3MountPath, s3Path)
err := os.Setenv("STORAGE_PATH", storagePath)