b8788c239e
MCP Docker / build-and-push (push) Has been cancelled
- Remove telemetry: disabled all phone-home (installation notify, false positives, behavior tracking, upgrade tips) - Version branding: removed 'ce-' prefix, product name changed to '长亭雷池 WAF' - Detection engine enhancement: strict preset enables all 17 modules with aggressive configs - Multi-user RBAC: admin/operator/viewer roles with password + TOTP 2FA - Rate limiting: nginx limit_req per website (RPS, burst, action) - JS Challenge: browser fingerprint verification page with cookie-based bypass - Security fixes: removed InsecureSkipVerify, hardcoded credentials, NO_AUTH backdoor
57 lines
945 B
Go
57 lines
945 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
|
|
"chaitin.cn/dev/go/settings"
|
|
)
|
|
|
|
var (
|
|
GlobalConfig = DefaultGlobalConfig()
|
|
)
|
|
|
|
func InitConfigs(configFilePath string) error {
|
|
s, err := settings.New(configFilePath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.DB.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.Log.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.Server.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.Detector.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.Telemetry.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err = GlobalConfig.GPRC.Load(s); err != nil {
|
|
return err
|
|
}
|
|
|
|
if err := settings.Unmarshal("platform_addr", &GlobalConfig.PlatformAddr); err != nil {
|
|
return err
|
|
}
|
|
|
|
if v, ok := os.LookupEnv("MANAGEMENT_RESOURCES_DIR"); ok {
|
|
GlobalConfig.MgtResDir = v
|
|
}
|
|
|
|
if v, ok := os.LookupEnv("NGINX_RESOURCES_DIR"); ok {
|
|
GlobalConfig.NgxResDir = v
|
|
}
|
|
|
|
return nil
|
|
}
|