Make webdav namespace configurable across services
This commit is contained in:
@@ -49,6 +49,7 @@ type Config struct {
|
||||
Tracing Tracing
|
||||
Service Service
|
||||
OcisPublicURL string
|
||||
WebdavNamespace string
|
||||
|
||||
Context context.Context
|
||||
Supervised bool
|
||||
|
||||
@@ -148,6 +148,13 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
EnvVars: []string{"OCIS_PUBLIC_URL", "OCIS_URL"},
|
||||
Destination: &cfg.OcisPublicURL,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "webdav-namespace",
|
||||
Value: flags.OverrideDefaultString(cfg.WebdavNamespace, "/home"),
|
||||
Usage: "Namespace prefix for the /webdav endpoint",
|
||||
EnvVars: []string{"STORAGE_WEBDAV_NAMESPACE"},
|
||||
Destination: &cfg.WebdavNamespace,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ func (g Webdav) Thumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
Height: tr.Height,
|
||||
Source: &thumbnails.GetThumbnailRequest_Cs3Source{
|
||||
Cs3Source: &thumbnails.CS3Source{
|
||||
Path: path.Join("/home", tr.Filepath),
|
||||
Path: path.Join(g.config.WebdavNamespace, tr.Filepath),
|
||||
Authorization: t,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user