From fbf131c6b276f1b51e759666c450675e33d9e2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 29 Jan 2020 22:01:40 +0100 Subject: [PATCH] change default ocdav namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/change-default-namespace.md | 9 +++++++++ pkg/command/frontend.go | 4 ++-- pkg/config/config.go | 6 ++++++ pkg/flagset/frontend.go | 10 ++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 changelog/unreleased/change-default-namespace.md diff --git a/changelog/unreleased/change-default-namespace.md b/changelog/unreleased/change-default-namespace.md new file mode 100755 index 0000000..0b31f26 --- /dev/null +++ b/changelog/unreleased/change-default-namespace.md @@ -0,0 +1,9 @@ +Change: use /home as default namespace + +Currently, cross storage etag propagation is not yet implemented, which prevents the desktop client from detecting changes via the PROPFIND to /. / is managed by the root storage provider which is independend of the home and oc storage providers. If a file changes in /home/foo, the etag change will only be propagated to the root of the home storage provider. + +This change jails users into the `/home` namespace, and allows configuring the namespace to use for the two webdav endpoints using the new environment variable `WEBDAV_NAMESPACE_JAIL` which affects both endpoints `/dav/files` and `/webdav`. + +This will allow us to focus on getting a single storage driver like eos or owncloud tested and better resembles what owncloud 10 does. + +To get back the global namespace, which ultimately is the goal, just set the above environment variable to `/`. \ No newline at end of file diff --git a/pkg/command/frontend.go b/pkg/command/frontend.go index fd73589..51dd56d 100644 --- a/pkg/command/frontend.go +++ b/pkg/command/frontend.go @@ -187,8 +187,8 @@ func Frontend(cfg *config.Config) *cli.Command { "prefix": "", "chunk_folder": "/var/tmp/revad/chunks", "gateway": cfg.Reva.Gateway.URL, - "files_namespace": "/", - "webdav_namespace": "/", + "files_namespace": cfg.Reva.OCDav.NamespaceJail, + "webdav_namespace": cfg.Reva.OCDav.NamespaceJail, }, "ocs": map[string]interface{}{ "gateway": cfg.Reva.Gateway.URL, diff --git a/pkg/config/config.go b/pkg/config/config.go index ddc3ff4..c2f2cc6 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -178,6 +178,11 @@ type LDAPSchema struct { CN string } +// OCDav defines the available ocdav configuration. +type OCDav struct { + NamespaceJail string +} + // Reva defines the available reva configuration. type Reva struct { // JWTSecret used to sign jwt tokens between services @@ -186,6 +191,7 @@ type Reva struct { TransferExpires int OIDC OIDC LDAP LDAP + OCDav OCDav Storages StorageConfig // Ports are used configure which services to start on which port Frontend Port diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index c852086..4f55967 100644 --- a/pkg/flagset/frontend.go +++ b/pkg/flagset/frontend.go @@ -89,6 +89,16 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.TransferSecret, }, + // OCDav + + &cli.StringFlag{ + Name: "webdav-namespace-jail", + Value: "/home/", + Usage: "Namespace prefix for the webdav endpoints /dav/files and /webdav", + EnvVars: []string{"WEBDAV_NAMESPACE_JAIL"}, + Destination: &cfg.Reva.OCDav.NamespaceJail, + }, + // OIDC &cli.StringFlag{