diff --git a/changelog/unreleased/bump-reva.md b/changelog/unreleased/bump-reva.md index ee203b6bd..5e37f2f01 100644 --- a/changelog/unreleased/bump-reva.md +++ b/changelog/unreleased/bump-reva.md @@ -1,7 +1,65 @@ -Enhancement: Bump Reva +Enhancement: Bump Reva to v2.20.0 -bumps reva version +* Bugfix [cs3org/reva#4623](https://github.com/cs3org/reva/pull/4623): Consistently use spaceid and nodeid in logs +* Bugfix [cs3org/reva#4584](https://github.com/cs3org/reva/pull/4584): Prevent copying a file to a parent folder +* Bugfix [cs3org/reva#4700](https://github.com/cs3org/reva/pull/4700): Clean empty trash node path on delete +* Bugfix [cs3org/reva#4567](https://github.com/cs3org/reva/pull/4567): Fix error message in authprovider if user is not found +* Bugfix [cs3org/reva#4615](https://github.com/cs3org/reva/pull/4615): Write blob based on session id +* Bugfix [cs3org/reva#4557](https://github.com/cs3org/reva/pull/4557): Fix ceph build +* Bugfix [cs3org/reva#4711](https://github.com/cs3org/reva/pull/4711): Duplicate headers in DAV responses +* Bugfix [cs3org/reva#4568](https://github.com/cs3org/reva/pull/4568): Fix sharing invite on virtual drive +* Bugfix [cs3org/reva#4559](https://github.com/cs3org/reva/pull/4559): Fix graph drive invite +* Bugfix [cs3org/reva#4593](https://github.com/cs3org/reva/pull/4593): Make initiatorIDs also work on uploads +* Bugfix [cs3org/reva#4608](https://github.com/cs3org/reva/pull/4608): Use gateway selector in jsoncs3 +* Bugfix [cs3org/reva#4546](https://github.com/cs3org/reva/pull/4546): Fix the mount points naming +* Bugfix [cs3org/reva#4678](https://github.com/cs3org/reva/pull/4678): Fix nats encoding +* Bugfix [cs3org/reva#4630](https://github.com/cs3org/reva/pull/4630): Fix ocm-share-id +* Bugfix [cs3org/reva#4518](https://github.com/cs3org/reva/pull/4518): Fix an error when lock/unlock a file +* Bugfix [cs3org/reva#4622](https://github.com/cs3org/reva/pull/4622): Fix public share update +* Bugfix [cs3org/reva#4566](https://github.com/cs3org/reva/pull/4566): Fix public link previews +* Bugfix [cs3org/reva#4589](https://github.com/cs3org/reva/pull/4589): Fix uploading via a public link +* Bugfix [cs3org/reva#4660](https://github.com/cs3org/reva/pull/4660): Fix creating documents in nested folders of public shares +* Bugfix [cs3org/reva#4635](https://github.com/cs3org/reva/pull/4635): Fix nil pointer when removing groups from space +* Bugfix [cs3org/reva#4709](https://github.com/cs3org/reva/pull/4709): Fix share update +* Bugfix [cs3org/reva#4661](https://github.com/cs3org/reva/pull/4661): Fix space share update for ocs +* Bugfix [cs3org/reva#4656](https://github.com/cs3org/reva/pull/4656): Fix space share update +* Bugfix [cs3org/reva#4561](https://github.com/cs3org/reva/pull/4561): Fix Stat() by Path on re-created resource +* Bugfix [cs3org/reva#4710](https://github.com/cs3org/reva/pull/4710): Tolerate missing user space index +* Bugfix [cs3org/reva#4632](https://github.com/cs3org/reva/pull/4632): Fix access to files withing a public link targeting a space root +* Bugfix [cs3org/reva#4603](https://github.com/cs3org/reva/pull/4603): Mask user email in output +* Change [cs3org/reva#4542](https://github.com/cs3org/reva/pull/4542): Drop unused service spanning stat cache +* Enhancement [cs3org/reva#4712](https://github.com/cs3org/reva/pull/4712): Add the error translation to the utils +* Enhancement [cs3org/reva#4696](https://github.com/cs3org/reva/pull/4696): Add List method to ocis and s3ng blobstore +* Enhancement [cs3org/reva#4693](https://github.com/cs3org/reva/pull/4693): Add mimetype for sb3 files +* Enhancement [cs3org/reva#4699](https://github.com/cs3org/reva/pull/4699): Add a Path method to blobstore +* Enhancement [cs3org/reva#4695](https://github.com/cs3org/reva/pull/4695): Add photo and image props +* Enhancement [cs3org/reva#4706](https://github.com/cs3org/reva/pull/4706): Add secureview flag when listing apps via http +* Enhancement [cs3org/reva#4585](https://github.com/cs3org/reva/pull/4585): Move more consistency checks to the usershare API +* Enhancement [cs3org/reva#4702](https://github.com/cs3org/reva/pull/4702): Added theme capability +* Enhancement [cs3org/reva#4672](https://github.com/cs3org/reva/pull/4672): Add virus filter to list uploads sessions +* Enhancement [cs3org/reva#4614](https://github.com/cs3org/reva/pull/4614): Bump mockery to v2.40.2 +* Enhancement [cs3org/reva#4621](https://github.com/cs3org/reva/pull/4621): Use a memory cache for the personal space creation cache +* Enhancement [cs3org/reva#4556](https://github.com/cs3org/reva/pull/4556): Allow tracing requests by giving util functions a context +* Enhancement [cs3org/reva#4694](https://github.com/cs3org/reva/pull/4694): Expose SecureView in WebDAV permissions +* Enhancement [cs3org/reva#4652](https://github.com/cs3org/reva/pull/4652): Better error codes when removing a space member +* Enhancement [cs3org/reva#4725](https://github.com/cs3org/reva/pull/4725): Unique share mountpoint name +* Enhancement [cs3org/reva#4689](https://github.com/cs3org/reva/pull/4689): Extend service account permissions +* Enhancement [cs3org/reva#4545](https://github.com/cs3org/reva/pull/4545): Extend service account permissions +* Enhancement [cs3org/reva#4581](https://github.com/cs3org/reva/pull/4581): Make decomposedfs more extensible +* Enhancement [cs3org/reva#4564](https://github.com/cs3org/reva/pull/4564): Send file locked/unlocked events +* Enhancement [cs3org/reva#4730](https://github.com/cs3org/reva/pull/4730): Improve posixfs storage driver +* Enhancement [cs3org/reva#4587](https://github.com/cs3org/reva/pull/4587): Allow passing a initiator id +* Enhancement [cs3org/reva#4645](https://github.com/cs3org/reva/pull/4645): Add ItemID to LinkRemoved +* Enhancement [cs3org/reva#4686](https://github.com/cs3org/reva/pull/4686): Mint view only token for open in app requests +* Enhancement [cs3org/reva#4606](https://github.com/cs3org/reva/pull/4606): Remove resharing +* Enhancement [cs3org/reva#4643](https://github.com/cs3org/reva/pull/4643): Secure viewer share role +* Enhancement [cs3org/reva#4631](https://github.com/cs3org/reva/pull/4631): Add space-share-updated event +* Enhancement [cs3org/reva#4685](https://github.com/cs3org/reva/pull/4685): Support t and x in ACEs +* Enhancement [cs3org/reva#4625](https://github.com/cs3org/reva/pull/4625): Test async processing cornercases +* Enhancement [cs3org/reva#4653](https://github.com/cs3org/reva/pull/4653): Allow to resolve public shares without the ocs tokeninfo endpoint +* Enhancement [cs3org/reva#4657](https://github.com/cs3org/reva/pull/4657): Add ScanData to Uploadsession +https://github.com/owncloud/ocis/pull/9415 https://github.com/owncloud/ocis/pull/9377 https://github.com/owncloud/ocis/pull/9330 https://github.com/owncloud/ocis/pull/9318 diff --git a/go.mod b/go.mod index df79bcd40..6d63e0005 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.10.0 github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 - github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b + github.com/cs3org/reva/v2 v2.20.0 github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 diff --git a/go.sum b/go.sum index 63b525a95..489914c6b 100644 --- a/go.sum +++ b/go.sum @@ -1024,8 +1024,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY= github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b h1:IPFiNd8Xev9WxAt+LkJUxnbyU8Y1rGi5Ha0S+ZNObr8= -github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b/go.mod h1:Rb2XnhpGKnH7k6WBFZlMygbyBxW6ma09Z4Uk+ro0v+A= +github.com/cs3org/reva/v2 v2.20.0 h1:UzfWFEg1c3J78LuB1BbOCuWrl5MsieAV5hu55Jj4lW4= +github.com/cs3org/reva/v2 v2.20.0/go.mod h1:Rb2XnhpGKnH7k6WBFZlMygbyBxW6ma09Z4Uk+ro0v+A= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/lookup.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/lookup.go index 9fe369c30..3c1b491aa 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/lookup.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/lookup.go @@ -24,7 +24,6 @@ import ( "os" "path/filepath" "strings" - "syscall" user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" @@ -77,10 +76,6 @@ func New(b metadata.Backend, um usermapper.Mapper, o *options.Options) *Lookup { userMapper: um, } - go func() { - _ = lu.WarmupIDCache(o.Root) - }() - return lu } @@ -94,66 +89,6 @@ func (lu *Lookup) GetCachedID(ctx context.Context, spaceID, nodeID string) (stri return lu.IDCache.Get(ctx, spaceID, nodeID) } -// WarmupIDCache warms up the id cache -func (lu *Lookup) WarmupIDCache(root string) error { - spaceID := []byte("") - - scopeSpace := func(spaceCandidate string) error { - if !lu.Options.UseSpaceGroups { - return nil - } - - // set the uid and gid for the space - fi, err := os.Stat(spaceCandidate) - if err != nil { - return err - } - sys := fi.Sys().(*syscall.Stat_t) - gid := int(sys.Gid) - _, err = lu.userMapper.ScopeUserByIds(-1, gid) - return err - } - - return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if err != nil { - return err - } - - attribs, err := lu.metadataBackend.All(context.Background(), path) - if err == nil { - nodeSpaceID := attribs[prefixes.SpaceIDAttr] - if len(nodeSpaceID) > 0 { - spaceID = nodeSpaceID - - err = scopeSpace(path) - if err != nil { - return err - } - } else { - // try to find space - spaceCandidate := path - for strings.HasPrefix(spaceCandidate, lu.Options.Root) { - spaceID, err = lu.MetadataBackend().Get(context.Background(), spaceCandidate, prefixes.SpaceIDAttr) - if err == nil { - err = scopeSpace(path) - if err != nil { - return err - } - break - } - spaceCandidate = filepath.Dir(spaceCandidate) - } - } - - id, ok := attribs[prefixes.IDAttr] - if ok && len(spaceID) > 0 { - _ = lu.IDCache.Set(context.Background(), string(spaceID), string(id), path) - } - } - return nil - }) -} - // NodeFromPath returns the node for the given path func (lu *Lookup) NodeIDFromParentAndName(ctx context.Context, parent *node.Node, name string) (string, error) { id, err := lu.metadataBackend.Get(ctx, filepath.Join(parent.InternalPath(), name), prefixes.IDAttr) diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/store_idcache.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/store_idcache.go index b695cde61..ca5d69552 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/store_idcache.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup/store_idcache.go @@ -36,7 +36,6 @@ func NewStoreIDCache(o *options.Options) *StoreIDCache { return &StoreIDCache{ cache: store.Create( store.Store(o.IDCache.Store), - store.TTL(o.IDCache.TTL), store.Size(o.IDCache.Size), microstore.Nodes(o.IDCache.Nodes...), microstore.Database(o.IDCache.Database), diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/assimilation.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/assimilation.go index 16f9de16f..40a1b65b6 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/assimilation.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/assimilation.go @@ -279,3 +279,68 @@ assimilate: return fi, nil } + +// WarmupIDCache warms up the id cache +func (t *Tree) WarmupIDCache(root string, assimilate bool) error { + spaceID := []byte("") + + scopeSpace := func(spaceCandidate string) error { + if !t.options.UseSpaceGroups { + return nil + } + + // set the uid and gid for the space + fi, err := os.Stat(spaceCandidate) + if err != nil { + return err + } + sys := fi.Sys().(*syscall.Stat_t) + gid := int(sys.Gid) + _, err = t.userMapper.ScopeUserByIds(-1, gid) + return err + } + + return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + attribs, err := t.lookup.MetadataBackend().All(context.Background(), path) + if err == nil { + nodeSpaceID := attribs[prefixes.SpaceIDAttr] + if len(nodeSpaceID) > 0 { + spaceID = nodeSpaceID + + err = scopeSpace(path) + if err != nil { + return err + } + } else { + // try to find space + spaceCandidate := path + for strings.HasPrefix(spaceCandidate, t.options.Root) { + spaceID, err = t.lookup.MetadataBackend().Get(context.Background(), spaceCandidate, prefixes.SpaceIDAttr) + if err == nil { + err = scopeSpace(path) + if err != nil { + return err + } + break + } + spaceCandidate = filepath.Dir(spaceCandidate) + } + } + if len(spaceID) == 0 { + return nil // no space found + } + + id, ok := attribs[prefixes.IDAttr] + if ok { + _ = t.lookup.(*lookup.Lookup).CacheID(context.Background(), string(spaceID), string(id), path) + } else if assimilate { + _ = t.Scan(path, false) + } + } + return nil + }) +} diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfsfilauditloggingwatcher.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfsfilauditloggingwatcher.go index 453da7096..4f9f173e5 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfsfilauditloggingwatcher.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfsfilauditloggingwatcher.go @@ -7,8 +7,6 @@ import ( "os" "strconv" "time" - - "github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup" ) type GpfsFileAuditLoggingWatcher struct { @@ -72,7 +70,7 @@ start: case "RENAME": go func() { _ = w.tree.Scan(ev.Path, true) - _ = w.tree.lookup.(*lookup.Lookup).WarmupIDCache(ev.Path) + _ = w.tree.WarmupIDCache(ev.Path, false) }() } case io.EOF: diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfswatchfolderwatcher.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfswatchfolderwatcher.go index c32a9f50b..67b4d5828 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfswatchfolderwatcher.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/gpfswatchfolderwatcher.go @@ -7,7 +7,6 @@ import ( "strconv" "strings" - "github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup" kafka "github.com/segmentio/kafka-go" ) @@ -57,7 +56,7 @@ func (w *GpfsWatchFolderWatcher) Watch(topic string) { case strings.Contains(lwev.Event, "IN_MOVED_TO"): go func() { _ = w.tree.Scan(lwev.Path, true) - _ = w.tree.lookup.(*lookup.Lookup).WarmupIDCache(lwev.Path) + _ = w.tree.WarmupIDCache(lwev.Path, false) }() } } diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/inotifywatcher.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/inotifywatcher.go index 200468c68..601430edd 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/inotifywatcher.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/inotifywatcher.go @@ -4,7 +4,6 @@ import ( "fmt" "strings" - "github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup" "github.com/pablodz/inotifywaitgo/inotifywaitgo" ) @@ -52,7 +51,7 @@ func (iw *InotifyWatcher) Watch(path string) { case inotifywaitgo.MOVED_TO: go func() { _ = iw.tree.Scan(event.Filename, true) - _ = iw.tree.lookup.(*lookup.Lookup).WarmupIDCache(event.Filename) + _ = iw.tree.WarmupIDCache(event.Filename, false) }() case inotifywaitgo.CLOSE_WRITE: go func() { _ = iw.tree.Scan(event.Filename, true) }() diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go index 15dc8d7ed..6ef8eefda 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree/tree.go @@ -30,6 +30,7 @@ import ( "strings" "time" + "github.com/gofrs/flock" "github.com/google/uuid" "github.com/pkg/errors" "github.com/rs/zerolog" @@ -133,10 +134,25 @@ func New(lu node.PathLookup, bs Blobstore, um usermapper.Mapper, o *options.Opti } // Start watching for fs events and put them into the queue - go t.watcher.Watch(watchPath) + go func() { + fileLock := flock.New(filepath.Join(o.Root, ".primary.lock")) + locked, err := fileLock.TryLock() + if err != nil { + log.Err(err).Msg("could not acquire primary lock") + return + } + if !locked { + log.Err(err).Msg("watcher is already locked") + return + } + log.Debug().Msg("acquired primary lock") - // Handle queued fs events - go t.workScanQueue() + go t.watcher.Watch(watchPath) + go t.workScanQueue() + go func() { + _ = t.WarmupIDCache(o.Root, true) + }() + }() return t, nil } @@ -308,7 +324,7 @@ func (t *Tree) Move(ctx context.Context, oldNode *node.Node, newNode *node.Node) _ = t.lookup.(*lookup.Lookup).CacheID(ctx, newNode.SpaceID, newNode.ID, filepath.Join(newNode.ParentPath(), newNode.Name)) // update id cache for the moved subtree if oldNode.IsDir(ctx) { - err = t.lookup.(*lookup.Lookup).WarmupIDCache(filepath.Join(newNode.ParentPath(), newNode.Name)) + err = t.WarmupIDCache(filepath.Join(newNode.ParentPath(), newNode.Name), false) if err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 79e9f338b..b7fc9faff 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -366,7 +366,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.19.2-0.20240618080316-ed0273c9db9b +# github.com/cs3org/reva/v2 v2.20.0 ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime