]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/API/Admin/Types.hs
[ChangeLog] Node names
[gargantext.git] / src / Gargantext / API / Admin / Types.hs
1 -- |
2
3 {-# LANGUAGE TemplateHaskell #-}
4
5 module Gargantext.API.Admin.Types where
6
7 import Control.Lens
8 import Control.Monad.Logger
9 import Data.ByteString (ByteString)
10 import GHC.Enum
11 import GHC.Generics (Generic)
12 import Gargantext.Prelude
13 import Servant.Auth.Server (JWTSettings, CookieSettings(..))
14 import Servant.Client (BaseUrl)
15
16
17 type PortNumber = Int
18
19 data SendEmailType = SendEmailViaAws
20 | LogEmailToConsole
21 | WriteEmailToFile
22 deriving (Show, Read, Enum, Bounded, Generic)
23
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
35 }
36
37 makeLenses ''Settings
38
39 class HasSettings env where
40 settings :: Getter env Settings
41
42 instance HasSettings Settings where
43 settings = identity
44
45 data FireWall = FireWall { unFireWall :: Bool }