X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=passwd.go;h=2a473f6ca5a189ad6e0aa34f5abdb01001f1c6ab;hb=d9767ae738045ebf1bd483ae708af80fa384ca9f;hp=dbdac8c178065bb20fb77495548da27554661d3b;hpb=ad6b9b1dca039678e7c48fe07e864b614e01158f;p=gocheese.git diff --git a/passwd.go b/passwd.go index dbdac8c..2a473f6 100644 --- a/passwd.go +++ b/passwd.go @@ -1,7 +1,7 @@ /* GoCheese -- Python private package repository and caching proxy -Copyright (C) 2019 Sergey Matveev - 2019 Elena Balakhonova +Copyright (C) 2019-2020 Sergey Matveev + 2019-2020 Elena Balakhonova This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ import ( "errors" "io/ioutil" "log" + "os" "strings" ) @@ -52,6 +53,9 @@ func strToAuther(verifier string) (string, Auther, error) { func refreshPasswd() { passwd, err := ioutil.ReadFile(*passwdPath) + if os.IsNotExist(err) { + return + } if err != nil { log.Fatal(err) } @@ -73,7 +77,7 @@ func refreshPasswd() { log.Fatalf("%s:%d: %s: %s", *passwdPath, i, login, err) } passwordsNew[login] = auther - log.Println("Added password for " + login) + log.Println("added password for:", login) } passwords = passwordsNew }