add federation technical details

This commit is contained in:
Claus-Peter Hübner 2022-01-10 18:13:37 +01:00
parent 4df06c3374
commit d254f875ec
4 changed files with 257 additions and 2 deletions

View File

@ -287,7 +287,7 @@ Der Prozess *Neue Community erstellen* wird entweder automatisiert beim erstmali
Der oben grafisch dargestellte Ablauf wird in drei grobe Teile untergliedert:
1. den eigentlichen Community-Prozess "*neue Community erstellen*" (links in grün gehalten), in dem die Community spezifischen Attribute erfasst, geladen und/oder angelegt werden. Dazu gehören neben dem Erfassen der Community eigenen Attributen, das Laden von vordefinierten Standard-Daten wie die Tätigkeitsliste, Berechtigungen, etc. und optional als eigenständiger Prozess die Erfassung bzw das Anlegen von neuen Community-Mitgliedern.
2. das Starten der "*Federation*" als Hintergrundprozess, um die neu erstellte Community im Gradido-Community-Verbund bekannt zu machen. Dabei wird
2. das Starten der "*Federation*" als Hintergrundprozess, um die neu erstellte Community im Gradido-Community-Verbund bekannt zu machen. Dietechnischen Details der *Federation* werden im Dokument [Federation](../TechnicalRequirements/Federation.md " ") beschrieben. Dabei wird
* als erstes geprüft, ob in der eigenen Community die notwendigen Attribute wie Community-Key, URL und ggf. weitere korrekt initialisiert und gespeichert sind. Falls nicht wird der Hintergrundprozess mit einem Fehler abgebrochen
* dann werden die Attribute Community-Key und URL in eine *newCommunity*-Message gepackt und asynchron an den Public-Channel der Community-Federation des Gradido-Community-Verbundes gesendet
* Im Anschluss geht der Federation-Prozess in den "Lausch-Modus" auf eingehende Messages am *Public-Channel*. Die Verarbeitung von eingehenden Messages muss so sichergestellt werden, dass einerseits keine Message verloren geht auch bei DownTimes und andererseits, dass eine Message erst aus dem Public-Channel gelöscht wird, sobald diese vollständig abgearbeitet ist. Der Federation-Prozess lauscht auf Messages vom Typ *replyNewCommunity* und *newCommunity*, die bei Empfang entsprechend verarbeitet werden:
@ -299,7 +299,6 @@ Der oben grafisch dargestellte Ablauf wird in drei grobe Teile untergliedert:
* Sollte es keine solche Einträge geben, dann werden die eigenen Daten *Community-Ke*y und *URL* in eine *replyNewCommunity*-Message gepackt, der *MessageState = OK* gesetzt und direkt in den Public-Channel zurückgesendet. Danach wird wieder in den "Lausch-Modus" am Public-Channel gewechselt.
3. und die *"Community-Communication"* als Hintergrundprozess. Dieser liest zuerst die eigenen Community-Daten und geht dann per Direkt-Verbindung über die URL mit der neuen Community in Dialog, um die Community spezifischen Daten untereinander auszutauschen. Die genaue Beschreibung der dazu verwendeten APIs beider Communities erfolgt in der technischen Konzeption [CommunityCommunication](../TechnicalRequirements/CommunityCommunication.md).
#### Ende Status
1. Community-Infrastruktur ist installiert und aktiv

View File

@ -0,0 +1,32 @@
# Federation
This document contains the concept and technical details for the *federation* of gradido communities. It base on the [ActivityPub specification](https://www.w3.org/TR/activitypub/ " ") and is extended for the gradido requirements.
## ActivityPub
The activity pub defines a server-to-server federation protocol to share information between decentralized instances and will be the main komponent for the gradido community federation.
At first we asume a *gradido community* as an *ActivityPub user*. A user is represented by "*actors*" via the users's accounts on servers. User's accounts on different servers corrsponds to different actors, which means community accounts on different servers corrsponds to different communities.
Every community (actor) has an:
* inbox: to get messages from the world
* outbox: to send messages to others
and are simple endpoints or just URLs, which are described in the *ActivityStream* of each *ActivityPub community*.
### Open Decision:
It has to be decided, if the Federation will work with an internal or with external ActivityPub-Server, as shown in the picture below:
![FederationActivityPub](./image/FederationActivityPub.png " ")
The Variant A with an internal server contains the benefit to be as independent as possible from third party service providers and will not cause additional hosting costs. But this solution will cause the additional efforts of impementing an ActivityPub-Server in the gradido application and the responsibility for this component.
The Varaint B with an external server contains the benefit to reduce the implementation efforts and the responsibility for an own ActivitPub-Server. But it will cause an additional dependency to a third party service provider and the growing hosting costs.
## ActivityStream
An ActivityStream includes all definitions and terms needed for community activities and content flow around the gradido community network.

View File

@ -0,0 +1,224 @@
<mxfile host="65bd71144e">
<diagram id="Qdxn-o_uMU4q21qeaE9f" name="Seite-1">
<mxGraphModel dx="1088" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2336" pageHeight="1654" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="gradido application" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;verticalAlign=top;fontStyle=1;fontSize=16;" vertex="1" parent="1">
<mxGeometry x="160" y="120" width="640" height="370" as="geometry"/>
</mxCell>
<mxCell id="19" value="Federation Service" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;verticalAlign=top;fontStyle=1;fontSize=14;" vertex="1" parent="1">
<mxGeometry x="200" y="170" width="240" height="270" as="geometry"/>
</mxCell>
<mxCell id="16" value="&amp;nbsp;intern ActivityPub Server" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;verticalAlign=top;fontStyle=1;fontSize=14;" vertex="1" parent="1">
<mxGeometry x="480" y="250" width="300" height="160" as="geometry"/>
</mxCell>
<mxCell id="3" value="INBOX" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="580" y="290" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="4" value="OUTBOX" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="580" y="350" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="5" value="" style="shape=flexArrow;endArrow=classic;html=1;endWidth=18.5;endSize=6.0825;width=17.5;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="309.5" as="sourcePoint"/>
<mxPoint x="490" y="310" as="targetPoint"/>
<Array as="points">
<mxPoint x="530" y="310"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="6" value="GET" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="5">
<mxGeometry x="-0.325" y="1" relative="1" as="geometry">
<mxPoint x="-3" y="-1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="9" value="" style="shape=flexArrow;endArrow=classic;html=1;fontSize=12;width=21.75;endSize=6.1675;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="369.88" as="sourcePoint"/>
<mxPoint x="570" y="369.88" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="10" value="POST" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="9">
<mxGeometry x="-0.275" y="2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="11" value="" style="shape=flexArrow;endArrow=classic;html=1;endWidth=18.5;endSize=6.0825;width=17.5;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="840" y="311" as="sourcePoint"/>
<mxPoint x="670" y="310.5" as="targetPoint"/>
<Array as="points">
<mxPoint x="710" y="310.5"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="12" value="POST" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="11">
<mxGeometry x="-0.325" y="1" relative="1" as="geometry">
<mxPoint x="-3" y="-1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="13" value="" style="shape=flexArrow;endArrow=classic;html=1;fontSize=12;width=21.75;endSize=6.1675;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="670" y="370.38" as="sourcePoint"/>
<mxPoint x="840" y="370" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="14" value="GET" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="13">
<mxGeometry x="-0.275" y="2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="15" value="Gradido &lt;br style=&quot;font-size: 15px;&quot;&gt;Community Network" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=15;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="870" y="245" width="220" height="170" as="geometry"/>
</mxCell>
<mxCell id="20" value="newCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="340" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="21" value="replyNewCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="250" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="22" value="newCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="280" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="23" value="" style="endArrow=classic;html=1;fontSize=14;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="21">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="310" as="sourcePoint"/>
<mxPoint x="550" y="330" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="24" value="" style="endArrow=classic;html=1;fontSize=14;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="22">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="310" as="sourcePoint"/>
<mxPoint x="440" y="275" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="25" value="" style="endArrow=classic;html=1;fontSize=14;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="20">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="510" y="330" as="sourcePoint"/>
<mxPoint x="490" y="370" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="26" value="replyNewCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="370" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="27" value="" style="endArrow=classic;html=1;fontSize=14;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="26">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="440" y="365" as="sourcePoint"/>
<mxPoint x="490" y="370" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="gradido application" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;verticalAlign=top;fontStyle=1;fontSize=16;" vertex="1" parent="1">
<mxGeometry x="160" y="680" width="300" height="370" as="geometry"/>
</mxCell>
<mxCell id="29" value="Federation Service" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;verticalAlign=top;fontStyle=1;fontSize=14;" vertex="1" parent="1">
<mxGeometry x="200" y="730" width="240" height="270" as="geometry"/>
</mxCell>
<mxCell id="30" value="extern ActivityPub Server" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6d0de;gradientColor=#d5739d;strokeColor=#996185;verticalAlign=top;fontStyle=1;fontSize=14;" vertex="1" parent="1">
<mxGeometry x="480" y="810" width="300" height="160" as="geometry"/>
</mxCell>
<mxCell id="31" value="INBOX" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="580" y="850" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="32" value="OUTBOX" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;gradientColor=#7ea6e0;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="580" y="910" width="80" height="40" as="geometry"/>
</mxCell>
<mxCell id="33" value="" style="shape=flexArrow;endArrow=classic;html=1;endWidth=18.5;endSize=6.0825;width=17.5;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="570" y="869.5" as="sourcePoint"/>
<mxPoint x="490" y="870" as="targetPoint"/>
<Array as="points">
<mxPoint x="530" y="870"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="34" value="GET" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="33">
<mxGeometry x="-0.325" y="1" relative="1" as="geometry">
<mxPoint x="-3" y="-1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="35" value="" style="shape=flexArrow;endArrow=classic;html=1;fontSize=12;width=21.75;endSize=6.1675;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="929.8800000000001" as="sourcePoint"/>
<mxPoint x="570" y="929.8800000000001" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="36" value="POST" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="35">
<mxGeometry x="-0.275" y="2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="37" value="" style="shape=flexArrow;endArrow=classic;html=1;endWidth=18.5;endSize=6.0825;width=17.5;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="840" y="871" as="sourcePoint"/>
<mxPoint x="670" y="870.5" as="targetPoint"/>
<Array as="points">
<mxPoint x="710" y="870.5"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="38" value="POST" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="37">
<mxGeometry x="-0.325" y="1" relative="1" as="geometry">
<mxPoint x="-3" y="-1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="39" value="" style="shape=flexArrow;endArrow=classic;html=1;fontSize=12;width=21.75;endSize=6.1675;fillColor=#f5f5f5;gradientColor=#b3b3b3;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="670" y="930.3800000000001" as="sourcePoint"/>
<mxPoint x="840" y="930" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="40" value="GET" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=12;labelBackgroundColor=none;" vertex="1" connectable="0" parent="39">
<mxGeometry x="-0.275" y="2" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="41" value="Gradido &lt;br style=&quot;font-size: 15px;&quot;&gt;Community Network" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=15;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="870" y="805" width="220" height="170" as="geometry"/>
</mxCell>
<mxCell id="42" value="newCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="900" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="43" value="replyNewCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="810" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="44" value="newCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="840" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="45" value="" style="endArrow=classic;html=1;fontSize=14;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="43">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="870" as="sourcePoint"/>
<mxPoint x="550" y="890" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="46" value="" style="endArrow=classic;html=1;fontSize=14;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" target="44">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="490" y="870" as="sourcePoint"/>
<mxPoint x="440" y="835" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="47" value="" style="endArrow=classic;html=1;fontSize=14;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="42">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="510" y="890" as="sourcePoint"/>
<mxPoint x="490" y="930" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="48" value="replyNewCommunity-Msg" style="rounded=0;whiteSpace=wrap;html=1;labelBackgroundColor=none;fontSize=14;fillColor=#d5e8d4;gradientColor=#97d077;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="255" y="930" width="175" height="30" as="geometry"/>
</mxCell>
<mxCell id="49" value="" style="endArrow=classic;html=1;fontSize=14;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="48">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="440" y="925" as="sourcePoint"/>
<mxPoint x="490" y="930" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="50" value="Variant A: Federation with an &quot;internal&quot; ActivityPub-Server" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;fontSize=16;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="40" width="720" height="30" as="geometry"/>
</mxCell>
<mxCell id="51" value="Variant B: Federation with an &quot;external&quot; ActivityPub-Server" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;labelBackgroundColor=none;fontSize=16;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="80" y="610" width="720" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB