-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Preserve symbolic links from sync clients #41321
base: master
Are you sure you want to change the base?
Preserve symbolic links from sync clients #41321
Conversation
eed02ab
to
9761eb9
Compare
5d8f769
to
9d681dd
Compare
46cdd0d
to
24d5ee5
Compare
24d5ee5
to
eb1af0a
Compare
@juliushaertl @ArtificialOwl @icewind1991 @sorbaugh I think I got the first draft for this feature and would appreciate your thoughts on the implementation. Please bear with me if its not the most idomatic code, this is my first time working with PHP - any hints on how to improve it are welcome. After experimenting with different server representations of symlinks, I finally settled on creating a new database table ( Current limitations:
If you don't see any major issues with this approach (please also point out potential other limitations that I've overlooked), I'll add according unit tests for the new code and rewrite the git history to ~6 commits (or would you prefer smaller or even fewer commits?). Also feel free to ping me if something is not as intuitive as I thought or you have any other questions. |
f56673c
to
2f7d601
Compare
6791bf2
to
2166494
Compare
2166494
to
0aa45ba
Compare
Hi @artonge, thanks for your reply - great to know at least someone is alive in this project.
I don't think it is - I wasn't able to find anything for symlinks.
It is already in use in the code base, e.g. https://github.com/nextcloud/3rdparty/blob/d7b9f6f5f0513adc3ed652eb84b1822fb5b53032/sabre/dav/lib/DAV/CorePlugin.php#L548 (see also https://github.com/dmfs/davwiki/wiki/DAV::resourcetype)
No, that is a new header field - see the second point in "Open Discussions" in the PR description. But I think for the mime type we'll also have to define a custom string since I'm not aware of any "official" symlink mime type. Also thanks for pointing out the metadata feature, I wasn't aware of that. That should simplify the code and looks pretty useful. |
Hey @taminob, after discussing the PR internally, we think that this feature could cause too many issues, especially when dealing with compatibility between Windows, MacOS and Linux. Server side, this could be developed as an app to not have it in core, but client side there is no app system, and I fear that they probably won't accept to cover such use case. |
@artonge First...I should point out that the lack of proper symlink synchronization is already causing a lot of issues and should be considered a bug, not a feature. As currently implemented Nextcloud actively breaks multi-client Linux/Mac Nextcloud setups. Secondly...I'd like to stress that if implemented correctly, it should be invisible to Windows users and transparently supported on Linux. Allow me to make the case:
Why is this at all complicated? Can you provide a use-case where the above would break any given install or cause comlications? Please explain. We, as a team of Mac and Linux users, are incredibly frustrated with Nextcloud because of this very broken aspect of the way Nextcloud handles POSIX filesystems. If you claim to support Linux as a client, symlinks must be properly supported. They are a critcial and integral part of computing-on-Linux. |
To further clarify...on the Nextcloud server and through the web interface, the symlink filetype would:
YES...moving the file may have the effect of breaking the symlink when it is synchronized to the clients if they are relative links. But such is the life of the symlink user...that is our problem to deal with. Whether or not a symlink points to anything useful is of no concern of the file-sync software...it should sync my broken links if I tell it to. Allow us to shoot our own foot off if we so desire. Please and Thank You. |
@artonge The above is the correct way symlink handling should be implemented. Based on earlier conversations with @taminob, this is also more-or-less how he implemented it. If this understanding is incorrect, then the conversation should instead be focused on how to fix the implementation and not to simply refuse support for a core system filetype. |
@artonge this could be a Linux feature only or under a checkbox/specific manual configuration too and not in an app on the side. @f1d094 @taminob I think I might fork Nextcloud just for this feature, I'll try to build a CI/CD to synchronize commits if there is just simply no way forward with this PR as this feature is highly necessary for me, because I believe this is just plain wrong to not support this feature. Feel free to let me know, if there would be any support towards this effort if we do need to come down this road sadly. |
@AkechiShiro: I agree. Unfortunately, doing a fork is a very heavy lift and especially frustrating because this is something that should have been built-in from day one. Symlinks are very simple, both in concept and in execution. I am embarrassed on behalf of the Nextcloud team that nobody seems to have a grasp of filesystem basics. It is supposed to be at the core of what they do. That said, if we were to do a fork, I would only be interested in supporting whatever the minimum use-case is to make symbolic links sync properly on Linux/Mac. I've never done something similar, but I imagine with a CI/CD setup we could simply maintain a running patch set for the server and the client binaries. IIRC, @taminob is out of bandwidth to do further development until August...do you have the capacity to pull his fork and test what he's already commited? I'm already working two jobs...I take time to come here and advocate because this feature is very important to me. Unfortunately I don't have any more room for another project and was counting on the Nextcloud devs to come to their senses. |
@AkechiShiro I would disgree that this should be an optional "Linux feature only". It should just be native...and transparent. Symlinks are just another file, more-or-less. The fact that they only serve a function in relation to a POSIX filesystem is irrelevant. They should be ignored by Windows systems because there simply isn't a clean way to translate them to/from Windows<->Unix. Any attempt here just adds tons of needless complexity. Just look at all the ridiculous nonsense that the SAMBA project has to deal with. No-Thank-You. Let's keep it simple. As long as the server recognizes them and will send them to/from valid clients (linux/mac) is all that matters. |
You are correct @f1d094 I just wanted to try and at least get my foot in the door officially for this feature as @artonge seems to be concerned about multi-platform support and potential issue that could rise maybe a symlink in EDIT : Read your answer fully, I plainly agree Regarding the fork, yes but I can't keep working without symlinks on my end, so I'll push this effort alone at first and see where it goes, if I can end up with something more polished, more tested, more focused on user's wanted feature than the current Nextcloud situation which is frankly totally dissapointing, we have to deal with, well that will be at least a win despite the hard difficulty of maintaining such a fork. I'm working one job on my side but I do have time to work on a side project, if people donate and find the fork better than Nextcloud, then maybe this will help me focus on it full time. Maybe we can fix user centric issues, instead of putting AI in Nextcloud or making Nextcloud a replacement for . |
Given the current reaction of Nextcloud devs to this issue and others issues, I've started loosing hope Nextcloud will definitely get better with time, hence the motivation towards making a fork. I don't mean to spite Nextcloud devs, they do work hard on a lot of features and aim to do their best but sometimes I just plainly don't understand what is currently prioritized on the project and why it is prioritized, I feel there is no real prioritization being done or proper organization on the project at the current scale, they are operating (really wanted user features can get ignored, let's take grouping user contacts for instance, no one works on it, I believe). |
@AkechiShiro Well...if you decide to really do it, you should call the new fork: Nixcloud: Works well with *nix!:) |
Hi @artonge, thanks for the feedback. So if this was designed as an app (in @f1d094 @AkechiShiro I don't think a Nextcloud server fork is worth it for this since it's much easier to apply these simple changes as a patch on top of the latest official Nextcloud releases. If this actually is rejected, it makes more sense to fork the Nextcloud desktop application since the changes there are much more invasive and might lead to more merge conflicts in the future when applying as a patch. |
Yes, if this is an external app, then no need for our approval :)
No, you can try to ping them again in the desktop client PR? |
I'd like it to be part of the Nextcloud server repository (like the integrated weather_status, files_trashbin, ... apps) or at least in the nextcloud namespace (like the E2E encryption app) - otherwise I think it would be kind of weird to support it in the official desktop app.
👍 |
Just want to mention that this is a pretty standard way to handle this, e.g. git is also handling symlinks exactly like this. |
@taminob do you believe we should fork or let this be an external app ? I just want to know what's your opinion on this ? I don't think it's worth putting efforts alone on merging this feature in Nextcloud in a fork if the feature is going to be in an external app. EDIT : As you've said a patch should be enough for this feature, so most likely just patching the package of Nextcloud would be enough to provide this feature hence a fork is not needed AFAIK. |
You're right in your edit, I don't think a fork of Nextcloud server makes sense. I'd probably prefer having this as an app than a patch, but both should be feasible - since I've never written a Nextcloud app, I still have to check how exactly this could be implemented. The desktop client will be far more challenging if the changes get rejected there and if that happens, a fork of the desktop app might become the only option (a scenario I'd like to avoid if possible). |
Summary
This PR aims to allow clients to upload/download symlinks to/from the server.
I try to provide an MVP to make some progress with the 5 years old issue regarding symlink synchronization.
TODO
Open discussions
oc_symlinks
to identify file:fileid
vsstorage
+path
OC-File-Type
in requests to indicate symlink or encode inContent-Type
via unique symlink mimetypeChecklist
Disclaimer
This PR is still in a WIP state, do not test this on a production Nextcloud server.
Also, everything in there is still subject to change and hacky solutions and code full with TODOs will appear in this PR.