Warn about non-FQDN hostnames

References: https://github.com/ircdocs/modern-irc/pull/148
This commit is contained in:
Simon Ser 2022-03-15 20:45:23 +01:00
parent c7039da54b
commit 8b926be817

View File

@ -71,6 +71,11 @@ func loadConfig() (*config.Server, *soju.Config, error) {
raw = config.Defaults() raw = config.Defaults()
} }
// A hostname without a dot can confuse clients
if !strings.Contains(raw.Hostname, ".") {
log.Printf("warning: hostname %q is not a fully qualified domain name", raw.Hostname)
}
var motd string var motd string
if raw.MOTDPath != "" { if raw.MOTDPath != "" {
b, err := ioutil.ReadFile(raw.MOTDPath) b, err := ioutil.ReadFile(raw.MOTDPath)