I have been using Syncthing for a while now and have a question about permissions.
Allow me explain how my setup is being run:
Syncthing is running on my Synology NAS as the “Main Server” for my Network.
One Shared Folder is allowed access using the Group SC-Syncthing and it is called DL.
The “Client” for Syncthing is running inside a VM running Linux Mint for various other tasks, but only watching one SEND ONLY folder - Completed DL.
When files get put into the Completed DL folder they are transferred one-way back to the NAS.
I run FileBot Node on the NAS and am running into permission issues with that particular folder, because after Syncthing performs the transfer it changes the folder and files Owner to syncthing. The way this FileBot package operates is it needs the folder and files to have an Owner of admin instead.
So instead of automation I have to backtrack on a scheduled task and change the permissions each time to move the files out of that folder. I have thought about making a script on the NAS that runs behind FileBot that would change permissions of that folder & files to admin first…but that is very complex when the permissions could already be set from the beginning!
Any insight or ideas on how I can fix this would be great!
Syncthing doesn’t change the owner, syncthing simply creates the files as that user. If you want syncthing to create files as admin, run syncthing as admin user.
Even with “station” as my username it still uses “syncthing” as that user for files?
What would be the best way to do this? Right now I have it start upon login under my Linux Mint user “station” using:
If I try something like
sudo -u admin syncthing or syncthing-gtk
I will get errors.
I already created “admin” as a user.
I suspect you need more Synology NAS specific advice than Syncthing specific advice.
I’m confused, in what way?
Are you implying that the user running the NAS package is naming them now?
All I want to know is how to get it to NOT run on my VM as the user “syncthing” by default.
Syncthing doesn’t choose who to run as, syncthing just runs whatever your NAS package started it as.
After experimenting with the
/var/packages/syncthing/scripts/start-stop-status user settings,
I decided that the only clear way to overcome this limitation is to chmod the whole Directory before allowing FileBot to run it’s script:
SSH into the NAS with your main account.
Create a script using vi or nano
chmod -R 777/volume1/YOURFOLDER/Media
Give it a name like perms.sh and then
sudo chmod 755 perms.sh to make it executable.
Go to your Task Scheduler and set the script user as ‘root’ and edit the time to execute as well as the location of it. I put mine inside one of my shares.
Execute your Filebot script and avoid permission errors when moving files!
*Warning this is only meant to be run at home and not in a production setting, as this makes things insecure.
I would still like to take suggestions to do this a better way.
As it was explained above, you should probably ask for advice on your NAS forum.
That’s not possible.
Each SPK runs under it’s own user in DSM, while there might be the way and messing up the start/stop scripts (which i don’t recommend) everything should work pretty well since the user running syncthing is also added to two user groups (users and sc-syncthing)
Why is filebot requireing the files to be owned by admin? that doesn’t seem right to me. I’ve got Syncthing SPK running on a DS myself and never ever had any permission issues. I have multiple tools which access the files frequently and all work (maybe because all of them are in the users group ;))
EDIT: you can change the user which runs synchting by changing it in the start/stop script but thats something i don’t recommend to do and you’ll have to do it everytime you’ll update the SPK… so the easyest way would be to get your Permissions setup correctly i guess
Thank you for the detailed explanation! I can live with it acting the way it does as it does not interfere with my normal user accounts.
FileBot-node is just plain strange altogether, but it works for my use at this time. If you want to look at the instructions over here it is spelled out that it must be run as admin, but not root…which leaves me scratching my head. Yes I have posted on their Forum, and linked this question in hopes of a reply.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.