This commit is contained in:
antanst
2025-10-09 17:43:23 +03:00
parent 2ead66f012
commit 3a5835fc42
54 changed files with 5881 additions and 120 deletions

View File

@@ -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,
}
}