cmd/tailscale: remove statekey for now.

Signed-off-by: David Anderson <dave@natulte.net>
pull/10/head
David Anderson 5 years ago committed by Dave Anderson
parent f51293a2c7
commit b0f5751a76

@ -44,15 +44,14 @@ func main() {
log.Printf("fixConsoleOutput: %v\n", err) log.Printf("fixConsoleOutput: %v\n", err)
} }
config := getopt.StringLong("config", 'f', "", "path to config file") config := getopt.StringLong("config", 'f', "", "path to config file")
statekey := getopt.StringLong("statekey", 0, "", "state key for daemon-side config")
server := getopt.StringLong("server", 's', "https://login.tailscale.com", "URL to tailcontrol server") server := getopt.StringLong("server", 's', "https://login.tailscale.com", "URL to tailcontrol server")
nuroutes := getopt.BoolLong("no-single-routes", 'N', "disallow (non-subnet) routes to single nodes") nuroutes := getopt.BoolLong("no-single-routes", 'N', "disallow (non-subnet) routes to single nodes")
rroutes := getopt.BoolLong("remote-routes", 'R', "allow routing subnets to remote nodes") rroutes := getopt.BoolLong("remote-routes", 'R', "allow routing subnets to remote nodes")
droutes := getopt.BoolLong("default-routes", 'D', "allow default route on remote node") droutes := getopt.BoolLong("default-routes", 'D', "allow default route on remote node")
getopt.Parse() getopt.Parse()
if *config == "" && *statekey == "" { if *config == "" {
logpolicy.New("tailnode.log.tailscale.io", "tailscale") logpolicy.New("tailnode.log.tailscale.io", "tailscale")
log.Fatal("no --config or --statekey provided") log.Fatal("no --config provided")
} }
if len(getopt.Args()) > 0 { if len(getopt.Args()) > 0 {
log.Fatalf("too many non-flag arguments: %#v", getopt.Args()[0]) log.Fatalf("too many non-flag arguments: %#v", getopt.Args()[0])
@ -61,8 +60,6 @@ func main() {
pol := logpolicy.New("tailnode.log.tailscale.io", *config) pol := logpolicy.New("tailnode.log.tailscale.io", *config)
defer pol.Close() defer pol.Close()
var prefs *ipn.Prefs
if *config != "" {
localCfg, err := loadConfig(*config) localCfg, err := loadConfig(*config)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -70,11 +67,10 @@ func main() {
// TODO(apenwarr): fix different semantics between prefs and uflags // TODO(apenwarr): fix different semantics between prefs and uflags
// TODO(apenwarr): allow setting/using CorpDNS // TODO(apenwarr): allow setting/using CorpDNS
prefs = &localCfg prefs := &localCfg
prefs.WantRunning = true prefs.WantRunning = true
prefs.RouteAll = *rroutes || *droutes prefs.RouteAll = *rroutes || *droutes
prefs.AllowSingleHosts = !*nuroutes prefs.AllowSingleHosts = !*nuroutes
}
c, err := safesocket.Connect("", "Tailscale", "tailscaled", 41112) c, err := safesocket.Connect("", "Tailscale", "tailscaled", 41112)
if err != nil { if err != nil {
@ -95,7 +91,6 @@ func main() {
bc := ipn.NewBackendClient(log.Printf, clientToServer) bc := ipn.NewBackendClient(log.Printf, clientToServer)
opts := ipn.Options{ opts := ipn.Options{
StateKey: ipn.StateKey(*statekey),
Prefs: prefs, Prefs: prefs,
ServerURL: *server, ServerURL: *server,
Notify: func(n ipn.Notify) { Notify: func(n ipn.Notify) {

Loading…
Cancel
Save