autocomplete
This commit is contained in:
parent
a17d4b1fcf
commit
10e4fb47da
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module git.teamworkapps.com/shortcut/docker-mailserver-passwords
|
|||
go 1.22.2
|
||||
|
||||
require (
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98
|
||||
github.com/gorilla/mux v1.8.1
|
||||
github.com/knadh/go-pop3 v1.0.0
|
||||
)
|
||||
|
|
2
go.sum
2
go.sum
|
@ -2,6 +2,8 @@ git.teamworkapps.com/shortcut/forms v0.0.0-20240319204456-8f50f1d78d23 h1:3UWDUv
|
|||
git.teamworkapps.com/shortcut/forms v0.0.0-20240319204456-8f50f1d78d23/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y=
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92 h1:58ahYebx7K9oYuLRgUMwpTyp5xy1xsKIxVb+GEXGmgo=
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20240812141315-1ed2ebc91b92/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y=
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98 h1:qu2By0n7SZ12veS3syyC3fFScL2Yd1R6+dBOfgVKAXc=
|
||||
git.teamworkapps.com/shortcut/forms v0.0.0-20241008222643-619c5114ff98/go.mod h1:1ElXS6rlK/NaNDQoqfCALVVKnwaSYAg2pNF8Ksvoc3Y=
|
||||
github.com/emersion/go-message v0.15.0 h1:urgKGqt2JAc9NFJcgncQcohHdiYb803YTH9OQwHBHIY=
|
||||
github.com/emersion/go-message v0.15.0/go.mod h1:wQUEfE+38+7EW8p8aZ96ptg6bAb1iwdgej19uXASlE4=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY=
|
||||
|
|
6
main.go
6
main.go
|
@ -151,7 +151,7 @@ recreation@pinnaclelake.com|{SHA512-CRYPT}$6$uTiy7Q5xn1CIN22w$3VAElns3TFfejtdTCT
|
|||
// createPasswordEntry: input email and plain text password, output a password entry with sha512-crypt.
|
||||
|
||||
func modifyPasswordFile(email, password string) bool {
|
||||
email=strings.ToLower(email)
|
||||
email = strings.ToLower(email)
|
||||
log.Printf("Changing password for %s", email)
|
||||
// read the password file
|
||||
// find the entry with the given email
|
||||
|
@ -170,11 +170,11 @@ func modifyPasswordFile(email, password string) bool {
|
|||
|
||||
lines := strings.Split(string(in), "\n")
|
||||
for _, line := range lines {
|
||||
tmp:=strings.Split(line,"|")
|
||||
tmp := strings.Split(line, "|")
|
||||
if len(tmp) != 2 {
|
||||
continue
|
||||
}
|
||||
if tmp[0]==email {
|
||||
if tmp[0] == email {
|
||||
line = createPasswordEntry(email, password)
|
||||
}
|
||||
out.WriteString(line)
|
||||
|
|
Loading…
Reference in New Issue