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