forked from External/ergo
fix #741
This commit is contained in:
parent
e10a5f07de
commit
05cb80507f
4 changed files with 130 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue