.
This commit is contained in:
@@ -15,6 +15,8 @@ type Config struct {
|
||||
RootPath string // Path to serve files from
|
||||
DirIndexingEnabled bool // Allow client to browse directories or not
|
||||
ListenAddr string // Address to listen on
|
||||
TLSCert string // TLS certificate file
|
||||
TLSKey string // TLS key file
|
||||
}
|
||||
|
||||
var CONFIG Config //nolint:gochecknoglobals
|
||||
@@ -43,6 +45,8 @@ func GetConfig() *Config {
|
||||
rootPath := flag.String("root-path", "", "Path to serve files from")
|
||||
dirIndexing := flag.Bool("dir-indexing", false, "Allow client to browse directories")
|
||||
listen := flag.String("listen", "localhost:1965", "Address to listen on")
|
||||
tlsCert := flag.String("tls-cert", "certs/server.crt", "TLS certificate file")
|
||||
tlsKey := flag.String("tls-key", "certs/server.key", "TLS key file")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -65,5 +69,7 @@ func GetConfig() *Config {
|
||||
RootPath: *rootPath,
|
||||
DirIndexingEnabled: *dirIndexing,
|
||||
ListenAddr: *listen,
|
||||
TLSCert: *tlsCert,
|
||||
TLSKey: *tlsKey,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user