diff --git a/index.rst b/index.rst index dec0855ff65fdbd1218c0322fa0807abbc56a125..a22b15906181b31d0d3b4f0d4c7034a79ecb2e35 100644 --- a/index.rst +++ b/index.rst @@ -23,3 +23,4 @@ contribute<guides/how-to-contribute-to-this-documentation>`! general/index guides/index + technical/index \ No newline at end of file diff --git a/technical/index.rst b/technical/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..3fc5d86a6ed94e3d744e23263e7e3085559f4ed1 --- /dev/null +++ b/technical/index.rst @@ -0,0 +1,11 @@ +######### +Technical +######### + +This chapter includes in-depth explanations of how Jami is designed. +It also serves as a reference for contributors. + +.. toctree:: + :maxdepth: 1 + + swarm diff --git a/technical/2.3.-Swarm.md b/technical/swarm.md similarity index 94% rename from technical/2.3.-Swarm.md rename to technical/swarm.md index dca22562fcb911a8fccf01e85fe6899d62e07c2a..8dc978b869cde266349e3c4b2edee58cef7e6d3b 100644 --- a/technical/2.3.-Swarm.md +++ b/technical/swarm.md @@ -72,7 +72,7 @@ For pinging other devices, the sender sends to other members a SIP message with 1. *Bob* do a git pull on *Alice* 2. Commits MUST be verified via a hook 3. If all commits are valid, commits are stored and displayed. Then *Bob* announces the message via the DRT for other devices. -4. If all commits are not valid, pull is canceled. *Alice* must reestablish her state to a correct state. **TODO process* +4. If all commits are not valid, pull is canceled. *Alice* must reestablish her state to a correct state. **TODO process* ## Validating a commit @@ -87,12 +87,13 @@ Note2: If a fetch is too big, it's not done (**TODO**) + Check that admin cert is added + Check that device cert is added + Check CRLs added - + Check that no other file is added + + Check that no other file is added + The commit has 1 parent, commit message is a JSON with a type: + If text (or other mime-type that doesn't change files) + Check signature from certificate in the repo + Check that no weird file is added outside device cert nor removed + If vote + + Check that voteType is supported (ban, unban) + Check that vote is for the user that signs the commit + Check that vote is from an admin and device present & not banned + Check that no weird file is added nor removed @@ -108,12 +109,12 @@ Note2: If a fetch is too big, it's not done (**TODO**) + Check that device is added + Check that invitation is moved to members + Check that no weird file is added nor removed - + If kickban - + Check that vote is valid + + If banned + + Check that vote is valid + Check that the user is ban via an admin + Check that member or device certificate is moved to banned/ + Check that only files related to the vote are removed - + Check that no weird file is added nor removed + + Check that no weird file is added nor removed + else fail. Notify the user that they may be with an old version or that peer tried to submit unwanted commits @@ -144,11 +145,16 @@ This is needed to detect revoked devices, or simply avoid getting unwanted peopl Note: Alice MUST be admins to vote -+ First, she votes for ban Bob. To do that, she creates the file in /votes/members/uri_bob/uri_alice (members can be replaced by devices for a device) and commits ++ First, she votes for banning Bob. To do that, she creates the file in /votes/ban/members/uri_bob/uri_alice (members can be replaced by devices for a device, or invited for invites or admins for admins) and commits + Then she checks if the vote is resolved. This means that >50% of the admins agree to ban Bob (if she is alone, it's sure it's more than 50%). -+ If the vote is resolved, files into /votes can be removed, all files for Bob in /members, /admins, /invited, /CRLs, /devices can be removed (or only in /devices if it's a device that is banned) and Bob's certificate can be placed into /banned/members/bob_uri.crt (or /banned/devices/uri.crt if a device is banned) and committed to the repo ++ If the vote is resolved, files into /votes/ban can be removed, all files for Bob in /members, /admins, /invited, /CRLs, /devices can be removed (or only in /devices if it's a device that is banned) and Bob's certificate can be placed into /banned/members/bob_uri.crt (or /banned/devices/uri.crt if a device is banned) and committed to the repo + Then, Alice informs other users (outside Bob) +*Alice (admin) re-adds Bob (banned member) ++ Fir she votes for unbanning Bob. To do that, she creates the file in /votes/unban/members/uri_bob/uri_alice (members can be replaced by devices for a device, or invited for invites or admins for admins) and commits ++ Then she checks if the vote is resolved. This means that >50% of the admins agree to ban Bob (if she is alone, it's sure it's more than 50%). ++ If the vote is resolved, files into /votes/unban can be removed, all files for Bob in /members, /admins, /invited, /CRLs, can be re-added (or only in /devices if it's a device that is unbanned) and committed to the repo + ## Remove a conversation 1. Save in convInfos removed=time::now() (like removeContact saves in contacts) that the conversation is removed and sync with other user's devices @@ -196,7 +202,7 @@ There are some cases where two conversations can be created. This is at least tw 3. Alice removes Bob 4. Alice adds Bob -or +or 1, Alice adds Bob & Bob adds Alice at the same time, but both are not connected together @@ -344,12 +350,21 @@ Moreover editing messages will be possible! (`commit --fixup`) - devices (certificates of authors to verify commits) - banned - devices + - invited + - admins - members - votes - - members - - uri - - devices - - uri + - ban + - members + - uri + - uriAdmin + - devices + - uri + - uriAdmin + - unban + - members + - uri + - uriAdmin - CRLs ```