From 01890aa83d0216372eaf41042c9e910e4e3f1459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 11 Mar 2023 10:42:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E9=9B=86=E7=BE=A4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/serverconfigs/global_server_config.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/serverconfigs/global_server_config.go b/pkg/serverconfigs/global_server_config.go index 5f64c77..f76bef5 100644 --- a/pkg/serverconfigs/global_server_config.go +++ b/pkg/serverconfigs/global_server_config.go @@ -11,6 +11,10 @@ func DefaultGlobalServerConfig() *GlobalServerConfig { config.Log.RecordServerError = false config.Performance.AutoWriteTimeout = true config.Performance.AutoReadTimeout = true + config.Stat.Upload.MaxCities = 20 + config.Stat.Upload.MaxProviders = 20 + config.Stat.Upload.MaxSystems = 20 + config.Stat.Upload.MaxBrowsers = 20 return config } @@ -22,7 +26,7 @@ type GlobalServerConfig struct { AllowNodeIP bool `yaml:"allowNodeIP" json:"allowNodeIP"` // 允许IP直接访问 DefaultDomain string `yaml:"defaultDomain" json:"defaultDomain"` // 默认的域名 DomainMismatchAction *DomainMismatchAction `yaml:"domainMismatchAction" json:"domainMismatchAction"` // 不匹配时采取的动作 - } `yaml:"httpAll" json:"httpAll"` + } `yaml:"httpAll" json:"httpAll"` // HTTP统一配置 HTTPAccessLog struct { EnableRequestHeaders bool `yaml:"enableRequestHeaders" json:"enableRequestHeaders"` // 记录请求Header @@ -32,6 +36,15 @@ type GlobalServerConfig struct { EnableServerNotFound bool `yaml:"enableServerNotFound" json:"enableServerNotFound"` // 记录服务找不到的日志 } `yaml:"httpAccessLog" json:"httpAccessLog"` // 访问日志配置 + Stat struct { + Upload struct { + MaxCities int16 `yaml:"maxCities" json:"maxCities"` // 最大区域数量 + MaxProviders int16 `yaml:"maxProviders" json:"maxProviders"` // 最大运营商数量 + MaxSystems int16 `yaml:"maxSystems" json:"maxSystems"` // 最大操作系统数量 + MaxBrowsers int16 `yaml:"maxBrowsers" json:"maxBrowsers"` // 最大浏览器数量 + } `yaml:"upload" json:"upload"` // 上传相关设置 + } `yaml:"stat" json:"stat"` // 统计相关配置 + Performance struct { Debug bool `yaml:"debug" json:"debug"` // Debug模式 AutoWriteTimeout bool `yaml:"autoWriteTimeout" json:"autoWriteTimeout"` // 是否自动写超时