I didn’t think the version would be a problem. I sync several machines (not servers) and they all have different versions.
The devices are connected and the folder ID is the same.
I have made a test syncing the same folder under /home/manuel/folder rather than /var/www/my/folder. The folder is empty and gets filled as soon as I accept the request from the other server and give that path.
That makes me think that it’s really something specific to the /var/www/my folder, either related to the owner, group or permission in that folder, or something else specific to the fact that it’s a web server.
I keep running tests, any more tips welcome.
I think there were two problems. I’ll explain the one I haven’t solved yet, in case you have any further tips.
Folders that I create now on the web server are re-created on the file server, so that part works (hurray!).
However, on the file server, syncthing creates sync’ed folders with user/group/permissions that don’t allow other uses (from a Windows workstation) to put files there:
4 drwxrwxr-x 2 ad ad 4096 Apr 29 19:22 folder
(ad is the user that installed or ran syncthing).
I would need to have something like this (users group):
4 drwxrwxr-x 2 ad users 4096 Apr 29 19:22 folder
or like this (world has permissions 7):
4 drwxrwxrwx 2 ad ad 4096 Apr 29 19:22 folder
How can I make syncthing do that?
About the other problem, in the webserver, I fixed it by deleting all files and folders inside the folder I want to sync. Then I changed permissions on /var/www/my/folder as sudo chown $USER:varwwwusers folder/ -R and added it a third time in the syncthing’s UI.
Now it seems to work, so indeed it seemed a permissions problem.
syncthing inherits the permissions from the shell it launches.
If you want it to use a different group you need to set the group via newgrp.
If you want it to use different permissions, you’ve got to set the umask.