|
@@ -15,6 +15,7 @@ import (
|
15
|
15
|
"time"
|
16
|
16
|
|
17
|
17
|
"code.cloudfoundry.org/bytefmt"
|
|
18
|
+ "github.com/oragono/oragono/irc/connection_limiting"
|
18
|
19
|
"github.com/oragono/oragono/irc/custime"
|
19
|
20
|
"github.com/oragono/oragono/irc/logger"
|
20
|
21
|
"github.com/oragono/oragono/irc/passwd"
|
|
@@ -108,29 +109,6 @@ func (conf *OperConfig) PasswordBytes() []byte {
|
108
|
109
|
return bytes
|
109
|
110
|
}
|
110
|
111
|
|
111
|
|
-// ConnectionLimitsConfig controls the automated connection limits.
|
112
|
|
-type ConnectionLimitsConfig struct {
|
113
|
|
- Enabled bool
|
114
|
|
- CidrLenIPv4 int `yaml:"cidr-len-ipv4"`
|
115
|
|
- CidrLenIPv6 int `yaml:"cidr-len-ipv6"`
|
116
|
|
- IPsPerCidr int `yaml:"ips-per-subnet"`
|
117
|
|
- Exempted []string
|
118
|
|
-}
|
119
|
|
-
|
120
|
|
-// ConnectionThrottleConfig controls the automated connection throttling.
|
121
|
|
-type ConnectionThrottleConfig struct {
|
122
|
|
- Enabled bool
|
123
|
|
- CidrLenIPv4 int `yaml:"cidr-len-ipv4"`
|
124
|
|
- CidrLenIPv6 int `yaml:"cidr-len-ipv6"`
|
125
|
|
- ConnectionsPerCidr int `yaml:"max-connections"`
|
126
|
|
- DurationString string `yaml:"duration"`
|
127
|
|
- Duration time.Duration `yaml:"duration-time"`
|
128
|
|
- BanDurationString string `yaml:"ban-duration"`
|
129
|
|
- BanDuration time.Duration
|
130
|
|
- BanMessage string `yaml:"ban-message"`
|
131
|
|
- Exempted []string
|
132
|
|
-}
|
133
|
|
-
|
134
|
112
|
// LineLenConfig controls line lengths.
|
135
|
113
|
type LineLenConfig struct {
|
136
|
114
|
Tags int
|
|
@@ -184,8 +162,8 @@ type Config struct {
|
184
|
162
|
ProxyAllowedFrom []string `yaml:"proxy-allowed-from"`
|
185
|
163
|
MaxSendQString string `yaml:"max-sendq"`
|
186
|
164
|
MaxSendQBytes uint64
|
187
|
|
- ConnectionLimits ConnectionLimitsConfig `yaml:"connection-limits"`
|
188
|
|
- ConnectionThrottle ConnectionThrottleConfig `yaml:"connection-throttling"`
|
|
165
|
+ ConnectionLimits connection_limiting.ConnectionLimitsConfig `yaml:"connection-limits"`
|
|
166
|
+ ConnectionThrottle connection_limiting.ConnectionThrottleConfig `yaml:"connection-throttling"`
|
189
|
167
|
}
|
190
|
168
|
|
191
|
169
|
Datastore struct {
|