diff --git a/go.mod b/go.mod index edf987e782..52c8fc7749 100644 --- a/go.mod +++ b/go.mod @@ -35,6 +35,7 @@ require ( github.com/go-playground/validator/v10 v10.30.3 github.com/go-resty/resty/v2 v2.17.2 github.com/go-viper/mapstructure/v2 v2.5.0 + github.com/gofrs/flock v0.13.1 github.com/golang-jwt/jwt/v5 v5.3.1 github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.7.0 @@ -65,7 +66,7 @@ require ( github.com/open-policy-agent/opa v1.19.1 github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89 github.com/opencloud-eu/libre-graph-api-go v1.0.8 - github.com/opencloud-eu/reva/v2 v2.51.0 + github.com/opencloud-eu/reva/v2 v2.51.1-0.20261006112042-7d9dd4c07424 github.com/opensearch-project/opensearch-go/v4 v4.7.3 github.com/orcaman/concurrent-map v1.0.0 github.com/pkg/errors v0.9.1 @@ -229,7 +230,6 @@ require ( github.com/gobwas/ws v1.4.0 // indirect github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect - github.com/gofrs/flock v0.13.1 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/golang/snappy v1.0.0 // indirect diff --git a/go.sum b/go.sum index c30cad60d3..086bba6d3e 100644 --- a/go.sum +++ b/go.sum @@ -761,8 +761,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 h1:VTkFLkLNna+T4RN6JUZnVQ1bqVAfPtMeORXbFzEYGKs= github.com/opencloud-eu/libre-graph-api-go v1.0.8/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU= -github.com/opencloud-eu/reva/v2 v2.51.0 h1:PbvUtLlbCpS5em48cSGk2sHRdjVA7htRQVKjpckI2w4= -github.com/opencloud-eu/reva/v2 v2.51.0/go.mod h1:ngLsDakKnt8zCFCeULhuSZFESGy5NIuSq5/JGeOhPdU= +github.com/opencloud-eu/reva/v2 v2.51.1-0.20261006112042-7d9dd4c07424 h1:rvopdGQTsI0PT7P3MRamrDsO1yYIKJBOxJAbbYmc4P8= +github.com/opencloud-eu/reva/v2 v2.51.1-0.20261006112042-7d9dd4c07424/go.mod h1:ngLsDakKnt8zCFCeULhuSZFESGy5NIuSq5/JGeOhPdU= 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= diff --git a/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go b/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go index cdbb161a61..350fed869c 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go +++ b/vendor/github.com/opencloud-eu/reva/v2/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go @@ -198,6 +198,12 @@ func (h *Handler) Init(c *config.Config) { // h.c.Capabilities.FilesSharing.Federation.Outgoing is boolean // h.c.Capabilities.FilesSharing.Federation.Incoming is boolean + if h.c.Capabilities.FilesSharing.GuestLinks == nil { + h.c.Capabilities.FilesSharing.GuestLinks = &ocs.CapabilitiesFilesSharingGuestLinks{} + } + + // h.c.Capabilities.FilesSharing.GuestLinks.Enabled is boolean + if h.c.Capabilities.FilesSharing.SearchMinLength == 0 { h.c.Capabilities.FilesSharing.SearchMinLength = 2 } diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/owncloud/ocs/capabilities.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/owncloud/ocs/capabilities.go index 603ec41536..4a643b8fb5 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/owncloud/ocs/capabilities.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/owncloud/ocs/capabilities.go @@ -225,6 +225,7 @@ type CapabilitiesFilesSharing struct { DefaultPermissions int `json:"default_permissions" xml:"default_permissions" mapstructure:"default_permissions"` UserEnumeration *CapabilitiesFilesSharingUserEnumeration `json:"user_enumeration" xml:"user_enumeration" mapstructure:"user_enumeration"` Federation *CapabilitiesFilesSharingFederation `json:"federation" xml:"federation"` + GuestLinks *CapabilitiesFilesSharingGuestLinks `json:"guest_links" xml:"guest_links" mapstructure:"guest_links"` Public *CapabilitiesFilesSharingPublic `json:"public" xml:"public"` User *CapabilitiesFilesSharingUser `json:"user" xml:"user"` // TODO: Remove next line once web defaults to resharing=false @@ -291,6 +292,11 @@ type CapabilitiesFilesSharingFederation struct { Incoming ocsBool `json:"incoming" xml:"incoming"` } +// CapabilitiesFilesSharingGuestLinks holds the guest links capabilities +type CapabilitiesFilesSharingGuestLinks struct { + Enabled ocsBool `json:"enabled" xml:"enabled" mapstructure:"enabled"` +} + // CapabilitiesNotifications holds a list of notification endpoints type CapabilitiesNotifications struct { Endpoints []string `json:"ocs-endpoints,omitempty" xml:"ocs-endpoints>element,omitempty" mapstructure:"endpoints"` diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/decomposed/blobstore/blobstore.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/decomposed/blobstore/blobstore.go index 7c6edc0a8e..a4dbfde458 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/decomposed/blobstore/blobstore.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/decomposed/blobstore/blobstore.go @@ -53,7 +53,7 @@ func New(root string) (*Blobstore, error) { } // Upload stores some data in the blobstore under the given key -func (bs *Blobstore) Upload(node *node.Node, source, _copyTarget string) error { +func (bs *Blobstore) Upload(node *node.Node, source, _copyTarget string) (err error) { if node.BlobID == "" { return ErrBlobIDEmpty } @@ -80,14 +80,27 @@ func (bs *Blobstore) Upload(node *node.Node, source, _copyTarget string) error { if err != nil { return errors.Wrapf(err, "could not open blob '%s' for writing", dest) } + defer func() { + if cerr := f.Close(); cerr != nil && err == nil { + err = errors.Wrapf(cerr, "could not close blob '%s'", dest) + } + }() w := bufio.NewWriter(f) - _, err = w.ReadFrom(file) - if err != nil { + if _, err = w.ReadFrom(file); err != nil { return errors.Wrapf(err, "could not write blob '%s'", dest) } - return w.Flush() + if err = w.Flush(); err != nil { + return errors.Wrapf(err, "could not flush blob '%s'", dest) + } + + // Ensure data is synced to disk before returning + if err = f.Sync(); err != nil { + return errors.Wrapf(err, "could not sync blob '%s' to disk", dest) + } + + return nil } // Download retrieves a blob from the blobstore for reading diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/ocis/blobstore/blobstore.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/ocis/blobstore/blobstore.go index 41ed3a091c..07b820c220 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/ocis/blobstore/blobstore.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/ocis/blobstore/blobstore.go @@ -53,7 +53,7 @@ func New(root string) (*Blobstore, error) { } // Upload stores some data in the blobstore under the given key -func (bs *Blobstore) Upload(node *node.Node, source string) error { +func (bs *Blobstore) Upload(node *node.Node, source string) (err error) { if node.BlobID == "" { return ErrBlobIDEmpty } @@ -80,14 +80,27 @@ func (bs *Blobstore) Upload(node *node.Node, source string) error { if err != nil { return errors.Wrapf(err, "could not open blob '%s' for writing", dest) } + defer func() { + if cerr := f.Close(); cerr != nil && err == nil { + err = errors.Wrapf(cerr, "could not close blob '%s'", dest) + } + }() w := bufio.NewWriter(f) - _, err = w.ReadFrom(file) - if err != nil { + if _, err = w.ReadFrom(file); err != nil { return errors.Wrapf(err, "could not write blob '%s'", dest) } - return w.Flush() + if err = w.Flush(); err != nil { + return errors.Wrapf(err, "could not flush blob '%s'", dest) + } + + // Ensure data is synced to disk before returning + if err = f.Sync(); err != nil { + return errors.Wrapf(err, "could not sync blob '%s' to disk", dest) + } + + return nil } // Download retrieves a blob from the blobstore for reading diff --git a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore/blobstore.go b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore/blobstore.go index bbf3397972..75f598c784 100644 --- a/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore/blobstore.go +++ b/vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/blobstore/blobstore.go @@ -95,6 +95,7 @@ func (bs *Blobstore) Upload(n *node.Node, source, copyTarget string) error { } if err := copyWithPeriodicSync(tempFile, sourceFile); err != nil { + _ = tempFile.Close() return fmt.Errorf("failed to copy source file '%s' to temp file '%s' - %v", source, tempName, err) } @@ -204,8 +205,7 @@ func copyWithPeriodicSync(dst, src *os.File) error { } } if err == io.EOF { - _ = dst.Sync() - return nil + return dst.Sync() } if err != nil { return err diff --git a/vendor/modules.txt b/vendor/modules.txt index 909c2e43fd..94725c0862 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1362,7 +1362,7 @@ github.com/opencloud-eu/icap-client # github.com/opencloud-eu/libre-graph-api-go v1.0.8 ## explicit; go 1.23 github.com/opencloud-eu/libre-graph-api-go -# github.com/opencloud-eu/reva/v2 v2.51.0 +# github.com/opencloud-eu/reva/v2 v2.51.1-0.20261006112042-7d9dd4c07424 ## explicit; go 1.26.0 github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace github.com/opencloud-eu/reva/v2/cmd/revad/runtime