An OpenBSD server with Syncthing. Got started by running Syncthing as a regular user, configured everything, synced folders, all good.
Now, I noticed what I missed: I’d rather run Syncthing as _syncthing as a system service via the included RC script and not as <username> as a user’s application: # rcctl enable syncthing and # rcctl start syncthing instead of $ syncthing
I tried:
moving Syncthing config from user’s to system location and adjusting files permissions, this way:
cp -rv /home/<username>/.config/syncthing/ /var/syncthing/.config/ # copy config
chown -R _syncthing /var/syncthing/.config/syncthing # make it belong to _syncthing
usermod -G <username> _syncthing # add _syncthing to group <username>
chmod -R g+w /data/syncthing # grant _syncthing writing access in storage directory via group permission
and restarting Syncthing resolves the permission denied, but then my files would not belong to my regular user on that machine, which is an inconvenience.
So the actual migration of config and database for Syncthing appears to have worked. The problem is with the actual data files. You will need to figure out how to manage the permissions (probably using system user groups) so that your regular user as well as the one running Syncthing can both access the files and directories. The SGID attribute might be part of the solution, which makes files created in a directory group-owned by the same group as the parent directory. I don’t know how one could change the owning user though, for files created by Syncthing. Those will always belong to the user it runs as.