Skip to content

Create reference to shared files and list shared files - #6

Closed
C0rby wants to merge 1 commit into
masterfrom
feature/accept-shares
Closed

C0rby wants to merge 1 commit into
masterfrom
feature/accept-shares

Conversation

@C0rby

@C0rby C0rby commented May 29, 2020

Copy link
Copy Markdown

DON'T MERGE

The goal of this draft is to gather opinions on the implementation.

I'm working on this issue owncloud/ocis-reva#11 and wanted to get your feedback about my implementation. Is the approach ok or did you alread have something else in mind?

With these changes I could successfully accept a share and list it in the "all files" list.
Also updating (the owner updated) the shared file worked.

@C0rby
C0rby requested review from butonic and refs May 29, 2020 13:18
@C0rby C0rby self-assigned this May 29, 2020
@butonic

butonic commented Jun 22, 2020

Copy link
Copy Markdown

ok, so you are implementing the hidden shared folder using symbolic links. nice! The problem I see is that you are using a path to the original file in the link. What happens if the target file is moved or renamed. The link will break. :-(

the eos implementation uses a dedicated 'shadow' folder that users do not have access to when bypassing reva. when accepting a share reference is created, which for eos stores the target fileid in the extended attributes: https://github.com/cs3org/reva/blob/master/pkg/storage/utils/eosfs/eosfs.go#L886-L895

when listing the shared folder the extended attributes are converted back to cs3 references: https://github.com/cs3org/reva/blob/5fb4422a44a955f244aded20ce6c68ca59452629/pkg/storage/utils/eosfs/eosfs.go#L685

note that the cs3 gateway service will exchange all cs3 references with actual file metadata.

the owncloud storage driver also stores share information in the extended attributes, see https://github.com/cs3org/reva/blob/5fb4422a44a955f244aded20ce6c68ca59452629/pkg/storage/fs/owncloud/owncloud.go#L64-L122 for the dertails.

If we want to implemen oc10 then we need to be able to create references anywhere in the tree.
you can store an empty file or folder with an additional extended attribute that contains the target filed ... maybe a symbolic link works as well. would be cool to be able to navigate an the fs ... but only if the actual reference is stored using the file id so the link can be 'healed'.

@C0rby
C0rby force-pushed the feature/accept-shares branch from f16376c to b6c10b7 Compare June 30, 2020 14:40
@C0rby

C0rby commented Jun 30, 2020

Copy link
Copy Markdown
Author

I implemented a similar solution as in pkg/storage/utils/eosfs/eosfs.go.
Uploading files, sharing, listing shares and downloading shared files work.

I have to review internal/grpc/services/gateway/storageprovider.go though since I made some changes which could break other storage drivers.

@C0rby
C0rby force-pushed the feature/accept-shares branch from b6c10b7 to f873101 Compare July 2, 2020 11:48
@C0rby

C0rby commented Jul 2, 2020

Copy link
Copy Markdown
Author

Finally created the upstream PR. cs3org#929

@C0rby C0rby closed this Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants