refactor: refactoring of code, update docs

This commit is contained in:
2024-01-21 15:18:35 +01:00
parent e19643ebcb
commit 620801cb99
5 changed files with 33 additions and 14 deletions

View File

@@ -39,7 +39,7 @@ func RestoreDatabase(file string) {
dbPort = os.Getenv("DB_PORT")
storagePath = os.Getenv("STORAGE_PATH")
if file == "" {
utils.Fatal("Error required --file")
utils.Fatal("Error, file required")
}
if os.Getenv("DB_HOST") == "" || os.Getenv("DB_NAME") == "" || os.Getenv("DB_USERNAME") == "" || os.Getenv("DB_PASSWORD") == "" || file == "" {

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)