I have a few clients that send, receive or sync data. The relationships are sometimes complicated and I would love to see them as a graph between clients, data, and kind of connection (send, receive, sync).
Is there a way to do that one way or another? (short of drawing them myself)
Actually every node knows its own connected devices and shared folders, plus every other device directly sharing the same folder with one of the connected remote devices. In other words, the local perspective tells you every involved device that is one or two hops away. In a straight linear topology A - B - C - D, that means A can know about B (directly) and C (indirectly), but not D.
This info is all contained in the ClusterConfig messages exchanged each time a connection is established. However, Syncthing currently does not expose it in any way for analysis or plotting. Something I’d like to implement in the long term.
If you do find or develop a solution how to visualize device and folder relationships (even if generated from a manual description of the links), I’d be very interested so please do share it here in case.
I would love to be able to use something like this too!
For now, I’ve always resorted to simply drawing the whole thing by hand, but the obvious disadvantage is that you need to re-do everything each time there are changes to the configuration. This could, however, be mitigated by drawing on a computer with a stylus (which I’ve actually got but I’m not a digital artist and drawing by hand still feels more natural to me ).
@acolomb@tomasz86 I started to develop a very rudimentary tool that takes all the config.xml files that are available to someone (in my case several of them, plus a few on the family devices that I may or may not have access to).
My idea is to plot the basic relationships (who sends what where, and the type (synch, receive / send only)) via mermaid.js. Or something different if there is a better way.
I would love to automatically get the data via the API but this is very limitative and wild work only when all devices are within one network (which in my case could be possible, especially if I continuously try to pull the data).
The obvious drawback is that with the vibe files the plot is a one-shot.
That’s great to hear! I’ll definitely be looking forward to testing it .
The config.xml approach is probably much more flexible. In my network there are devices located in a different country, so just querying the API is a no-go here.
This is not going to happen overnight as I am quite loaded with work, family and the need to finish my smart lock
But I will add this to my parallelized development because it would really help me to ensure that the configuration is consistent and actually does what I think it does. I gave some thoughts this morning under the shower and I should bootstrap something “soon”, at least a very rough first draft.
I was considering sharing the configuration (as part of a synching folder share), send only, to a centralized machine but it will be a bit messy. I will see.
Thanks - this is basically what I want to do, with the addition of
parsing a config file and its cert generates a JSON object that is indexed with the hostname. Several different configs (and certs) will generate several entries in the JSON which will allow to map several devices
I will add the direction (type) for each connection, as seen from both sides to check for consistency (when I have one folder as “receiveonly”, I usually have it as “sendonly” on the other side - but not always)
I will “pack” folders under a host to check for discrepancies in naming
Great, thanks for sharing this! I hope it will keep getting developed and extended upon. If you like, we can add a pointer to the tool in the documentation.
I hope I’ll have time to try it out soon, already had some ideas what could be added, such as differing device names or being able to show when a folder is shared only one way, but not accepted on the other end.
I’ve tried to use it under Windows, but unfortunately it doesn’t seem to be able to open the XML files. For the record, there are two of them in the folder.
.\syncthing-graph.exe *.xml > graph.dot
*** DEBUG prima del marshal {{ } [] []}
=== Processing file *.xml ( 1 of 1 )
open *.xml: The filename, directory name, or volume label syntax is incorrect.
*** DEBUG dopo marshal {{ } [] []}
The problem seems to be about the wildcard, because .\syncthing-graph.exe config1.xml config2.xml > graph.dot does work.