forked from mirror/serenity
Minor fixes
This commit is contained in:
parent
adab7ec47e
commit
383aede207
@ -30,5 +30,15 @@ func filterNullGroupReference(metadata M.Metadata, options *option.Options) erro
|
|||||||
}
|
}
|
||||||
options.Outbounds[i] = outbound
|
options.Outbounds[i] = outbound
|
||||||
}
|
}
|
||||||
|
options.Route.Rules = common.Filter(options.Route.Rules, func(it option.Rule) bool {
|
||||||
|
switch it.Type {
|
||||||
|
case C.RuleTypeDefault:
|
||||||
|
return common.Contains(outboundTags, it.DefaultOptions.Outbound)
|
||||||
|
case C.RuleTypeLogical:
|
||||||
|
return common.Contains(outboundTags, it.LogicalOptions.Outbound)
|
||||||
|
default:
|
||||||
|
panic("no")
|
||||||
|
}
|
||||||
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
@ -41,7 +41,7 @@ func extendTemplate(rawTemplates []option.Template, root, current option.Templat
|
|||||||
}
|
}
|
||||||
next = newNext
|
next = newNext
|
||||||
}
|
}
|
||||||
newRawTemplate, err := badjson.MergeJSON(next.RawMessage, current.RawMessage, true)
|
newRawTemplate, err := badjson.MergeJSON(next.RawMessage, current.RawMessage, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return option.Template{}, E.Cause(err, "initialize template[", current.Name, "]: merge extended template: ", current.Extend)
|
return option.Template{}, E.Cause(err, "initialize template[", current.Name, "]: merge extended template: ", current.Extend)
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if !t.DisableDNSLeak && (metadata.Version != nil && metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.1"))) {
|
if !t.DisableDNSLeak && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.1"))) {
|
||||||
options.DNS.Rules = append(options.DNS.Rules, option.DNSRule{
|
options.DNS.Rules = append(options.DNS.Rules, option.DNSRule{
|
||||||
Type: C.RuleTypeDefault,
|
Type: C.RuleTypeDefault,
|
||||||
DefaultOptions: option.DefaultDNSRule{
|
DefaultOptions: option.DefaultDNSRule{
|
||||||
|
@ -30,7 +30,7 @@ func (t *Template) renderExperimental(metadata M.Metadata, options *option.Optio
|
|||||||
CacheID: profileName,
|
CacheID: profileName,
|
||||||
StoreFakeIP: t.EnableFakeIP,
|
StoreFakeIP: t.EnableFakeIP,
|
||||||
}
|
}
|
||||||
if !t.DisableDNSLeak && (metadata.Version != nil && metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.8"))) {
|
if !t.DisableDNSLeak && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.1"))) {
|
||||||
options.Experimental.CacheFile.StoreRDRC = true
|
options.Experimental.CacheFile.StoreRDRC = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ func (t *Template) renderExperimental(metadata M.Metadata, options *option.Optio
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !t.DisableClashMode {
|
if !t.DisableClashMode {
|
||||||
if !t.DisableDNSLeak && (metadata.Version != nil && metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.1"))) {
|
if !t.DisableDNSLeak && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.9.0-alpha.1"))) {
|
||||||
clashModeLeak := t.ClashModeLeak
|
clashModeLeak := t.ClashModeLeak
|
||||||
if clashModeLeak == "" {
|
if clashModeLeak == "" {
|
||||||
clashModeLeak = "Leak"
|
clashModeLeak = "Leak"
|
||||||
|
Loading…
Reference in New Issue
Block a user