Questions about "automatic" configuration & "external" control

Hello all,

I discover Syncthing last week and I’m currently testing the possibilities. It looks very interesting but I have some questions about the possibilities.

I have a project in which some linux devices are talking together with a MQTT & websocket based protocol to exchange various informations. This system allows that when a new device is added to the LAN, it is automatically discovered with the websocket protocol (ping/pong and custom protocol which let is to register to other devices).

I was thinking since lots of weeks that the “big files” I wanted to share btw all this devices have to be synchronized with websockets when I discovered Syncthing.

So you see my question I think … Is it possible, like I already make with my software, to automatically join a new device to shared folders of each device on the LAN ?

We can imagine that I can control the procedures with my software, but it’s my second question : how ? :slight_smile:

Thanks a lot

There’s a REST API to control Syncthing: REST API — Syncthing v1 documentation

It should not be hard to use it from your software.

There’s also an event API which can be useful if you need to observe what’s going on: Event API — Syncthing v1 documentation

It is also easy to use but uses the long-polling approach (instead of web sockets).

Thanks for your answer.

Yes, I’m trying to understand how it works. But can we really pair unknown devices ?

Add the shared folder to all others devices and allow all device to share their folder with the new device ? I saw one command to get the device ID but not more. I just want to be sure that I can do it before starting lots of tests :stuck_out_tongue: but using the rest api is not a problem for me, I think. Just have to see how I can manage the API Key… Or I can fix it maybe

You can basically swap out the entire configuration (devs, folders and all related settings) via the REST API. As far as I know the web UI is also just using the REST API under the hood.