Make bcrypt cost configurable (#1793)

This commit is contained in:
Kegsay 2021-03-08 13:19:02 +00:00 committed by GitHub
parent c3ad2cca49
commit 850abb1dde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 39 additions and 18 deletions

View file

@ -24,6 +24,7 @@ import (
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/dendrite/userapi/storage/accounts"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/bcrypt"
)
const usage = `Usage: %s
@ -57,7 +58,7 @@ func main() {
accountDB, err := accounts.NewDatabase(&config.DatabaseOptions{
ConnectionString: cfg.UserAPI.AccountDatabase.ConnectionString,
}, cfg.Global.ServerName)
}, cfg.Global.ServerName, bcrypt.DefaultCost)
if err != nil {
logrus.Fatalln("Failed to connect to the database:", err.Error())
}