mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-20 11:58:39 +00:00
hostinfo: add Home Assistant Add-On detection (#8857)
Fixes #8856 Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
This commit is contained in:
parent
de8e55fda6
commit
cc3caa4b2a
@ -141,15 +141,16 @@ func packageTypeCached() string {
|
|||||||
type EnvType string
|
type EnvType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
KNative = EnvType("kn")
|
KNative = EnvType("kn")
|
||||||
AWSLambda = EnvType("lm")
|
AWSLambda = EnvType("lm")
|
||||||
Heroku = EnvType("hr")
|
Heroku = EnvType("hr")
|
||||||
AzureAppService = EnvType("az")
|
AzureAppService = EnvType("az")
|
||||||
AWSFargate = EnvType("fg")
|
AWSFargate = EnvType("fg")
|
||||||
FlyDotIo = EnvType("fly")
|
FlyDotIo = EnvType("fly")
|
||||||
Kubernetes = EnvType("k8s")
|
Kubernetes = EnvType("k8s")
|
||||||
DockerDesktop = EnvType("dde")
|
DockerDesktop = EnvType("dde")
|
||||||
Replit = EnvType("repl")
|
Replit = EnvType("repl")
|
||||||
|
HomeAssistantAddOn = EnvType("haao")
|
||||||
)
|
)
|
||||||
|
|
||||||
var envType atomic.Value // of EnvType
|
var envType atomic.Value // of EnvType
|
||||||
@ -255,6 +256,9 @@ func getEnvType() EnvType {
|
|||||||
if inReplit() {
|
if inReplit() {
|
||||||
return Replit
|
return Replit
|
||||||
}
|
}
|
||||||
|
if inHomeAssistantAddOn() {
|
||||||
|
return HomeAssistantAddOn
|
||||||
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,6 +368,13 @@ func inDockerDesktop() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func inHomeAssistantAddOn() bool {
|
||||||
|
if os.Getenv("SUPERVISOR_TOKEN") != "" || os.Getenv("HASSIO_TOKEN") != "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// goArchVar returns the GOARM or GOAMD64 etc value that the binary was built
|
// goArchVar returns the GOARM or GOAMD64 etc value that the binary was built
|
||||||
// with.
|
// with.
|
||||||
func goArchVar() string {
|
func goArchVar() string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user