use SQLCipher (#981)

* use SQLCipher

* pass encryption key via CLI options

* update dependencies to use git

* add CONTRIBUTING.md

* move flag, enable build in sqlcipher branch

* update dependencies
This commit is contained in:
Evgeny Poberezkin
2022-08-30 12:49:07 +01:00
committed by GitHub
parent b4d7afb4c1
commit 02ca7234fb
16 changed files with 115 additions and 26 deletions
+10
View File
@@ -25,6 +25,7 @@ import System.FilePath (combine)
data ChatOpts = ChatOpts
{ dbFilePrefix :: String,
dbKey :: String,
smpServers :: [SMPServer],
networkConfig :: NetworkConfig,
logConnections :: Bool,
@@ -47,6 +48,14 @@ chatOpts appDir defaultDbFileName = do
<> value defaultDbFilePath
<> showDefault
)
dbKey <-
strOption
( long "key"
<> short 'k'
<> metavar "KEY"
<> help "Database encryption key/pass-phrase"
<> value ""
)
smpServers <-
option
parseSMPServers
@@ -126,6 +135,7 @@ chatOpts appDir defaultDbFileName = do
pure
ChatOpts
{ dbFilePrefix,
dbKey,
smpServers,
networkConfig = fullNetworkConfig socksProxy $ useTcpTimeout socksProxy t,
logConnections,