mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
changes to OPER command
* Impose a throttle on OPER attempts regardless of whether they caused a password check. * Never disconnect the client on a failed attempt, even if there was a password check. * Change error numeric to ERR_NOOPERHOST * Explicit information about the failure in the server log (copying Insp) Fixes #2296.
This commit is contained in:
parent
efc1627d23
commit
6fdac13ad4
6 changed files with 43 additions and 8 deletions
|
|
@ -599,6 +599,7 @@ type Config struct {
|
|||
Cloaks cloaks.CloakConfig `yaml:"ip-cloaking"`
|
||||
SecureNetDefs []string `yaml:"secure-nets"`
|
||||
secureNets []net.IPNet
|
||||
OperThrottle time.Duration `yaml:"oper-throttle"`
|
||||
supportedCaps *caps.Set
|
||||
supportedCapsWithoutSTS *caps.Set
|
||||
capValues caps.Values
|
||||
|
|
@ -1480,6 +1481,10 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
config.Server.supportedCaps.Disable(caps.SASL)
|
||||
}
|
||||
|
||||
if config.Server.OperThrottle <= 0 {
|
||||
config.Server.OperThrottle = 10 * time.Second
|
||||
}
|
||||
|
||||
if err := config.Accounts.OAuth2.Postprocess(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue