feat: machine mode, PEM-only certs, ECH support, multi-instance config, batch ops, xbctl

This commit is contained in:
xboard
2026-04-16 23:06:58 +08:00
parent 598b6b531b
commit c5bcbc3299
52 changed files with 6676 additions and 1348 deletions
+39
View File
@@ -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
}