2019-04-24 21:52:08 +00:00
|
|
|
package schema
|
|
|
|
|
2021-11-30 11:15:21 +00:00
|
|
|
import (
|
|
|
|
"net/mail"
|
|
|
|
"time"
|
|
|
|
)
|
2021-08-10 00:52:41 +00:00
|
|
|
|
2019-04-24 21:52:08 +00:00
|
|
|
// FileSystemNotifierConfiguration represents the configuration of the notifier writing emails in a file.
|
|
|
|
type FileSystemNotifierConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
Filename string `koanf:"filename"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SMTPNotifierConfiguration represents the configuration of the SMTP server to send emails with.
|
|
|
|
type SMTPNotifierConfiguration struct {
|
2021-08-10 00:52:41 +00:00
|
|
|
Host string `koanf:"host"`
|
|
|
|
Port int `koanf:"port"`
|
|
|
|
Timeout time.Duration `koanf:"timeout"`
|
|
|
|
Username string `koanf:"username"`
|
|
|
|
Password string `koanf:"password"`
|
|
|
|
Identifier string `koanf:"identifier"`
|
2021-11-30 11:15:21 +00:00
|
|
|
Sender mail.Address `koanf:"sender"`
|
2021-08-10 00:52:41 +00:00
|
|
|
Subject string `koanf:"subject"`
|
|
|
|
StartupCheckAddress string `koanf:"startup_check_address"`
|
|
|
|
DisableRequireTLS bool `koanf:"disable_require_tls"`
|
|
|
|
DisableHTMLEmails bool `koanf:"disable_html_emails"`
|
|
|
|
TLS *TLSConfig `koanf:"tls"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
|
|
|
|
2020-01-05 23:03:16 +00:00
|
|
|
// NotifierConfiguration represents the configuration of the notifier to use when sending notifications to users.
|
2019-04-24 21:52:08 +00:00
|
|
|
type NotifierConfiguration struct {
|
2021-08-03 09:55:21 +00:00
|
|
|
DisableStartupCheck bool `koanf:"disable_startup_check"`
|
|
|
|
FileSystem *FileSystemNotifierConfiguration `koanf:"filesystem"`
|
|
|
|
SMTP *SMTPNotifierConfiguration `koanf:"smtp"`
|
2022-04-03 12:24:51 +00:00
|
|
|
TemplatePath string `koanf:"template_path"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
2020-04-09 00:21:28 +00:00
|
|
|
|
2020-04-20 21:03:38 +00:00
|
|
|
// DefaultSMTPNotifierConfiguration represents default configuration parameters for the SMTP notifier.
|
2020-04-09 00:21:28 +00:00
|
|
|
var DefaultSMTPNotifierConfiguration = SMTPNotifierConfiguration{
|
2021-11-30 11:15:21 +00:00
|
|
|
Timeout: time.Second * 5,
|
|
|
|
Subject: "[Authelia] {title}",
|
|
|
|
Identifier: "localhost",
|
|
|
|
StartupCheckAddress: "test@authelia.com",
|
2021-01-04 10:28:55 +00:00
|
|
|
TLS: &TLSConfig{
|
|
|
|
MinimumVersion: "TLS1.2",
|
|
|
|
},
|
2020-04-09 00:21:28 +00:00
|
|
|
}
|