Skip to content

Commit e2d0d97

Browse files
committed
Merge branch 'master' into ab/tls-2
2 parents 3f510cc + d47c099 commit e2d0d97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3218
-701
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 5.8.1
2+
3+
Agent:
4+
- API to reconnect one server.
5+
- Better error handling of file errors and remote control connection errors.
6+
- Only start uploading file once all chunks were registered on the servers.
7+
8+
SMP server:
9+
- additional stats for sent message notifications.
10+
- fix server page layout.
11+
112
# 5.8.0
213

314
Version 5.8.0.10

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,17 @@ On Linux, you can build smp server using Docker.
208208

209209
#### Using your distribution
210210

211-
1. Install [Haskell GHCup](https://www.haskell.org/ghcup/), GHC 8.10.7 and cabal:
211+
1. Install dependencies and build tools (`GHC`, `cabal` and dev libs):
212212

213213
```sh
214-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
215-
ghcup install ghc 8.10.7
216-
ghcup install cabal
217-
ghcup set ghc 8.10.7
218-
ghcup set cabal
214+
# On Ubuntu. Depending on your distribution, use your package manager to determine package names.
215+
sudo apt-get update && apt-get install -y build-essential curl libffi-dev libffi7 libgmp3-dev libgmp10 libncurses-dev libncurses5 libtinfo5 pkg-config zlib1g-dev libnuma-dev libssl-dev
216+
export BOOTSTRAP_HASKELL_GHC_VERSION=9.6.3
217+
export BOOTSTRAP_HASKELL_CABAL_VERSION=3.10.3.0
218+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
219+
ghcup set ghc "${BOOTSTRAP_HASKELL_GHC_VERSION}"
220+
ghcup set cabal "${BOOTSTRAP_HASKELL_CABAL_VERSION}"
221+
source ~/.ghcup/env
219222
```
220223

221224
2. Build the project:
@@ -224,10 +227,20 @@ On Linux, you can build smp server using Docker.
224227
git clone https://github.com/simplex-chat/simplexmq
225228
cd simplexmq
226229
git checkout stable
227-
# On Ubuntu. Depending on your distribution, use your package manager to determine package names.
228-
apt-get update && apt-get install -y build-essential libgmp3-dev zlib1g-dev
229230
cabal update
230-
cabal install
231+
cabal build exe:smp-server exe:xftp-server
232+
```
233+
234+
3. List compiled binaries:
235+
236+
`smp-server`
237+
```sh
238+
cabal list-bin exe:smp-server
239+
```
240+
241+
`xftp-server`
242+
```sh
243+
cabal list-bin exe:xftp-server
231244
```
232245

233246
- Initialize SMP server with `smp-server init [-l] -n <fqdn>` or `smp-server init [-l] --ip <ip>` - depending on how you initialize it, either FQDN or IP will be used for server's address.

apps/smp-server/static/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
<link rel="stylesheet" href="/media/style.css">
1616

1717
<style>
18+
body,
19+
html {
20+
width: 100%;
21+
overflow-x: hidden;
22+
}
23+
1824
table#config {
1925
border-collapse: collapse;
2026
margin-bottom: 4px;
@@ -42,6 +48,17 @@
4248
}
4349
}
4450

51+
@media screen and (max-width: 440px) {
52+
table {
53+
width: 100%;
54+
table-layout: fixed;
55+
}
56+
57+
tr td:not(:last-child) {
58+
width: 40%;
59+
}
60+
}
61+
4562
.dark tr td:not(:last-child) {
4663
color: #fff;
4764
}

apps/smp-server/static/media/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ img {
5050
/* For Internet Explorer and Edge */
5151
}
5252

53+
a{
54+
word-wrap: break-word;
55+
}
56+
5357
/* NEW SITE */
5458
.container,
5559
.container-fluid,

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: simplexmq
2-
version: 5.8.0.10
2+
version: 5.8.1.0
33
synopsis: SimpleXMQ message broker
44
description: |
55
This package includes <./docs/Simplex-Messaging-Server.html server>,

protocol/agent-protocol.md

Lines changed: 316 additions & 259 deletions
Large diffs are not rendered by default.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
sequenceDiagram
2+
participant A as Alice
3+
participant AA as Alice's<br>agent
4+
participant AS as Alice's<br>server
5+
participant BS as Bob's<br>server
6+
participant BA as Bob's<br>agent
7+
participant B as Bob
8+
9+
note over AA, BA: status (receive/send): NONE/NONE
10+
11+
note over A, AA: 1. request connection<br>from agent
12+
A ->> AA: createConnection
13+
14+
note over AA, AS: 2. create Alice's SMP queue
15+
AA ->> AS: NEW: create SMP queue<br>allow sender to secure
16+
AS ->> AA: IDS: SMP queue IDs
17+
note over AA: status: NEW/NONE
18+
19+
AA ->> A: INV: invitation<br>to connect
20+
21+
note over A, B: 3. out-of-band invitation
22+
A ->> B: OOB: invitation to connect
23+
24+
note over BA, B: 4. accept connection
25+
B ->> BA: joinConnection:<br>via invitation info
26+
note over BA: status: NONE/NEW
27+
28+
note over BA, AS: 5. secure Alice's SMP queue
29+
BA ->> AS: SKEY: secure queue (this command needs to be proxied)
30+
note over BA: status: NONE/SECURED
31+
32+
note over BA, BS: 6. create Bob's SMP queue
33+
BA ->> BS: NEW: create SMP queue<br>allow sender to secure
34+
BS ->> BA: IDS: SMP queue IDs
35+
note over BA: status: NEW/SECURED
36+
37+
note over BA, AA: 7. confirm Alice's SMP queue
38+
BA ->> AS: SEND: Bob's info without sender's key (SMP confirmation with reply queues)
39+
note over BA: status: NEW/CONFIRMED
40+
41+
AS ->> AA: MSG: Bob's info without<br>sender server key
42+
note over AA: status: CONFIRMED/NEW
43+
AA ->> AS: ACK: confirm message
44+
AA ->> A: CONF: connection request ID<br>and Bob's info
45+
A -> AA: allowConnection: accept connection request,<br>send Alice's info
46+
47+
note over AA, BS: 8. secure Bob's SMP queue
48+
AA ->> BS: SKEY: secure queue (this command needs to be proxied)
49+
note over BA: status: CONFIRMED/SECURED
50+
51+
AA ->> BS: SEND: Alice's info without sender's server key (SMP confirmation without reply queues)
52+
note over AA: status: CONFIRMED/CONFIRMED
53+
54+
note over AA, A: 9. notify Alice<br>about connection success<br>(no HELLO needed in v6)
55+
AA ->> A: CON: connected
56+
note over AA: status: ACTIVE/ACTIVE
57+
58+
note over BA, B: 10. notify Bob<br>about connection success
59+
BS ->> BA: MSG: Alice's info without<br>sender's server key
60+
note over BA: status: CONFIRMED/CONFIRMED
61+
BA ->> B: INFO: Alice's info
62+
BA ->> BS: ACK: confirm message
63+
64+
BA ->> B: CON: connected
65+
note over BA: status: ACTIVE/ACTIVE

protocol/diagrams/duplex-messaging/duplex-creating-fast.svg

Lines changed: 3 additions & 0 deletions
Loading

protocol/diagrams/duplex-messaging/duplex-creating-v2.mmd

Lines changed: 0 additions & 71 deletions
This file was deleted.

protocol/diagrams/duplex-messaging/duplex-creating.mmd

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,67 @@ sequenceDiagram
88

99
note over AA, BA: status (receive/send): NONE/NONE
1010

11-
note over A, AA: 1. request connection from agent
12-
A ->> AA: NEW: create<br>duplex connection
11+
note over A, AA: 1. request connection<br>from agent
12+
A ->> AA: createConnection
1313

1414
note over AA, AS: 2. create Alice's SMP queue
1515
AA ->> AS: NEW: create SMP queue
1616
AS ->> AA: IDS: SMP queue IDs
1717
note over AA: status: NEW/NONE
1818

1919
AA ->> A: INV: invitation<br>to connect
20-
note over AA: status: PENDING/NONE
2120

2221
note over A, B: 3. out-of-band invitation
2322
A ->> B: OOB: invitation to connect
2423

2524
note over BA, B: 4. accept connection
26-
B ->> BA: JOIN:<br>via invitation info
25+
B ->> BA: joinConnection:<br>via invitation info
2726
note over BA: status: NONE/NEW
2827

29-
note over BA, AA: 5. establish Alice's SMP queue
30-
BA ->> AS: SEND: Bob's info and sender server key (SMP confirmation)
31-
note over BA: status: NONE/CONFIRMED
32-
activate BA
28+
note over BA, BS: 5. create Bob's SMP queue
29+
BA ->> BS: NEW: create SMP queue
30+
BS ->> BA: IDS: SMP queue IDs
31+
note over BA: status: NEW/NEW
32+
33+
note over BA, AA: 6. confirm Alice's SMP queue
34+
BA ->> AS: SEND: Bob's info and sender server key (SMP confirmation with reply queues)
35+
note over BA: status: NEW/CONFIRMED
36+
3337
AS ->> AA: MSG: Bob's info and<br>sender server key
3438
note over AA: status: CONFIRMED/NONE
3539
AA ->> AS: ACK: confirm message
3640
AA ->> A: CONF: connection request ID<br>and Bob's info
37-
A ->> AA: LET: accept connection request,<br>send Alice's info
41+
A ->> AA: allowConnection: accept connection request,<br>send Alice's info
3842
AA ->> AS: KEY: secure queue
3943
note over AA: status: SECURED/NONE
4044

41-
BA ->> AS: SEND: HELLO: try sending until successful
42-
deactivate BA
43-
note over BA: status: NONE/ACTIVE
44-
AS ->> AA: MSG: HELLO: Alice's agent<br>knows Bob can send
45-
note over AA: status: ACTIVE/NONE
46-
AA ->> AS: ACK: confirm message
47-
48-
note over BA, BS: 6. create Bob's SMP queue
49-
BA ->> BS: NEW: create SMP queue
50-
BS ->> BA: IDS: SMP queue IDs
51-
note over BA: status: NEW/ACTIVE
45+
AA ->> BS: SEND: Alice's info and sender's server key (SMP confirmation without reply queues)
46+
note over AA: status: SECURED/CONFIRMED
5247

53-
note over AA, BA: 7. establish Bob's SMP queue
54-
BA ->> AS: SEND: REPLY: invitation to the connect
55-
note over BA: status: PENDING/ACTIVE
56-
AS ->> AA: MSG: REPLY: invitation<br>to connect
57-
note over AA: status: ACTIVE/NEW
58-
AA ->> AS: ACK: confirm message
59-
60-
AA ->> BS: SEND: Alice's info and sender's server key
61-
note over AA: status: ACTIVE/CONFIRMED
62-
activate AA
48+
note over BA, AA: 7. confirm Bob's SMP queue
6349
BS ->> BA: MSG: Alice's info and<br>sender's server key
64-
note over BA: status: CONFIRMED/ACTIVE
50+
note over BA: status: CONFIRMED/CONFIRMED
6551
BA ->> B: INFO: Alice's info
6652
BA ->> BS: ACK: confirm message
6753
BA ->> BS: KEY: secure queue
54+
note over BA: status: SECURED/CONFIRMED
55+
56+
BA ->> AS: SEND: HELLO message
57+
6858
note over BA: status: SECURED/ACTIVE
6959

70-
AA ->> BS: SEND: HELLO: try sending until successful
71-
deactivate AA
60+
AS ->> AA: MSG: HELLO: Alice's agent<br>knows Bob can send
61+
note over AA: status: SECURED/ACTIVE
62+
AA ->> AS: ACK: confirm message
63+
AA ->> BS: SEND: HELLO
64+
65+
note over A, AA: 8. notify Alice<br>about connection success
66+
AA ->> A: CON: connected
7267
note over AA: status: ACTIVE/ACTIVE
68+
7369
BS ->> BA: MSG: HELLO: Bob's agent<br>knows Alice can send
7470
note over BA: status: ACTIVE/ACTIVE
7571
BA ->> BS: ACK: confirm message
7672

77-
note over A, B: 8. notify users about connection success
78-
AA ->> A: CON: connected
73+
note over BA, B: 9. notify Bob<br>about connection success
7974
BA ->> B: CON: connected

0 commit comments

Comments
 (0)