This commit is contained in:
Shivaram Lingamneni 2020-01-11 22:43:40 -05:00
parent e10a5f07de
commit 05cb80507f
4 changed files with 130 additions and 1 deletions

View file

@ -117,6 +117,7 @@ type VHostConfig struct {
Channel string
Cooldown time.Duration
} `yaml:"user-requests"`
OfferList []string `yaml:"offer-list"`
}
type NickEnforcementMethod int
@ -810,6 +811,12 @@ func LoadConfig(filename string) (config *Config, err error) {
config.Accounts.VHosts.ValidRegexp = defaultValidVhostRegex
}
for _, vhost := range config.Accounts.VHosts.OfferList {
if !config.Accounts.VHosts.ValidRegexp.MatchString(vhost) {
return nil, fmt.Errorf("invalid offered vhost: %s", vhost)
}
}
if !config.Accounts.LoginThrottling.Enabled {
config.Accounts.LoginThrottling.MaxAttempts = 0 // limit of 0 means disabled
}