99 "time"
1010
1111 "tailscale.com/feature/buildfeatures"
12+ "tailscale.com/tsconst"
1213 "tailscale.com/version"
1314)
1415
@@ -26,7 +27,7 @@ This file contains definitions for the Warnables maintained within this `health`
2627// updateAvailableWarnable is a Warnable that warns the user that an update is available.
2728var updateAvailableWarnable = condRegister (func () * Warnable {
2829 return & Warnable {
29- Code : "update-available" ,
30+ Code : tsconst . HealthWarnableUpdateAvailable ,
3031 Title : "Update available" ,
3132 Severity : SeverityLow ,
3233 Text : func (args Args ) string {
@@ -42,7 +43,7 @@ var updateAvailableWarnable = condRegister(func() *Warnable {
4243// securityUpdateAvailableWarnable is a Warnable that warns the user that an important security update is available.
4344var securityUpdateAvailableWarnable = condRegister (func () * Warnable {
4445 return & Warnable {
45- Code : "security-update-available" ,
46+ Code : tsconst . HealthWarnableSecurityUpdateAvailable ,
4647 Title : "Security update available" ,
4748 Severity : SeverityMedium ,
4849 Text : func (args Args ) string {
@@ -59,7 +60,7 @@ var securityUpdateAvailableWarnable = condRegister(func() *Warnable {
5960// so they won't be surprised by all the issues that may arise.
6061var unstableWarnable = condRegister (func () * Warnable {
6162 return & Warnable {
62- Code : "is-using-unstable-version" ,
63+ Code : tsconst . HealthWarnableIsUsingUnstableVersion ,
6364 Title : "Using an unstable version" ,
6465 Severity : SeverityLow ,
6566 Text : StaticMessage ("This is an unstable version of Tailscale meant for testing and development purposes. Please report any issues to Tailscale." ),
@@ -69,7 +70,7 @@ var unstableWarnable = condRegister(func() *Warnable {
6970// NetworkStatusWarnable is a Warnable that warns the user that the network is down.
7071var NetworkStatusWarnable = condRegister (func () * Warnable {
7172 return & Warnable {
72- Code : "network-status" ,
73+ Code : tsconst . HealthWarnableNetworkStatus ,
7374 Title : "Network down" ,
7475 Severity : SeverityMedium ,
7576 Text : StaticMessage ("Tailscale cannot connect because the network is down. Check your Internet connection." ),
@@ -81,7 +82,7 @@ var NetworkStatusWarnable = condRegister(func() *Warnable {
8182// IPNStateWarnable is a Warnable that warns the user that Tailscale is stopped.
8283var IPNStateWarnable = condRegister (func () * Warnable {
8384 return & Warnable {
84- Code : "wantrunning-false" ,
85+ Code : tsconst . HealthWarnableWantRunningFalse ,
8586 Title : "Tailscale off" ,
8687 Severity : SeverityLow ,
8788 Text : StaticMessage ("Tailscale is stopped." ),
@@ -91,7 +92,7 @@ var IPNStateWarnable = condRegister(func() *Warnable {
9192// localLogWarnable is a Warnable that warns the user that the local log is misconfigured.
9293var localLogWarnable = condRegister (func () * Warnable {
9394 return & Warnable {
94- Code : "local-log-config-error" ,
95+ Code : tsconst . HealthWarnableLocalLogConfigError ,
9596 Title : "Local log misconfiguration" ,
9697 Severity : SeverityLow ,
9798 Text : func (args Args ) string {
@@ -104,7 +105,7 @@ var localLogWarnable = condRegister(func() *Warnable {
104105// and provides the last login error if available.
105106var LoginStateWarnable = condRegister (func () * Warnable {
106107 return & Warnable {
107- Code : "login-state" ,
108+ Code : tsconst . HealthWarnableLoginState ,
108109 Title : "Logged out" ,
109110 Severity : SeverityMedium ,
110111 Text : func (args Args ) string {
@@ -121,7 +122,7 @@ var LoginStateWarnable = condRegister(func() *Warnable {
121122// notInMapPollWarnable is a Warnable that warns the user that we are using a stale network map.
122123var notInMapPollWarnable = condRegister (func () * Warnable {
123124 return & Warnable {
124- Code : "not-in-map-poll" ,
125+ Code : tsconst . HealthWarnableNotInMapPoll ,
125126 Title : "Out of sync" ,
126127 Severity : SeverityMedium ,
127128 DependsOn : []* Warnable {NetworkStatusWarnable , IPNStateWarnable },
@@ -134,7 +135,7 @@ var notInMapPollWarnable = condRegister(func() *Warnable {
134135// noDERPHomeWarnable is a Warnable that warns the user that Tailscale doesn't have a home DERP.
135136var noDERPHomeWarnable = condRegister (func () * Warnable {
136137 return & Warnable {
137- Code : "no-derp-home" ,
138+ Code : tsconst . HealthWarnableNoDERPHome ,
138139 Title : "No home relay server" ,
139140 Severity : SeverityMedium ,
140141 DependsOn : []* Warnable {NetworkStatusWarnable },
@@ -147,7 +148,7 @@ var noDERPHomeWarnable = condRegister(func() *Warnable {
147148// noDERPConnectionWarnable is a Warnable that warns the user that Tailscale couldn't connect to a specific DERP server.
148149var noDERPConnectionWarnable = condRegister (func () * Warnable {
149150 return & Warnable {
150- Code : "no-derp-connection" ,
151+ Code : tsconst . HealthWarnableNoDERPConnection ,
151152 Title : "Relay server unavailable" ,
152153 Severity : SeverityMedium ,
153154 DependsOn : []* Warnable {
@@ -177,7 +178,7 @@ var noDERPConnectionWarnable = condRegister(func() *Warnable {
177178// heard from the home DERP region for a while.
178179var derpTimeoutWarnable = condRegister (func () * Warnable {
179180 return & Warnable {
180- Code : "derp-timed-out" ,
181+ Code : tsconst . HealthWarnableDERPTimedOut ,
181182 Title : "Relay server timed out" ,
182183 Severity : SeverityMedium ,
183184 DependsOn : []* Warnable {
@@ -198,7 +199,7 @@ var derpTimeoutWarnable = condRegister(func() *Warnable {
198199// derpRegionErrorWarnable is a Warnable that warns the user that a DERP region is reporting an issue.
199200var derpRegionErrorWarnable = condRegister (func () * Warnable {
200201 return & Warnable {
201- Code : "derp-region-error" ,
202+ Code : tsconst . HealthWarnableDERPRegionError ,
202203 Title : "Relay server error" ,
203204 Severity : SeverityLow ,
204205 DependsOn : []* Warnable {NetworkStatusWarnable },
@@ -211,7 +212,7 @@ var derpRegionErrorWarnable = condRegister(func() *Warnable {
211212// noUDP4BindWarnable is a Warnable that warns the user that Tailscale couldn't listen for incoming UDP connections.
212213var noUDP4BindWarnable = condRegister (func () * Warnable {
213214 return & Warnable {
214- Code : "no-udp4-bind" ,
215+ Code : tsconst . HealthWarnableNoUDP4Bind ,
215216 Title : "NAT traversal setup failure" ,
216217 Severity : SeverityMedium ,
217218 DependsOn : []* Warnable {NetworkStatusWarnable , IPNStateWarnable },
@@ -223,7 +224,7 @@ var noUDP4BindWarnable = condRegister(func() *Warnable {
223224// mapResponseTimeoutWarnable is a Warnable that warns the user that Tailscale hasn't received a network map from the coordination server in a while.
224225var mapResponseTimeoutWarnable = condRegister (func () * Warnable {
225226 return & Warnable {
226- Code : "mapresponse-timeout" ,
227+ Code : tsconst . HealthWarnableMapResponseTimeout ,
227228 Title : "Network map response timeout" ,
228229 Severity : SeverityMedium ,
229230 DependsOn : []* Warnable {NetworkStatusWarnable , IPNStateWarnable },
@@ -236,7 +237,7 @@ var mapResponseTimeoutWarnable = condRegister(func() *Warnable {
236237// tlsConnectionFailedWarnable is a Warnable that warns the user that Tailscale could not establish an encrypted connection with a server.
237238var tlsConnectionFailedWarnable = condRegister (func () * Warnable {
238239 return & Warnable {
239- Code : "tls-connection-failed" ,
240+ Code : tsconst . HealthWarnableTLSConnectionFailed ,
240241 Title : "Encrypted connection failed" ,
241242 Severity : SeverityMedium ,
242243 DependsOn : []* Warnable {NetworkStatusWarnable },
@@ -249,7 +250,7 @@ var tlsConnectionFailedWarnable = condRegister(func() *Warnable {
249250// magicsockReceiveFuncWarnable is a Warnable that warns the user that one of the Magicsock functions is not running.
250251var magicsockReceiveFuncWarnable = condRegister (func () * Warnable {
251252 return & Warnable {
252- Code : "magicsock-receive-func-error" ,
253+ Code : tsconst . HealthWarnableMagicsockReceiveFuncError ,
253254 Title : "MagicSock function not running" ,
254255 Severity : SeverityMedium ,
255256 Text : func (args Args ) string {
@@ -261,7 +262,7 @@ var magicsockReceiveFuncWarnable = condRegister(func() *Warnable {
261262// testWarnable is a Warnable that is used within this package for testing purposes only.
262263var testWarnable = condRegister (func () * Warnable {
263264 return & Warnable {
264- Code : "test-warnable" ,
265+ Code : tsconst . HealthWarnableTestWarnable ,
265266 Title : "Test warnable" ,
266267 Severity : SeverityLow ,
267268 Text : func (args Args ) string {
@@ -273,7 +274,7 @@ var testWarnable = condRegister(func() *Warnable {
273274// applyDiskConfigWarnable is a Warnable that warns the user that there was an error applying the envknob config stored on disk.
274275var applyDiskConfigWarnable = condRegister (func () * Warnable {
275276 return & Warnable {
276- Code : "apply-disk-config" ,
277+ Code : tsconst . HealthWarnableApplyDiskConfig ,
277278 Title : "Could not apply configuration" ,
278279 Severity : SeverityMedium ,
279280 Text : func (args Args ) string {
@@ -291,7 +292,7 @@ const warmingUpWarnableDuration = 5 * time.Second
291292// the backend is fully started.
292293var warmingUpWarnable = condRegister (func () * Warnable {
293294 return & Warnable {
294- Code : "warming-up" ,
295+ Code : tsconst . HealthWarnableWarmingUp ,
295296 Title : "Tailscale is starting" ,
296297 Severity : SeverityLow ,
297298 Text : StaticMessage ("Tailscale is starting. Please wait." ),
0 commit comments