Add default login if no htpasswd provided
This commit is contained in:
parent
299140dab1
commit
be91a04022
6
main.go
6
main.go
@ -20,7 +20,9 @@ func main() {
|
|||||||
flag.StringVar(&ThumbsDir, "thumbsdir", "./images/thumbs/", "Directory where generate thumbs")
|
flag.StringVar(&ThumbsDir, "thumbsdir", "./images/thumbs/", "Directory where generate thumbs")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
htpasswd := &Htpasswd{}
|
htpasswd := &Htpasswd{
|
||||||
|
entries: map[string]string{"admin": "2fClb0C8dIphk"},
|
||||||
|
}
|
||||||
|
|
||||||
if htpasswd_file != nil && *htpasswd_file != "" {
|
if htpasswd_file != nil && *htpasswd_file != "" {
|
||||||
log.Println("Reading htpasswd file...")
|
log.Println("Reading htpasswd file...")
|
||||||
@ -28,6 +30,8 @@ func main() {
|
|||||||
if htpasswd, err = NewHtpasswd(*htpasswd_file); htpasswd == nil {
|
if htpasswd, err = NewHtpasswd(*htpasswd_file); htpasswd == nil {
|
||||||
log.Fatal("Unable to parse htpasswd:", err)
|
log.Fatal("Unable to parse htpasswd:", err)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log.Println("Using default credentials for administrative part: admin:admin")
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("Checking paths...")
|
log.Println("Checking paths...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user