forked from External/ergo
Merge pull request #744 from slingamn/hostserv_offer.1
add support for offering vhosts
This commit is contained in:
commit
b329cf430e
4 changed files with 180 additions and 21 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue