mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 14:57:49 +00:00
ipn: put discovery key generation behind an environment flag for now
Later we'll want to use the presence of a discovery key as a signal that the node knows how to participate in discovery. Currently the code generates keys and sends them to the control server but doesn't do anything with them, which is a bad state to stay in lest we release this code and end up with nodes in the future that look like they're functional with the new discovery protocol but aren't. So for now, make this opt-in as a debug option for now, until the rest of it is in. Updates #483
This commit is contained in:
parent
00ca17edf4
commit
666d404066
11
ipn/local.go
11
ipn/local.go
@ -8,6 +8,8 @@
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@ -358,9 +360,12 @@ func (b *LocalBackend) Start(opts Options) error {
|
||||
|
||||
b.updateFilter(nil)
|
||||
|
||||
discoPrivate := key.NewPrivate()
|
||||
b.e.SetDiscoPrivateKey(discoPrivate)
|
||||
discoPublic := tailcfg.DiscoKey(discoPrivate.Public())
|
||||
var discoPublic tailcfg.DiscoKey
|
||||
if useDisco, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_USE_DISCO")); useDisco {
|
||||
discoPrivate := key.NewPrivate()
|
||||
b.e.SetDiscoPrivateKey(discoPrivate)
|
||||
discoPublic = tailcfg.DiscoKey(discoPrivate.Public())
|
||||
}
|
||||
|
||||
var err error
|
||||
if persist == nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user