1
0
Fork 0
forked from External/ergo

Merge pull request #744 from slingamn/hostserv_offer.1

add support for offering vhosts
This commit is contained in:
Shivaram Lingamneni 2020-01-28 19:36:17 -08:00 committed by GitHub
commit b329cf430e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 180 additions and 21 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
@ -796,6 +797,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
}