diff --git a/cmd/derper/derper.go b/cmd/derper/derper.go index 3af280610..a83e7a39f 100644 --- a/cmd/derper/derper.go +++ b/cmd/derper/derper.go @@ -58,7 +58,12 @@ func loadConfig() config { return config{PrivateKey: mustNewKey()} } if *configPath == "" { - log.Fatalf("derper: -c not specified") + if os.Getuid() == 0 { + *configPath = "/var/lib/derper/derper.key" + } else { + *configPath = "derper.key" + } + log.Printf("no config path specified; using %s", *configPath) } b, err := ioutil.ReadFile(*configPath) switch {