mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 09:58:14 -05:00
fix old, fix config tag
This commit is contained in:
parent
85bde00ded
commit
f034bbd39b
@ -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) {
|
||||
|
@ -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"`
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user