forked from External/ergo
commit
ea970f94a0
6 changed files with 41 additions and 29 deletions
|
|
@ -883,6 +883,15 @@ func (server *Server) loadDatastore(config *Config) error {
|
|||
// open the datastore and load server state for which it (rather than config)
|
||||
// is the source of truth
|
||||
|
||||
_, err := os.Stat(config.Datastore.Path)
|
||||
if os.IsNotExist(err) {
|
||||
server.logger.Warning("rehash", "database does not exist, creating it", config.Datastore.Path)
|
||||
err = initializeDB(config.Datastore.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
db, err := OpenDatabase(config)
|
||||
if err == nil {
|
||||
server.store = db
|
||||
|
|
@ -891,7 +900,7 @@ func (server *Server) loadDatastore(config *Config) error {
|
|||
}
|
||||
|
||||
// load *lines (from the datastores)
|
||||
server.logger.Debug("startup", "Loading D/Klines")
|
||||
server.logger.Debug("rehash", "Loading D/Klines")
|
||||
server.loadDLines()
|
||||
server.loadKLines()
|
||||
|
||||
|
|
@ -963,7 +972,7 @@ func (server *Server) setupListeners(config *Config) (err error) {
|
|||
}
|
||||
|
||||
if len(tlsListeners) == 0 {
|
||||
server.logger.Warning("startup", "You are not exposing an SSL/TLS listening port. You should expose at least one port (typically 6697) to accept TLS connections")
|
||||
server.logger.Warning("rehash", "You are not exposing an SSL/TLS listening port. You should expose at least one port (typically 6697) to accept TLS connections")
|
||||
}
|
||||
|
||||
var usesStandardTLSPort bool
|
||||
|
|
@ -974,7 +983,7 @@ func (server *Server) setupListeners(config *Config) (err error) {
|
|||
}
|
||||
}
|
||||
if 0 < len(tlsListeners) && !usesStandardTLSPort {
|
||||
server.logger.Warning("startup", "Port 6697 is the standard TLS port for IRC. You should (also) expose port 6697 as a TLS port to ensure clients can connect securely")
|
||||
server.logger.Warning("rehash", "Port 6697 is the standard TLS port for IRC. You should (also) expose port 6697 as a TLS port to ensure clients can connect securely")
|
||||
}
|
||||
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue