diff --git a/conf/conf_test.go b/conf/conf_test.go index 0591ed2..1c4f917 100644 --- a/conf/conf_test.go +++ b/conf/conf_test.go @@ -7,7 +7,7 @@ import ( func TestConf_LoadFromPath(t *testing.T) { c := New() - t.Log(c.LoadFromPath("../example/config.yml.example"), c.NodesConfig[0].ControllerConfig.LimitConfig.IPLimit) + t.Log(c.LoadFromPath("../example/config.yml.example"), c.NodesConfig[0].ControllerConfig.EnableXtls) } func TestConf_Watch(t *testing.T) { diff --git a/conf/node.go b/conf/node.go index 9ccf237..ab561a5 100644 --- a/conf/node.go +++ b/conf/node.go @@ -20,7 +20,7 @@ type ControllerConfig struct { EnableDNS bool `yaml:"EnableDNS"` DNSType string `yaml:"DNSType"` EnableVless bool `yaml:"EnableVless"` - EnableXtls bool `json:"EnableXtls"` + EnableXtls bool `yaml:"EnableXtls"` LimitConfig LimitConfig `yaml:"LimitConfig"` DisableUploadTraffic bool `yaml:"DisableUploadTraffic"` DisableGetRule bool `yaml:"DisableGetRule"` diff --git a/conf/old.go b/conf/old.go index 5efa33a..85f392e 100644 --- a/conf/old.go +++ b/conf/old.go @@ -48,7 +48,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) { break } // node option - if !old.NodesConfig[i].ApiConfig.EnableVless { + if old.NodesConfig[i].ApiConfig.EnableVless { n.ControllerConfig.EnableVless = true changed = true } @@ -61,7 +61,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) { n.ControllerConfig.LimitConfig.IPLimit = old.NodesConfig[i].ApiConfig.DeviceLimit changed = true } - if !old.NodesConfig[i].ControllerConfig.EnableDynamicSpeedLimit { + if old.NodesConfig[i].ControllerConfig.EnableDynamicSpeedLimit { n.ControllerConfig.LimitConfig.EnableDynamicSpeedLimit = true changed = true } @@ -70,7 +70,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) { old.NodesConfig[i].ControllerConfig.DynamicSpeedLimitConfig changed = true } - if !old.NodesConfig[i].ControllerConfig.EnableIpRecorder { + if old.NodesConfig[i].ControllerConfig.EnableIpRecorder { n.ControllerConfig.LimitConfig.EnableIpRecorder = true changed = true }