MCPcopy
hub / github.com/tailscale/tailscale / IsMacAppStore

Function IsMacAppStore

version/prop.go:132–149  ·  view source on GitHub ↗

IsMacAppStore returns whether this binary is from the App Store version of Tailscale for macOS. Returns true for both the network extension and the GUI app.

()

Source from the content-addressed store, hash-verified

130// IsMacAppStore returns whether this binary is from the App Store version of Tailscale
131// for macOS. Returns true for both the network extension and the GUI app.
132func IsMacAppStore() bool {
133 if runtime.GOOS != "darwin" {
134 return false
135 }
136 return isMacAppStore.Get(func() bool {
137 if AppIdentifierFn != nil {
138 id := AppIdentifierFn()
139 return id == appStoreBundleID || id == appStoreExtBundleId
140 }
141 // TODO (barnstar): This check should be redundant once all relevant callers
142 // use AppIdentifierFn.
143 // Both macsys and app store versions can run CLI executable with
144 // suffix /Contents/MacOS/Tailscale. Check $HOME to filter out running
145 // as macsys.
146 return strings.Contains(os.Getenv("HOME"), "/Containers/io.tailscale.ipn.macos/") ||
147 strings.Contains(os.Getenv("XPC_SERVICE_NAME"), appStoreBundleID)
148 })
149}
150
151var isMacAppStoreGUI lazy.SyncValue[bool]
152

Callers 9

runSSHFunction · 0.92
applyWebServeMethod · 0.92
getUpdateFunctionMethod · 0.92
stateEncryptedMethod · 0.92
warnings.goFile · 0.92
IsMacGUIVariantFunction · 0.85
IsSandboxedMacOSFunction · 0.85
osVariantFunction · 0.85

Calls 2

GetMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…