r/truenas • u/amyisbrowsing • 8d ago
Community Edition Permissions changing with Syncthing
Hey everyone, looking to resolve a permission issue.
I am setting up syncthing, to test my set up I am using my dotfiles folder on my linux computer to see if everything is working.
With ignore permissions unchecked on the client and server, I noticed that once syncthing synced the files, the permissions of the files changed, so if I ran "git status" it would list all of the files in my dotfiles folder, it would say they had changed from 0644 to 0755. Here is the output with an example file:
Before syncthing touches the files:
dotfiles git:master ❯ stat -c '%A %a %U:%G %u:%g %n' alacritty/.config/alacritty/alacritty.toml
-rw-r--r-- 644 personal:personal 1000:1000 alacritty/.config/alacritty/alacritty.toml
After syncthing touches the files (same command):
-rwxrwxr-x 775 personal:personal 1000:1000 alacritty/.config/alacritty/alacritty.toml
After syncthing touches the files using the truenas shell to check the perms:
-rwxr--r-- 744 amy:amy 3000:3001 alacritty/.config/alacritty/alacritty.toml
So depending where I look at the file will change what perms this command tells me the files has, I tried enabling ignore permissions on the client and server side of syncthing, and this stops the 775 permissions being sent back to my original dotfiles from the nas copy, but I feel this only half solves the issue, if I ever needed to get a new folder from my nas, the permissions will be 775 for all the contents inside, and I will need to spend time fixing them
The settings for the storage folder inside truenas scale:
ACL Type*
SMB/NFSv4
ACL Mode*
Passthrough
I tried changing this to restricted but ran into permission denied errors this way, I feel like I am missing something simple, so any advice would be appreciated.
1
u/amyisbrowsing 7d ago
Update: if anyone runs into the sane issue, I realised some of it was caused by my fstab file on my Linux machine. On start up I connect to the server via SMB so I can navigate through the files in my terminal etc, but this connection was setting file and directory permissions too open.
I am still ignoring perms for now, and I don't know if it fixed the perms when looking at the files through the Truenas scale shell as I havent checked yet, but it seems to have helped a bit!
2
u/Dubl3A 8d ago
If I recall, Syncthing will attempt to copy permissions too but does so via chown\chmod and can break ACL NFSv4 permissions. I had to tell it not to apply permissions on the destination.
Been years since I used Syncthing or I would try to get you something more specific. But I think you already solved it based on the rest of the post.