mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 23:32:47 +01:00
Configurable S3 Region (#1007)
Co-authored-by: Jonas Plum <cugu@users.noreply.github.com>
This commit is contained in:
@@ -49,6 +49,7 @@ type CLI struct {
|
|||||||
S3Host string `env:"S3_HOST" default:"http://minio:9000" name:"s3-host"`
|
S3Host string `env:"S3_HOST" default:"http://minio:9000" name:"s3-host"`
|
||||||
S3User string `env:"S3_USER" default:"minio" name:"s3-user"`
|
S3User string `env:"S3_USER" default:"minio" name:"s3-user"`
|
||||||
S3Password string `env:"S3_PASSWORD" required:"" name:"s3-password"`
|
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."`
|
Version kong.VersionFlag `help:"Show version."`
|
||||||
}
|
}
|
||||||
@@ -84,7 +85,7 @@ func MapConfig(cli CLI) (*catalyst.Config, error) {
|
|||||||
User: cli.ArangoDBUser,
|
User: cli.ArangoDBUser,
|
||||||
Password: cli.ArangoDBPassword,
|
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,
|
ExternalAddress: cli.ExternalAddress,
|
||||||
InternalAddress: cli.CatalystAddress,
|
InternalAddress: cli.CatalystAddress,
|
||||||
Port: cli.Port,
|
Port: cli.Port,
|
||||||
|
|||||||
1
dev/start_dev.sh
Normal file → Executable file
1
dev/start_dev.sh
Normal file → Executable file
@@ -11,6 +11,7 @@ export OIDC_CLIENT_SECRET=secret
|
|||||||
export ARANGO_DB_HOST=http://localhost:8529
|
export ARANGO_DB_HOST=http://localhost:8529
|
||||||
export ARANGO_DB_PASSWORD=foobar
|
export ARANGO_DB_PASSWORD=foobar
|
||||||
export S3_HOST=http://localhost:9000
|
export S3_HOST=http://localhost:9000
|
||||||
|
export S3_REGION=eu-central-1
|
||||||
export S3_PASSWORD=minio123
|
export S3_PASSWORD=minio123
|
||||||
|
|
||||||
export AUTH_BLOCK_NEW=false
|
export AUTH_BLOCK_NEW=false
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ type Storage struct {
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Host string
|
Host string
|
||||||
User string
|
User string
|
||||||
|
Region string
|
||||||
Password string
|
Password string
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ func New(config *Config) (*Storage, error) {
|
|||||||
s, err := session.NewSession(&aws.Config{
|
s, err := session.NewSession(&aws.Config{
|
||||||
Credentials: credentials.NewStaticCredentials(config.User, config.Password, ""),
|
Credentials: credentials.NewStaticCredentials(config.User, config.Password, ""),
|
||||||
Endpoint: aws.String(config.Host),
|
Endpoint: aws.String(config.Host),
|
||||||
Region: aws.String("us-east-1"),
|
Region: aws.String(config.Region),
|
||||||
DisableSSL: aws.Bool(true),
|
DisableSSL: aws.Bool(true),
|
||||||
S3ForcePathStyle: aws.Bool(true),
|
S3ForcePathStyle: aws.Bool(true),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ func Config(_ context.Context) (*catalyst.Config, error) {
|
|||||||
Storage: &storage.Config{
|
Storage: &storage.Config{
|
||||||
Host: "http://localhost:9000",
|
Host: "http://localhost:9000",
|
||||||
User: "minio",
|
User: "minio",
|
||||||
|
Region: "eu-central-1",
|
||||||
Password: "minio123",
|
Password: "minio123",
|
||||||
},
|
},
|
||||||
Auth: &maut.Config{
|
Auth: &maut.Config{
|
||||||
|
|||||||
Reference in New Issue
Block a user