Evgeny Poberezkin
d7394aa762
fix ntf server version range in the client
2024-02-22 19:33:14 +00:00
Evgeny Poberezkin
baf2c47065
agent: expire messages failed after quota exceeded after 7 days, and expire multiple messages at once ( #973 )
...
* agent: expire messages failed after quota exceeded after 7 days, and expire multiple messages at once
* fix, test
* refactor
* catch in loop
2024-01-19 17:21:25 +00:00
Evgeny Poberezkin
00c4ff4a21
agent: fix race condition in subscription worker (results in stuck delivery), better error handling in batch operations ( #962 )
...
* debugging test: join connection when reply queue creation fails
* more logs
* more logs
* more logs, fixed bug
* cleanup
* catch all errors
* simplify
* comment
* remove client ID counter
2024-01-16 10:29:35 +00:00
Evgeny Poberezkin
fa794d7878
agent: send errors on subscription timeouts ( #937 )
...
* agent: debug server reconnections
* update lock only if it has the same name already
* report subscription timeouts
* clean up
2024-01-05 17:36:57 +00:00
Evgeny Poberezkin
2488cf1e3a
agent: restart worker when it terminated ( #948 )
...
* agent: restart worker when it terminated
* comment
* remove writeTMVar
* remove writeTMVar 2
* remove writeTMVar 3
2024-01-05 14:22:26 +00:00
spaced4ndy
22e1932372
xftp, ntf: refactor, reuse workers abstractions ( #935 )
...
* xftp: refactor, reuse workers abstractions (wip, test fails)
* rename
* refactor (tests pass)
* refactor2
* linebreaks
* do
* reuse worker abstractions for notifications
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-12-27 13:02:08 +04:00
spaced4ndy
e43e4860b9
xftp: file workers cycle through pending files based on retries count (limit number of iterations per work item to prevent stuck delivery) ( #930 )
...
* xftp: test file reception - shouldn't get stuck if file is deleted on server
* comment
* expiration test
* approach
* wip
* sort by retries in other works, revert some diff
* revert diff
* modify tests
* refactor
* refactor
* remove prints
* apply to other workers
* remove import
* comment
* refactor
* revert queue size
* fix test
* rename
* comment, correct number of retries
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-12-26 22:20:25 +00:00
Evgeny Poberezkin
13a60d1d39
use ChaChaDRG as the source of randomness ( #920 )
...
* use ChaChaDRG as the source of randomness
* remove functions using entropy directly
* comment
2023-12-21 00:12:08 +00:00
Evgeny Poberezkin
560dc55312
agent: notify about polled message processing (for iOS notifications) ( #908 )
...
* agent: notify about polled message processing (for iOS notifications)
* optionally keep key and support re-opening database
* exports
* test that cannot reopen when created with keepKey: false
* set max number of messages to receive for a notification to 3
2023-12-11 13:03:53 +00:00
Alexander Bondarenko
40ba94ce72
remote: add multicast discovery w/ encrypted announce ( #895 )
...
* Implement multicast discovery
* replace rcConnectMulticast with explicit discoverRCCtrl
* add multicast source/invitation host check
* remove JSON encoding for multicast invitations
* add specific error for announcing "new" controllers
* rename
* set size, rename
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-11-17 17:56:14 +00:00
Evgeny Poberezkin
4660ee9cff
agent: revert to TVar ( #883 )
2023-11-01 09:15:51 +00:00
Evgeny Poberezkin
b5f733d2db
agent: use IORef for DRG ( #882 )
2023-10-31 23:52:13 +00:00
Evgeny Poberezkin
58cb2855d2
agent: delivery receipts ( #752 )
...
* rfc: delivery receipts
* update doc
* update rfc
* implementation plan, types, schema
* migration, update types
* update types
* rename migration
* export MsgReceiptStatus, JSON encoding
* update rfc, schema
* correction
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* skeleton of the implementation
* more implementation (some tests fail)
* more code, 1 test fails
* fix encoding
* refactor
* refactor
* test, fix
* only send receipts in v3+, test
* flip condition
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* flip condition
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* agent version 4 required to send receipts
* fix test
---------
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
2023-07-13 22:33:48 +01:00
Evgeny Poberezkin
532cd2f39c
fix allFinally
2023-07-09 21:36:23 +01:00
Evgeny Poberezkin
f76a5ca5b6
agent: catch IO errors correctly in MonadError ( #795 )
...
* agent: catch IO errors correctly in MonadError
* correction
* correction
* utils
* agentFinally to catch IO exceptions in ExceptT
* rename
* remove, inline
* rename utils
* utils unit test
* test to show catch and finally problems
* tryAllErrors
* enable all tests
2023-07-09 18:04:45 +01:00
spaced4ndy
8be2505fa0
ratchet re-synchronization ( #774 )
...
* ratchet re-synchronization rfc wip
* additions
* additions, types
* fix tests
* re-sync implementation wip
* re-sync implementation 1st rev.
* test wip
* test passes
* doc
* wording
* improve doc schema
* single agreed state
* refactor (1 state variable)
* allowed -> required
* prohibit enqueue
* enqueue
* send via multiple queues
* test with server offline
* clarify errors
* rename
* more tests
* refactor
* rename AgentRKey
* rename AM_CONN_RATCHET_KEY
* more tests
* rename
* write encoded AgentRatchetInfo to AgentRatchetKey info
* move withConnLock
* refactor qDuplex
* re-create ratchet on receiving second key
* invert condition
* refactor
* simplify
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-06-30 14:17:08 +04:00
spaced4ndy
6c6f22051d
check previous encrypted message hashes for duplicates on decryption errors ( #756 )
2023-05-17 15:42:57 +04:00
spaced4ndy
e346a81e46
xftp: delete snd files on servers ( #722 )
2023-04-13 17:46:43 +04:00
spaced4ndy
d35bd8a954
xftp: restore snd files, expire snd files in agent ( #718 )
2023-04-11 22:00:09 +04:00
spaced4ndy
d8e60ecfdb
xftp: recoverable send - spike ( #707 )
2023-04-07 11:19:50 +04:00
spaced4ndy
bdff274f56
use Int64 for time calculations ( #706 )
2023-04-04 14:51:13 +04:00
spaced4ndy
e27c4f7b81
xftp: notify about errors on rcv files retry; process snd files errors ( #700 )
2023-03-30 16:26:33 +04:00
spaced4ndy
b5869cf169
xftp: agent to expire rcv files older than 2 days ( #699 )
2023-03-28 15:23:08 +04:00
Evgeny Poberezkin
6a665a0833
support down migrations ( #696 )
...
* support down migrations
* test
* update
* add down migrations and tests
* get current migrations
* corrections
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
* update tests
---------
Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com >
2023-03-27 12:44:53 +01:00
spaced4ndy
0df7733125
xftp: relative file paths, worker management ( #694 )
2023-03-22 15:34:25 +04:00
Evgeny Poberezkin
d41c2bec2a
store retry intervals to resume from the same interval on restart ( #693 )
...
* store retry intervals to resume from the same interval on restart
* add migration
* updates
2023-03-22 08:42:56 +00:00
Evgeny Poberezkin
e33d5b5184
use different constraint for non-error functions ( #690 )
2023-03-17 16:01:24 +04:00
spaced4ndy
2b1a02d7d4
xftp: reconnect XFTP client on replica retry ( #689 )
...
* xftp: re-create XFTP client on replica retry
* closeXFTPSessionClient
* refactor
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-03-17 09:50:49 +00:00
Evgeny Poberezkin
ddc2da8fe4
xftp: agent API for xftp commands and events ( #684 )
...
* xftp: agent API for xftp commands and events
* fix tests
* fix tests 2
* xftp: update agent send api
* update API to make temp path optional
* revert tmp path changes (fixes send)
---------
Co-authored-by: spacedandy <8711996+spaced4ndy@users.noreply.github.com >
2023-03-13 09:04:23 +00:00
spaced4ndy
cf8f78f518
xftp: add random bytestring entity id for rcv files ( #681 )
2023-03-10 20:32:37 +04:00
spaced4ndy
6d52150672
xftp: agent send file design wip ( #674 )
2023-03-08 14:30:37 +04:00
spaced4ndy
cf147397a4
xftp: agent receive file ( #637 )
...
* xftp: agent receive file draft
* receiveFile more stubs, changes to types, schema
* cabal file
* comments
* xftp_server_id
* schema changes, get client, local worker/action
* agent env, save file description, adjust schema
* client stubs
* download chunk wip, store, schema, types
* remove commented code
* read file description, schema, types
* check received, decrypt
* remove pure
* todo
* add XFTP to agent client
* add user id
* agent test
* tests
* rename supervisor into agent
---------
Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com >
2023-03-03 18:50:16 +04:00
Evgeny Poberezkin
6a48b735d1
increase timeout for QUOTA errors
2023-02-18 18:09:58 +00:00
Evgeny Poberezkin
d4fc638478
async batch connection deletion ( #617 )
...
* async batch connection deletion
* delete user record with connections, async connection deletion
* updates
* update query
2023-01-21 13:41:16 +00:00
Evgeny Poberezkin
ca5c4b75eb
Merge branch 'master' into users
2023-01-17 20:32:23 +00:00
Evgeny Poberezkin
a1eda12475
increase sending retries on ERR QUOTA
2023-01-15 18:14:20 +00:00
Evgeny Poberezkin
f4ad3a983e
support users in agent to isolate traffic of different users ( #598 )
...
* users table, isolate traffic sessions by users or by queues
* remove extra indices
* corrections
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
2023-01-11 17:47:20 +04:00
Evgeny Poberezkin
61e0c346df
simplify C.sign, Crypto tests, triage TODOs ( #592 )
...
* simplify C.sign, Crypto tests, triage TODOs
* update condition
* remove todos
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
2023-01-06 15:34:05 +00:00
Evgeny Poberezkin
058e3ac55e
send/process "quota exceeded" message from SMP server when sender gets ERR QUOTA ( #585 )
...
* send "quota exceeded" message from SMP server when sender gets ERR QUOTA (ignored in the agent for now)
* send msg quota to the recipient to indicate that sender got ERR QUOTA, test
* switch between slow/fast retry intervals (tests do not pass yet)
* send QCONT message, refactor RetryInterval, test
* refactor
* remove comment
* remove space
* unit test for withRetryLock2
* refactor
2023-01-04 14:10:13 +00:00
Evgeny Poberezkin
e281efdcb8
server: SMP basic auth ( #561 )
...
* server: SMP basic auth
* update ini default
* rfc, types
* tests
* update INI file
* typo
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
* refactor
* update INI options, log new queue creation mode on start (on/off/requires auth)
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
2022-11-12 22:29:36 +00:00
Evgeny Poberezkin
eb5c1c78cb
connection queue redundancy and rotation ( #521 )
...
* rfc: queue rotation
* update rfc
* messages for queue rotation
* allow multiple subscribed queues per connection in Agent/Client.hs
* refactor
* fix module name
* allow multiple queues in duplex connection type
* update commands
* add indices
* addConnectionRcvQueue
* switch connection to another queue (WIP)
* update schema/protocol
* switching queue works, but sending messages after the switch fails
* messages are delivered after rotation
* use connection-scoped queue ID
* rename queue records fields
* refactor using SMPQueue class/instances
* simplify queries
* QKEY: check queue is not secured, refactor
* update rfc
* mark queue as primary in QUSE
* queue rotation errors
* fix async ack
* fix async ACK to send OK
* correction
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
* use SWCH command
* rename
* take into account only active queue subscription when determining connection result if at least one queue is active
* remove comment
* only enable notifications for connections with enableNtfs = True
* async test (WIP)
* async queue rotation test
* simplify combining results
* test with 2 servers
* fix unused subscribeConnection
* switch to cabal build
* increase build timeout
* increase delay in async test
* skip queue rotation tests
* build matrix
* step name
* use ubuntu-18.04 in build matrix
* enable rotation tests
Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com >
2022-10-29 18:57:01 +01:00
Evgeny Poberezkin
d06bb2b9c5
use KDF in X3DH ( #548 )
...
* use KDF in X3DH
* configure ratchet version via agent config, test matrix
* add comment
2022-10-20 11:03:19 +01:00
Evgeny Poberezkin
29332a5e9f
lints ( #539 )
...
* lints
* revert
* add import
* remove StrictData
2022-10-01 11:51:52 +01:00
Evgeny Poberezkin
413aad5139
allow passing agent store instead of path and key ( #535 )
2022-09-23 18:45:00 +01:00
Evgeny Poberezkin
e4b47825b5
functions to create and close store ( #512 )
2022-09-02 15:42:37 +01:00
Evgeny Poberezkin
e4b77ed9e6
use SQLCipher ( #507 )
...
* use SQLCipher
* pass database key via options, use local direct-sqlcipher and sqlcipher-simple
* update stack.yaml
* use dependencies in git
* update sqlcipher dependencies
2022-08-30 12:31:41 +01:00
Evgeny Poberezkin
68138c08d2
support multiple server hostnames per queue ( #494 )
...
* store SMP client version per queue
* use versioned format for queue addresses (not compatible with v1)
* multiple server hosts in queue URI/data, versioned encoding (cross-version tests fail)
* choose server host based on socksProxy setting
* test works
* multiple server addresses mostly work
* add onion hosts for provided servers
* update SMP hosts
2022-08-12 11:32:04 +01:00
Evgeny Poberezkin
6bfaa4985e
expire messages after 2 days, increase max message sending interval ( #490 )
...
* expire messages after 2 days, increase max message sending interval
* rename
2022-08-11 10:15:08 +01:00
Evgeny Poberezkin
e9db0a1162
allow passing all network configuration to the agent ( #488 )
2022-08-02 13:30:00 +01:00
Evgeny Poberezkin
fcaddb7848
agent functions to get/set network configuration ( #484 )
...
* agent functions to get/set network configuration
* fix condition
2022-07-25 13:50:46 +01:00