mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
parent
0af0a0b445
commit
4e13f72ca9
3 changed files with 29 additions and 10 deletions
|
|
@ -214,16 +214,17 @@ type LineLenLimits struct {
|
|||
|
||||
// Various server-enforced limits on data size.
|
||||
type Limits struct {
|
||||
AwayLen int `yaml:"awaylen"`
|
||||
ChanListModes int `yaml:"chan-list-modes"`
|
||||
ChannelLen int `yaml:"channellen"`
|
||||
IdentLen int `yaml:"identlen"`
|
||||
KickLen int `yaml:"kicklen"`
|
||||
LineLen LineLenLimits `yaml:"linelen"`
|
||||
MonitorEntries int `yaml:"monitor-entries"`
|
||||
NickLen int `yaml:"nicklen"`
|
||||
TopicLen int `yaml:"topiclen"`
|
||||
WhowasEntries int `yaml:"whowas-entries"`
|
||||
AwayLen int `yaml:"awaylen"`
|
||||
ChanListModes int `yaml:"chan-list-modes"`
|
||||
ChannelLen int `yaml:"channellen"`
|
||||
IdentLen int `yaml:"identlen"`
|
||||
KickLen int `yaml:"kicklen"`
|
||||
LineLen LineLenLimits `yaml:"linelen"`
|
||||
MonitorEntries int `yaml:"monitor-entries"`
|
||||
NickLen int `yaml:"nicklen"`
|
||||
TopicLen int `yaml:"topiclen"`
|
||||
WhowasEntries int `yaml:"whowas-entries"`
|
||||
RegistrationMessages int `yaml:"registration-messages"`
|
||||
}
|
||||
|
||||
// STSConfig controls the STS configuration/
|
||||
|
|
@ -532,6 +533,9 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
if config.Limits.NickLen < 1 || config.Limits.ChannelLen < 2 || config.Limits.AwayLen < 1 || config.Limits.KickLen < 1 || config.Limits.TopicLen < 1 {
|
||||
return nil, ErrLimitsAreInsane
|
||||
}
|
||||
if config.Limits.RegistrationMessages == 0 {
|
||||
config.Limits.RegistrationMessages = 1024
|
||||
}
|
||||
if config.Server.STS.Enabled {
|
||||
config.Server.STS.Duration, err = custime.ParseDuration(config.Server.STS.DurationString)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue