LAN sync please

Good question. In the settings of external storage you can set if the storage should be checked for changed files on each access. Iā€™m not sure if this triggers the activity app (you could easily trigger an access via cronjob).

1 Like

Thanks the follow up. It would be great to have a better sync integration between both products, and I would like to break my existing Nextcloud apps as little as possible. Here is a recent thread asking about improving integration and here is a recent github issue as well.

Here is my feature wishlist:

  • Hopefully adopt Syncthing as a fully supported method for Lan Sync between Nextcloud instances
  • Allow Nextcloud apps to communicate with Syncthing apps as p2p, such as between mobile devices. No server available, no problem!
  • Activity app picks up changes
  • Nextcloud is able to track changes and additions of files without lulls.
  • Total disk space in Nextcloud includes syncthing directories.

Integration is probably not that easy. Is it possible that the Nextcloud server can directly talk this syncthing protocol? It would have to be implemented in php, opening ports and such stuff is probably difficultā€¦

Could Syncthing implement a webdav api and could be used via federated sharing?

Or you run a special client software of syncthing on the Nextcloud server that can directly talk to the Nextcloud server (push notifications, update database, ā€¦).

Says who? Please give some arguments.

It will reduce traffic on our site and speedup the sync.

Our team uses three shared folders. There are several ā€œheavyā€ files (graphics) in them.
If we are all on site - and this happens often - the sync is done by our shared internet-connection. So the line is used for syncing and there is no space for doing mails and using internet.

NC is so much useful software, but this missing LAN-Sync-Thing is a handbrake for quick access.

Says who? Please give some arguments.

you got slow dsl in rural area.
you run your own nextcloud server and have 15-230gb data in it.
one pc already synced
try adding other pc to that and see how much you get done during the day.
lan sync reduces internet bandwidth and is faster

1 Like

Havenā€™t got yet such problem. But maybe this can be a quicksolution:

For me, a simple change which would do most of what I would want LAN sync for is to allow multiple urls to be given to the client for the same nextcloud account, and when trying to sync have the nextcloud client try each of them in turn until one works. I could put the local IP address on my LAN as the top option, and the remote url as the second.

1 Like

thing is the dropbox method just plain works well. it would ( IMO ) behoove the devs to emulate that method.
it is SO simple to use and just plain works well.

Is this possible? I want this for localhost and hosted urls to help with uptime.

That sounds pretty non-trivial to meā€¦ how would one go about doing that?

For those curious on how this might be implemented, hereā€™s a suggested workflow which would probably be most expected by users familiar with how dropbox lan sync works:

  1. Server remains connected to clients, to ensure permission based attacks are not possible
  2. Server and client agree on which files need to be copied in the normal way
  3. If in local sync mode,* instead of copying the file from the server, the server somehow identifies the file needing to be synced, perhaps with a hash. The client broadcasts this hash to all available peers, and then downloads it from them if available. The peer client would also need to check with the server to see if the user requesting had permission to access that file hash. If all that succeeds, transfer from client instead of server.

Youā€™d also want to probably gate this and specify that files under a certain size are never lan synced, because the protocol overhead would be more than the file transfer time savings.

*Re: ā€˜If in local sync modeā€™
This could be determined in a number of ways - one such simplistic algo could be:

if [ping time to server] > [5x ping time to a peer client] {
try to sync from client
}

In other words, if the server is substantially further than another client (keeping in mind, a really fast WAN ping would be ~10-20ms, and LAN pings are typically ~1ms).

Similar tests could also be done with bandwidth instead of ping.

1 Like

Maybe DHT (distributed has tables) could be of interest too for decentralized LAN sync. That would allow sync between clients without the server accessible/running at all. There is an issue on the Syncthing Github page too:

1 Like

Hi, I hope you all find this relevant:

Jos has recently responded to the request to Integrate Syncthing with Nextcloud Server #8384 on Github. The Syncthing protocol is not only an excellent p2p protocol, but provides LAN & Delta Sync. With more direct integration to Nextcloud Files/Activity it could be a really awesome tool that helps fulfill this need.

1 Like

Or even better: use Pi-hole.

For information, I opened a new issue on LAN sync in https://github.com/nextcloud/desktop/issues/2010

2 Likes

Working offline in standalone and shared (p2p) modes to work with data when having outage and without access to the server.

Moved your idea to this on-going thread, so you can follow along. See linked issue above:

1 Like

Thanks! I have already added my comments there as well, certain time agoā€¦

I use Syncthing as www-data to handle this sort of syncing between my devices, along with KDEconnect.