refactor: move server.secret warning to before server startup messsage

done as it seems to be confusing some users that the server
actually had some issues starting when in reality it did not.
This commit is contained in:
Jordan Knott
2021-02-18 08:47:02 -06:00
parent 383d90d747
commit 0cf4141418
2 changed files with 3 additions and 1 deletions

View File

@ -70,7 +70,6 @@ func newWebCmd() *cobra.Command {
}
}
log.WithFields(log.Fields{"url": viper.GetString("server.hostname")}).Info("starting server")
secret := viper.GetString("server.secret")
if strings.TrimSpace(secret) == "" {
log.Warn("server.secret is not set, generating a random secret")
@ -85,6 +84,7 @@ func newWebCmd() *cobra.Command {
Password: viper.GetString("smtp.password"),
InsecureSkipVerify: viper.GetBool("smtp.skip_verify"),
}, security)
log.WithFields(log.Fields{"url": viper.GetString("server.hostname")}).Info("starting server")
return http.ListenAndServe(viper.GetString("server.hostname"), r)
},
}