mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
ipn: add documentation to the Prefs struct.
Signed-off-by: David Anderson <dave@natulte.net>
This commit is contained in:
parent
59ba2e6316
commit
e0c35723a8
37
ipn/prefs.go
37
ipn/prefs.go
@ -18,14 +18,39 @@ import (
|
|||||||
"tailscale.com/control/controlclient"
|
"tailscale.com/control/controlclient"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Prefs are the user modifiable settings of the Tailscale node agent.
|
||||||
type Prefs struct {
|
type Prefs struct {
|
||||||
RouteAll bool
|
// RouteAll specifies whether to accept subnet and default routes
|
||||||
|
// advertised by other nodes on the Tailscale network.
|
||||||
|
RouteAll bool
|
||||||
|
// AllowSingleHosts specifies whether to install routes for each
|
||||||
|
// node IP on the tailscale network, in addition to a route for
|
||||||
|
// the whole network.
|
||||||
|
//
|
||||||
|
// TODO(danderson): why do we have this? It dumps a lot of stuff
|
||||||
|
// into the routing table, and a single network route _should_ be
|
||||||
|
// all that we need. But when I turn this off in my tailscaled,
|
||||||
|
// packets stop flowing. What's up with that?
|
||||||
AllowSingleHosts bool
|
AllowSingleHosts bool
|
||||||
CorpDNS bool
|
// CorpDNS specifies whether to install the Tailscale network's
|
||||||
WantRunning bool
|
// DNS configuration, if it exists.
|
||||||
NotepadURLs bool
|
CorpDNS bool
|
||||||
UsePacketFilter bool
|
// WantRunning indicates whether networking should be active on
|
||||||
AdvertiseRoutes []*net.IPNet
|
// this node.
|
||||||
|
WantRunning bool
|
||||||
|
// UsePacketFilter indicates whether to enforce centralized ACLs
|
||||||
|
// on this node. If false, all traffic in and out of this node is
|
||||||
|
// allowed.
|
||||||
|
UsePacketFilter bool
|
||||||
|
// AdvertiseRoutes specifies CIDR prefixes to advertise into the
|
||||||
|
// Tailscale network as reachable through the current node.
|
||||||
|
AdvertiseRoutes []*net.IPNet
|
||||||
|
|
||||||
|
// NotepadURLs is a debugging setting that opens OAuth URLs in
|
||||||
|
// notepad.exe on Windows, rather than loading them in a browser.
|
||||||
|
//
|
||||||
|
// TODO(danderson): remove?
|
||||||
|
NotepadURLs bool
|
||||||
|
|
||||||
// The Persist field is named 'Config' in the file for backward
|
// The Persist field is named 'Config' in the file for backward
|
||||||
// compatibility with earlier versions.
|
// compatibility with earlier versions.
|
||||||
|
@ -20,7 +20,7 @@ func fieldsOf(t reflect.Type) (fields []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPrefsEqual(t *testing.T) {
|
func TestPrefsEqual(t *testing.T) {
|
||||||
prefsHandles := []string{"RouteAll", "AllowSingleHosts", "CorpDNS", "WantRunning", "NotepadURLs", "UsePacketFilter", "AdvertiseRoutes", "Persist"}
|
prefsHandles := []string{"RouteAll", "AllowSingleHosts", "CorpDNS", "WantRunning", "UsePacketFilter", "AdvertiseRoutes", "NotepadURLs", "Persist"}
|
||||||
if have := fieldsOf(reflect.TypeOf(Prefs{})); !reflect.DeepEqual(have, prefsHandles) {
|
if have := fieldsOf(reflect.TypeOf(Prefs{})); !reflect.DeepEqual(have, prefsHandles) {
|
||||||
t.Errorf("Prefs.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
|
t.Errorf("Prefs.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
|
||||||
have, prefsHandles)
|
have, prefsHandles)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user