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

[Bug]: client (at least macOS client) doesn't sync symbolic links #5509

Closed
5 of 8 tasks
avibrazil opened this issue Mar 9, 2023 · 6 comments
Closed
5 of 8 tasks

[Bug]: client (at least macOS client) doesn't sync symbolic links #5509

avibrazil opened this issue Mar 9, 2023 · 6 comments

Comments

@avibrazil
Copy link

avibrazil commented Mar 9, 2023

⚠️ Before submitting, please verify the following: ⚠️

Bug description

I know this is being discussed in some forum.

Nextcloud must support Unix symbolic links, either storing them as a reference (the correct way of doing this, in my opinion) or de-referencing them (storing a copy of the content they are pointing to). Or let the user chose how to store.

Unix filesystem symbolic links have nothing to do with web links. Please let's not confuse these 2 different concepts in this discussion.

Unix filesystem symbolic links are an incredible practical OS feature.

Steps to reproduce

On my Mac, inside a folder synced and managed by Nextcloud, I do this:

$ touch a
$ ln -s a b
$ mkdir x
$ ln -s x y

Create a file named a and create a symbolic link named b pointing to a, all in the same folder.
Create a folder named x and create a symbolic link named y pointing to x, all in the same folder.

File a gets synced but file (symbolic link) b doesn't. Same for folders x and link y. I verified by going into the Nextcloud Linux server and checking which files appeared under /var/lib/nextcloud/data/USER/files/...

I don't get the symbolic links in the server.

Expected behavior

Expected behavior is to get the Nextcloud client handling and storing Unix symbolic links as symbolic links.

Then clients on other platforms, such as Windows, will convert the server-side Unix symbolic link into something that makes sense in Windows filesystems, which apparently already supports symbolic links.

When I mount my Nextcloud folder via WebDAV as a regular filesystem (using davfs2), I also expect to correctly see the synced symbolic links.

Which files are affected by this bug

I have no idea

Operating system

Mac OS

Which version of the operating system you are running.

Ventura 13.2.1

Package

Appimage

Nextcloud Server version

25.0.1

Nextcloud Desktop Client version

3.7.3

Is this bug present after an update or on a fresh install?

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

  • Default internal user-backend
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Nextcloud Server logs

No response

Additional info

No response

@iGadget
Copy link

iGadget commented Apr 4, 2023

Same goes for Linux. It's one of my main irritations when using Nextcloud - I have to manually re-create all symlinks on all my systems en keep them in sync by some other method than Nextcloud, defeating the purpose of Nextcloud file sync altogether.
Please fix this.

@mikeperalta1
Copy link

Hope this will be done eventually. It's a big time waster to constantly have to re setup symlinks on every desktop I use, especially in situations where I use many many symlinks to organize things.

@taminob
Copy link

taminob commented Oct 21, 2023

I think this might be a duplicate of #250. Already posted it over there, but I'd like to work on Linux symlink synching (without dereferencing, so "as-is") which might be identical for MacOS, but I have no experience with MacOS. :)

However, they probably shouldn't be stored as symbolic links on the server-side since that might pose a security risk (or requires additional handling to prevent links to the outside of the user data directory, could also be an option to allow for your WebDAV mounting use case).

@f1d094
Copy link

f1d094 commented Nov 7, 2023

@taminob I just did a quick test on my nextcloud instance by creating a symlink to one of my folders directly in my user's data dir ( ln -s /var/www/nextcloud/data/myuser/myfolder /var/www/nextcloud/data/myuser/mylink ) and restarted apache and it does not show up in the web front end...not a conclusive test by any means but it doesn't seem that they are even visible by the web file browser.

@taminob
Copy link

taminob commented Nov 7, 2023

@taminob I just did a quick test on my nextcloud instance by creating a symlink to one of my folders directly in my user's data dir ( ln -s /var/www/nextcloud/data/myuser/myfolder /var/www/nextcloud/data/myuser/mylink ) and restarted apache and it does not show up in the web front end...not a conclusive test by any means but it doesn't seem that they are even visible by the web file browser.

You have to enable 'localstorage.allowsymlinks' => false in your nextcloud server config if you want them to show up. Broken symlinks will be ignored and all other symlinks (to either file or directory) will be simply shown as that file/directory in the front end. (You probably also have to run a occ files:scan --all if you create the file manually.)

However, I think this will actually also let the client download the file/directory twice because the server will dereference them and send the file/directory content.

I already did some work for uploading symlinks, I will open a PR soon. Changes on server and client are definitely necessary.

@joshtrichards
Copy link
Member

Duplicate of #250

@joshtrichards joshtrichards marked this as a duplicate of #250 Aug 14, 2024
@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants