Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type ThentosConfig = Tagged (ToConfigCode ThentosConfig')
- type ThentosConfig' = Maybe (("frontend" :> HttpConfig') :>: "HTTP server for html forms.") :*> (Maybe (("backend" :> HttpConfig') :>: "HTTP server for rest api.") :*> (Maybe (("purescript" :> ST) :>: "File system location of frontend code") :*> (Maybe (("proxy" :> ProxyConfig') :>: "The default proxied app.") :*> (Maybe (("proxies" :> [ProxyConfig']) :>: "A list of proxied apps.") :*> ((("smtp" :> SmtpConfig') :>: "Sending email.") :*> ((("database" :> DatabaseConfig') :>: "The database.") :*> (Maybe (("default_user" :> DefaultUserConfig') :>: "A user that is created if the user table is empty.") :*> ((("user_reg_expiration" :> Timeout) :>: "User registration expiration period") :*> ((("pw_reset_expiration" :> Timeout) :>: "Password registration token expiration period") :*> ((("email_change_expiration" :> Timeout) :>: "Email-change-token expiration period") :*> ((("captcha_expiration" :> Timeout) :>: "Captcha expiration period") :*> (Maybe (("gc_interval" :> Timeout) :>: "Garbage collection interval") :*> ((("log" :> LogConfig') :>: "Logging") :*> (("mail" :> MailConfig') :>: "Mail templates"))))))))))))))
- defaultThentosConfig :: ToConfig (ToConfigCode ThentosConfig') Maybe
- type HttpConfig = Tagged (ToConfigCode HttpConfig')
- type HttpConfig' = Maybe (("bind_schema" :> HttpSchema) :>: "Http schema that the server experiences. Differs from expose_schema e.g. when running behind nginx.") :*> ((("bind_host" :> ST) :>: "Host name that the server experiences. Differs from expose_host e.g. when running behind nginx.") :*> ((("bind_port" :> Int) :>: "Host port that the server experiences. Differs from expose_port e.g. when running behind nginx.") :*> (Maybe (("expose_schema" :> HttpSchema) :>: "Http schema that the client experiences. Differs from bind_schema e.g. when running behind nginx.") :*> (Maybe (("expose_host" :> ST) :>: "Host name that the client experiences. Differs from bind_host e.g. when running behind nginx.") :*> Maybe (("expose_port" :> Int) :>: "Host port that the client experiences. Differs from bind_port e.g. when running behind nginx.")))))
- type ProxyConfig = Tagged (ToConfigCode ProxyConfig')
- type ProxyConfig' = ("service_id" :> ST) :*> ("endpoint" :> ProxyUri)
- type SmtpConfig = Tagged (ToConfigCode SmtpConfig')
- type SmtpConfig' = Maybe ("sender_name" :> ST) :*> (("sender_address" :> ST) :*> (("sendmail_path" :> ST) :*> ("sendmail_args" :> [ST])))
- defaultSmtpConfig :: ToConfig (ToConfigCode SmtpConfig') Maybe
- type DatabaseConfig = Tagged (ToConfigCode DatabaseConfig')
- type DatabaseConfig' = "name" :> ST
- defaultDatabaseConfig :: ToConfig (ToConfigCode DatabaseConfig') Maybe
- type DefaultUserConfig = Tagged (ToConfigCode DefaultUserConfig')
- type DefaultUserConfig' = ("name" :> ST) :*> (("password" :> ST) :*> (("email" :> UserEmail) :*> Maybe ("roles" :> [Role])))
- type LogConfig = Tagged (ToConfigCode LogConfig')
- type LogConfig' = ("path" :> ST) :*> ("level" :> Prio)
- type MailConfig = Tagged (ToConfigCode MailConfig')
- type MailConfig' = "account_verification" :> AccountVerificationConfig'
- type AccountVerificationConfig = Tagged (ToConfigCode AccountVerificationConfig')
- type AccountVerificationConfig' = ("subject" :> ST) :*> ("body" :> ST)
- defaultMailConfig :: ToConfig (ToConfigCode MailConfig') Maybe
- defaultAccountVerificationConfig :: ToConfig (ToConfigCode AccountVerificationConfig') Maybe
- data HttpSchema
- printConfigUsage :: IO ()
- getConfig :: FilePath -> IO ThentosConfig
- getBackendConfig :: ThentosConfig -> HttpConfig
- getFrontendConfig :: ThentosConfig -> HttpConfig
- getProxyConfigMap :: ThentosConfig -> Map ServiceId ProxyConfig
- bindUrl :: HttpConfig -> ST
- exposeUrl :: HttpConfig -> ST
- extractTargetUrl :: ProxyConfig -> ProxyUri
- _renderUrl :: Maybe HttpSchema -> ST -> Int -> ST
- buildEmailAddress :: SmtpConfig -> Address
- getUserData :: DefaultUserConfig -> UserFormData
- getDefaultUser :: DefaultUserConfig -> (UserFormData, [Role])
- configLogger :: ST -> Prio -> IO ()
config structure
type ThentosConfig = Tagged (ToConfigCode ThentosConfig')
type ThentosConfig' = Maybe (("frontend" :> HttpConfig') :>: "HTTP server for html forms.") :*> (Maybe (("backend" :> HttpConfig') :>: "HTTP server for rest api.") :*> (Maybe (("purescript" :> ST) :>: "File system location of frontend code") :*> (Maybe (("proxy" :> ProxyConfig') :>: "The default proxied app.") :*> (Maybe (("proxies" :> [ProxyConfig']) :>: "A list of proxied apps.") :*> ((("smtp" :> SmtpConfig') :>: "Sending email.") :*> ((("database" :> DatabaseConfig') :>: "The database.") :*> (Maybe (("default_user" :> DefaultUserConfig') :>: "A user that is created if the user table is empty.") :*> ((("user_reg_expiration" :> Timeout) :>: "User registration expiration period") :*> ((("pw_reset_expiration" :> Timeout) :>: "Password registration token expiration period") :*> ((("email_change_expiration" :> Timeout) :>: "Email-change-token expiration period") :*> ((("captcha_expiration" :> Timeout) :>: "Captcha expiration period") :*> (Maybe (("gc_interval" :> Timeout) :>: "Garbage collection interval") :*> ((("log" :> LogConfig') :>: "Logging") :*> (("mail" :> MailConfig') :>: "Mail templates"))))))))))))))
defaultThentosConfig :: ToConfig (ToConfigCode ThentosConfig') Maybe
type HttpConfig = Tagged (ToConfigCode HttpConfig')
type HttpConfig' = Maybe (("bind_schema" :> HttpSchema) :>: "Http schema that the server experiences. Differs from expose_schema e.g. when running behind nginx.") :*> ((("bind_host" :> ST) :>: "Host name that the server experiences. Differs from expose_host e.g. when running behind nginx.") :*> ((("bind_port" :> Int) :>: "Host port that the server experiences. Differs from expose_port e.g. when running behind nginx.") :*> (Maybe (("expose_schema" :> HttpSchema) :>: "Http schema that the client experiences. Differs from bind_schema e.g. when running behind nginx.") :*> (Maybe (("expose_host" :> ST) :>: "Host name that the client experiences. Differs from bind_host e.g. when running behind nginx.") :*> Maybe (("expose_port" :> Int) :>: "Host port that the client experiences. Differs from bind_port e.g. when running behind nginx.")))))
type ProxyConfig = Tagged (ToConfigCode ProxyConfig')
type ProxyConfig' = ("service_id" :> ST) :*> ("endpoint" :> ProxyUri)
type SmtpConfig = Tagged (ToConfigCode SmtpConfig')
type SmtpConfig' = Maybe ("sender_name" :> ST) :*> (("sender_address" :> ST) :*> (("sendmail_path" :> ST) :*> ("sendmail_args" :> [ST])))
defaultSmtpConfig :: ToConfig (ToConfigCode SmtpConfig') Maybe
type DatabaseConfig = Tagged (ToConfigCode DatabaseConfig')
type DatabaseConfig' = "name" :> ST
defaultDatabaseConfig :: ToConfig (ToConfigCode DatabaseConfig') Maybe
type DefaultUserConfig = Tagged (ToConfigCode DefaultUserConfig')
type DefaultUserConfig' = ("name" :> ST) :*> (("password" :> ST) :*> (("email" :> UserEmail) :*> Maybe ("roles" :> [Role])))
type LogConfig = Tagged (ToConfigCode LogConfig')
type LogConfig' = ("path" :> ST) :*> ("level" :> Prio)
type MailConfig = Tagged (ToConfigCode MailConfig')
type MailConfig' = "account_verification" :> AccountVerificationConfig'
type AccountVerificationConfig = Tagged (ToConfigCode AccountVerificationConfig')
type AccountVerificationConfig' = ("subject" :> ST) :*> ("body" :> ST)
defaultMailConfig :: ToConfig (ToConfigCode MailConfig') Maybe
defaultAccountVerificationConfig :: ToConfig (ToConfigCode AccountVerificationConfig') Maybe
leaf types
data HttpSchema
Bounded HttpSchema | |
Enum HttpSchema | |
Eq HttpSchema | |
Ord HttpSchema | |
Show HttpSchema | |
Generic HttpSchema | |
ToJSON HttpSchema | |
FromJSON HttpSchema | |
type Rep HttpSchema |
driver
printConfigUsage :: IO ()
getConfig :: FilePath -> IO ThentosConfig
helpers
getProxyConfigMap :: ThentosConfig -> Map ServiceId ProxyConfig
bindUrl :: HttpConfig -> ST
exposeUrl :: HttpConfig -> ST
_renderUrl :: Maybe HttpSchema -> ST -> Int -> ST
buildEmailAddress :: SmtpConfig -> Address
getDefaultUser :: DefaultUserConfig -> (UserFormData, [Role])
logging
configLogger :: ST -> Prio -> IO ()