2019-04-25 04:52:08 +07:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// FileSystemNotifierConfiguration represents the configuration of the notifier writing emails in a file.
|
|
|
|
type FileSystemNotifierConfiguration struct {
|
2020-01-22 03:56:44 +07:00
|
|
|
Filename string `mapstructure:"filename"`
|
2019-04-25 04:52:08 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
// SMTPNotifierConfiguration represents the configuration of the SMTP server to send emails with.
|
|
|
|
type SMTPNotifierConfiguration struct {
|
2021-01-04 17:28:55 +07:00
|
|
|
Host string `mapstructure:"host"`
|
|
|
|
Port int `mapstructure:"port"`
|
|
|
|
Username string `mapstructure:"username"`
|
|
|
|
Password string `mapstructure:"password"`
|
|
|
|
Identifier string `mapstructure:"identifier"`
|
|
|
|
Sender string `mapstructure:"sender"`
|
|
|
|
Subject string `mapstructure:"subject"`
|
|
|
|
StartupCheckAddress string `mapstructure:"startup_check_address"`
|
|
|
|
DisableRequireTLS bool `mapstructure:"disable_require_tls"`
|
|
|
|
DisableHTMLEmails bool `mapstructure:"disable_html_emails"`
|
|
|
|
TLS *TLSConfig `mapstructure:"tls"`
|
2019-04-25 04:52:08 +07:00
|
|
|
}
|
|
|
|
|
2020-01-06 06:03:16 +07:00
|
|
|
// NotifierConfiguration represents the configuration of the notifier to use when sending notifications to users.
|
2019-04-25 04:52:08 +07:00
|
|
|
type NotifierConfiguration struct {
|
[FEATURE] Notifier Startup Checks (#889)
* implement SMTP notifier startup check
* check dial, starttls, auth, mail from, rcpt to, reset, and quit
* log the error on failure
* implement mock
* misc optimizations, adjustments, and refactoring
* implement validate_skip config option
* fix comments to end with period
* fix suites that used smtp notifier without a smtp container
* add docs
* add file notifier startup check
* move file mode into const.go
* disable gosec linting on insecureskipverify since it's intended, warned, and discouraged
* minor PR commentary adjustment
* apply suggestions from code review
Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-21 11:59:38 +07:00
|
|
|
DisableStartupCheck bool `mapstructure:"disable_startup_check"`
|
|
|
|
FileSystem *FileSystemNotifierConfiguration `mapstructure:"filesystem"`
|
|
|
|
SMTP *SMTPNotifierConfiguration `mapstructure:"smtp"`
|
2019-04-25 04:52:08 +07:00
|
|
|
}
|
2020-04-09 07:21:28 +07:00
|
|
|
|
2020-04-21 04:03:38 +07:00
|
|
|
// DefaultSMTPNotifierConfiguration represents default configuration parameters for the SMTP notifier.
|
2020-04-09 07:21:28 +07:00
|
|
|
var DefaultSMTPNotifierConfiguration = SMTPNotifierConfiguration{
|
2020-11-05 06:22:10 +07:00
|
|
|
Subject: "[Authelia] {title}",
|
|
|
|
Identifier: "localhost",
|
2021-01-04 17:28:55 +07:00
|
|
|
TLS: &TLSConfig{
|
|
|
|
MinimumVersion: "TLS1.2",
|
|
|
|
},
|
2020-04-09 07:21:28 +07:00
|
|
|
}
|