mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
prepare v1 release (#189)
* update servers * update version * update simplexmq version * update database file names * update server fingerprints and simlexmq * update simplexmq commit * fix port in tests * update tls fixtures (#193) * add -v cli option; print update instructions on -v and /v (#194) Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
This commit is contained in:
parent
809a87ce61
commit
5a74b8066f
19 changed files with 59 additions and 98 deletions
|
@ -208,7 +208,7 @@ To specify a different file path prefix for the database files use `-d` command
|
|||
$ simplex-chat -d alice
|
||||
```
|
||||
|
||||
Running above, for example, would create `alice_chat.db` and `alice_agent.db` database files in current directory.
|
||||
Running above, for example, would create `alice_v1_chat.db` and `alice_v1_agent.db` database files in current directory.
|
||||
|
||||
Default SMP servers are hosted on Linode (London, UK and Fremont, CA) - they are [pre-configured in the app](https://github.com/simplex-chat/simplex-chat/blob/master/src/Simplex/Chat/Options.hs#L40). Base-64 encoded string after server host is the transport key digest.
|
||||
|
||||
|
|
|
@ -22,6 +22,6 @@ welcomeGetOpts = do
|
|||
appDir <- getAppUserDataDirectory "simplex"
|
||||
opts@ChatOpts {dbFile} <- getChatOpts appDir
|
||||
putStrLn $ "SimpleX Chat v" ++ versionNumber
|
||||
putStrLn $ "db: " <> dbFile <> ".chat.db, " <> dbFile <> ".agent.db"
|
||||
putStrLn $ "db: " <> dbFile <> "_chat.db, " <> dbFile <> "_agent.db"
|
||||
putStrLn "type \"/help\" or \"/h\" for usage info"
|
||||
pure opts
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: simplex-chat
|
||||
version: 0.5.4
|
||||
version: 1.0.0
|
||||
#synopsis:
|
||||
#description:
|
||||
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
||||
|
@ -29,7 +29,7 @@ dependencies:
|
|||
- optparse-applicative >= 0.15 && < 0.17
|
||||
- process == 1.6.*
|
||||
- simple-logger == 0.1.*
|
||||
- simplexmq >= 0.5.2 && < 0.6
|
||||
- simplexmq >= 1.0 && < 1.1
|
||||
- sqlite-simple == 0.4.*
|
||||
- stm == 2.5.*
|
||||
- terminal == 0.2.*
|
||||
|
|
|
@ -5,7 +5,7 @@ cabal-version: 1.12
|
|||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: simplex-chat
|
||||
version: 0.5.4
|
||||
version: 1.0.0
|
||||
category: Web, System, Services, Cryptography
|
||||
homepage: https://github.com/simplex-chat/simplex-chat#readme
|
||||
author: Evgeny Poberezkin
|
||||
|
@ -56,7 +56,7 @@ library
|
|||
, optparse-applicative >=0.15 && <0.17
|
||||
, process ==1.6.*
|
||||
, simple-logger ==0.1.*
|
||||
, simplexmq >=0.5.2 && <0.6
|
||||
, simplexmq ==1.0.*
|
||||
, sqlite-simple ==0.4.*
|
||||
, stm ==2.5.*
|
||||
, terminal ==0.2.*
|
||||
|
@ -93,7 +93,7 @@ executable simplex-chat
|
|||
, process ==1.6.*
|
||||
, simple-logger ==0.1.*
|
||||
, simplex-chat
|
||||
, simplexmq >=0.5.2 && <0.6
|
||||
, simplexmq ==1.0.*
|
||||
, sqlite-simple ==0.4.*
|
||||
, stm ==2.5.*
|
||||
, terminal ==0.2.*
|
||||
|
@ -138,7 +138,7 @@ test-suite simplex-chat-test
|
|||
, process ==1.6.*
|
||||
, simple-logger ==0.1.*
|
||||
, simplex-chat
|
||||
, simplexmq >=0.5.2 && <0.6
|
||||
, simplexmq ==1.0.*
|
||||
, sqlite-simple ==0.4.*
|
||||
, stm ==2.5.*
|
||||
, terminal ==0.2.*
|
||||
|
|
|
@ -142,7 +142,7 @@ newChatController config@ChatConfig {agentConfig = cfg, dbPoolSize, tbqSize} Cha
|
|||
chatStore <- createStore f dbPoolSize
|
||||
currentUser <- newTVarIO =<< getCreateActiveUser chatStore
|
||||
chatTerminal <- newChatTerminal t
|
||||
smpAgent <- getSMPAgentClient cfg {dbFile = dbFile <> ".agent.db", smpServers}
|
||||
smpAgent <- getSMPAgentClient cfg {dbFile = dbFile <> "_agent.db", smpServers}
|
||||
idsDrg <- newTVarIO =<< drgNew
|
||||
inputQ <- newTBQueueIO tbqSize
|
||||
notifyQ <- newTBQueueIO tbqSize
|
||||
|
|
|
@ -26,7 +26,13 @@ import System.IO (Handle)
|
|||
import UnliftIO.STM
|
||||
|
||||
versionNumber :: String
|
||||
versionNumber = "0.5.4"
|
||||
versionNumber = "1.0.0"
|
||||
|
||||
versionStr :: String
|
||||
versionStr = "SimpleX Chat v" <> versionNumber
|
||||
|
||||
updateStr :: String
|
||||
updateStr = "To update run: curl -o- https://raw.githubusercontent.com/simplex-chat/simplex-chat/master/install.sh | bash"
|
||||
|
||||
data ChatConfig = ChatConfig
|
||||
{ agentConfig :: AgentConfig,
|
||||
|
|
|
@ -7,6 +7,7 @@ import qualified Data.ByteString.Char8 as B
|
|||
import Data.List.NonEmpty (NonEmpty)
|
||||
import qualified Data.List.NonEmpty as L
|
||||
import Options.Applicative
|
||||
import Simplex.Chat.Controller (updateStr, versionStr)
|
||||
import Simplex.Messaging.Agent.Protocol (SMPServer (..))
|
||||
import Simplex.Messaging.Encoding.String
|
||||
import Simplex.Messaging.Parsers (parseAll)
|
||||
|
@ -24,8 +25,9 @@ chatOpts appDir =
|
|||
( long "database"
|
||||
<> short 'd'
|
||||
<> metavar "DB_FILE"
|
||||
<> help ("sqlite database file path (" <> defaultDbFilePath <> ")")
|
||||
<> help "Path prefix to chat and agent database files"
|
||||
<> value defaultDbFilePath
|
||||
<> showDefault
|
||||
)
|
||||
<*> option
|
||||
parseSMPServer
|
||||
|
@ -33,18 +35,17 @@ chatOpts appDir =
|
|||
<> short 's'
|
||||
<> metavar "SERVER"
|
||||
<> help
|
||||
( "SMP server(s) to use"
|
||||
<> "\n(smp2.simplex.im,smp3.simplex.im)"
|
||||
)
|
||||
"Comma separated list of SMP server(s) to use \
|
||||
\(default: smp4.simplex.im,smp5.simplex.im,smp6.simplex.im)"
|
||||
<> value
|
||||
( L.fromList
|
||||
[ "smp://z5W2QLQ1Br3Yd6CoWg7bIq1bHdwK7Y8bEiEXBs_WfAg=@smp2.simplex.im", -- London, UK
|
||||
"smp://nxc7HnrnM8dOKgkMp008ub_9o9LXJlxlMrMpR-mfMQw=@smp3.simplex.im" -- Fremont, CA
|
||||
[ "smp://CTMzyymBBawF0yuMln3UxTip6RgFVtYPL8UYuCoIBwE=@139.162.205.110", -- London, UK
|
||||
"smp://t82czNx4tiftzbk_M4KEITL1RS9CmcTWiCLHSlNsEZ8=@96.126.97.196" -- Fremont, CA
|
||||
]
|
||||
)
|
||||
)
|
||||
where
|
||||
defaultDbFilePath = combine appDir "simplex"
|
||||
defaultDbFilePath = combine appDir "simplex_v1"
|
||||
|
||||
parseSMPServer :: ReadM (NonEmpty SMPServer)
|
||||
parseSMPServer = eitherReader $ parseAll servers . B.pack
|
||||
|
@ -52,12 +53,11 @@ parseSMPServer = eitherReader $ parseAll servers . B.pack
|
|||
servers = L.fromList <$> strP `A.sepBy1` A.char ','
|
||||
|
||||
getChatOpts :: FilePath -> IO ChatOpts
|
||||
getChatOpts appDir = execParser opts
|
||||
getChatOpts appDir =
|
||||
execParser $
|
||||
info
|
||||
(helper <*> versionOption <*> chatOpts appDir)
|
||||
(header versionStr <> fullDesc <> progDesc "Start chat with DB_FILE file and use SERVER as SMP server")
|
||||
where
|
||||
opts =
|
||||
info
|
||||
(chatOpts appDir <**> helper)
|
||||
( fullDesc
|
||||
<> header "Chat prototype using Simplex Messaging Protocol (SMP)"
|
||||
<> progDesc "Start chat with DB_FILE file and use SERVER as SMP server"
|
||||
)
|
||||
versionOption = infoOption versionAndUpdate (long "version" <> short 'v' <> help "Show version")
|
||||
versionAndUpdate = versionStr <> "\n" <> updateStr
|
||||
|
|
|
@ -145,7 +145,7 @@ createStore :: FilePath -> Int -> IO SQLiteStore
|
|||
createStore dbFilePath poolSize = createSQLiteStore dbFilePath poolSize migrations
|
||||
|
||||
chatStoreFile :: FilePath -> FilePath
|
||||
chatStoreFile = (<> ".chat.db")
|
||||
chatStoreFile = (<> "_chat.db")
|
||||
|
||||
checkConstraint :: StoreError -> IO (Either StoreError a) -> IO (Either StoreError a)
|
||||
checkConstraint err action = action `E.catch` (pure . Left . handleSQLError err)
|
||||
|
|
|
@ -834,4 +834,4 @@ styleTime :: String -> StyledString
|
|||
styleTime = Styled [SetColor Foreground Vivid Black]
|
||||
|
||||
clientVersionInfo :: [StyledString]
|
||||
clientVersionInfo = [plain $ "SimpleX Chat v" <> versionNumber]
|
||||
clientVersionInfo = [plain versionStr, plain updateStr]
|
||||
|
|
|
@ -41,7 +41,7 @@ extra-deps:
|
|||
# - simplexmq-0.5.2@sha256:3544e479f353c1bbc6aa9405ef6976b78364f437d8af9cc45b9e0b228429e240,7884
|
||||
# - ../simplexmq
|
||||
- github: simplex-chat/simplexmq
|
||||
commit: 40d91e8fad499c9e3fb4317b6bcd93037b2bf1cd
|
||||
commit: d8a61de290207509dc57a548f5551e294066e040
|
||||
- github: simplex-chat/hs-tls
|
||||
commit: cea6d52c512716ff09adcac86ebc95bb0b3bb797
|
||||
subdirs:
|
||||
|
|
|
@ -39,7 +39,7 @@ opts :: ChatOpts
|
|||
opts =
|
||||
ChatOpts
|
||||
{ dbFile = undefined,
|
||||
smpServers = ["smp://9VjLsOY5ZvB4hoglNdBzJFAUi_vP4GkZnJFahQOXV20=@localhost:5001"]
|
||||
smpServers = ["smp://LcJUMfVhwD8yxjAiSaDzzGF3-kLG4Uh0Fl_ZIjrRwjI=@localhost:5001"]
|
||||
}
|
||||
|
||||
termSettings :: VirtualTerminalSettings
|
||||
|
@ -71,7 +71,7 @@ cfg =
|
|||
|
||||
virtualSimplexChat :: FilePath -> Profile -> IO TestCC
|
||||
virtualSimplexChat dbFile profile = do
|
||||
st <- createStore (dbFile <> ".chat.db") 1
|
||||
st <- createStore (dbFile <> "_chat.db") 1
|
||||
void . runExceptT $ createUser st profile True
|
||||
t <- withVirtualTerminal termSettings pure
|
||||
cc <- newChatController cfg opts {dbFile} t . const $ pure () -- no notifications
|
||||
|
|
|
@ -23,7 +23,7 @@ srv :: SMPServer
|
|||
srv =
|
||||
SMPServer
|
||||
{ host = "smp.simplex.im",
|
||||
port = Just "5223",
|
||||
port = "5223",
|
||||
keyHash = C.KeyHash "\215m\248\251"
|
||||
}
|
||||
|
||||
|
|
1
tests/fixtures/tls/.gitignore
vendored
1
tests/fixtures/tls/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
server.csr
|
26
tests/fixtures/tls/README.md
vendored
26
tests/fixtures/tls/README.md
vendored
|
@ -1,26 +0,0 @@
|
|||
To generate fixtures:
|
||||
|
||||
(keep these instructions and *openssl.cnf* consistent with certificate generation on server)
|
||||
|
||||
```sh
|
||||
# CA certificate (identity/offline)
|
||||
openssl genpkey -algorithm ED448 -out ca.key
|
||||
openssl req -new -x509 -days 999999 -config openssl.cnf -extensions v3_ca -key ca.key -out ca.crt
|
||||
# server certificate (online)
|
||||
openssl genpkey -algorithm ED448 -out server.key
|
||||
openssl req -new -config openssl.cnf -reqexts v3_req -key server.key -out server.csr
|
||||
openssl x509 -req -days 999999 -extfile openssl.cnf -extensions v3_req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt
|
||||
# to pretty-print
|
||||
openssl x509 -in ca.crt -text -noout
|
||||
openssl req -in server.csr -text -noout
|
||||
openssl x509 -in server.crt -text -noout
|
||||
```
|
||||
|
||||
To compute fingerprint for tests:
|
||||
|
||||
```haskell
|
||||
stack ghci
|
||||
> import Data.X509.Validation (Fingerprint (..))
|
||||
> Fingerprint fp <- loadFingerprint "tests/fixtures/ca.crt"
|
||||
> strEncode fp
|
||||
```
|
19
tests/fixtures/tls/ca.crt
vendored
19
tests/fixtures/tls/ca.crt
vendored
|
@ -1,11 +1,12 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIBijCCAQqgAwIBAgIUf/txCk9PXE4nY2gQ/B/HG2sNzmswBQYDK2VxMBQxEjAQ
|
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vkC8Ov0pBAYpYi5ukSNNVXl
|
||||
ABVRlipB+vOcLQStNyaZ7kXzQ2IO/0btmIidh+G6SP8I4aytYIYYcV5pEUZpG1L1
|
||||
57g8P29SDv81AA==
|
||||
-----END CERTIFICATE-----
|
||||
|
|
4
tests/fixtures/tls/ca.key
vendored
4
tests/fixtures/tls/ca.key
vendored
|
@ -1,4 +0,0 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MEcCAQAwBQYDK2VxBDsEOZvjURTKSor4A7+45hnY721WD06L3E4UMKh9zntEY83C
|
||||
CCv1Jju2fffDmtIFl6EXytF/nyEPGQfS5A==
|
||||
-----END PRIVATE KEY-----
|
16
tests/fixtures/tls/openssl.cnf
vendored
16
tests/fixtures/tls/openssl.cnf
vendored
|
@ -1,16 +0,0 @@
|
|||
[req]
|
||||
distinguished_name = req_distinguished_name
|
||||
prompt = no
|
||||
|
||||
[req_distinguished_name]
|
||||
CN = localhost
|
||||
|
||||
[v3_ca]
|
||||
subjectKeyIdentifier = hash
|
||||
authorityKeyIdentifier = keyid:always
|
||||
basicConstraints = critical,CA:true
|
||||
|
||||
[v3_req]
|
||||
basicConstraints = CA:FALSE
|
||||
keyUsage = digitalSignature, nonRepudiation, keyAgreement
|
||||
extendedKeyUsage = serverAuth
|
19
tests/fixtures/tls/server.crt
vendored
19
tests/fixtures/tls/server.crt
vendored
|
@ -1,11 +1,12 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIBpjCCASagAwIBAgIUZVFfBPmSQ+hPioDvatGcRuwcKhgwBQYDK2VxMBQxEjAQ
|
||||
BgNVBAMMCWxvY2FsaG9zdDAgFw0yMjAxMDMxNjI1MDhaGA80NzU5MTEzMDE2MjUw
|
||||
OFowFDESMBAGA1UEAwwJbG9jYWxob3N0MEMwBQYDK2VxAzoA/q7ngl2MOKDeHVgC
|
||||
4aNgO4+pOQ7cfHJhgVTKz0W6CCK9Ce39B0N+cRy6/dPzGCSSOYNKyGE0rnWAo28w
|
||||
bTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIDyDATBgNVHSUEDDAKBggrBgEFBQcDATAd
|
||||
BgNVHQ4EFgQUQP8dENbwDxWZNX2QwauT1Ple6aswHwYDVR0jBBgwFoAUxJBTkCx0
|
||||
2jIpcUKU4fJYcnce59QwBQYDK2VxA3MAyQKimFiGGPR+vHHo2PVh5hHG9QSJn+34
|
||||
b36oGP4ekP/JFA0P3ZS7Kt7mLx2Lm8WmB31Ah1xJu1SA79LpArfum4QLn9GvOIyt
|
||||
K4Ox/bUdYRvnWqFF8msQAWetO2tt0ZUar7zI7ac3uHBdKAzLFDw1fjgA
|
||||
MIIBvDCCATygAwIBAgIUUgqht3ibEJ9jp5JuroML5Baxa/IwBQYDK2VxMCoxFjAU
|
||||
BgNVBAMMDVNNUCBzZXJ2ZXIgQ0ExEDAOBgNVBAoMB1NpbXBsZVgwIBcNMjIwMTEx
|
||||
MTYzOTQ2WhgPNDc1OTEyMDgxNjM5NDZaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDBD
|
||||
MAUGAytlcQM6AFj+fmjmgOMBFgQ7lXfICSlSaB5sYp1wzhM2IaqgmVhWbDs3Tw7W
|
||||
oUXFJsWpKku1kFjLH2yhqIInAKNvMG0wCQYDVR0TBAIwADALBgNVHQ8EBAMCA8gw
|
||||
EwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0OBBYEFMjbHbxESDI8YDPjJ8kXWjkg
|
||||
jHxmMB8GA1UdIwQYMBaAFBxQm9HuabbrLExB8KxaBufAyYlUMAUGAytlcQNzAP98
|
||||
RpFacmjxsc07GwC07uAxUxNgxX4R2nA+0St866uFbdyxApiyn44giG+m+YXCXLjh
|
||||
1ffKEhhqAPdlpzByLarx8EWgmOsisBCRWrmraksOV15FKxjPqm7OYKp4f9GvieAQ
|
||||
o/SKOyZVVdcZX7NcuDUxAA==
|
||||
-----END CERTIFICATE-----
|
||||
|
|
4
tests/fixtures/tls/server.key
vendored
4
tests/fixtures/tls/server.key
vendored
|
@ -1,4 +1,4 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MEcCAQAwBQYDK2VxBDsEOQANqfrmSygKW1iiDCgf/G/y2AH1lp5NurM3Q73fp9Aw
|
||||
nznRFYq6BvM03cMOkqtFpQd15A+DZr248A==
|
||||
MEcCAQAwBQYDK2VxBDsEOZcXSjKQ3FQ9EBfqHmFIidOu4LecpUgi5NVPMhx7mS2d
|
||||
QNQ0lFasp+EfvLErbs1Sd9xLVxA1hnZJng==
|
||||
-----END PRIVATE KEY-----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue