mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
hostinfo, ipn/ipnlocal: add SetPackage, remove ipnlocal hacks
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -48,6 +48,9 @@ func getOSVersion() string {
|
||||
}
|
||||
|
||||
func packageType() string {
|
||||
if v, _ := packagingType.Load().(string); v != "" {
|
||||
return v
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
if _, err := os.Stat(`C:\ProgramData\chocolatey\lib\tailscale`); err == nil {
|
||||
@@ -95,6 +98,7 @@ func GetEnvType() EnvType {
|
||||
var (
|
||||
deviceModelAtomic atomic.Value // of string
|
||||
osVersionAtomic atomic.Value // of string
|
||||
packagingType atomic.Value // of string
|
||||
)
|
||||
|
||||
// SetDeviceModel sets the device model for use in Hostinfo updates.
|
||||
@@ -103,6 +107,11 @@ func SetDeviceModel(model string) { deviceModelAtomic.Store(model) }
|
||||
// SetOSVersion sets the OS version.
|
||||
func SetOSVersion(v string) { osVersionAtomic.Store(v) }
|
||||
|
||||
// SetPackage sets the packaging type for the app.
|
||||
// This is currently (2021-10-05) only used by Android,
|
||||
// set to "nogoogle" for the F-Droid build.
|
||||
func SetPackage(v string) { packagingType.Store(v) }
|
||||
|
||||
func deviceModel() string {
|
||||
s, _ := deviceModelAtomic.Load().(string)
|
||||
return s
|
||||
|
Reference in New Issue
Block a user