summaryrefslogtreecommitdiffhomepage
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2020-07-27cmd/cloner, tailcfg: fix nil vs len 0 issues, add tests, use for HostinfocloneBrad Fitzpatrick1-3/+3
Also use go:generate and https://golang.org/s/generatedcode header style.
2020-07-27cmd/cloner: tool to generate Clone methodsDavid Crawshaw1-0/+264
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-07-23cmd/tailscaled: always flush logs properlyDmytro Shynkevych1-31/+63
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-23cmd/tailscale: rename use-dns to accept-dnsDmytro Shynkevych1-3/+3
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-23cmd/tailscale: add corpDNS flagDmytro Shynkevych1-0/+3
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-22cmd/tailscale: default to not reporting daemon versionBrad Fitzpatrick1-1/+1
That's what I meant to do when I added "tailscale version" but apparently I didn't.
2020-07-21cmd/tailscale: add "version" subcommandBrad Fitzpatrick2-1/+76
Fixes #448 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-07-20safesocket: support connecting to Mac TCP server from within App SandboxBrad Fitzpatrick1-3/+2
2020-07-16all: fix vet warningsBrad Fitzpatrick2-3/+3
2020-07-15cmd/tailscale: simplify hostname validationDmytro Shynkevych1-33/+2
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-15cmd/tailscale: modify empty hostname caseDmytro Shynkevych1-2/+3
Signed-Off-By: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-15cmd/tailscale: allow overriding hostname in tailscale upDmytro Shynkevych1-0/+37
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-15cmd/tailscale/cli: add initial predicate func ActLikeCLIBrad Fitzpatrick1-0/+15
2020-07-15cmd/tailscale: fix typo in license headersDmytro Shynkevych2-2/+2
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-15cmd/tailscale: make tailscale status -active also filter in -json modeBrad Fitzpatrick1-2/+15
2020-07-15cmd/tailscale: move code into new reusable cmd/tailscale/cli packageBrad Fitzpatrick5-304/+352
cmd/tailscale's package main is now just a few lines. This'll let us embed the CLI in the Mac and Windows clients. Updates #541
2020-07-13cmd/tailscaled: don't require --socket path on windowsBrad Fitzpatrick1-1/+1
2020-07-13cmd/tailscaled: use "Tailscale" as default TUN device name on WindowsBrad Fitzpatrick1-6/+12
That's what's used in the Windows GUI version and seems special. If we don't use that, Windows tries to rename it and fails.
2020-07-13paths, cmd/tailscaled: on Windows, don't try to migrate from legacy relay.confBrad Fitzpatrick1-1/+1
Avoids confusing logspam on Windows.
2020-07-13cmd/tailscaled: graceful shutdown (#534)Dmytro Shynkevych2-5/+27
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-09cmd/tailscale: add -active flag to 'tailscale status' to filter out inactive ↵Brad Fitzpatrick1-3/+8
peers
2020-07-06netcheck, tailcfg, interfaces, magicsock: survey UPnP, NAT-PMP, PCPBrad Fitzpatrick1-6/+18
Don't do anything with UPnP, NAT-PMP, PCP yet, but see how common they are in the wild. Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-07-06net/interfaces: add func LikelyHomeRouterIPBrad Fitzpatrick1-0/+6
For discovering where we might direct NAT-PMP/PCP/UPnP queries at in the future.
2020-07-03cmd/tailscale: add tailscale status region name, last write, consistently starBrad Fitzpatrick1-0/+10
There's a lot of confusion around what tailscale status shows, so make it better: show region names, last write time, and put stars around DERP too if active. Now stars are always present if activity, and always somewhere.
2020-06-24cmd/derper: fix embarassing bug introduced in earlier refactorBrad Fitzpatrick1-1/+1
The remove hook implementation was copy/pasted from the line above and I didn't change the body, resulting in packet forwarding routes never being removed. Fortunately we weren't using this path yet, but it led to stats being off, and (very) slow memory growth.
2020-06-24cmd/tailscale: Allow advertising subnet routes on *BSD.Brian Chu1-7/+20
Use sysctl to check IP forwarding state for better OS compatiblity. Signed-off-by: Brian Chu <cynix@cynix.org>
2020-06-23cmd/derper, derp: add some more varz and consistency check handlerBrad Fitzpatrick1-0/+10
I'm trying to hunt down a slow drift in numbers not agreeing.
2020-06-15cmd/derper, derp/derphttp: move bulk of derp mesh code into derphttpBrad Fitzpatrick1-104/+3
To be reused in various other tools.
2020-06-15cmd/derper: remove unused parameter in runMeshClientBrad Fitzpatrick1-2/+2
2020-06-15derp: reduce DERP memory use; don't require callers to pass in memory to useBrad Fitzpatrick1-2/+1
The magicsock derpReader was holding onto 65KB for each DERP connection forever, just in case. Make the derp{,http}.Client be in charge of memory instead. It can reuse its bufio.Reader buffer space.
2020-06-05cmd/derper: support forwarding packets amongst set of peer DERP serversBrad Fitzpatrick2-4/+150
Updates #388 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-06-04cmd/derper: treat self-connection connection watch as no-opBrad Fitzpatrick1-1/+1
Updates #388
2020-06-04cmd/derper: add /home/bradfitz/keys to default mesh key search listBrad Fitzpatrick1-3/+8
2020-06-03derp, cmd/derper: add frameWatchConns, framePeerPresent for inter-DERP routingBrad Fitzpatrick2-2/+32
This lets a trusted DERP client that knows a pre-shared key subscribe to the connection list. Upon subscribing, they get the current set of connected public keys, and then all changes over time. This lets a set of DERP server peers within a region all stay connected to each other and know which clients are connected to which nodes. Updates #388 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-06-03cmd/tailscale: fix inverted flag meanings.v0.99.0v0.98.1David Anderson1-2/+2
The flags were --no-blah for a brief time, then we switched them to --blah=true/false with a default of true, but didn't fix the boolean inversions in the code. So up was down, true was false, etc. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-06-02cmd/tailscale: fix broken build, result of borked stash pop.David Anderson1-4/+4
2020-06-02cmd/tailscale: remove double negation arguments.David Anderson1-2/+2
--no-snat becomes --snat-subnet-routes --no-single-routes becomes --host-routes Signed-off-by: David Anderson <danderson@tailscale.com>
2020-06-01cmd/tailscale: warn to stderr that netcheck -format=json isn't stableBrad Fitzpatrick1-0/+5
2020-05-28Make netcheck handle v6-only interfaces better, faster.Brad Fitzpatrick1-4/+13
Also: * add -verbose flag to cmd/tailscale netcheck * remove some API from the interfaces package * convert some of the interfaces package to netaddr.IP * don't even send IPv4 probes on machines with no IPv4 (or only v4 loopback) * and once three regions have replied, stop waiting for other probes at 2x the slowest duration. Updates #376
2020-05-28cmd/tailscale: add netcheck flags for incremental reports, JSON outputBrad Fitzpatrick1-2/+53
2020-05-28router_linux: fix behaviour when switching --netfilter-mode.Avery Pennarun1-2/+2
On startup, and when switching into =off and =nodivert, we were deleting netfilter rules even if we weren't the ones that added them. In order to avoid interfering with rules added by the sysadmin, we have to be sure to delete rules only in the case that we added them in the first place. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-28cmd/tailscale: make ip_forward warnings more actionable.Avery Pennarun1-3/+3
Let's actually list the file we checked (/proc/sys/net/ipv4/ip_forward). That gives the admin something specific to look for when they get this message. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-28cmd/tailscale: be quiet when no interaction or errors are needed.Avery Pennarun1-1/+8
We would print a message about "nothing more to do", which some people thought was an error or warning. Let's only print a message after authenticating if we previously asked for interaction, and let's shorten that message to just "Success," which is what it means. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-26cmd/tailscale: expose --enable-derpDmytro Shynkevych1-0/+3
Signed-off-by: Dmytro Shynkevych <dm.shynk@gmail.com>
2020-05-25stun, netcheck: move under netBrad Fitzpatrick2-2/+2
2020-05-23all: make client use server-provided DERP map, add DERP region supportBrad Fitzpatrick1-10/+16
Instead of hard-coding the DERP map (except for cmd/tailscale netcheck for now), get it from the control server at runtime. And make the DERP map support multiple nodes per region with clients picking the first one that's available. (The server will balance the order presented to clients for load balancing) This deletes the stunner package, merging it into the netcheck package instead, to minimize all the config hooks that would've been required. Also fix some test flakes & races. Fixes #387 (Don't hard-code the DERP map) Updates #388 (Add DERP region support) Fixes #399 (wgengine: flaky tests) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-05-20log rate limiting: reformat limiter messages, and use nonempty burst size.Avery Pennarun1-1/+1
- Reformat the warning about a message being rate limited to print the format string, rather than the formatted message. This helps give a clue what "type" of message is being limited. - Change the rate limit warning to be [RATE LIMITED] in all caps. This uses less space on each line, plus is more noticeable. - In tailscaled, change the frequency to be less often (once every 5 seconds per format string) but to allow bursts of up to 5 messages. This greatly reduces the number of messages that are rate limited during startup, but allows us to tighten the limit even further during normal runtime. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-20cmd/tailscaled: SetGCPercent() if GOGC is not set.Avery Pennarun1-0/+10
This cuts RSS from ~30MB to ~20MB on my machine, after the previous fix to get rid of unnecessary zstd buffers. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-20cmd/tailscaled: eliminate unnecessary use of an init() function.Avery Pennarun1-5/+2
Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-15wgengine: log node IDs when peers are added/removed (#381)Wendi Yu1-1/+2
Also stop logging data sent/received from nodes we're not connected to (ie all those `x`s being logged in the `peers: ` line) Signed-off-by: Wendi <wendi.yu@yahoo.ca>