Is this use of Syncthing and NextCloud a good or bad idea?


#1

My approach over the last couple of weeks to setting up my personal cloud server has evolved, so I’m writing this post to start with a clean context and get feedback on if my new solution is valid or not.

I have a linux desktop/server and a windows laptop. I want my desktop /home/david/work folder and my /user/david/work laptop folder to be in sync, and also available to share or link through the nextcloud web GUI.

I though this would be fine. I had my /home/david/work folders mounted to my nextcloud server through the external folders apps, and therefore could access them through the web gui portal no problems. BUT, I began to run into problems with the syncing between the laptop and desktop.

I was then told that even though I was not directly manipulating folders or files that were inside the /var/share/www/nextcloud folders, manipulating the /home/david/work folder was still a problem. NextCloud is designed so that you don’t directly access the files.

So my solution is this:

image

I could sync the laptop /user/david/work and the desktop /home/david/work using Syncthing, and then have those files made accessible for sharing etc to the web through NextCloud by mounting the /home/david/work folder to NextCloud using the external folders application correct?

The web front for NextCloud would sometimes be a little out of sync with the actual files, because changes made on the laptop would have to sync through syncthing to the desktop/server and then a cronjob on nextcloud would have to run in order to reindex the changes that had been made to those folders, but otherwise, it should basically work, right?

I’ve been having some trouble getting Syncthing to work but I think I’ve figured out the problem on that end. I just want to make sure I’m understanding fully the limitations of what I can do with NextCloud.


#2

No, the Nextcloud client does the sync immediately


#3

Wait… so why am I not supposed to mess with the files on my desktop in /home/david/work that have been mounted to the server on my desktop using the external folders app?


#4

@sanook I think I realize where some of my confusion laid. I’m not proposing using the nextcloud client at all. I’m proposing using syncthing to sync my laptop and desktop and then mount those folders on the desktop to NextCloud using the external folders extension.

In asking around though, I realize that I’m getting a lot of conflicting information. I think I may need to elevate this to the Github repo in order to get a straight answer from a dev, because answers so far have been inconsistent.

If I have /home/david/work mounted as an external folder on my desktop, am I, or am I not, allowed to directly manipulate those files? As in, copy, paste, rename, open up in text editor and edit, open up in photoshop and edit, etc?


#5

Sure. It’s just a network folder.

https://docs.nextcloud.com/server/13/user_manual/files/access_webdav.html


#6

So first of all, why on earth do you want syncthing inbetween this? You save a lot of headache by simply using Nextcloud clients to sync your files.

Nextcloud’s initial use case is to keep several desktop machines (eg your laptop and workstation) in sync, it is what it was designed to do…

But if you somehow want syncthing, keep in mind:

  • don’t ever change the files in nextcloud primary storage (the data folder)
  • you can change files in external storage, you can configure how often to check for changes but in any case, Nextcloud ONLY checks for changes if you use the web UI, not the client
  • Nextcloud has a WebDAV interface you can mount. Use it as any normal network drive - no need to sync, that is done immediately, just like the Desktop client syncs any change you do locally within seconds to the server.

In your setup, you sync from one system to the next, but you have Nextcloud on one to make the files available to the outside, right? If you mounted that folder as external storage and set it to always update the storage contents, what you see in Nextcloud web UI should be up to date with what is in the folder, whatever syncthing does in the background doesn’t matter. No need for a Nc cronjob in case you use the web UI.

If you use the Nextcloud clients it is better to use a cronjob, yes, it doesn’t always check for new files so if the content of a file is changed it doesn’t matter but if files are renamed, deleted or added, you’d have to scan. Again, I suggest to avoid this mess and not use syncthing.

PS props for the drawn picture, though :smiley:


How do I mount a NextCloud server drive using SFTP, as a virtual drive on Windows?
#7

Here I am told something different though:

But I think the gist in the end is basically the same. I’m not really supposed to mess with the files in the external storage, but as long as I am aware of how it might mess with things and let the cron job scan for stuff in between my changes, I should be basically okay?

And yes, I’m also using the NextCloud webdav interface to do the mounting process. Thank you!