From 67fbe62ae19281ba3a32b7ba0f5ff22db1ea8c55 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 23 Dec 2025 14:16:05 +0000 Subject: [PATCH] core: update simplexmq (support any 127.x.x.x address as loopback), show other addresses in CLI during remote connection, update tests (#6526) --- cabal.project | 2 +- scripts/nix/sha256map.nix | 2 +- src/Simplex/Chat/View.hs | 9 ++++----- tests/RemoteTests.hs | 20 ++++++++++++++++++-- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/cabal.project b/cabal.project index 642b252b44..aee9490aef 100644 --- a/cabal.project +++ b/cabal.project @@ -12,7 +12,7 @@ constraints: zip +disable-bzip2 +disable-zstd source-repository-package type: git location: https://github.com/simplex-chat/simplexmq.git - tag: 538dcb6a4c53e115655dc07266c4ff386d45511d + tag: 2ea98db9d8ad0dc43820227a89c744822dfadb5d source-repository-package type: git diff --git a/scripts/nix/sha256map.nix b/scripts/nix/sha256map.nix index 9bbc469869..9eed446658 100644 --- a/scripts/nix/sha256map.nix +++ b/scripts/nix/sha256map.nix @@ -1,5 +1,5 @@ { - "https://github.com/simplex-chat/simplexmq.git"."538dcb6a4c53e115655dc07266c4ff386d45511d" = "01g6dicws9cdgk4slmlqyvl3i84nw3gyqwmqwr2rwbq0yx7fcmmq"; + "https://github.com/simplex-chat/simplexmq.git"."2ea98db9d8ad0dc43820227a89c744822dfadb5d" = "1vh9s66yywqi33df0la340jws9z3hag7ym7q03rc9x8cjcg6s8sw"; "https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38"; "https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d"; "https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl"; diff --git a/src/Simplex/Chat/View.hs b/src/Simplex/Chat/View.hs index 89bc58171c..1b022f2a1f 100644 --- a/src/Simplex/Chat/View.hs +++ b/src/Simplex/Chat/View.hs @@ -257,11 +257,10 @@ chatResponseToView hu cfg@ChatConfig {logLevel, showReactions, testView} liveIte rhi_ ] CRRemoteHostList hs -> viewRemoteHosts hs - CRRemoteHostStarted {remoteHost_, invitation, localAddrs = RCCtrlAddress {address} :| _, ctrlPort} -> - [ plain $ maybe ("new remote host" <> started) (\RemoteHostInfo {remoteHostId = rhId} -> "remote host " <> show rhId <> started) remoteHost_, - "Remote session invitation:", - plain invitation - ] + CRRemoteHostStarted {remoteHost_, invitation, localAddrs = RCCtrlAddress {address} :| addrs, ctrlPort} -> + [plain $ maybe ("new remote host" <> started) (\RemoteHostInfo {remoteHostId = rhId} -> "remote host " <> show rhId <> started) remoteHost_] + <> [plain $ "other addresses: " <> intercalate " " (map (\RCCtrlAddress {address = a} -> B.unpack (strEncode a)) addrs) | not (null addrs)] + <> ["Remote session invitation:", plain invitation] where started = " started on " <> B.unpack (strEncode address) <> ":" <> ctrlPort CRRemoteFileStored rhId (CryptoFile filePath cfArgs_) -> diff --git a/tests/RemoteTests.hs b/tests/RemoteTests.hs index 9790681f3b..6f215a5dc8 100644 --- a/tests/RemoteTests.hs +++ b/tests/RemoteTests.hs @@ -9,9 +9,11 @@ import ChatClient import ChatTests.DBUtils import ChatTests.Utils import Control.Logger.Simple +import Control.Monad import qualified Data.Aeson as J import qualified Data.ByteString as B import qualified Data.ByteString.Lazy.Char8 as LB +import Data.List (find, isPrefixOf) import qualified Data.Map.Strict as M import Simplex.Chat.Controller (versionNumber) import qualified Simplex.Chat.Controller as Controller @@ -116,6 +118,7 @@ remoteHandshakeRejectTest = testChat3 aliceProfile aliceDesktopProfile bobProfil mobileBob <## "ok" desktop ##> "/start remote host 1" desktop <##. "remote host 1 started on " + desktop <##. "other addresses: " desktop <## "Remote session invitation:" inv <- getTermLine desktop mobileBob ##> ("/connect remote ctrl " <> inv) @@ -143,8 +146,18 @@ storedBindingsTest = testChat2 aliceProfile aliceDesktopProfile $ \mobile deskto mobile ##> "/set device name Mobile" mobile <## "ok" - desktop ##> "/start remote host new addr=127.0.0.1 iface=\"lo\" port=52230" - desktop <##. "new remote host started on 127.0.0.1:52230" -- TODO: show ip? + desktop ##> "/start remote host new" + desktop <##. "new remote host started on " + addrs <- words . dropStrPrefix "other addresses: " <$> getTermLine desktop + Just localAddress <- pure $ find ("127." `isPrefixOf`) addrs + desktop <## "Remote session invitation:" + void $ getTermLine desktop + desktop ##> "/stop remote host new" + desktop <## "ok" + + desktop ##> ("/start remote host new addr=" <> localAddress <> " iface=\"lo\" port=52230") + desktop <## ("new remote host started on " <> localAddress <> ":52230") + desktop <##. "other addresses: " desktop <## "Remote session invitation:" inv <- getTermLine desktop @@ -497,6 +510,7 @@ startRemote mobile desktop = do mobile <## "ok" desktop ##> "/start remote host new" desktop <##. "new remote host started on " + desktop <##. "other addresses: " desktop <## "Remote session invitation:" inv <- getTermLine desktop mobile ##> ("/connect remote ctrl " <> inv) @@ -512,6 +526,7 @@ startRemoteStored :: TestCC -> TestCC -> IO () startRemoteStored mobile desktop = do desktop ##> "/start remote host 1" desktop <##. "remote host 1 started on " + desktop <##. "other addresses: " desktop <## "Remote session invitation:" inv <- getTermLine desktop mobile ##> ("/connect remote ctrl " <> inv) @@ -526,6 +541,7 @@ startRemoteDiscover :: TestCC -> TestCC -> IO () startRemoteDiscover mobile desktop = do desktop ##> "/start remote host 1 multicast=on" desktop <##. "remote host 1 started on " + desktop <##. "other addresses: " desktop <## "Remote session invitation:" _inv <- getTermLine desktop -- will use multicast instead mobile ##> "/find remote ctrl"