Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NC file symlinking (database [maybe filesystem] based) #28178

Closed
grinapo opened this issue Jul 26, 2021 · 2 comments
Closed

Implement NC file symlinking (database [maybe filesystem] based) #28178

grinapo opened this issue Jul 26, 2021 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement Nice to have

Comments

@grinapo
Copy link

grinapo commented Jul 26, 2021

Please consider providing a file [sym]linking API to modules and support it in file manager.

Problem

It is not currently possible to categorise or share one file in multiple places, with different sharing properties and having separate attributes (chat, comments, ...). Since NC doesn't deduplicate files if they need to be copied multiple times the result is very inefficient: the data is duplicated N-times.

Same problem is present with various plugins, especially image-sharing or gallery plugins: it is not possible to efficiently create mutiple galleries, shared albums with the same images but with different (sharing or else) attributes. (Similar to what Google Photos do.)

Plugins would need to separately and redundantly implement their own symlinking code, it is much better if it was provided as a central feature.

Suggestion

NextCloud core should provide symlinking, or creating virtual files which point to the same physical data without actual data duplication. This need not to use real filesystem symlinks, a simple database structure can do it.
Apps could use this feature to create subdirectories and link specific files into them and configure their sharing and other attributes separately, implementing various group sharing features (shared albums, shared group files, etc).

Required internals

  • The physical file can be the first referenced file or moved into a specific [sharing] directory
  • Handling file removal needs reference counting to remove the physical file when all the links are gone
  • Virtual files are same as real ones, having separate, full attributes, chats, sharing, etc.
  • Parallel file operations shall be handled like normal files accessed by parallel users
@grinapo grinapo added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jul 26, 2021
@szaimen
Copy link
Contributor

szaimen commented Aug 8, 2021

As this sounds like a nice feature, the requests for this are quite low. Currently there are no plans to implement such a feature. Thus I will close this ticket for now. This does not mean we don't want this feature, but it is simply not on our roadmap for the near future. If somebody wants to implement this feature nevertheless we are happy to assist and help out.If you wish to have this feature implemented by the Nextcloud GmbH there is the option for consulting work on top of your Nextcloud Enterprise subscription to get your features implemented.

@grinapo
Copy link
Author

grinapo commented Sep 17, 2021

(Accepted; just a sidenote: there are a lot of requests around the 'net about symlinking, about gallery enhancements including albums, and various features in various subsystem which would be solved by a central linking feature. Search keywords may be "albums", "symlink", "linking", "share by file", "permission by file" and similar. I am not sure how you expect to gather "requests" for a non-existing backend feature.

Implementation-wise this seems to require one database table ("links") and a few lines of code at lookup points where NC resolves objects onto physical files; and some basic UI using probably the same structure as copy/move. I don't use PHP so I cannot help reverse engineering NC code then patch it, unfortunately. I am not even sure whether such core function could be extended by a plugin or it does require real core code.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants