Documentation
¶
Index ¶
Constants ¶
const DeviceNameCtxKey = "deviceName"
DeviceNameCtxKey context key for device name
const OsNameCtxKey = "OsName"
OsNameCtxKey context key for operating system name
const OsVersionCtxKey = "OsVersion"
OsVersionCtxKey context key for operating system version
const UiVersionCtxKey = "user-agent"
UiVersionCtxKey context key for user UI version
Variables ¶
This section is empty.
Functions ¶
func UpdateStaticInfoAsync ¶ added in v0.56.1
func UpdateStaticInfoAsync()
Types ¶
type Environment ¶ added in v0.26.0
type Info ¶
type Info struct {
GoOS string
Kernel string
Platform string
OS string
OSVersion string
Hostname string
CPUs int
NetbirdVersion string
UIVersion string
KernelVersion string
NetworkAddresses []NetworkAddress
SystemSerialNumber string
SystemProductName string
SystemManufacturer string
Environment Environment
Files []File // for posture checks
RosenpassEnabled bool
RosenpassPermissive bool
ServerSSHAllowed bool
DisableClientRoutes bool
DisableServerRoutes bool
DisableDNS bool
DisableFirewall bool
BlockLANAccess bool
BlockInbound bool
DisableIPv6 bool
EnableSSHRoot bool
EnableSSHSFTP bool
EnableSSHLocalPortForwarding bool
EnableSSHRemotePortForwarding bool
DisableSSHAuth bool
}
Info is an object that contains machine information Most of the code is taken from https://github.com/matishsiao/goInfo
func GetInfoWithChecks ¶ added in v0.28.0
func GetInfoWithChecks(ctx context.Context, checks []*proto.Checks, excludeIPs ...netip.Addr) (*Info, error)
GetInfoWithChecks retrieves and parses the system information with applied checks. excludeIPs are dropped from the reported network addresses (e.g. our own WireGuard overlay address, which otherwise churns the peer meta).
func GetInfoWithChecksTimeout ¶ added in v0.74.0
func GetInfoWithChecksTimeout(ctx context.Context, timeout time.Duration, checks []*proto.Checks, excludeIPs ...netip.Addr) (*Info, bool)
GetInfoWithChecksTimeout is GetInfoWithChecks bounded by timeout. Posture-check gathering runs uncancellable system calls (process enumeration, os.Stat), so calling it inline can block the caller for as long as such a call hangs. It runs in a goroutine instead: if it does not return within timeout the caller gets (nil, false) and should proceed with degraded behavior rather than block. On a gathering error it falls back to base GetInfo.
The buffered channel lets the abandoned goroutine finish and exit once its blocking call returns, so it does not leak beyond the duration of that call.
func (*Info) SetFlags ¶ added in v0.36.0
func (i *Info) SetFlags( rosenpassEnabled, rosenpassPermissive bool, serverSSHAllowed *bool, disableClientRoutes, disableServerRoutes, disableDNS, disableFirewall, blockLANAccess, blockInbound, disableIPv6 bool, enableSSHRoot, enableSSHSFTP, enableSSHLocalPortForwarding, enableSSHRemotePortForwarding *bool, disableSSHAuth *bool, )
type NetworkAddress ¶ added in v0.26.0
type StaticInfo ¶ added in v0.34.0
type StaticInfo struct {
SystemSerialNumber string
SystemProductName string
SystemManufacturer string
Environment Environment
// Windows specific fields
OSName string
OSVersion string
BuildVersion string
}
StaticInfo is an object that contains machine information that does not change