Commit graph

5153 commits

Author SHA1 Message Date
Evgeny Poberezkin
cc9b351c65
SMP agent protocol - duplex messaging (#39)
* duplex messaging commands syntax

* update duplex messaging commands

* update duplex commands/responses

* SMP messages between agents

* error for multiple skipped messages

* more syntax

* more syntax

* add diagram: creating duplex connection

* fix diagram link

* update diagram

* update duplex diagram

* add queue statuses to the diagram

* add "try sending" periods to duplex diagram

* diagram: queue status (receive/send)

* update queue status

* simplify duplex connection to only have two queues

* remove error notification sent to another agent, only notify user

* remove unused commands, add "unsubscribed" notification

* simplified commands and added connection invitation syntax

* update SMP agent protocol

* duplex protocol correction

* corrections (#40)

* SMP agent protocol

* rename duplex-messaging to agent-protocol

* minor fixes

* SMP agent protocol corrections

Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
2021-04-16 19:56:53 +01:00
Evgeny Poberezkin
4a5b5da3e2 Merge branch 'master' into v2 2021-04-14 21:30:30 +01:00
Efim Poberezkin
7503ee9a3a tests: block on tcp server creation (#99)
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-04-14 02:25:57 +04:00
Evgeny Poberezkin
d6cd828257 remove /reset command (#96) 2021-04-12 23:56:17 +01:00
Evgeny Poberezkin
3778c308f7 new chat UX: removed /name, add /delete and /reset, change /accept to /connect, allow command abbreviations (#95)
* remove current user name

* rename /accept to /connect, remove /chat, add /reset, allow 1-letter abbreviations

* update help

* /delete contact, separate response for confirmation

* update invatation instruction

* unset active contact only if it is the same as current
2021-04-11 18:03:55 +01:00
Evgeny Poberezkin
6caab6f539 fix: initially blocked keys (#94) 2021-04-11 11:22:56 +01:00
Evgeny Poberezkin
7c6d67634c markdown help (#93)
* markdown help
2021-04-11 10:17:17 +01:00
Evgeny Poberezkin
bad7e7f20b fix left arrow key (#92)
* fix left arrow key

* remove LambdaCase
2021-04-11 09:55:57 +01:00
Evgeny Poberezkin
8fad84d3ec Secret markdown (#91)
* secret text markdown

* refactor
2021-04-11 09:54:14 +01:00
Evgeny Poberezkin
62281a62d7 fix multiline output (messages and help) (#90) 2021-04-11 09:51:57 +01:00
Evgeny Poberezkin
6f137d25bf refactor key handling (#88)
* refactor key handling

* remove constant change

* simplify

* refactor Downwards
2021-04-10 13:30:58 +01:00
Evgeny Poberezkin
e49bda7957 markdown tests (#86) 2021-04-10 13:12:28 +01:00
Evgeny Poberezkin
a819fcb86b support Home, End and Del keys (#87)
* add Home and End keys

* support Delete key

* simplify updateTermState
2021-04-10 12:53:22 +01:00
Evgeny Poberezkin
ee8814dd25 Windows support in editor mode (#85)
* use System.Terminal for "editor" mode (WIP, does not work in POSIX)

* fix getKey - only return one event on control keys

* fix printing with System.Terminal

* different markdown escape for color, added black color

* fix color escapes

* make black invisible

* markdown fixes

* remove Key type, fix editor bug, refactor

* refactor: use getKey in getTermLine

* default mode is "editor", remove windows warning

* markdown: code snippet

* use ! for color markdown

* edit previous input

* clean up

* use getWindowSize from System.Terminal
2021-04-10 11:57:28 +01:00
Efim Poberezkin
ef944226b2 automate changelogs (#84) 2021-04-09 18:20:09 +04:00
Evgeny Poberezkin
d0163ccd56 refactor chat terminal (#83) 2021-04-08 20:20:06 +01:00
Evgeny Poberezkin
bac96b4433 Markdown (#81)
* Markdown type

* Markdown parser (WIP)

* fix markdown parser

* style markdown in messages

* one-letter color abbreviations in markdown
2021-04-08 19:32:38 +01:00
Evgeny Poberezkin
b61b1e8384 Support windows terminal in basic mode (#80)
* add terminal package

* basic terminal mode with utf8 support in windows

* fix terminal input in basic mode on mac

* test code

* send StyledString to ChatTerminal

* clean up

* support StyledString with System.Terminal

* minor style change

* clean up

* minor style change
2021-04-07 20:20:32 +01:00
Evgeny Poberezkin
0ccde5871c transport encryption (#65)
* transport encryption (WIP - using fixed key, parsing/serialization works, SMP tests fail)

* transport encryption

* transport encryption: separate keys to receive and to send, counter-based IVs

* docs: update transport encryption and handshake

* transport encryption handshake (TODO: validate key hash, welcome block, move keys to system environment)

* change KeyHash type to newtype of Digest SHA256

* transport encryption: validate public key hash

* send and receive welcome block with SMP version

* refactor: parsing SMPServer

* remove unused function

* verify that client version is compatible with server version (major version is not smaller)

* update (fix) SMP server tests
2021-04-05 13:10:16 +01:00
Evgeny Poberezkin
578e06cd75 remove terminal mode "simple" (#78) 2021-04-03 21:53:16 +01:00
Evgeny Poberezkin
c1fdcfb906 enforce windows terminal mode to basic, warning message (#77) 2021-04-03 20:39:37 +01:00
Efim Poberezkin
4f20c23201 automate releases (#76) 2021-04-03 23:17:51 +04:00
Efim Poberezkin
31b0cf8a8e agent sqlite: initialize database in home directory by default (#74) 2021-03-29 19:18:54 +04:00
Efim Poberezkin
94c756adb5 agent sqlite: initialize database in home directory by default (#74) 2021-03-29 19:18:54 +04:00
Evgeny Poberezkin
251f453c91 readme: note on docker (#73) 2021-03-09 07:17:11 +00:00
Evgeny Poberezkin
a602587046 simplify installation instruction (#72) 2021-03-09 07:08:36 +00:00
Evgeny Poberezkin
a3e987b78a Windows terminal editing (#71)
* windows-compatible getChar without buffering, option to use terminal without editing

* option to choose terminal mode, conditional compilation for Windows

* conditional extension

* add basic terminal mode (no contact insertion)

* option help
2021-03-09 07:05:08 +00:00
Efim Poberezkin
97e80cfb07 chat: subscribe to all connections on startup (#70) 2021-03-06 15:39:00 +04:00
Efim Poberezkin
0bce6e8173 check that sqlite library is compiled with threadsafe code (#63) 2021-03-02 22:30:59 +04:00
Efim Poberezkin
fe8b28a655 add chat history instructions to README (#56) 2021-02-26 18:53:50 +04:00
Efim Poberezkin
4da27e0dfa chat: fix welcome line (#51) 2021-02-26 18:17:29 +04:00
Efim Poberezkin
b5bfa3ac8c add Dockerfile for building chat executable and instructions on running it (#48)
* [WIP] add instructions how to build project inside docker container

* docker run -> docker create

* add Dockerfile for building chat executable and instructions
2021-02-26 18:17:29 +04:00
Evgeny Poberezkin
d5ea9793dc add mutex to prevent ansi codes appearing in the output (#50) 2021-02-26 18:17:29 +04:00
Efim Poberezkin
2ad54cf1d3 add instructions on how to run chat client to README (#43)
* add instructions on how to run chat client to README

* wording

* wording

* corrections to the manual

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-02-26 18:17:29 +04:00
Evgeny Poberezkin
c379c16569 terminal UI (#44)
* separate terminal IO to separate thread via queues

* terminal input arithmetics (WIP)

* editable multiline terminal input

* print messages above input area

* support Up/Down arrows

* terminal chat: move by word, move to the beginning/end of input

* insert active contact when typing starts

* refactor inserting active contact

* highlight "to contact"

* add username to prompt

* change beginning/end of line keys to shoft-arrow

* remove unused code

* add ctrl arrow key bindings

* add comment for debugging keys in terminal

Co-authored-by: Efim Poberezkin <efim.poberezkin@gmail.com>
2021-02-26 18:17:29 +04:00
Efim Poberezkin
0ef6e4e26a add instructions on how to run chat client to README (#43)
* add instructions on how to run chat client to README

* wording

* wording

* corrections to the manual

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-02-26 18:17:29 +04:00
Efim Poberezkin
be17af4321 dog-food: distinguish self from contacts (#42)
* dog-food: distinguish self from contacts

* add missing space

* rename tty functions

* return indents

* remove indentation in sent messages

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-02-26 18:17:29 +04:00
Efim Poberezkin
aedba41e16 fix ghc version in build (#36) 2021-02-26 18:14:22 +04:00
Evgeny Poberezkin
3de4fa7518 Sign / verify SMP commands (#37)
* generate key pair

* crypto: sign/verify functions

* remove extension

* parse/serialize keys

* use RSA recipient/sender keys (TODO sign/verify)

* make PublicKey newtype, assign 0s to private_p & private_q

* replace SMP command parsing with Attoparsec

* rename types: Signed->Transmission, Transmission->SignedTransmission

* sign and verify commands (server tests skipped, agent tests pass)

* SMP client: avoid seralizing transmission twice when sending commands

* update SMP server tests to use command signatures

* remove support for "SEND :msg" syntax from SMP server protocol

* rename RSA module name to R to avoid confusion with C used for S.M.Crypto

* update key sizes to use bits `div` 8

* tidy up
2021-02-26 18:14:22 +04:00
Evgeny Poberezkin
5489e92e31 message management (#32)
* message management rfc

* update message management rfc

* message management ideas (WIP)

* message management updated

* messages RFC

* update agent MSG constructor to include recipient/broker/sender message IDs and timestamps

* remove agent command ACK - agent automatically acknowledges server messages

* correct messages doc
2021-02-26 18:13:04 +04:00
Evgeny Poberezkin
88e799797c chat prototype (#35)
* chat prototype

* chat prototype now compiles

* chat prototype works

* agent: respond SENT mId to SEND (instead of OK), ne repsonse to chat message in terminal

* chat prototype help, update commands

* chat CLI options

* add active contact to ChatClient (not used yet)

* refactor agentTransmission

* InviteContact -> AddContact

* automatically insert active contact

* highlight contact in chat

* name for invitations

* do not ask name on start

* change default server to smp.simplex.im
2021-02-26 18:13:04 +04:00
Evgeny Poberezkin
54e818bd39 Sending messages end to end (#21)
* duplex connection end-to-end (working, debug logs)

* agent: send, receive, acknowledge messages

* logging proposal

* logging: client/server (dis)connections

* agent scenario testing framework

* add tests, remove logs

* clean up
2021-02-26 18:11:22 +04:00
Efim Poberezkin
8e52d78cf2 ci: cache dependencies (#11) 2021-02-26 18:09:26 +04:00
Evgeny Poberezkin
0720d20218 Merge pull request #1 from simplex-chat/client
SMP agent implementation
2021-01-12 08:45:38 +00:00
Evgeny Poberezkin
062934ec1e readme: link to releases 2021-01-11 19:25:37 +00:00
Evgeny Poberezkin
8be832689a rename workflow, build/version badges 2021-01-11 19:23:36 +00:00
Evgeny Poberezkin
1c2ac43a13 rename workflow, build/version badges 2021-01-11 19:23:36 +00:00
Evgeny Poberezkin
eede6c5da9 readme: released version link 2021-01-11 19:14:54 +00:00
Efim Poberezkin
986e44abbe GitHub workflow for tests (#7)
* ci: add github workflow for tests

* ci: break test

* ci: fix folder name

* ci: fix test

* ci: break test

* fix test

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
2021-01-11 22:21:35 +04:00
Evgeny Poberezkin
162af5c60c Merge pull request #2 from simplex-chat/correlation-id
add corellationId to SMP protocol server (WIP)
2020-12-28 16:56:03 +00:00