mirror of https://github.com/gophish/gophish
Will exit on port binding failure (#1635)
parent
3227437f52
commit
28252bcb56
|
@ -82,19 +82,18 @@ func WithContactAddress(addr string) PhishingServerOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start launches the phishing server, listening on the configured address.
|
// Start launches the phishing server, listening on the configured address.
|
||||||
func (ps *PhishingServer) Start() error {
|
func (ps *PhishingServer) Start() {
|
||||||
if ps.config.UseTLS {
|
if ps.config.UseTLS {
|
||||||
err := util.CheckAndCreateSSL(ps.config.CertPath, ps.config.KeyPath)
|
err := util.CheckAndCreateSSL(ps.config.CertPath, ps.config.KeyPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
log.Infof("Starting phishing server at https://%s", ps.config.ListenURL)
|
log.Infof("Starting phishing server at https://%s", ps.config.ListenURL)
|
||||||
return ps.server.ListenAndServeTLS(ps.config.CertPath, ps.config.KeyPath)
|
log.Fatal(ps.server.ListenAndServeTLS(ps.config.CertPath, ps.config.KeyPath))
|
||||||
}
|
}
|
||||||
// If TLS isn't configured, just listen on HTTP
|
// If TLS isn't configured, just listen on HTTP
|
||||||
log.Infof("Starting phishing server at http://%s", ps.config.ListenURL)
|
log.Infof("Starting phishing server at http://%s", ps.config.ListenURL)
|
||||||
return ps.server.ListenAndServe()
|
log.Fatal(ps.server.ListenAndServe())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown attempts to gracefully shutdown the server.
|
// Shutdown attempts to gracefully shutdown the server.
|
||||||
|
|
|
@ -65,7 +65,7 @@ func NewAdminServer(config config.AdminServer, options ...AdminServerOption) *Ad
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start launches the admin server, listening on the configured address.
|
// Start launches the admin server, listening on the configured address.
|
||||||
func (as *AdminServer) Start() error {
|
func (as *AdminServer) Start() {
|
||||||
if as.worker != nil {
|
if as.worker != nil {
|
||||||
go as.worker.Start()
|
go as.worker.Start()
|
||||||
}
|
}
|
||||||
|
@ -73,14 +73,13 @@ func (as *AdminServer) Start() error {
|
||||||
err := util.CheckAndCreateSSL(as.config.CertPath, as.config.KeyPath)
|
err := util.CheckAndCreateSSL(as.config.CertPath, as.config.KeyPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
log.Infof("Starting admin server at https://%s", as.config.ListenURL)
|
log.Infof("Starting admin server at https://%s", as.config.ListenURL)
|
||||||
return as.server.ListenAndServeTLS(as.config.CertPath, as.config.KeyPath)
|
log.Fatal(as.server.ListenAndServeTLS(as.config.CertPath, as.config.KeyPath))
|
||||||
}
|
}
|
||||||
// If TLS isn't configured, just listen on HTTP
|
// If TLS isn't configured, just listen on HTTP
|
||||||
log.Infof("Starting admin server at http://%s", as.config.ListenURL)
|
log.Infof("Starting admin server at http://%s", as.config.ListenURL)
|
||||||
return as.server.ListenAndServe()
|
log.Fatal(as.server.ListenAndServe())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown attempts to gracefully shutdown the server.
|
// Shutdown attempts to gracefully shutdown the server.
|
||||||
|
|
Loading…
Reference in New Issue