You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Joe Tsai c299a96624 all: apply consistent imports of "json" packages
This runs:

        go run ./cmd/jsonimports -update -ignore=tempfork/

which applies the following rules:

  * Until the Go standard library formally accepts "encoding/json/v2"
    and "encoding/json/jsontext" into the standard library
    (i.e., they are no longer considered experimental),
    we forbid any code from directly importing those packages.
    Go code should instead import "github.com/go-json-experiment/json"
    and "github.com/go-json-experiment/json/jsontext".
    The latter packages contain aliases to the standard library
    if built on Go 1.25 with the goexperiment.jsonv2 tag specified.

  * Imports of "encoding/json" or "github.com/go-json-experiment/json/v1"
    must be explicitly imported under the package name "jsonv1".
    If both packages need to be imported, then
    the former should be imported under the package name "jsonv1std".

  * Imports of "github.com/go-json-experiment/json"
    must be explicitly imported under the package name "jsonv2".

The latter two rules exist to provide clarity when reading code.
Without them, it is unclear whether "json.Marshal" refers to v1 or v2.
With them, however, it is clear that "jsonv1.Marshal" is calling v1 and
that "jsonv2.Marshal" is calling v2.

Updates tailscale/corp#791

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
4 weeks ago
.bencher bencher: add config to suppress failures on benchmark regressions. 4 years ago
.github all: apply consistent imports of "json" packages 4 weeks ago
appc appc,ipn/ipnlocal: receive AppConnector updates via the event bus (#17411) 2 months ago
atomicfile ipn/store: automatically migrate between plaintext and encrypted state (#16318) 5 months ago
chirp scripts/check_license_headers.sh: delete, rewrite as a Go test 6 months ago
client all: apply consistent imports of "json" packages 4 weeks ago
clientupdate all: apply consistent imports of "json" packages 4 weeks ago
cmd all: apply consistent imports of "json" packages 4 weeks ago
control all: apply consistent imports of "json" packages 4 weeks ago
derp all: apply consistent imports of "json" packages 4 weeks ago
disco disco: add missing message types to MessageSummary (#17081) 3 months ago
docs all: apply consistent imports of "json" packages 4 weeks ago
doctor all: remove non-applicable "linux" deps on Android 7 months ago
drive all: apply consistent imports of "json" packages 4 weeks ago
envknob all: use buildfeature constants in a few more places 2 months ago
feature all: apply consistent imports of "json" packages 4 weeks ago
gokrazy all: apply consistent imports of "json" packages 4 weeks ago
health all: apply consistent imports of "json" packages 4 weeks ago
hostinfo all: apply consistent imports of "json" packages 4 weeks ago
internal all: apply consistent imports of "json" packages 4 weeks ago
ipn all: apply consistent imports of "json" packages 4 weeks ago
jsondb all: apply consistent imports of "json" packages 4 weeks ago
k8s-operator all: apply consistent imports of "json" packages 4 weeks ago
kube all: apply consistent imports of "json" packages 4 weeks ago
licenses licenses: update license notices 1 month ago
log all: apply consistent imports of "json" packages 4 weeks ago
logpolicy all: apply consistent imports of "json" packages 4 weeks ago
logtail all: apply consistent imports of "json" packages 4 weeks ago
maths maths: add exponentially weighted moving average type 9 months ago
metrics all: apply consistent imports of "json" packages 4 weeks ago
net all: apply consistent imports of "json" packages 4 weeks ago
omit cmd/tailscaled, ipn/conffile: support ec2 user-data config file 2 years ago
packages/deb go.mod: upgrade nfpm to v2 (#8786) 2 years ago
paths all: detect JetKVM and specialize a handful of things for it 5 months ago
portlist all: apply consistent imports of "json" packages 4 weeks ago
posture util/syspolicy/policyclient: add policyclient.Client interface, start plumbing 3 months ago
prober all: apply consistent imports of "json" packages 4 weeks ago
proxymap ipnlocal,proxymap,wgengine/netstack: add optional WhoIs/proxymap debug 1 year ago
release all: use Go 1.20's errors.Join instead of our multierr package 2 months ago
safesocket feature/featuretags, all: add build features, use existing ones in more places 2 months ago
safeweb safeweb: Set Cross-Origin-Opener-Policy for browser requests (#15936) 7 months ago
scripts scripts/installer.sh: add Siemens Industrial OS (#17185) 3 months ago
sessionrecording all: apply consistent imports of "json" packages 4 weeks ago
ssh/tailssh all: apply consistent imports of "json" packages 4 weeks ago
syncs all: apply consistent imports of "json" packages 4 weeks ago
tailcfg all: apply consistent imports of "json" packages 4 weeks ago
tempfork feature/c2n: move answerC2N code + deps out of control/controlclient 2 months ago
tka tka: rename a mutex to `mu` instead of single-letter `l` 1 month ago
tool tool/gocross: ensure child process error codes are propagated on non-Unix 3 months ago
tsconsensus all: apply consistent imports of "json" packages 4 weeks ago
tsconst health: compare warnable codes to avoid errors on release branch (#17637) 1 month ago
tsd cmd/tailscaled: start implementing ts_omit_netstack 2 months ago
tsnet wgengine/netlog: include node OS in logged attributes (#17755) 4 weeks ago
tstest all: apply consistent imports of "json" packages 4 weeks ago
tstime all: apply consistent imports of "json" packages 4 weeks ago
tsweb all: apply consistent imports of "json" packages 4 weeks ago
types all: apply consistent imports of "json" packages 4 weeks ago
util all: apply consistent imports of "json" packages 4 weeks ago
version clientupdate, util/osshare, util/winutil, version: improve Windows GUI filename resolution and WinUI build awareness 2 months ago
wf wf/firewall: allow link-local multicast for permitted local routes when the killswitch is on on Windows 1 year ago
wgengine all: apply consistent imports of "json" packages 4 weeks ago
words words: remove a fish (#17704) 1 month ago
.gitattributes .: add .gitattributes entry to use Go hunk-header driver 4 years ago
.gitignore cmd/k8s-operator: Add NOTES.txt to Helm chart (#16364) 5 months ago
.golangci.yml .github: Bump golangci/golangci-lint-action from 6.5.0 to 7.0.0 (#15476) 8 months ago
ALPINE.txt docker: bump alpine v3.19 -> 3.22 (#17155) 3 months ago
AUTHORS Move Linux client & common packages into a public repo. 6 years ago
CODEOWNERS CODEOWNERS: add the start of an owners file 2 years ago
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md: update code of conduct 1 month ago
Dockerfile docker: bump alpine v3.19 -> 3.22 (#17155) 3 months ago
Dockerfile.base docker: bump alpine v3.19 -> 3.22 (#17155) 3 months ago
LICENSE all: update tools that manage copyright headers 3 years ago
Makefile Makefile, cmd/*/depaware.txt: split out vendor packages explicitly 2 months ago
PATENTS Move Linux client & common packages into a public repo. 6 years ago
README.md README: update the version of Go in the README 2 months ago
SECURITY.md Add a SECURITY.md for vulnerability reports. 6 years ago
VERSION.txt VERSION.txt: this is v1.91.0 1 month ago
api.md {api.md,publicapi}: remove old API docs (#13468) 1 year ago
assert_ts_toolchain_match.go tailscaleroot: panic if tailscale_go build tag but Go toolchain mismatch 1 year ago
build_dist.sh build_dist.sh: keep --extra-small making a usable build, add --min 2 months ago
build_docker.sh build_docker.sh: support including extra files (#17405) 2 months ago
flake.lock .github/Makefile/flake: update nix flake support (#16636) 4 months ago
flake.nix util/eventbus: allow logging of slow subscribers (#17705) 1 month ago
go.mod util/eventbus: allow logging of slow subscribers (#17705) 1 month ago
go.mod.sri util/eventbus: allow logging of slow subscribers (#17705) 1 month ago
go.sum util/eventbus: allow logging of slow subscribers (#17705) 1 month ago
go.toolchain.branch go.toolchain.branch: bump to go1.25 (#16954) 3 months ago
go.toolchain.rev go.toolchain.rev: update to Go 1.25.3 2 months ago
go.toolchain.rev.sri go.toolchain.rev: update to Go 1.25.3 2 months ago
go.toolchain.version go.toolchain.rev: update to Go 1.25.3 2 months ago
gomod_test.go go.mod: add test that replace directives aren't added in oss 2 years ago
header.txt cmd/k8s-operator: operator can create subnetrouter (#9505) 2 years ago
license_test.go wgengine/router{,/osrouter}: split OS router implementations into subpackage 2 months ago
pkgdoc_test.go all: skip looking for package comments in .git/ repository (#15384) 9 months ago
pull-toolchain.sh flake.nix: update Nix to use tailscale/go 1.25.2 (#17500) 2 months ago
shell.nix util/eventbus: allow logging of slow subscribers (#17705) 1 month ago
staticcheck.conf all: cleanup unused code, part 2 (#10670) 2 years ago
update-flake.sh flake.nix: update Nix to use tailscale/go 1.25.2 (#17500) 2 months ago
version-embed.go Fix various linting, vet & static check issues 11 months ago
version_tailscale_test.go tailscaleroot: panic if tailscale_go build tag but Go toolchain mismatch 1 year ago
version_test.go .github/workflows: test that ./go/tool version matches go mod version 6 months ago

README.md

Tailscale

https://tailscale.com

Private WireGuard® networks made easy

Overview

This repository contains the majority of Tailscale's open source code. Notably, it includes the tailscaled daemon and the tailscale CLI tool. The tailscaled daemon runs on Linux, Windows, macOS, and to varying degrees on FreeBSD and OpenBSD. The Tailscale iOS and Android apps use this repo's code, but this repo doesn't contain the mobile GUI code.

Other Tailscale repos of note:

For background on which parts of Tailscale are open source and why, see https://tailscale.com/opensource/.

Using

We serve packages for a variety of distros and platforms at https://pkgs.tailscale.com.

Other clients

The macOS, iOS, and Windows clients use the code in this repository but additionally include small GUI wrappers. The GUI wrappers on non-open source platforms are themselves not open source.

Building

We always require the latest Go release, currently Go 1.25. (While we build releases with our Go fork, its use is not required.)

go install tailscale.com/cmd/tailscale{,d}

If you're packaging Tailscale for distribution, use build_dist.sh instead, to burn commit IDs and version info into the binaries:

./build_dist.sh tailscale.com/cmd/tailscale
./build_dist.sh tailscale.com/cmd/tailscaled

If your distro has conventions that preclude the use of build_dist.sh, please do the equivalent of what it does in your distro's way, so that bug reports contain useful version information.

Bugs

Please file any issues about this code or the hosted service on the issue tracker.

Contributing

PRs welcome! But please file bugs. Commit messages should reference bugs.

We require Developer Certificate of Origin Signed-off-by lines in commits.

See commit-messages.md (or skim git log) for our commit message style.

About Us

Tailscale is primarily developed by the people at https://github.com/orgs/tailscale/people. For other contributors, see:

WireGuard is a registered trademark of Jason A. Donenfeld.