Hey friends,
How do I set the umask for syncthing?
My issue is that files I create on my macbook that get synced to my UnRaid are read only over SMB. I have a theory as to why.
The default file permissions on Mac (and every unix I've seen except unraid) are 644 for files and 755 for folders. Files on my macbook are created with these permissions, then synced to the server with this permissions, but under the user nobody:users. They are then read only when you access them over SMB. My testing suggests that samba accesses files as whoever you're logged into the share as. So I log in as chuckdries, my user (or guest it shouldn't matter), and I get hit with a read only because I'm merely a member of group. If I manually chown any given file to chuckdries, suddenly that file is writeable over SMB with 644. From this and Unraid's "New Permissions" tool, we conclude that files need 666 or 777 for UnRaid to operate correctly. The default umask for unraid's root user is 0000, so the default permissions are 666 and 777.
The solution is to either set my mac to create files with 666 (lol definitely a last resort) or have syncthing transform the permissions correctly, using the ignore permissions flag.
Well, if you set the ignore permissions flag, it defaults to...
(wait for it)
644. :(.
The syncthing documentation says you need to specify the umask if you ignore permissions. How can I specify the umask in this container?
Thanks in advance for the help!
EDIT: thinking about this more, I'm really surprised it isn't a more common issue. In theory it should afflict every linux and mac syncthing user, unless I'm just an idiot and I'm missing something big.
EDIT 2: I see the configuration option about setting a user ID. This would mostly work, as I use the same user to log in from all my devices, but my roommate occasionally uses my server for stuff and I want his user to be able to access and edit everything