mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
fix config compatibility with old inbound/inboundDetors/out
This commit is contained in:
parent
2bd5f2fe96
commit
0fd0c374c1
@ -360,6 +360,21 @@ func (c *Config) Override(o *Config, fn string) {
|
|||||||
c.Reverse = o.Reverse
|
c.Reverse = o.Reverse
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deprecated attrs... keep them for now
|
||||||
|
if o.InboundConfig != nil {
|
||||||
|
c.InboundConfig = o.InboundConfig
|
||||||
|
}
|
||||||
|
if o.OutboundConfig != nil {
|
||||||
|
c.OutboundConfig = o.OutboundConfig
|
||||||
|
}
|
||||||
|
if o.InboundDetours != nil {
|
||||||
|
c.InboundDetours = o.InboundDetours
|
||||||
|
}
|
||||||
|
if o.OutboundDetours != nil {
|
||||||
|
c.OutboundDetours = o.OutboundDetours
|
||||||
|
}
|
||||||
|
// deprecated attrs
|
||||||
|
|
||||||
// update the Inbound in slice if the only one in overide config has same tag
|
// update the Inbound in slice if the only one in overide config has same tag
|
||||||
if len(o.InboundConfigs) > 0 {
|
if len(o.InboundConfigs) > 0 {
|
||||||
if len(c.InboundConfigs) > 0 && len(o.InboundConfigs) == 1 {
|
if len(c.InboundConfigs) > 0 && len(o.InboundConfigs) == 1 {
|
||||||
|
@ -74,9 +74,6 @@ func getConfigFilePath() (cmdarg.Arg, error) {
|
|||||||
if envConfDir := platform.GetConfDirPath(); dirExists(envConfDir) {
|
if envConfDir := platform.GetConfDirPath(); dirExists(envConfDir) {
|
||||||
log.Println("Using confdir from env:", envConfDir)
|
log.Println("Using confdir from env:", envConfDir)
|
||||||
readConfDir(envConfDir)
|
readConfDir(envConfDir)
|
||||||
if len(configFiles) > 0 {
|
|
||||||
return configFiles, nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user