mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
cmd/derper: add default -c arguments
This adds some convenient defaults for -c, so that user-provided DERPs require less command line flags. Signed-off-by: julianknodt <julianknodt@gmail.com>
This commit is contained in:
parent
ee71c966fd
commit
9d4eddcef8
@ -58,7 +58,12 @@ func loadConfig() config {
|
||||
return config{PrivateKey: mustNewKey()}
|
||||
}
|
||||
if *configPath == "" {
|
||||
log.Fatalf("derper: -c <config path> 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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user