mirror of
https://github.com/twofas/2fas-server.git
synced 2024-12-04 16:20:13 +01:00
fix: pass region from env
This commit is contained in:
parent
782e77173d
commit
ce476fe477
@ -4,4 +4,5 @@ type PassConfig struct {
|
||||
Addr string `envconfig:"PASS_ADDR" default:":8082"`
|
||||
KMSKeyID string `envconfig:"KMS_KEY_ID" default:"alias/pass_service_signing_key"`
|
||||
AWSEndpoint string `envconfig:"AWS_ENDPOINT" default:""`
|
||||
AWSRegion string `envconfig:"AWS_REGION" default:"us-east-2"`
|
||||
}
|
||||
|
@ -25,8 +25,12 @@ func NewServer(cfg config.PassConfig) *Server {
|
||||
if cfg.AWSEndpoint != "" {
|
||||
awsEndpoint = aws.String(cfg.AWSEndpoint)
|
||||
}
|
||||
region := cfg.AWSRegion
|
||||
if region == "" {
|
||||
region = "us-east-1"
|
||||
}
|
||||
sess, err := session.NewSession(&aws.Config{
|
||||
Region: aws.String("us-east-1"),
|
||||
Region: aws.String(region),
|
||||
S3ForcePathStyle: aws.Bool(true),
|
||||
Endpoint: awsEndpoint,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user