crusttech / crust-server

Apache License 2.0
87 stars 21 forks source link

Federation #75

Open titpetric opened 5 years ago

titpetric commented 5 years ago

I'm documenting some references here about Federation, with the goal of analyzing existing solutions we can pair against, it's restrictions and requirements as they apply to crust (messaging or otherwise).

The main intent is to achieve server 2 server federation, where two (or more) Crust users on different instances may connect "directly" and have a communication channel which replicates between servers. As such, initially this would apply only to direct messaging and group messaging (private channels).

Effectively:

  1. servers create a p2p mesh network (possibly on-demand instead of always on),
  2. one server holds the "master" user account, while all others have "shadowed" users,
  3. to initiate a connection, user A(server1) has to add user B(server2) -
    • does the server allow federation (settings),
    • server pairing (handshake, signatures - some form of verification later on)
    • shadow account creation (server2:A, and server1:B),
    • live status updates as allowed by the server(s) - is the user online, etc.,
    • message replication when a message is sent to the group (O(N) where N number of crust servers),

The starting scope would only support messaging groups, as they are not subject to role memberships or require federation of additional resources (channels, roles, permissions).

alexiskraft commented 5 years ago

@zmija Should we have a separate project for this long-term stuff? My target is that we have Federation in place by end of 2019.