webdav: add prefix support

This commit is contained in:
Nicola Murino
2021-03-07 17:10:45 +01:00
parent 1ab02d5891
commit 4c658bb6f0
9 changed files with 25 additions and 3 deletions

View File

@@ -59,6 +59,7 @@ var (
EnableHTTPS: false,
ClientAuthType: 0,
TLSCipherSuites: nil,
Prefix: "",
}
defaultHTTPDBinding = httpd.Binding{
Address: "127.0.0.1",
@@ -675,6 +676,12 @@ func getWebDAVDBindingFromEnv(idx int) {
isSet = true
}
prefix, ok := os.LookupEnv(fmt.Sprintf("SFTPGO_WEBDAVD__BINDINGS__%v__PREFIX", idx))
if ok {
binding.Prefix = prefix
isSet = true
}
if isSet {
if len(globalConf.WebDAVD.Bindings) > idx {
globalConf.WebDAVD.Bindings[idx] = binding