feat: traefik-selectel-dns — A-записи Selectel по роутам Traefik + CI сборка образа
Build / Tests (push) Successful in 13s
Build / Build image (push) Failing after 15s
Build / Notify on failure (push) Failing after 0s

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 21:50:07 +07:00
co-authored by Claude Sonnet 5
commit 273cd54415
35 changed files with 3722 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package hostparse
import "strings"
// MatchZone возвращает наиболее специфичную зону из zones, которой принадлежит host
// (host равен зоне или является её поддоменом). Зоны и host ожидаются нормализованными.
func MatchZone(host string, zones []string) (string, bool) {
best := ""
for _, z := range zones {
if host == z || strings.HasSuffix(host, "."+z) {
if len(z) > len(best) {
best = z
}
}
}
return best, best != ""
}