Front-End Stuff

This commit is contained in:
Chris Mann 2023-07-20 20:02:54 +02:00
parent ed51fe353a
commit 1dbe41811e
2 changed files with 6 additions and 6 deletions

1
go.mod
View file

@ -14,7 +14,6 @@ require (
github.com/minio/minio-go/v7 v7.0.0 github.com/minio/minio-go/v7 v7.0.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
github.com/sethvargo/go-password/password
) )
require ( require (

View file

@ -19,7 +19,7 @@ import (
// "github.com/emersion/go-smtp" // "github.com/emersion/go-smtp"
// "github.com/gorilla/mux" // "github.com/gorilla/mux"
// "golang.org/x/crypto/argon2" // "golang.org/x/crypto/argon2"
"github.com/sethvargo/go-password/password" "math/rand"
) )
type NewUser struct { type NewUser struct {
@ -45,11 +45,12 @@ func openLdap(config ConfigFile) *ldap.Conn {
} }
func suggestPassword() string { func suggestPassword() string {
res, err := password.Generate(10, 2, 2, false, false) password := ""
if err != nil { chars := "abcdfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*+_-="
log.Fatal(err) for i := 0; i < 12; i++ {
password += string([]rune(chars)[rand.Intn(len(chars))])
} }
return res return password
} }
func addNewUser(newUser NewUser, config *ConfigFile, login *LoginStatus) bool { func addNewUser(newUser NewUser, config *ConfigFile, login *LoginStatus) bool {