Documentation
¶
Overview ¶
Package hostinfo answers questions about the host environment that Tailscale is running on.
Index ¶
- Constants
- func DisabledEtcAptSource() bool
- func FirewallMode() string
- func GetOSVersion() string
- func Hostname() (string, error)
- func IsInVM86() bool
- func IsNATLabGuestVM() bool
- func IsSELinuxEnforcing() bool
- func New() *tailcfg.Hostinfo
- func RegisterHostinfoNewHook(f func(*tailcfg.Hostinfo))
- func SetApp(v string)
- func SetDeviceModel(model string)
- func SetFirewallMode(v string)
- func SetHostnameFn(fn hostnameQuery)
- func SetOSVersion(v string)
- func SetPackage(v string)
- type EnvType
Constants ¶
const ( KNative = EnvType("kn") AWSLambda = EnvType("lm") Heroku = EnvType("hr") AzureAppService = EnvType("az") AWSFargate = EnvType("fg") FlyDotIo = EnvType("fly") Kubernetes = EnvType("k8s") DockerDesktop = EnvType("dde") Replit = EnvType("repl") HomeAssistantAddOn = EnvType("haao") )
Variables ¶
This section is empty.
Functions ¶
func DisabledEtcAptSource ¶ added in v1.18.0
func DisabledEtcAptSource() bool
DisabledEtcAptSource reports whether Ubuntu (or similar) has disabled the /etc/apt/sources.list.d/tailscale.list file contents upon upgrade to a new release of the distro.
func FirewallMode ¶ added in v1.48.0
func FirewallMode() string
FirewallMode returns the firewall mode for the app. It is empty if unset.
func GetOSVersion ¶ added in v1.16.1
func GetOSVersion() string
GetOSVersion returns the OSVersion of current host if available.
func Hostname ¶ added in v1.84.0
Hostname returns the system hostname using the function set by SetHostNameFn. We will fallback to os.Hostname.
func IsInVM86 ¶ added in v1.84.0
func IsInVM86() bool
IsInVM86 reports whether we're running in the copy/v86 wasm emulator, https://github.com/copy/v86/.
func IsNATLabGuestVM ¶ added in v1.72.0
func IsNATLabGuestVM() bool
IsNATLabGuestVM reports whether the current host is a NAT Lab guest VM.
func IsSELinuxEnforcing ¶ added in v1.44.0
func IsSELinuxEnforcing() bool
IsSELinuxEnforcing reports whether SELinux is in "Enforcing" mode.
func RegisterHostinfoNewHook ¶ added in v1.80.0
RegisterHostinfoNewHook registers a callback to be called on a non-nil tailcfg.Hostinfo before it is returned by New.
func SetApp ¶ added in v1.38.0
func SetApp(v string)
SetApp sets the app type for the app. It is used by tsnet to specify what app is using it such as "golinks" and "k8s-operator".
func SetDeviceModel ¶ added in v1.14.0
func SetDeviceModel(model string)
SetDeviceModel sets the device model for use in Hostinfo updates.
func SetFirewallMode ¶ added in v1.48.0
func SetFirewallMode(v string)
SetFirewallMode sets the firewall mode for the app.
func SetHostnameFn ¶ added in v1.84.0
func SetHostnameFn(fn hostnameQuery)
SetHostNameFn sets a custom function for querying the system hostname.
func SetPackage ¶ added in v1.16.0
func SetPackage(v string)
SetPackage sets the packaging type for the app.
For Android, the possible values are: - "googleplay": installed from Google Play Store. - "fdroid": installed from the F-Droid repository. - "amazon": installed from the Amazon Appstore. - "unknown": when the installer package name is null. - "unknown$installerPackageName": for unrecognized installer package names, prefixed by "unknown". Additionally, tsnet sets this value to "tsnet".