Skip to content
Snippets Groups Projects
Commit 32640d5c authored by Sébastien Blin's avatar Sébastien Blin Committed by Amin Bandali
Browse files

Add technical section with up-to-date documentation for swarm

Change-Id: If1e5e95b4f9a128ecce7e800b8e5a0137eb36106
parent 9e412ab6
No related branches found
No related tags found
No related merge requests found
......@@ -23,3 +23,4 @@ contribute<guides/how-to-contribute-to-this-documentation>`!
general/index
guides/index
technical/index
\ No newline at end of file
#########
Technical
#########
This chapter includes in-depth explanations of how Jami is designed.
It also serves as a reference for contributors.
.. toctree::
:maxdepth: 1
swarm
......@@ -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
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment