Auto accept folders, default folder per device

Hello Syncthing forum.

First of all, I’m new to Syncthing, but starting to love it. Great work guys. Until now all my questions have been answered just by reading docs, and by searching the forum, but now I’m kind of stuck.

If I have three known devices, and they all create a folder named “pictures”, how can I make these to be auto accepted in different directories in my server? Ie is there a way to make the server to automatically create a folder named “Device A” with a subfolder “pictures”…?

I’m sorry in advance, if this already is answered somewhere. I’ve tried to search the forums for a solution, but I can’t seem to find it.

If this is a missing feature, I would love to see it :slight_smile:

Thanks.

Kind regards, Oistein

There is an auto accept feature but it does not work the way you describe it. It works by auto-accepting folders from a given device and storing it in default path/folder id, and for every device that has auto-accept enabled has the same folder shared with you, it gets shared back automatically. There is no function as you described which would put each devices same folder id under a different path.

Thanks for the quick reply.

I have been playing around with the auto accept feature, and in most cases it’s brilliant, but in some cases it would have been really nice to have the posibility to specify a default folder per device.

Ie if I have a server that I would like to have sync folders between only 3 devices, instead of all of my devices. So it is ok that it’s not an all automatic feature, but it would be great with the possibility to define a default folder per device. Then Syncthing would auto accept new folders in the same folder for those devices that has the same default folder, and the other devices would still have auto accept folders to the default system folder.

Thanks again.

It’s based on folder ID. If you have 6 devices and you want 3 to share one folder and other 3 to share another folder, make sure the folder id matches on the first 3 and matches on the last 3 but is different than the first 3.

Sure, this can still collide if last 3 suddenly share a folder with the id of the first folder, but given you control the devices, you can make sure this doesn’t happen.

1 Like

Yes. I’ve seen that possibility :slight_smile: problem is that I’m not in full control of all the devices, but I have full control of the main server. Was just hoping that I wouldn’t have to handle all folder share requests to keep things organized.

With the possibility to give default folder paths per device, it would be a bit more automized. My wifes devices would have their sync-folders auto accepted in one location, and I would have mine. Try explaining the folder ID rules to my wife :slight_smile: guess I just have to keep things maintained manually.

Thanks anyway for your great support.

The folder id rule has nothing to do with auto accept. You can only have a folder id once. If your wife creates a folder with the same id you already use, you cannot have both folders separate on the server, as accepting that folder (auto or manually) will share the existing folder and not create a new one.

I’m not sure I understand what you meen.

If auto accept is turned on for some devices, and if a folder doesn’t exist on the server or computer that these devices share, it will create a new folder in the default folder path. If my wifes devices could have their own default folder path, the new auto accepted folders for her devices will be added to that default path. As of now that is not possible, we have to share default path on the same computer or server.

So if both my wife and I create a folder with the same name with two different devices where auto accept is enabled, won’t the files be put in the same folder on that computer or server that we share…?

No, as auto accept uses the folder id, not its name.

If you crate a folder with id test1 on your device and your wife does this too, it is impossible to share those folders separately with the server, as syncthing identifies a folder only by folder id, not by device id + folder id.

Yes, thanks. That is why I was asking.

I thought this forum was where you could discuss potensial features of Syncthing…? I was only suggesting that if there by some chance was possible to tick a checkbox in device settings with a possibility to define a default subfolder for that device, this would be a great feature that would make Syncthing more flexible for me, and my scenario.

But if this is something that is completely impossible to implement, or if this is a feature that everyone else on this forum think is entirely waste of time, you can consider the question answered :slight_smile:

Thanks for everyones quick replies.

Discussing is one thing, implementing is another. Nobody as it stands now is interested in implementing this.

Also, your scenario can already be worked around by default most of the time, as folder ids are random by default, so your wife would have to deliberately try to mess your setup and deliberately specify a folder id you already have. You can just not tell her your folder id to prevent her from messing it up

1 Like

Hello in 2022. I just met the same need. My case: I have a server machine. It runs a number of services. Among them Syncthing. There are multiple users: ku(me), wife, mom, bro. Each user have his own folder inside /home. Only admin has access to Syncthing API and Admin panel. There is no multi-user system. Therefore we cannot and do not want to approve each new syncing folder. New folders must be created under /home/UserName. As a solution I see a per-device default folder as suggested here.

And the other less important issue is to keep permissions. Syncthing is running as root. /home/UserName folders owned by different users and permission mode is 750. Syncthing should create folders and files with owner:group of parent folder.

I think it is a cool Syncing thing and is almost ideal.

May be I should just run a per-user instance.?

You should, ideally.

However, for copying ownership from parent folder you’re in luck: Syncthing Configuration — Syncthing v1.19.1-8-gaf93ba9 documentation

That sounds like a reasonable idea if there is only one account using each computer anyway. The documentation has a lot of info about starting Syncthing automatically. I would recommend a systemd (system) service for this use case. Running as root is not recommended.

1 Like

Sure. I do not run as root.