Commit Graph

1364 Commits

Author SHA1 Message Date
Evgeny Poberezkin 5c1e9682c8 streams rfc draft (#64)
* streams rfc draft

* typos

* update streams RFC

Co-authored-by: Efim Poberezkin <efim.poberezkin@gmail.com>
2021-04-17 08:10:23 +01:00
Evgeny Poberezkin 36dad0ba86 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 417066c462 change missing IDs message status syntax (#100) 2021-04-16 18:48:13 +01:00
Evgeny Poberezkin 326050651a Merge branch 'master' into v2 2021-04-14 21:30:30 +01:00
Evgeny Poberezkin 0028939155 standard X509/PKCS8 encoding for RSA keys (#98)
* key encoding primitives (WIP)

* use X509/PKCS8 to read/write server key files

* make PrivateKey type class

* clean up

* remove separate public key file

* specific import
2021-04-14 21:20:08 +01:00
Efim Poberezkin 2eb5ce24ec 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 c4475499ba remove /reset command (#96) 2021-04-12 23:56:17 +01:00
Evgeny Poberezkin 19520787a6 0.2.2 2021-04-11 18:10:31 +01:00
Evgeny Poberezkin b364f168c8 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 a113067647 fix: initially blocked keys (#94) 2021-04-11 11:22:56 +01:00
Evgeny Poberezkin f6888cc9a2 markdown help (#93)
* markdown help
2021-04-11 10:17:17 +01:00
Evgeny Poberezkin 07410990a0 fix left arrow key (#92)
* fix left arrow key

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

* refactor
2021-04-11 09:54:14 +01:00
Evgeny Poberezkin 45514c0a65 fix multiline output (messages and help) (#90) 2021-04-11 09:51:57 +01:00
Efim Poberezkin 6c7e013007 0.2.1 2021-04-10 16:49:40 +04:00
Evgeny Poberezkin a594972df0 refactor key handling (#88)
* refactor key handling

* remove constant change

* simplify

* refactor Downwards
2021-04-10 13:30:58 +01:00
Evgeny Poberezkin e78b7a66d7 markdown tests (#86) 2021-04-10 13:12:28 +01:00
Evgeny Poberezkin a2016241df 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 5c44ad0a62 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 d0b047d197 automate changelogs (#84) v0.2.0 2021-04-09 18:20:09 +04:00
Evgeny Poberezkin b8241af7e9 refactor chat terminal (#83) 2021-04-08 20:20:06 +01:00
Evgeny Poberezkin 44c5a3142e 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 ad73298936 Read server keys from files or create if absent (#79)
* move server keys to config

* add server keys from files

* create server keys if key files do not exist

* validate loaded server key pair

* refactor fromString functions

* key files in /etc/opt/simplex
2021-04-07 22:59:57 +01:00
Evgeny Poberezkin 59ef46314d 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 0fbf406800 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 d8965d4a23 remove terminal mode "simple" (#78) 2021-04-03 21:53:16 +01:00
Evgeny Poberezkin 4353dcb3a7 enforce windows terminal mode to basic, warning message (#77) 2021-04-03 20:39:37 +01:00
Efim Poberezkin 16eb560dbc automate releases (#76) 2021-04-03 23:17:51 +04:00
Efim Poberezkin bd753dbe47 agent sqlite: enable FKs in *all* db connections (#75) 2021-03-29 19:27:05 +04:00
Efim Poberezkin 08171e987d agent sqlite: initialize database in home directory by default (#74) 2021-03-29 19:18:54 +04:00
Evgeny Poberezkin da72efc20a readme: note on docker (#73) 2021-03-09 07:17:11 +00:00
Evgeny Poberezkin 7cad237092 simplify installation instruction (#72) 2021-03-09 07:08:36 +00:00
Evgeny Poberezkin 9b0ed1d62d 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 b9943c359d chat: subscribe to all connections on startup (#70) 2021-03-06 15:39:00 +04:00
Efim Poberezkin 11c8bee836 agent store: make newtypes for msg internal Ids (#68) 2021-03-04 23:19:12 +04:00
Efim Poberezkin 93e782b874 agent store: organize sender and broker fields into tuples (#67) 2021-03-04 23:00:00 +04:00
Efim Poberezkin cc9a67f38a agent store: explain use for various message Ids (#66) 2021-03-04 22:30:15 +04:00
Efim Poberezkin 660e35d1d1 check that sqlite library is compiled with threadsafe code (#63) 2021-03-02 22:30:59 +04:00
Evgeny Poberezkin a3990ea170 Types.hs -> Protocol.hs (#62) 2021-02-28 17:00:14 +00:00
Evgeny Poberezkin d96aeb727f improve rsa encryption (#61)
* clrify encryption schemes

* increase SMP ping delay

* include authTag and msg size in encrypted message header, pad messages to fixed size

* use newtype for Key and IV bytestrings

* rename CryptoError constructors

* refactor Word to Int conversion

* refactor padding, replace padding character

* rfc corrections, comment

* rename aesTagSize -> authTagSize

* failing test
2021-02-28 16:17:28 +00:00
Evgeny Poberezkin 927ff230da Separate db connection for each TCP client connection (#60)
* use separate db connections for each TCP client connection

* refactor atomically, increast delay in tests

* increase test delay for SMP server to start

* increase SMP ping frequency

* remove comment

* separate SQLite connection per thread, to support multi-threaded mode

* remove redundant import
2021-02-28 14:59:29 +00:00
Evgeny Poberezkin 7570ef9e22 SMP heartbeat to maintain the connection (#59)
* SMP heartbeat to maintain the connection

* separate SMP commands into sections

* update SMP command sections

* update SMP commands comment

Co-authored-by: Efim Poberezkin <efim.poberezkin@gmail.com>
2021-02-27 15:24:05 +00:00
Efim Poberezkin 3af34dea8b agent store: accept internal ts and return internal id (#58) 2021-02-27 15:06:51 +04:00
Efim Poberezkin 135aac77ab add chat history instructions to README (#56) 2021-02-26 18:53:50 +04:00
Efim Poberezkin 8134bb0eb9 agent store: settle naming of Rcv and Snd entities (#55) 2021-02-26 18:17:56 +04:00
Efim Poberezkin a0c52033f7 add *.session.sql to .gitignore - for saving db queries (#52) 2021-02-26 18:17:56 +04:00
Efim Poberezkin dac35d8ea8 agent sqlite: merge SQLite and SQLite.Util (#54) 2021-02-26 18:17:56 +04:00
Efim Poberezkin b4ebe85ce3 agent sqlite: move sql queries closer to parameters (#53) 2021-02-26 18:17:56 +04:00
Efim Poberezkin 0f60c53a66 agent: save messages (#45) 2021-02-25 19:02:27 +04:00
Efim Poberezkin dca1bee926 chat: fix welcome line (#51) 2021-02-26 18:17:29 +04:00