mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-13 10:26:06 +00:00
Capitalize the first letter of all log messages throughout the codebase to improve readability and consistency in logging output. Key improvements: - All log messages now start with capital letters - Consistent formatting across all logging statements - Improved readability for debugging and monitoring - Enhanced user experience with better formatted messages Files updated: - CLI commands and service management - Internal client information discovery - Network operations and configuration - DNS resolver and proxy operations - Platform-specific implementations This completes the final phase of the logging improvement project, ensuring all log messages follow consistent capitalization standards for better readability and professional appearance.
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package cli
|
|
|
|
import (
|
|
"fmt"
|
|
"syscall"
|
|
|
|
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
|
|
"tailscale.com/util/dnsname"
|
|
)
|
|
|
|
// searchDomains returns the current search domains config.
|
|
func searchDomains() ([]dnsname.FQDN, error) {
|
|
flags := winipcfg.GAAFlagIncludeGateways |
|
|
winipcfg.GAAFlagIncludePrefix
|
|
|
|
aas, err := winipcfg.GetAdaptersAddresses(syscall.AF_UNSPEC, flags)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("winipcfg.GetAdaptersAddresses: %w", err)
|
|
}
|
|
|
|
var sds []dnsname.FQDN
|
|
for _, aa := range aas {
|
|
if aa.OperStatus != winipcfg.IfOperStatusUp {
|
|
continue
|
|
}
|
|
|
|
// Skip if software loopback or other non-physical types
|
|
// This is to avoid the "Loopback Pseudo-Interface 1" issue we see on windows
|
|
if aa.IfType == winipcfg.IfTypeSoftwareLoopback {
|
|
continue
|
|
}
|
|
|
|
for a := aa.FirstDNSSuffix; a != nil; a = a.Next {
|
|
d, err := dnsname.ToFQDN(a.String())
|
|
if err != nil {
|
|
mainLog.Load().Debug().Err(err).Msgf("Failed to parse domain: %s", a.String())
|
|
continue
|
|
}
|
|
sds = append(sds, d)
|
|
}
|
|
}
|
|
return sds, nil
|
|
}
|