Compare commits
2 commits
480ffba3f9
...
85344c0867
Author | SHA1 | Date | |
---|---|---|---|
|
85344c0867 | ||
|
cbc22ea207 |
2 changed files with 16 additions and 14 deletions
16
README.md
16
README.md
|
@ -16,12 +16,13 @@ The config file is a toml file, even though it as of now makes not really use
|
|||
of any toml features.
|
||||
|
||||
```toml
|
||||
mailDomain = "the domain of the smtp server to send messages with"
|
||||
mailUser = "the username on the smtp server"
|
||||
mailPassword = "the passwond on the smtp server"
|
||||
mailTo = "the mail to send to"
|
||||
mailFrom = "the sender of the mail"
|
||||
mailErrorTo = "the address to send a mail to in case of error"
|
||||
[mail]
|
||||
domain = "the domain of the smtp server to send messages with"
|
||||
user = "the username on the smtp server"
|
||||
password = "the passwond on the smtp server"
|
||||
to = "the mail to send to"
|
||||
from = "the sender of the mail"
|
||||
errorTo = "the address to send a mail to in case of error"
|
||||
```
|
||||
|
||||
## Develop
|
||||
|
@ -33,4 +34,5 @@ this depends on your local cabal cache.
|
|||
- Add the nix modules to the flake
|
||||
- Better Error handling
|
||||
- Find out which exceptions the SMTP module throws
|
||||
|
||||
- Split config into secrets and non secret config
|
||||
- make the pad url configurable
|
||||
|
|
|
@ -16,13 +16,13 @@ data Config = Config {
|
|||
} deriving Show
|
||||
|
||||
configCodec :: TomlCodec Config
|
||||
configCodec = Config
|
||||
<$> Toml.string "mailDomain" .= mailDomain
|
||||
<*> Toml.string "mailUser" .= mailUsername
|
||||
<*> Toml.string "mailPassword" .= mailPassword
|
||||
<*> Toml.text "mailTo" .= mailTo
|
||||
<*> Toml.text "mailFrom" .= mailFrom
|
||||
<*> Toml.text "mailErrorTo" .= mailErrorTo
|
||||
configCodec = flip Toml.table "mail" $ Config
|
||||
<$> Toml.string "domain" .= mailDomain
|
||||
<*> Toml.string "user" .= mailUsername
|
||||
<*> Toml.string "password" .= mailPassword
|
||||
<*> Toml.text "to" .= mailTo
|
||||
<*> Toml.text "from" .= mailFrom
|
||||
<*> Toml.text "errorTo" .= mailErrorTo
|
||||
|
||||
parseConfigFile :: (MonadIO m, MonadFail m) => String -> m Config
|
||||
parseConfigFile path = do
|
||||
|
|
Loading…
Reference in a new issue