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_geoip": {},
|
||||||
"custom_geosite": {},
|
"custom_geosite": {},
|
||||||
"custom_rule_set": [],
|
"custom_rule_set": [],
|
||||||
|
"post_custom_rule_set": [],
|
||||||
|
|
||||||
// Experimental
|
// 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.
|
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
|
#### disable_cache_file
|
||||||
|
|
||||||
Don't generate `cache_file` related options.
|
Don't generate `cache_file` related options.
|
||||||
|
@ -50,6 +50,7 @@ type Template struct {
|
|||||||
CustomGeoIP *option.GeoIPOptions `json:"custom_geoip,omitempty"`
|
CustomGeoIP *option.GeoIPOptions `json:"custom_geoip,omitempty"`
|
||||||
CustomGeosite *option.GeositeOptions `json:"custom_geosite,omitempty"`
|
CustomGeosite *option.GeositeOptions `json:"custom_geosite,omitempty"`
|
||||||
CustomRuleSet []option.RuleSet `json:"custom_rule_set,omitempty"`
|
CustomRuleSet []option.RuleSet `json:"custom_rule_set,omitempty"`
|
||||||
|
PostCustomRuleSet []option.RuleSet `json:"post_custom_rule_set,omitempty"`
|
||||||
|
|
||||||
// Experimental
|
// Experimental
|
||||||
DisableCacheFile bool `json:"disable_cache_file,omitempty"`
|
DisableCacheFile bool `json:"disable_cache_file,omitempty"`
|
||||||
|
@ -38,7 +38,8 @@ func (t *Template) renderGeoResources(metadata M.Metadata, options *option.Optio
|
|||||||
DownloadDetour: downloadDetour,
|
DownloadDetour: downloadDetour,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if len(t.CustomRuleSet) == 0 {
|
} else {
|
||||||
|
if len(t.CustomRuleSet) == 0 {
|
||||||
var (
|
var (
|
||||||
downloadURL string
|
downloadURL string
|
||||||
downloadDetour 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