mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-23 19:51:53 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
764a69cd33 | ||
|
|
d266f1150e |
@@ -5,6 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hacdias/webdav/webdav"
|
"github.com/hacdias/webdav/webdav"
|
||||||
@@ -81,6 +82,10 @@ func parseUsers(raw []interface{}, c *webdav.Config) {
|
|||||||
password, ok := u["password"].(string)
|
password, ok := u["password"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
password = ""
|
password = ""
|
||||||
|
|
||||||
|
if numPwd, ok := u["password"].(int); ok {
|
||||||
|
password = strconv.Itoa(numPwd)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(password, "{env}") {
|
if strings.HasPrefix(password, "{env}") {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ func init() {
|
|||||||
flags := rootCmd.Flags()
|
flags := rootCmd.Flags()
|
||||||
flags.StringVarP(&cfgFile, "config", "c", "", "config file path")
|
flags.StringVarP(&cfgFile, "config", "c", "", "config file path")
|
||||||
flags.BoolP("tls", "t", false, "enable tls")
|
flags.BoolP("tls", "t", false, "enable tls")
|
||||||
|
flags.Bool("auth", true, "enable auth")
|
||||||
flags.String("cert", "cert.pem", "TLS certificate")
|
flags.String("cert", "cert.pem", "TLS certificate")
|
||||||
flags.String("key", "key.pem", "TLS key")
|
flags.String("key", "key.pem", "TLS key")
|
||||||
flags.StringP("address", "a", "0.0.0.0", "address to listen to")
|
flags.StringP("address", "a", "0.0.0.0", "address to listen to")
|
||||||
|
|||||||
Reference in New Issue
Block a user