summaryrefslogtreecommitdiffhomepage
path: root/ipn/ipnserver
AgeCommit message (Collapse)AuthorFilesLines
2020-07-15ipn/ipnserver: support simultaneous connectionsv0.100.0-107Brad Fitzpatrick1-68/+96
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-07-13cmd/tailscaled: graceful shutdown (#534)Dmytro Shynkevych1-0/+1
Signed-off-by: Dmytro Shynkevych <dmytro@tailscale.com>
2020-07-08ipn, ipn/ipnserver: add support for serving in error-message-only modeBrad Fitzpatrick1-5/+35
So Windows service failures can be propagated to the Windows UI client.
2020-07-02smallzstd: new package that constructs zstd small encoders/decoders.David Anderson1-5/+2
It's just a config wrapper that passes "use less memory at the expense of compression" parameters by default, so that we don't accidentally construct resource-hungry (de)compressors. Also includes a benchmark that measures the memory cost of the small variants vs. the stock variants. The savings are significant on both compressors (~8x less memory) and decompressors (~1.4x less, not including the savings from the significantly smaller window on the compression side - with those savings included it's more like ~140x smaller). BenchmarkSmallEncoder-8 56174 19354 ns/op 31 B/op 0 allocs/op BenchmarkSmallEncoderWithBuild-8 2900 382940 ns/op 1746547 B/op 36 allocs/op BenchmarkStockEncoder-8 48921 25761 ns/op 286 B/op 0 allocs/op BenchmarkStockEncoderWithBuild-8 426 2630241 ns/op 13843842 B/op 124 allocs/op BenchmarkSmallDecoder-8 123814 9344 ns/op 0 B/op 0 allocs/op BenchmarkSmallDecoderWithBuild-8 41547 27455 ns/op 27694 B/op 31 allocs/op BenchmarkStockDecoder-8 129832 9417 ns/op 1 B/op 0 allocs/op BenchmarkStockDecoderWithBuild-8 25561 51751 ns/op 39607 B/op 92 allocs/op Signed-off-by: David Anderson <danderson@tailscale.com>
2020-06-03ipn/ipnserver: revert decoder memory limit.David Anderson1-1/+0
The zstd library treats that limit as a hard cap on decompressed size, in the mode we're using it, rather than a window size. Signed-off-by: David Anderson <danderson@tailscale.com>
2020-05-20ipnserver and logpolicy: configure zstd with low-memory settings.Avery Pennarun1-1/+5
The compressed blobs we send back and forth are small and infrequent, which doesn't justify the 8MB * GOMAXPROCS memory that was being allocated. This was the overwhelming majority of memory use in tailscaled. On my system it goes from ~100M RSS to ~15M RSS (which is still suspiciously high, but we can worry about that more later). Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-15wgengine: log node IDs when peers are added/removed (#381)Wendi Yu1-5/+1
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>
2020-05-13Add tstest.PanicOnLog(), and fix various problems detected by this.Avery Pennarun1-2/+2
If a test calls log.Printf, 'go test' horrifyingly rearranges the output to no longer be in chronological order, which makes debugging virtually impossible. Let's stop that from happening by making log.Printf panic if called from any module, no matter how deep, during tests. This required us to change the default error handler in at least one http.Server, as well as plumbing a bunch of logf functions around, especially in magicsock and wgengine, but also in logtail and backoff. To add insult to injury, 'go test' also rearranges the output when a parent test has multiple sub-tests (all the sub-test's t.Logf is always printed after all the parent tests t.Logf), so we need to screw around with a special Logf that can point at the "current" t (current_t.Logf) in some places. Probably our entire way of using subtests is wrong, since 'go test' would probably like to run them all in parallel if you called t.Parallel(), but it definitely can't because the're all manipulating the shared state created by the parent test. They should probably all be separate toplevel tests instead, with common setup/teardown logic. But that's a job for another time. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2020-05-08Implement rate limiting on log messages (#356)Wendi Yu1-1/+5
Implement rate limiting on log messages Addresses issue #317, where logs can get spammed with the same message nonstop. Created a rate limiting closure on logging functions, which limits the number of messages being logged per second based on format string. To keep memory usage as constant as possible, the previous cache purging at periodic time intervals has been replaced by an LRU that discards the oldest string when the capacity of the cache is reached. Signed-off-by: Wendi Yu <wendi.yu@yahoo.ca>
2020-04-11all: remove unnecessary trailing newlines in format patterns for consistencyBrad Fitzpatrick1-13/+12
And document on logger.Logf that it's unnecessary.
2020-03-27cmd/tailscale: add status subcommandBrad Fitzpatrick1-100/+4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-26cmd/tailscaled, wgengine, ipn: add /debug/ipn handler with world stateBrad Fitzpatrick1-0/+110
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-03-12controlclient/netmap: write our own b.ConciseDiffFrom(a) function.Avery Pennarun1-2/+0
This removes the need for go-cmp, which is extremely bloaty so we had to leave it out of iOS. As a result, we had also left it out of macOS, and so we didn't print netmap diffs at all on darwin-based platforms. Oops. As a bonus, the output format of the new function is way better. Minor oddity: because I used the dumbest possible diff algorithm, the sort order is a bit dumb. We print all "removed" lines and then print all "added" lines, rather than doing the usual diff-like thing of interspersing them. This probably doesn't matter (maybe it's an improvement).
2020-03-03ipn/ipnserver: remove unnecessary closure parameterBrad Fitzpatrick1-2/+2
2020-03-03ipn/ipnserver: document potential race, start on test for itBrad Fitzpatrick2-1/+78
2020-02-25types/logger: add WithPrefix, use it in two placesBrad Fitzpatrick1-5/+2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-25ipn: misc cleanupBrad Fitzpatrick1-11/+17
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-20ipn: temporary support for loading legacy relaynode configs.David Anderson1-1/+11
Signed-off-by: David Anderson <dave@natulte.net>
2020-02-19ipn: move Options.ServerURL into Prefs.David Anderson1-10/+1
We can't rely on a frontend to provide a control server URL, so this naturally belongs in server-persisted state. Signed-off-by: David Anderson <dave@natulte.net>
2020-02-18safesocket: simplify API.David Anderson1-1/+7
On unix, we want to provide a full path to the desired unix socket. On windows, currently we want to provide a TCP port, but someday we'll also provide a "path-ish" object for a named pipe. For now, simplify the API down to exactly a path and a TCP port. Signed-off-by: David Anderson <dave@natulte.net>
2020-02-17cmd/tailscaled: run off internal state autonomously.David Anderson1-8/+37
With this change, tailscaled can be restarted and reconnect without interaction from `tailscale`, and `tailscale` is merely there to provide login assistance and adjust preferences. Signed-off-by: David Anderson <dave@natulte.net>
2020-02-14Move "logger" package to under types, now that we have it.Brad Fitzpatrick1-1/+1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-14ipn/ipnserver: remove Options.AllowQuit.David Anderson1-6/+2
It was previously used by the MacOS client, but it now does something different. ipnserver should never obey a client's request to exit. Signed-off-by: David Anderson <dave@natulte.net>
2020-02-13Introduce a state store to LocalBackend.David Anderson1-1/+12
The store is passed-in by callers of NewLocalBackend and ipnserver.Run, but currently all callers are hardcoded to an in-memory store. The store is unused. Signed-Off-By: David Anderson <dave@natulte.net>
2020-02-11ipnserver: ignore lint error for unused context.David Anderson1-0/+4
The linter is strictly correct, but the code is structured this way to avoid variable shadowing problems in the following for loop. The context doesn't leak. Staticcheck is correctly pointing out that this code is hard to follow. However, this chunk of code is in service of enforcing one frontend <> one backend, and we want to remove that limitation. So, we'll just ignore the lint warning until this entire piece of code goes away. Signed-off-by: David Anderson <dave@natulte.net>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+253