Remove LoginFlags from Backend options.

- It was only used in one currently-unused client.
- It's an imperative command, not a configuration setting.
- The LoginFlags stuff in controlclient feels like it needs
  a refactor anyway.

I'll put this logic back once ipnd owns its state and Backend
commands reflect that.

Signed-Off-By: David Anderson <dave@natulte.net>
This commit is contained in:
David Anderson 2020-02-03 10:57:34 -08:00 committed by Dave Anderson
parent b5346fe7b4
commit f6f154193f
4 changed files with 5 additions and 13 deletions

View File

@ -20,7 +20,6 @@
"github.com/apenwarr/fixconsole" "github.com/apenwarr/fixconsole"
"github.com/pborman/getopt/v2" "github.com/pborman/getopt/v2"
"tailscale.com/atomicfile" "tailscale.com/atomicfile"
"tailscale.com/control/controlclient"
"tailscale.com/ipn" "tailscale.com/ipn"
"tailscale.com/logpolicy" "tailscale.com/logpolicy"
"tailscale.com/safesocket" "tailscale.com/safesocket"
@ -46,7 +45,6 @@ func main() {
} }
config := getopt.StringLong("config", 'f', "", "path to config file") config := getopt.StringLong("config", 'f', "", "path to config file")
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")
alwaysrefresh := getopt.BoolLong("always-refresh", 0, "force key refresh at startup")
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")
@ -82,10 +80,6 @@ func main() {
} }
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
lf := controlclient.LoginDefault
if *alwaysrefresh {
lf |= controlclient.LoginInteractive
}
go func() { go func() {
interrupt := make(chan os.Signal, 1) interrupt := make(chan os.Signal, 1)
@ -98,7 +92,6 @@ func main() {
opts := ipn.Options{ opts := ipn.Options{
Prefs: prefs, Prefs: prefs,
ServerURL: *server, ServerURL: *server,
LoginFlags: lf,
Notify: func(n ipn.Notify) { Notify: func(n ipn.Notify) {
log.Printf("Notify: %v\n", n) log.Printf("Notify: %v\n", n)
if n.ErrMessage != nil { if n.ErrMessage != nil {

View File

@ -5,10 +5,11 @@
package ipn package ipn
import ( import (
"time"
"tailscale.com/control/controlclient" "tailscale.com/control/controlclient"
"tailscale.com/tailcfg" "tailscale.com/tailcfg"
"tailscale.com/wgengine" "tailscale.com/wgengine"
"time"
) )
type State int type State int
@ -53,7 +54,6 @@ type Options struct {
FrontendLogID string // public logtail id used by frontend FrontendLogID string // public logtail id used by frontend
ServerURL string ServerURL string
Prefs Prefs Prefs Prefs
LoginFlags controlclient.LoginFlags
Notify func(n Notify) `json:"-"` Notify func(n Notify) `json:"-"`
} }

View File

@ -177,7 +177,6 @@ func newNode(t *testing.T, prefix string, https *httptest.Server) testNode {
WantRunning: true, WantRunning: true,
Persist: &c, Persist: &c,
}, },
LoginFlags: controlclient.LoginDefault,
Notify: func(n Notify) { Notify: func(n Notify) {
// Automatically visit auth URLs // Automatically visit auth URLs
if n.BrowseToURL != nil { if n.BrowseToURL != nil {

View File

@ -253,7 +253,7 @@ func (b *LocalBackend) Start(opts Options) error {
b.logf("Backend: logs: be:%v fe:%v\n", blid, opts.FrontendLogID) b.logf("Backend: logs: be:%v fe:%v\n", blid, opts.FrontendLogID)
b.send(Notify{BackendLogID: &blid}) b.send(Notify{BackendLogID: &blid})
cli.Login(nil, opts.LoginFlags) cli.Login(nil, controlclient.LoginDefault)
return nil return nil
} }