aboutsummaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Config.hs')
-rw-r--r--src/Config.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Config.hs b/src/Config.hs
index 2b2f341..6ffb1fd 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -30,7 +30,8 @@ data Config = Config {
confFavicon :: Text,
confUser :: Text,
confPwHash :: Text,
- confEmailCmd :: Maybe FilePath
+ confEmailCmd :: Maybe FilePath,
+ confAdminEmail :: String
} deriving (Show, Eq)
getConfig :: IO Config
@@ -47,6 +48,7 @@ getConfig = do
<*> resolveVal (lookup "admin-user" confFile) "ADMIN_USER" "bleb"
<*> resolveVal (lookup "admin-pw-hash" confFile) "ADMIN_PW_HASH" "" -- prevent login without manual pw
<*> fmap (<|> lookup "email-command" confFile) (lookupEnv "EMAIL_CMD")
+ <*> resolveVal (lookup "admin-email" confFile) "ADMIN_EMAIL" ""
where resolveVal :: IsString s => Maybe String -> String -> String -> IO s
resolveVal mayConf q def = do