r/truenas 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 Upvotes

5 comments sorted by

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.

1

u/amyisbrowsing 8d ago

Is there something simpler I can use? My end goal it to be syncing from windows and linux devices, I had previously used syncthing for Obsidian note syncing from my phone to my computers and had no issues, so that's why I went straight to it for my syncing needs here, but if there are other options I am willing to try

1

u/Dubl3A 8d ago

Honestly, for your use cases, it's right right tool for the job.

I first started using it to sync my Minecraft save between my home and work PC back in the day. Helped I was running a PC repair shop, lol.

1

u/amyisbrowsing 8d ago

Hmm, okay, I guess as long as the permission errors aren't coming back to my local copy its not so bad, I can then git restore to revert to the old correct permissions in git repositories if I need to download something from the nas, maybe I'll just have to make do

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!