platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,52 @@
package app
import (
"fmt"
"sort"
"strings"
)
func logWildcardSmartDNSTrace(mode DNSMode, source string, pairs [][2]string, wildcardIPCount int) {
lowMode := strings.ToLower(strings.TrimSpace(string(mode.Mode)))
if lowMode != string(DNSModeHybridWildcard) && lowMode != string(DNSModeSmartDNS) {
return
}
hostMap := wildcardHostIPMap(pairs)
hosts := make([]string, 0, len(hostMap))
for host := range hostMap {
hosts = append(hosts, host)
}
sort.Strings(hosts)
const maxHostsLog = 200
omitted := 0
if len(hosts) > maxHostsLog {
omitted = len(hosts) - maxHostsLog
}
appendTraceLineTo(
smartdnsLogPath,
"smartdns",
fmt.Sprintf(
"wildcard sync: mode=%s source=%s domains=%d ips=%d logged=%d omitted=%d map=%s",
mode.Mode, source, len(hosts), wildcardIPCount, len(hosts)-omitted, omitted, lastIPsMapDyn,
),
)
for i, host := range hosts {
if i >= maxHostsLog {
appendTraceLineTo(
smartdnsLogPath,
"smartdns",
fmt.Sprintf("wildcard sync: trace truncated, %d domains not shown (see %s)", omitted, lastIPsMapDyn),
)
return
}
appendTraceLineTo(
smartdnsLogPath,
"smartdns",
fmt.Sprintf("wildcard add: %s -> %s", host, strings.Join(hostMap[host], ", ")),
)
}
}