add bootstrap config field: pre_lvm_crypt
This commit is contained in:
30
tools/passwd.go
Normal file
30
tools/passwd.go
Normal file
@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"novit.tech/direktil/pkg/bootstrapconfig"
|
||||
)
|
||||
|
||||
func main() {
|
||||
in := bufio.NewReader(os.Stdin)
|
||||
|
||||
read := func() string {
|
||||
s, err := in.ReadString('\n')
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
return strings.TrimSpace(s)
|
||||
}
|
||||
|
||||
seed := read()
|
||||
pass := read()
|
||||
|
||||
hash := bootstrapconfig.PasswordHashFromSeed([]byte(seed), []byte(pass))
|
||||
|
||||
fmt.Println(bootstrapconfig.JoinSeedAndHash([]byte(seed), hash))
|
||||
}
|
Reference in New Issue
Block a user