forked from mirror/serenity
Add template.post_custom_rule_set
This commit is contained in:
parent
ef68e70c06
commit
45d6d8e99b
@ -55,6 +55,7 @@
|
||||
"custom_geoip": {},
|
||||
"custom_geosite": {},
|
||||
"custom_rule_set": [],
|
||||
"post_custom_rule_set": [],
|
||||
|
||||
// Experimental
|
||||
|
||||
@ -242,6 +243,12 @@ List of [RuleSet](https://sing-box.sagernet.org/configuration/rule-set/).
|
||||
|
||||
Default rule sets will not be generated if not empty.
|
||||
|
||||
#### post_custom_rule_set
|
||||
|
||||
List of [RuleSet](https://sing-box.sagernet.org/configuration/rule-set/).
|
||||
|
||||
Will be applied after default rule sets.
|
||||
|
||||
#### disable_cache_file
|
||||
|
||||
Don't generate `cache_file` related options.
|
||||
|
@ -50,6 +50,7 @@ type Template struct {
|
||||
CustomGeoIP *option.GeoIPOptions `json:"custom_geoip,omitempty"`
|
||||
CustomGeosite *option.GeositeOptions `json:"custom_geosite,omitempty"`
|
||||
CustomRuleSet []option.RuleSet `json:"custom_rule_set,omitempty"`
|
||||
PostCustomRuleSet []option.RuleSet `json:"post_custom_rule_set,omitempty"`
|
||||
|
||||
// Experimental
|
||||
DisableCacheFile bool `json:"disable_cache_file,omitempty"`
|
||||
|
@ -38,7 +38,8 @@ func (t *Template) renderGeoResources(metadata M.Metadata, options *option.Optio
|
||||
DownloadDetour: downloadDetour,
|
||||
}
|
||||
}
|
||||
} else if len(t.CustomRuleSet) == 0 {
|
||||
} else {
|
||||
if len(t.CustomRuleSet) == 0 {
|
||||
var (
|
||||
downloadURL string
|
||||
downloadDetour string
|
||||
@ -86,4 +87,6 @@ func (t *Template) renderGeoResources(metadata M.Metadata, options *option.Optio
|
||||
},
|
||||
}
|
||||
}
|
||||
options.Route.RuleSet = append(options.Route.RuleSet, t.PostCustomRuleSet...)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user