3 {-# LANGUAGE TemplateHaskell #-}
5 module Gargantext.API.Admin.Types where
8 import Control.Monad.Logger
9 import Data.ByteString (ByteString)
11 import GHC.Generics (Generic)
12 import Gargantext.Prelude
13 import Servant.Auth.Server (JWTSettings, CookieSettings(..))
14 import Servant.Client (BaseUrl)
19 data SendEmailType = SendEmailViaAws
22 deriving (Show, Read, Enum, Bounded, Generic)
24 data Settings = Settings
25 { _allowedOrigin :: !ByteString -- allowed origin for CORS
26 , _allowedHost :: !ByteString -- allowed host for CORS
27 , _appPort :: !PortNumber
28 , _logLevelLimit :: !LogLevel -- log level from the monad-logger package
29 -- , _dbServer :: Text
30 -- ^ this is not used yet
31 , _jwtSettings :: !JWTSettings
32 , _cookieSettings :: !CookieSettings
33 , _sendLoginEmails :: !SendEmailType
34 , _scrapydUrl :: !BaseUrl
39 class HasSettings env where
40 settings :: Getter env Settings
42 instance HasSettings Settings where
45 data FireWall = FireWall { unFireWall :: Bool }