app.go: Use cfg.Email.Enabled() to check for email config
before starting publishJobsQueue. Also fix Email.Enabled to handle smtp config.
This commit is contained in:
parent
0be229cdaa
commit
e65b73dc73
2 changed files with 7 additions and 10 deletions
10
app.go
10
app.go
|
@ -428,15 +428,11 @@ func Initialize(apper Apper, debug bool) (*App, error) {
|
||||||
|
|
||||||
initActivityPub(apper.App())
|
initActivityPub(apper.App())
|
||||||
|
|
||||||
if apper.App().cfg.Email.Domain != "" || apper.App().cfg.Email.MailgunPrivate != "" {
|
if apper.App().cfg.Email.Enabled() {
|
||||||
if apper.App().cfg.Email.Domain == "" {
|
|
||||||
log.Error("[FAILED] Starting publish jobs queue: no [letters]domain config value set.")
|
|
||||||
} else if apper.App().cfg.Email.MailgunPrivate == "" {
|
|
||||||
log.Error("[FAILED] Starting publish jobs queue: no [letters]mailgun_private config value set.")
|
|
||||||
} else {
|
|
||||||
log.Info("Starting publish jobs queue...")
|
log.Info("Starting publish jobs queue...")
|
||||||
go startPublishJobsQueue(apper.App())
|
go startPublishJobsQueue(apper.App())
|
||||||
}
|
} else {
|
||||||
|
log.Error("[FAILED] Starting publish jobs queue: no email provider is configured.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle local timeline, if enabled
|
// Handle local timeline, if enabled
|
||||||
|
|
|
@ -251,7 +251,8 @@ func (ac *AppCfg) LandingPath() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (lc EmailCfg) Enabled() bool {
|
func (lc EmailCfg) Enabled() bool {
|
||||||
return lc.Domain != "" && lc.MailgunPrivate != ""
|
return (lc.Domain != "" && lc.MailgunPrivate != "") ||
|
||||||
|
lc.Username != "" && lc.Password != "" && lc.Host != "" && lc.Port > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ac AppCfg) SignupPath() string {
|
func (ac AppCfg) SignupPath() string {
|
||||||
|
|
Loading…
Add table
Reference in a new issue