making a filter specific to a single remote device

Hi I was wondering if it could be possible to set filters on my main machine that would mean one remote machine only receives some folders while all the rest of the remote machines receive everything. Right now I can set a filter directly in the remote machine like so…

!*_bob *

That remote machine will only download and sync any folder in root with _bob at the end. Ideally I would like to do this from the primary machine in its own stignore file so anyone with access to the remote machine cannot expand or delete their stignore filters to pull down more folders and accidentally screw things up.

I don’t see a way to do this now but thought that could be a nice addition to filtering to add a pattern that denotes specific devices that specific filter applies to.

Sounds like you should maybe use several Syncthing folders where you can easily control which ones are shared to what device, instead of trying to shoehorn the ignores system into a solution for your use case. It only solves the problem of wanting just a subset of the offered folder contents locally. If you want to deny access to it from some remote nodes, just stop offering it to them by pointing Syncthing a bit lower in the folder hierarchy.


I personally wouldn’t call this “shoehorning”. There are legitimate cases where one wants to share the exact same folder with multiple other devices, but use different ignore patterns for each of them, e.g. due to space constrains or because they want to share different files with different people. Changing the existing folder structure is often impossible, e.g. when the folders to share are a a part of a larger project or software. Sharing nested folders is a viable option, but it has its own problems, e.g. problematic versioning support.

I would say that the question asked in this thread is essentially Custom `.stignore` name. · Issue #7836 · syncthing/syncthing · GitHub. Once there is a possibility to set custom .stignore per folder, one could simply use separate ignore files for each of them, e.g. using folder IDs like .stignore_2y777-pnfq6, .stignore_usp7k-kwixx, and so on.

Yes Tomasz86, that is exactly the set of issues I am dealing with. My total data footprint for syncthing is around 100TB shared in a number of folders (video production company). Three devices need all the data. A couple others are remote editors that need access to specific chunks at different times. They do not need all the data so using ignores works very well. The fact I can add a couple letters to a folder name and immediately push the data necessary to a specific device and just as easily remove those letters and remove that data from the device is pretty elegant. If I was to do this with folder shares I would creating and removing an additional 30 to 40 folders shares and/or constantly shifting TBs of data around in a folder structure which just screams something going wrong or getting lost not to mention all the time syncthing would spend re-syncing.

I can honestly say that the stignore method works perfectly it would just be ideal if I could control the filters centrally since I don’t have direct access to all the devices. Device specific stignore files sounds like a great route.

1 Like

Well I took this as some of the nodes being not trustworthy to decide on their own what to ignore and what to sync. That’s where ignores won’t help you.

If it’s just a means to ease administration, then of course you can use device specific .stignore files. Even with #7836 implemented, you would still need one piece of configuration done locally on each device once. If that’s acceptable, you could use the include directive to achieve this already.

Create a subfolder .stignores with your per-owner patterns: files named bob and jane for example. Then you tell Bob to paste include .stignores/bob into his folder configuration. Now whoever edits the bob file controls exactly what he gets to sync. Which can be anybody who shares the folder at all, so it hinges on you trusting people to not touch anything inside that hidden .stignores folder.

Well, you need to trust them anyway to not modify or delete your whole data…

Thanks, I’ll try out that method. Sorry I wasn’t more clear. Its not about trust per say so much as hiding as much complexity from people as possible while making sure they don’t accidentally delete that stignore file and suddenly get 40+ TB copying over. All this while of course making administration easier. Ideally I could build a pipeline where the remote users never have to know about filters or stignore files on their side but this sounds like it will at least improve administration.