feat: machine mode, PEM-only certs, ECH support, multi-instance config, batch ops, xbctl
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package kernel
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/cedar2025/xboard-node/internal/model"
|
||||
)
|
||||
|
||||
func NeedsGeoIPRules(rules []model.CustomRouteRule) bool {
|
||||
for _, r := range rules {
|
||||
for _, v := range r.Match.IPCIDRs {
|
||||
if strings.HasPrefix(v, "geoip:") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, v := range r.Match.SourceCIDRs {
|
||||
if strings.HasPrefix(v, "geoip:") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func NeedsGeoSiteRules(rules []model.CustomRouteRule) bool {
|
||||
for _, r := range rules {
|
||||
for _, v := range r.Match.Domains {
|
||||
if strings.HasPrefix(v, "geosite:") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for _, v := range r.Match.DomainSuffixes {
|
||||
if strings.HasPrefix(v, "geosite:") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user