syncthing icon indicating copy to clipboard operation
syncthing copied to clipboard

Allow a node to join multiple clusters

Open jpjp opened this issue 12 years ago • 16 comments

I can't find the issue for this.

Rather than having lots of instances of syncthing running on various different ports, a single syncthing instance which supports membership to multiple clusters would be nice.

Use case:

I have a PC that has the following structure:

~/Work
~/Documents
~/Photos

I share each of these directories with different people and PCs.

jpjp avatar Jan 13 '14 14:01 jpjp

I was just wondering how the access permissions will work on this. Will [nodes] become part of [repository] ?

jpjp avatar Jan 28 '14 18:01 jpjp

No idea. Haven't thought that through. Ideas?

calmh avatar Jan 28 '14 20:01 calmh

Will have a think.

jpjp avatar Jan 28 '14 20:01 jpjp

I think that since the [repository] section contains a single entry, dir, then it can become a simple key and value dir=something. This leads [nodes] where we could use node=something. The difficulty becomes how to represent the "=dynamic" or "=IP" part.

How about something like this:

[reponame]
dir = /path/here
node = ABC0
node = DEF1,dynamic
node = GHI2,1.2.3.4:22000

The default could be dynamic, the user doesn't need to specify it. Now the permissions model is the same as before.

jpjp avatar Jan 28 '14 22:01 jpjp

I guess you could even have a [global] or [.global] sectiom (but disallow non-ascii+nums in repo name) which could include items for every [repo], e.g. if you always wanted a particular node entry.

jpjp avatar Jan 28 '14 22:01 jpjp

The suggestions are not bad. However, here's what I think I'll do: just use JSON for the configuration format. The advantage is that it's trivial to represent nested structures and things like that in a nice way. The downside is that it's not nearly as user friendly as an .ini-style config. I hope to compensate for the latter by allowing configuration of all or most options in the GUI instead. This is also greatly simplified by having a config representation that's more machine friendly.

calmh avatar Feb 01 '14 10:02 calmh

Or even XML. Right now I'm looking at something like this as a straight conversion of the current file;

<configuration version="0">
    <repository directory="~/Sync">
        <node id="OWCJPCQ5W733YCPBRYOY2KL4MGJQKKEIEFGKFPN7KS4JIUNNG3TA">
            <address>dynamic</address>
        </node>
        <node id="YUFJOUDPORCMADCKM3PMJUHGZPPZWLPIBI74JMGOXHIEWDMAVDOQ">
            <address>dynamic</address>
        </node>
    </repository>
    <options>
        <listen-address>:22000</listen-address>
        <read-only>true</read-only>
        <allow-delete>true</allow-delete>
        <follow-symlinks>true</follow-symlinks>
        <gui-enabled>true</gui-enabled>
        <gui-address>127.0.0.1:8080</gui-address>
        <global-announce-server>syncthing.nym.se:22025</global-announce-server>
        <global-announce-enabled>true</global-announce-enabled>
        <local-announce-enabled>true</local-announce-enabled>
        <parallel-requests>16</parallel-requests>
        <max-send-kbps>0</max-send-kbps>
        <rescan-interval-s>60</rescan-interval-s>
        <reconnection-interval-s>60</reconnection-interval-s>
        <max-change-kbps>1000</max-change-kbps>
    </options>
</configuration>

Adding more repositories, when supported, is simply a question of adding another <repository> node.

calmh avatar Feb 01 '14 11:02 calmh

Haven't seen the json version, but the xml version looks fine, if a little verbose (as xml always does). As long as I can configure it from the command line I am content :)

jpjp avatar Feb 01 '14 11:02 jpjp

XML config is in a1d5758, so we're prepared on that front.

calmh avatar Feb 03 '14 15:02 calmh

Cool :) I wonder what the feature for mass adoption will be :)

jpjp avatar Feb 03 '14 21:02 jpjp

Could the gui show when there are changes pending?

jpjp avatar Feb 03 '14 21:02 jpjp

Yeah, -> #50

calmh avatar Feb 05 '14 06:02 calmh

Is there any chance of multi-repo support being added to the web gui?

jpjp avatar Mar 11 '14 15:03 jpjp

As soon as it's done in the backend, which is in progress. :)

(Sent from my phone - please excuse brevity and typos.)

On 11 mar 2014, at 16:33, jpjp [email protected] wrote:

Is there any chance of multi-repo support being added to the web gui?

— Reply to this email directly or view it on GitHub.

calmh avatar Mar 11 '14 16:03 calmh

Cool :+1:

jpjp avatar Mar 11 '14 16:03 jpjp

Step one of this has landed. A node can synchronize multiple repositories with various other peer nodes. There are some serious limitations that will be rectified in the coming releases. Description & discussion here; http://discourse.syncthing.net/t/v0-7-0-multiple-repository-synchronization/11

calmh avatar Mar 30 '14 19:03 calmh