mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
make MaxLineLen configurable
This commit is contained in:
parent
297f2af827
commit
7c5a8f2013
7 changed files with 30 additions and 5 deletions
|
|
@ -590,6 +590,7 @@ type Config struct {
|
|||
OutputPath string `yaml:"output-path"`
|
||||
IPCheckScript ScriptConfig `yaml:"ip-check-script"`
|
||||
OverrideServicesHostname string `yaml:"override-services-hostname"`
|
||||
MaxLineLen int `yaml:"max-line-len"`
|
||||
}
|
||||
|
||||
Roleplay struct {
|
||||
|
|
@ -1132,6 +1133,9 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
if config.Limits.RegistrationMessages == 0 {
|
||||
config.Limits.RegistrationMessages = 1024
|
||||
}
|
||||
if config.Server.MaxLineLen < DefaultMaxLineLen {
|
||||
config.Server.MaxLineLen = DefaultMaxLineLen
|
||||
}
|
||||
if config.Datastore.MySQL.Enabled {
|
||||
if config.Limits.NickLen > mysql.MaxTargetLength || config.Limits.ChannelLen > mysql.MaxTargetLength {
|
||||
return nil, fmt.Errorf("to use MySQL, nick and channel length limits must be %d or lower", mysql.MaxTargetLength)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue