mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
initialize argon params before creating the data provider
This commit is contained in:
parent
df2e490680
commit
dd485509f6
1 changed files with 7 additions and 7 deletions
|
@ -469,6 +469,13 @@ func Initialize(cnf Config, basePath string, checkAdmins bool) error {
|
||||||
} else {
|
} else {
|
||||||
credentialsDirPath = filepath.Join(basePath, config.CredentialsPath)
|
credentialsDirPath = filepath.Join(basePath, config.CredentialsPath)
|
||||||
}
|
}
|
||||||
|
argon2Params = &argon2id.Params{
|
||||||
|
Memory: cnf.PasswordHashing.Argon2Options.Memory,
|
||||||
|
Iterations: cnf.PasswordHashing.Argon2Options.Iterations,
|
||||||
|
Parallelism: cnf.PasswordHashing.Argon2Options.Parallelism,
|
||||||
|
SaltLength: 16,
|
||||||
|
KeyLength: 32,
|
||||||
|
}
|
||||||
|
|
||||||
if err = validateHooks(); err != nil {
|
if err = validateHooks(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -477,13 +484,6 @@ func Initialize(cnf Config, basePath string, checkAdmins bool) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
argon2Params = &argon2id.Params{
|
|
||||||
Memory: cnf.PasswordHashing.Argon2Options.Memory,
|
|
||||||
Iterations: cnf.PasswordHashing.Argon2Options.Iterations,
|
|
||||||
Parallelism: cnf.PasswordHashing.Argon2Options.Parallelism,
|
|
||||||
SaltLength: 16,
|
|
||||||
KeyLength: 32,
|
|
||||||
}
|
|
||||||
if cnf.UpdateMode == 0 {
|
if cnf.UpdateMode == 0 {
|
||||||
err = provider.initializeDatabase()
|
err = provider.initializeDatabase()
|
||||||
if err != nil && err != ErrNoInitRequired {
|
if err != nil && err != ErrNoInitRequired {
|
||||||
|
|
Loading…
Reference in a new issue