Configurable S3 Region (#1007)

Co-authored-by: Jonas Plum <cugu@users.noreply.github.com>
This commit is contained in:
missingscrews
2023-10-18 22:45:49 +02:00
committed by GitHub
parent 494fee194b
commit e41c50c9c2
4 changed files with 6 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ type CLI struct {
S3Host string `env:"S3_HOST" default:"http://minio:9000" name:"s3-host"`
S3User string `env:"S3_USER" default:"minio" name:"s3-user"`
S3Password string `env:"S3_PASSWORD" required:"" name:"s3-password"`
S3Region string `env:"S3_REGION" default:"us-east-1" name:"s3-region"`
Version kong.VersionFlag `help:"Show version."`
}
@@ -84,7 +85,7 @@ func MapConfig(cli CLI) (*catalyst.Config, error) {
User: cli.ArangoDBUser,
Password: cli.ArangoDBPassword,
},
Storage: &storage.Config{Host: cli.S3Host, User: cli.S3User, Password: cli.S3Password},
Storage: &storage.Config{Host: cli.S3Host, User: cli.S3User, Region: cli.S3Region, Password: cli.S3Password},
ExternalAddress: cli.ExternalAddress,
InternalAddress: cli.CatalystAddress,
Port: cli.Port,

1
dev/start_dev.sh Normal file → Executable file
View File

@@ -11,6 +11,7 @@ export OIDC_CLIENT_SECRET=secret
export ARANGO_DB_HOST=http://localhost:8529
export ARANGO_DB_PASSWORD=foobar
export S3_HOST=http://localhost:9000
export S3_REGION=eu-central-1
export S3_PASSWORD=minio123
export AUTH_BLOCK_NEW=false

View File

@@ -20,6 +20,7 @@ type Storage struct {
type Config struct {
Host string
User string
Region string
Password string
}
@@ -27,7 +28,7 @@ func New(config *Config) (*Storage, error) {
s, err := session.NewSession(&aws.Config{
Credentials: credentials.NewStaticCredentials(config.User, config.Password, ""),
Endpoint: aws.String(config.Host),
Region: aws.String("us-east-1"),
Region: aws.String(config.Region),
DisableSSL: aws.Bool(true),
S3ForcePathStyle: aws.Bool(true),
})

View File

@@ -42,6 +42,7 @@ func Config(_ context.Context) (*catalyst.Config, error) {
Storage: &storage.Config{
Host: "http://localhost:9000",
User: "minio",
Region: "eu-central-1",
Password: "minio123",
},
Auth: &maut.Config{