Emit Settings on startup for debugging
This commit is contained in:
parent
c5b3d26f81
commit
39d493dfb7
@ -114,9 +114,10 @@ makeFoundation appSettings@(AppSettings{..}) = do
|
|||||||
logFunc = messageLoggerSource tempFoundation appLogger
|
logFunc = messageLoggerSource tempFoundation appLogger
|
||||||
|
|
||||||
flip runLoggingT logFunc $ do
|
flip runLoggingT logFunc $ do
|
||||||
smtpPool <- traverse createSmtpPool appSmtpConf
|
|
||||||
|
|
||||||
$logDebugS "InstanceID" $ UUID.toText appInstanceID
|
$logDebugS "InstanceID" $ UUID.toText appInstanceID
|
||||||
|
$logDebugS "Configuration" $ tshow appSettings
|
||||||
|
|
||||||
|
smtpPool <- traverse createSmtpPool appSmtpConf
|
||||||
|
|
||||||
-- Create the database connection pool
|
-- Create the database connection pool
|
||||||
sqlPool <- createPostgresqlPool
|
sqlPool <- createPostgresqlPool
|
||||||
|
|||||||
@ -104,7 +104,7 @@ data AppSettings = AppSettings
|
|||||||
|
|
||||||
, appCryptoIDKeyFile :: FilePath
|
, appCryptoIDKeyFile :: FilePath
|
||||||
, appInstanceIDFile :: Maybe FilePath
|
, appInstanceIDFile :: Maybe FilePath
|
||||||
}
|
} deriving (Show)
|
||||||
|
|
||||||
data UserDefaultConf = UserDefaultConf
|
data UserDefaultConf = UserDefaultConf
|
||||||
{ userDefaultTheme :: Theme
|
{ userDefaultTheme :: Theme
|
||||||
@ -118,6 +118,9 @@ data PWHashConf = PWHashConf
|
|||||||
, pwHashStrength :: Int
|
, pwHashStrength :: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
instance Show PWHashConf where
|
||||||
|
show PWHashConf{..} = "PWHashConf { pwHashStrength = " <> show pwHashStrength <> ", .. }"
|
||||||
|
|
||||||
instance FromJSON PWHashConf where
|
instance FromJSON PWHashConf where
|
||||||
parseJSON = withObject "PWHashConf" $ \o -> do
|
parseJSON = withObject "PWHashConf" $ \o -> do
|
||||||
pwHashAlgorithm' <- (o .: "algorithm" :: Aeson.Parser Text)
|
pwHashAlgorithm' <- (o .: "algorithm" :: Aeson.Parser Text)
|
||||||
@ -209,11 +212,14 @@ deriveFromJSON
|
|||||||
}
|
}
|
||||||
''HaskellNet.AuthType
|
''HaskellNet.AuthType
|
||||||
|
|
||||||
deriveFromJSON
|
instance FromJSON SmtpConf where
|
||||||
defaultOptions
|
parseJSON = withObject "SmtpConf" $ \o -> do
|
||||||
{ fieldLabelModifier = intercalate "-" . map toLower . drop 1 . splitCamel
|
smtpHost <- o .: "host"
|
||||||
}
|
smtpPort <- o .: "port"
|
||||||
''SmtpConf
|
smtpAuth <- assertM (not . null . smtpAuthUsername) <$> o .:? "auth"
|
||||||
|
smtpSsl <- o .: "ssl"
|
||||||
|
smtpPool <- o .: "pool"
|
||||||
|
return SmtpConf{..}
|
||||||
|
|
||||||
deriveFromJSON
|
deriveFromJSON
|
||||||
defaultOptions
|
defaultOptions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user