mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
fix old, fix config tag
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
|||||||
|
|
||||||
func TestConf_LoadFromPath(t *testing.T) {
|
func TestConf_LoadFromPath(t *testing.T) {
|
||||||
c := New()
|
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) {
|
func TestConf_Watch(t *testing.T) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type ControllerConfig struct {
|
|||||||
EnableDNS bool `yaml:"EnableDNS"`
|
EnableDNS bool `yaml:"EnableDNS"`
|
||||||
DNSType string `yaml:"DNSType"`
|
DNSType string `yaml:"DNSType"`
|
||||||
EnableVless bool `yaml:"EnableVless"`
|
EnableVless bool `yaml:"EnableVless"`
|
||||||
EnableXtls bool `json:"EnableXtls"`
|
EnableXtls bool `yaml:"EnableXtls"`
|
||||||
LimitConfig LimitConfig `yaml:"LimitConfig"`
|
LimitConfig LimitConfig `yaml:"LimitConfig"`
|
||||||
DisableUploadTraffic bool `yaml:"DisableUploadTraffic"`
|
DisableUploadTraffic bool `yaml:"DisableUploadTraffic"`
|
||||||
DisableGetRule bool `yaml:"DisableGetRule"`
|
DisableGetRule bool `yaml:"DisableGetRule"`
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
// node option
|
// node option
|
||||||
if !old.NodesConfig[i].ApiConfig.EnableVless {
|
if old.NodesConfig[i].ApiConfig.EnableVless {
|
||||||
n.ControllerConfig.EnableVless = true
|
n.ControllerConfig.EnableVless = true
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) {
|
|||||||
n.ControllerConfig.LimitConfig.IPLimit = old.NodesConfig[i].ApiConfig.DeviceLimit
|
n.ControllerConfig.LimitConfig.IPLimit = old.NodesConfig[i].ApiConfig.DeviceLimit
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
if !old.NodesConfig[i].ControllerConfig.EnableDynamicSpeedLimit {
|
if old.NodesConfig[i].ControllerConfig.EnableDynamicSpeedLimit {
|
||||||
n.ControllerConfig.LimitConfig.EnableDynamicSpeedLimit = true
|
n.ControllerConfig.LimitConfig.EnableDynamicSpeedLimit = true
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,7 @@ func migrateOldConfig(c *Conf, old *OldConfig) {
|
|||||||
old.NodesConfig[i].ControllerConfig.DynamicSpeedLimitConfig
|
old.NodesConfig[i].ControllerConfig.DynamicSpeedLimitConfig
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
if !old.NodesConfig[i].ControllerConfig.EnableIpRecorder {
|
if old.NodesConfig[i].ControllerConfig.EnableIpRecorder {
|
||||||
n.ControllerConfig.LimitConfig.EnableIpRecorder = true
|
n.ControllerConfig.LimitConfig.EnableIpRecorder = true
|
||||||
changed = true
|
changed = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user