Saves 86 KB.
And stop depending on expvar and usermetrics when disabled,
in prep to removing all the expvar/metrics/tsweb stuff.
Updates #12614
Change-Id: I35d2479ddd1d39b615bab32b1fa940ae8cbf9b11
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
returnfmt.Sprintf("An update from version %s to %s is available.",args[ArgCurrentVersion],args[ArgAvailableVersion])
returnfmt.Sprintf("An update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now.",args[ArgCurrentVersion],args[ArgAvailableVersion])
}else{
}
returnfmt.Sprintf("An update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now.",args[ArgCurrentVersion],args[ArgAvailableVersion])
},
}
},
}
})
})
// securityUpdateAvailableWarnable is a Warnable that warns the user that an important security update is available.
// securityUpdateAvailableWarnable is a Warnable that warns the user that an important security update is available.
returnfmt.Sprintf("A security update from version %s to %s is available.",args[ArgCurrentVersion],args[ArgAvailableVersion])
returnfmt.Sprintf("A security update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now.",args[ArgCurrentVersion],args[ArgAvailableVersion])
}else{
}
returnfmt.Sprintf("A security update from version %s to %s is available. Run `tailscale update` or `tailscale set --auto-update` to update now.",args[ArgCurrentVersion],args[ArgAvailableVersion])
},
}
},
}
})
})
// unstableWarnable is a Warnable that warns the user that they are using an unstable version of Tailscale
// unstableWarnable is a Warnable that warns the user that they are using an unstable version of Tailscale
// so they won't be surprised by all the issues that may arise.
// so they won't be surprised by all the issues that may arise.
varunstableWarnable=Register(&Warnable{
varunstableWarnable=condRegister(func()*Warnable{
Code:"is-using-unstable-version",
return&Warnable{
Title:"Using an unstable version",
Code:"is-using-unstable-version",
Severity:SeverityLow,
Title:"Using an unstable version",
Text:StaticMessage("This is an unstable version of Tailscale meant for testing and development purposes. Please report any issues to Tailscale."),
Severity:SeverityLow,
Text:StaticMessage("This is an unstable version of Tailscale meant for testing and development purposes. Please report any issues to Tailscale."),
}
})
})
// NetworkStatusWarnable is a Warnable that warns the user that the network is down.
// NetworkStatusWarnable is a Warnable that warns the user that the network is down.
Text:StaticMessage("Unable to connect to the Tailscale coordination server to synchronize the state of your tailnet. Peer reachability might degrade over time."),
// 8 minutes reflects a maximum maintenance window for the coordination server.
Text:StaticMessage("Unable to connect to the Tailscale coordination server to synchronize the state of your tailnet. Peer reachability might degrade over time."),
TimeToVisible:8*time.Minute,
// 8 minutes reflects a maximum maintenance window for the coordination server.
TimeToVisible:8*time.Minute,
}
})
})
// noDERPHomeWarnable is a Warnable that warns the user that Tailscale doesn't have a home DERP.
// noDERPHomeWarnable is a Warnable that warns the user that Tailscale doesn't have a home DERP.
// Technically noDERPConnectionWarnable could be used to warn about
// failure to connect to a specific DERP server (e.g. your home is derp1
// Technically noDERPConnectionWarnable could be used to warn about
// but you're trying to connect to a peer's derp4 and are unable) but as
// failure to connect to a specific DERP server (e.g. your home is derp1
// of 2024-09-25 we only use this for connecting to your home DERP, so
// but you're trying to connect to a peer's derp4 and are unable) but as
// we depend on noDERPHomeWarnable which is the ability to figure out
// of 2024-09-25 we only use this for connecting to your home DERP, so
// what your DERP home even is.
// we depend on noDERPHomeWarnable which is the ability to figure out
noDERPHomeWarnable,
// what your DERP home even is.
},
noDERPHomeWarnable,
Text:func(argsArgs)string{
},
ifn:=args[ArgDERPRegionName];n!=""{
Text:func(argsArgs)string{
returnfmt.Sprintf("Tailscale could not connect to the '%s' relay server. Your Internet connection might be down, or the server might be temporarily unavailable.",n)
ifn:=args[ArgDERPRegionName];n!=""{
}else{
returnfmt.Sprintf("Tailscale could not connect to the '%s' relay server. Your Internet connection might be down, or the server might be temporarily unavailable.",n)
returnfmt.Sprintf("Tailscale could not connect to the relay server with ID '%s'. Your Internet connection might be down, or the server might be temporarily unavailable.",args[ArgDERPRegionID])
}else{
}
returnfmt.Sprintf("Tailscale could not connect to the relay server with ID '%s'. Your Internet connection might be down, or the server might be temporarily unavailable.",args[ArgDERPRegionID])
},
}
ImpactsConnectivity:true,
},
TimeToVisible:10*time.Second,
ImpactsConnectivity:true,
TimeToVisible:10*time.Second,
}
})
})
// derpTimeoutWarnable is a Warnable that warns the user that Tailscale hasn't
// derpTimeoutWarnable is a Warnable that warns the user that Tailscale hasn't
noDERPConnectionWarnable,// don't warn about it being stalled if we're not connected
NetworkStatusWarnable,
noDERPHomeWarnable,// same reason as noDERPConnectionWarnable's dependency
noDERPConnectionWarnable,// don't warn about it being stalled if we're not connected
},
noDERPHomeWarnable,// same reason as noDERPConnectionWarnable's dependency
Text:func(argsArgs)string{
},
ifn:=args[ArgDERPRegionName];n!=""{
Text:func(argsArgs)string{
returnfmt.Sprintf("Tailscale hasn't heard from the '%s' relay server in %v. The server might be temporarily unavailable, or your Internet connection might be down.",n,args[ArgDuration])
ifn:=args[ArgDERPRegionName];n!=""{
}else{
returnfmt.Sprintf("Tailscale hasn't heard from the '%s' relay server in %v. The server might be temporarily unavailable, or your Internet connection might be down.",n,args[ArgDuration])
returnfmt.Sprintf("Tailscale hasn't heard from the home relay server (region ID '%v') in %v. The server might be temporarily unavailable, or your Internet connection might be down.",args[ArgDERPRegionID],args[ArgDuration])
}else{
}
returnfmt.Sprintf("Tailscale hasn't heard from the home relay server (region ID '%v') in %v. The server might be temporarily unavailable, or your Internet connection might be down.",args[ArgDERPRegionID],args[ArgDuration])
},
}
},
}
})
})
// derpRegionErrorWarnable is a Warnable that warns the user that a DERP region is reporting an issue.
// derpRegionErrorWarnable is a Warnable that warns the user that a DERP region is reporting an issue.