feat: use env variable for setting a default tailnet id when using a system admin key

This commit is contained in:
Johan Siebens
2024-03-14 08:04:26 +01:00
parent 42702682c9
commit a1debdffb8
2 changed files with 17 additions and 2 deletions
+12
View File
@@ -25,6 +25,18 @@ func GetString(key, defaultValue string) string {
return defaultValue
}
func GetUint64(key string, defaultValue uint64) uint64 {
v := os.Getenv(key)
if v != "" {
vi, err := strconv.ParseUint(v, 10, 64)
if err != nil {
return defaultValue
}
return vi
}
return defaultValue
}
func validatePublicAddr(addr string) (*url.URL, string, int, error) {
scheme := "https"