Automatically share folders to previously introduced peers

Hi Guys,

I’m going to present you a scenario: we have 3 nodes: A, B and C and they want all to share a folder under id X. B is an introducer.

  • A handshakes X with B.
  • C handshakes X with B. C gets to know about A and viceversa (this is already existent behaviour on syncthing).
  • The actual feature comes into play: Once and A and C know about each other’s existence, they would automatically share X to each other if and only if allowed by the user. This allowance could be implemented as a folder-specific flag or a global one on each node.

I have been using syncthing for two days and so far it’s been awesome, especially since its upcoming 0.12 release. It seems that this behaviour is most likely desirable for commodity reasons, for example, you would like to share a folder between your phone and both your personal and work laptop, using your phone as your introducer without necessarily having to wait until Monday before you could “seal the deal” on your business laptop so that A and C can finally exchange X.

Anyways, let me know what you think!.

Cheers!, and thank you very much for such a wonderful effort.

1 Like

Edit: Actually, perhaps this is not dangerous, given A already has access to C’s X via B. Feel free to make a pull request. You might have to send a bit more information in the ClusterConfig message to know who shares what with who, to be able to derive this.

Right now, I am deeply reading through the source code. It will take me some time to implement this :smile: . Thanks for the hint btw!

1 Like

Beware. If you gaze long enough into source code, the source code will gaze back into you.

2 Likes