1
0
Fork 0
forked from External/ergo

Require that server names must be hostnames, and nicks cannot be hostnames

This commit is contained in:
Daniel Oaks 2016-04-21 10:48:15 +10:00
parent 9ac09a7027
commit 77bf7173ff
3 changed files with 32 additions and 0 deletions

View file

@ -110,6 +110,9 @@ func LoadConfig(filename string) (config *Config, err error) {
if config.Server.Name == "" {
return nil, errors.New("Server name missing")
}
if !IsHostname(config.Server.Name) {
return nil, errors.New("Server name must match the format of a hostname")
}
if config.Server.Database == "" {
return nil, errors.New("Server database missing")
}