mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-06-10 17:14:49 -04:00
bump reva to latest main
This commit is contained in:
2
go.mod
2
go.mod
@@ -64,7 +64,7 @@ require (
|
||||
github.com/open-policy-agent/opa v1.15.2
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260310090739-853d972b282d
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260609140739-8f745511cb37
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260610093751-a33d8108dd91
|
||||
github.com/opensearch-project/opensearch-go/v4 v4.6.0
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -948,8 +948,8 @@ github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89 h1:W1ms+l
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89/go.mod h1:vigJkNss1N2QEceCuNw/ullDehncuJNFB6mEnzfq9UI=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260310090739-853d972b282d h1:JcqGDiyrcaQwVyV861TUyQgO7uEmsjkhfm7aQd84dOw=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260310090739-853d972b282d/go.mod h1:pzatilMEHZFT3qV7C/X3MqOa3NlRQuYhlRhZTL+hN6Q=
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260609140739-8f745511cb37 h1:QpDLacGIjn1N9o1tU/26DVxnB4SbuaK4MCnw86tXCOI=
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260609140739-8f745511cb37/go.mod h1:RoFQt+u7edxwzHr1IZ2Y6VaDinMiRPQupAvMBy3WVmE=
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260610093751-a33d8108dd91 h1:A/a0d9UNclpNBWGp2NUDWF+qO+U/u38EBH4CIk2dqIE=
|
||||
github.com/opencloud-eu/reva/v2 v2.46.3-0.20260610093751-a33d8108dd91/go.mod h1:RoFQt+u7edxwzHr1IZ2Y6VaDinMiRPQupAvMBy3WVmE=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4 h1:l2oB/RctH+t8r7QBj5p8thfEHCM/jF35aAY3WQ3hADI=
|
||||
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
|
||||
@@ -405,10 +405,13 @@ func SpaceUpdated(r *provider.UpdateStorageSpaceResponse, req *provider.UpdateSt
|
||||
|
||||
// SpaceEnabled converts the response to an event
|
||||
func SpaceEnabled(r *provider.UpdateStorageSpaceResponse, req *provider.UpdateStorageSpaceRequest, executant *user.User) events.SpaceEnabled {
|
||||
var grants map[string]provider.ResourcePermissions
|
||||
_ = utils.ReadJSONFromOpaque(r.GetOpaque(), "grants", &grants)
|
||||
return events.SpaceEnabled{
|
||||
Executant: executant.GetId(),
|
||||
ID: r.StorageSpace.Id,
|
||||
Owner: extractOwner(r.StorageSpace.Owner),
|
||||
Members: grants,
|
||||
Timestamp: utils.TSNow(),
|
||||
}
|
||||
}
|
||||
@@ -460,9 +463,12 @@ func SpaceUnshared(r *collaboration.RemoveShareResponse, req *collaboration.Remo
|
||||
|
||||
// SpaceDisabled converts the response to an event
|
||||
func SpaceDisabled(r *provider.DeleteStorageSpaceResponse, req *provider.DeleteStorageSpaceRequest, executant *user.User) events.SpaceDisabled {
|
||||
var grants map[string]provider.ResourcePermissions
|
||||
_ = utils.ReadJSONFromOpaque(r.GetOpaque(), "grants", &grants)
|
||||
return events.SpaceDisabled{
|
||||
Executant: executant.GetId(),
|
||||
ID: req.Id,
|
||||
Members: grants,
|
||||
Timestamp: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,11 +169,12 @@ func NewUnary(m map[string]interface{}) (grpc.UnaryServerInterceptor, int, error
|
||||
case *provider.UpdateStorageSpaceResponse:
|
||||
if isSuccess(v) {
|
||||
r := req.(*provider.UpdateStorageSpaceRequest)
|
||||
if r.StorageSpace.Name != "" {
|
||||
ev = SpaceRenamed(v, r, executant)
|
||||
} else if utils.ExistsInOpaque(r.Opaque, "restore") {
|
||||
switch {
|
||||
case utils.ExistsInOpaque(r.Opaque, "restore"):
|
||||
ev = SpaceEnabled(v, r, executant)
|
||||
} else {
|
||||
case r.StorageSpace.Name != "":
|
||||
ev = SpaceRenamed(v, r, executant)
|
||||
default:
|
||||
ev = SpaceUpdated(v, r, executant)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,6 +608,12 @@ func (s *Service) UpdateStorageSpace(ctx context.Context, req *provider.UpdateSt
|
||||
return nil, err
|
||||
}
|
||||
s.addMissingStorageProviderID(res.GetStorageSpace().GetRoot(), res.GetStorageSpace().GetId())
|
||||
if res.Opaque == nil {
|
||||
res.Opaque = &typesv1beta1.Opaque{
|
||||
Map: map[string]*typesv1beta1.OpaqueEntry{},
|
||||
}
|
||||
}
|
||||
res.Opaque.Map["grants"] = res.StorageSpace.GetOpaque().GetMap()["grants"]
|
||||
return res, nil
|
||||
}
|
||||
|
||||
|
||||
2
vendor/github.com/opencloud-eu/reva/v2/pkg/events/spaces.go
generated
vendored
2
vendor/github.com/opencloud-eu/reva/v2/pkg/events/spaces.go
generated
vendored
@@ -67,6 +67,7 @@ func (SpaceRenamed) Unmarshal(v []byte) (interface{}, error) {
|
||||
type SpaceDisabled struct {
|
||||
Executant *user.UserId
|
||||
ID *provider.StorageSpaceId
|
||||
Members map[string]provider.ResourcePermissions
|
||||
Timestamp time.Time
|
||||
}
|
||||
|
||||
@@ -82,6 +83,7 @@ type SpaceEnabled struct {
|
||||
Executant *user.UserId
|
||||
ID *provider.StorageSpaceId
|
||||
Owner *user.UserId
|
||||
Members map[string]provider.ResourcePermissions
|
||||
Timestamp *types.Timestamp
|
||||
}
|
||||
|
||||
|
||||
58
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go
generated
vendored
58
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/tree/tree.go
generated
vendored
@@ -32,6 +32,8 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/pkg/xattr"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
"github.com/rs/zerolog"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
@@ -54,6 +56,7 @@ import (
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/permissions"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/tree/propagator"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/usermapper"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/utils/templates"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/utils"
|
||||
)
|
||||
|
||||
@@ -177,14 +180,67 @@ func New(lu node.PathLookup, bs node.Blobstore, um usermapper.Mapper, trashbin *
|
||||
go t.workScanQueue()
|
||||
}
|
||||
if o.ScanFS {
|
||||
// warmup the cache for all space roots right away so clients and migrations don't get confused when starting with a cold cache
|
||||
err := t.warmupSpaceRootCache(o)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error warming up space root cache")
|
||||
}
|
||||
|
||||
// scan the whole tree asynchronously to pick up new nodes
|
||||
go func() {
|
||||
_ = t.WarmupIDCache(o.Root, true, false)
|
||||
start := time.Now()
|
||||
err := t.WarmupIDCache(o.Root, true, false)
|
||||
if err != nil {
|
||||
t.log.Error().Err(err).Msg("error during initial fs scan")
|
||||
}
|
||||
duration := time.Since(start)
|
||||
|
||||
scanDurationGauge := promauto.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "reva_fs_scan_duration_seconds",
|
||||
Help: "Duration of the initial filesystem scan in seconds",
|
||||
})
|
||||
scanDurationGauge.Set(duration.Seconds())
|
||||
t.log.Info().Dur("duration", duration).Msg("initial fs scan finished")
|
||||
}()
|
||||
}
|
||||
|
||||
return t, nil
|
||||
}
|
||||
|
||||
func (t *Tree) warmupSpaceRootCache(options *options.Options) error {
|
||||
personalRoot := filepath.Clean(filepath.Join(options.Root, templates.Base(options.PersonalSpacePathTemplate)))
|
||||
projectRoot := filepath.Clean(filepath.Join(options.Root, templates.Base(options.GeneralSpacePathTemplate)))
|
||||
|
||||
var paths []string
|
||||
personalEntries, err := os.ReadDir(personalRoot)
|
||||
if err != nil && !errors.Is(err, fs.ErrNotExist) {
|
||||
return errors.Wrap(err, "could not read personal space root directory")
|
||||
}
|
||||
for _, entry := range personalEntries {
|
||||
paths = append(paths, filepath.Join(personalRoot, entry.Name()))
|
||||
}
|
||||
projectEntries, err := os.ReadDir(projectRoot)
|
||||
if err != nil && !errors.Is(err, fs.ErrNotExist) {
|
||||
return errors.Wrap(err, "could not read project space root directory")
|
||||
}
|
||||
for _, entry := range projectEntries {
|
||||
paths = append(paths, filepath.Join(projectRoot, entry.Name()))
|
||||
}
|
||||
|
||||
for _, path := range paths {
|
||||
spaceID, _, _, _, err := t.lookup.MetadataBackend().IdentifyPath(context.TODO(), path)
|
||||
if err != nil {
|
||||
t.log.Error().Err(err).Str("path", path).Msg("could not identify space root path")
|
||||
continue
|
||||
}
|
||||
err = t.idCache.Set(context.TODO(), spaceID, spaceID, path)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not cache space root path")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *Tree) checkStorage() error {
|
||||
// check if the root path is a directory
|
||||
err := os.MkdirAll(t.options.Root, 0700)
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -1360,7 +1360,7 @@ github.com/opencloud-eu/icap-client
|
||||
# github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260310090739-853d972b282d
|
||||
## explicit; go 1.18
|
||||
github.com/opencloud-eu/libre-graph-api-go
|
||||
# github.com/opencloud-eu/reva/v2 v2.46.3-0.20260609140739-8f745511cb37
|
||||
# github.com/opencloud-eu/reva/v2 v2.46.3-0.20260610093751-a33d8108dd91
|
||||
## explicit; go 1.25.0
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/runtime
|
||||
|
||||
Reference in New Issue
Block a user