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:
committed by
GitHub
parent
809a87ce61
commit
5a74b8066f
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user