Ensure default root password is randomly generated

This commit is contained in:
Tobie Morgan Hitchcock 2017-02-20 16:16:35 +00:00
parent 2c23ee3ffb
commit b3c732ad7b

View file

@ -22,6 +22,7 @@ import (
"github.com/abcum/surreal/cnf" "github.com/abcum/surreal/cnf"
"github.com/abcum/surreal/log" "github.com/abcum/surreal/log"
"github.com/abcum/surreal/util/rand"
"github.com/abcum/surreal/util/uuid" "github.com/abcum/surreal/util/uuid"
) )
@ -138,7 +139,7 @@ func setup() {
} }
if opts.Auth.Pass == "" { if opts.Auth.Pass == "" {
opts.Auth.Pass = "root" opts.Auth.Pass = string(rand.New(20))
} }
// -------------------------------------------------- // --------------------------------------------------