[server][mail] Initialize

This commit is contained in:
Abhishek Shroff
2025-07-08 21:55:30 +05:30
parent 58dd057436
commit b9c3de5204
5 changed files with 54 additions and 57 deletions

View File

@@ -137,9 +137,15 @@ func SetupCommand() {
steve.RegisterWorker(client, &jobs.DeleteContentsWorker{})
}
serve.Cfg = cfg.Server
mail.Cfg = cfg.Mail
core.Cfg = cfg.Core
if err := mail.Initialize(cfg.Mail); err != nil {
if errors.Is(err, mail.EmailNotConfigured) {
log.Info().Msg("mail not configured")
} else {
log.Fatal().Err(err).Msg("failed to initialize mail")
}
}
auth.Init(cfg.Auth, logger)
if err := storage.Initialize(db.Get(context.Background()), cfg.Storage); err != nil {