summaryrefslogtreecommitdiffhomepage
path: root/ipn/ipn_clone.go
AgeCommit message (Collapse)AuthorFilesLines
2026-01-23all: remove AUTHORS file and references to itWill Norris1-1/+1
This file was never truly necessary and has never actually been used in the history of Tailscale's open source releases. A Brief History of AUTHORS files --- The AUTHORS file was a pattern developed at Google, originally for Chromium, then adopted by Go and a bunch of other projects. The problem was that Chromium originally had a copyright line only recognizing Google as the copyright holder. Because Google (and most open source projects) do not require copyright assignemnt for contributions, each contributor maintains their copyright. Some large corporate contributors then tried to add their own name to the copyright line in the LICENSE file or in file headers. This quickly becomes unwieldy, and puts a tremendous burden on anyone building on top of Chromium, since the license requires that they keep all copyright lines intact. The compromise was to create an AUTHORS file that would list all of the copyright holders. The LICENSE file and source file headers would then include that list by reference, listing the copyright holder as "The Chromium Authors". This also become cumbersome to simply keep the file up to date with a high rate of new contributors. Plus it's not always obvious who the copyright holder is. Sometimes it is the individual making the contribution, but many times it may be their employer. There is no way for the proejct maintainer to know. Eventually, Google changed their policy to no longer recommend trying to keep the AUTHORS file up to date proactively, and instead to only add to it when requested: https://opensource.google/docs/releasing/authors. They are also clear that: > Adding contributors to the AUTHORS file is entirely within the > project's discretion and has no implications for copyright ownership. It was primarily added to appease a small number of large contributors that insisted that they be recognized as copyright holders (which was entirely their right to do). But it's not truly necessary, and not even the most accurate way of identifying contributors and/or copyright holders. In practice, we've never added anyone to our AUTHORS file. It only lists Tailscale, so it's not really serving any purpose. It also causes confusion because Tailscalars put the "Tailscale Inc & AUTHORS" header in other open source repos which don't actually have an AUTHORS file, so it's ambiguous what that means. Instead, we just acknowledge that the contributors to Tailscale (whoever they are) are copyright holders for their individual contributions. We also have the benefit of using the DCO (developercertificate.org) which provides some additional certification of their right to make the contribution. The source file changes were purely mechanical with: git ls-files | xargs sed -i -e 's/\(Tailscale Inc &\) AUTHORS/\1 contributors/g' Updates #cleanup Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
2025-11-25cmd/tailscale/cli,ipn,all: make peer relay server port a *uint16Jordan Whited1-1/+1
In preparation for exposing its configuration via ipn.ConfigVAlpha, change {Masked}Prefs.RelayServerPort from *int to *uint16. This takes a defensive stance against invalid inputs at JSON decode time. 'tailscale set --relay-server-port' is currently the only input to this pref, and has always sanitized input to fit within a uint16. Updates tailscale/corp#34591 Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-11-24cmd/tailscale,feature/relayserver,ipn: add relay-server-static-endpoints set ↵Jordan Whited1-34/+36
flag Updates tailscale/corp#31489 Updates #17791 Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-11-17ipn{,/local},cmd/tailscale: add "sync" flag and pref to disable control map pollBrad Fitzpatrick1-0/+1
For manual (human) testing, this lets the user disable control plane map polls with "tailscale set --sync=false" (which survives restarts) and "tailscale set --sync" to restore. A high severity health warning is shown while this is active. Updates #12639 Updates #17945 Change-Id: I83668fa5de3b5e5e25444df0815ec2a859153a6d Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2025-11-16ipn/ipnlocal: add PROXY protocol support to Funnel/ServeAndrew Dunham1-4/+5
This adds the --proxy-protocol flag to 'tailscale serve' and 'tailscale funnel', which tells the Tailscale client to prepend a PROXY protocol[1] header when making connections to the proxied-to backend. I've verified that this works with our existing funnel servers without additional work, since they pass along source address information via PeerAPI already. Updates #7747 [1]: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt Change-Id: I647c24d319375c1b33e995555a541b7615d2d203 Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
2025-10-29ipn: add support for HTTP Redirects (#17594)Fernando Serboncini1-0/+1
Adds a new Redirect field to HTTPHandler for serving HTTP redirects from the Tailscale serve config. The redirect URL supports template variables ${HOST} and ${REQUEST_URI} that are resolved per request. By default, it redirects using HTTP Status 302 (Found). For another redirect status, like 301 - Moved Permanently, pass the HTTP status code followed by ':' on Redirect, like: "301:https://tailscale.com" Updates #11252 Updates #11330 Signed-off-by: Fernando Serboncini <fserb@tailscale.com>
2025-10-28ipn/ipnlocal/serve: remove grant header truncation logicGesa Stupperich1-5/+5
Given that we filter based on the usercaps argument now, truncation should not be necessary anymore. Updates tailscale/corp/#28372 Signed-off-by: Gesa Stupperich <gesa@tailscale.com>
2025-10-28ipn/ipnlocal/serve: add grant headersGesa Stupperich1-4/+6
Updates tailscale/corp/#28372 Signed-off-by: Gesa Stupperich <gesa@tailscale.com>
2025-07-03cmd/tailscale/cli,ipn,ipn/ipnlocal: add AutoExitNode preference for ↵Nick Khyl1-0/+1
automatic exit node selection With this change, policy enforcement and exit node resolution can happen in separate steps, since enforcement no longer depends on resolving the suggested exit node. This keeps policy enforcement synchronous (e.g., when switching profiles), while allowing exit node resolution to be asynchronous on netmap updates, link changes, etc. Additionally, the new preference will be used to let GUIs and CLIs switch back to "auto" mode after a manual exit node override, which is necessary for tailscale/corp#29969. Updates tailscale/corp#29969 Updates #16459 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-04-09cmd/tailscale,ipn: add relay-server-port "tailscale set" flag and Prefs ↵Jordan Whited1-0/+4
field (#15594) This flag is currently no-op and hidden. The flag does round trip through the related pref. Subsequent commits will tie them to net/udprelay.Server. There is no corresponding "tailscale up" flag, enabling/disabling of the relay server will only be supported via "tailscale set". This is a string flag in order to support disablement via empty string as a port value of 0 means "enable the server and listen on a random unused port". Disablement via empty string also follows existing flag convention, e.g. advertise-routes. Early internal discussions settled on "tailscale set --relay="<port>", but the author felt this was too ambiguous around client vs server, and may cause confusion in the future if we add related flags. Updates tailscale/corp#27502 Signed-off-by: Jordan Whited <jordan@tailscale.com>
2025-01-30ipn: generate LoginProfileView and use it instead of *LoginProfile where ↵Nick Khyl1-0/+23
appropriate Conventionally, we use views (e.g., ipn.PrefsView, tailcfg.NodeView, etc.) when dealing with structs that shouldn't be mutated. However, ipn.LoginProfile has been an exception so far, with a mix of passing and returning LoginProfile by reference (allowing accidental mutations) and by value (which is wasteful, given its current size of 192 bytes). In this PR, we generate an ipn.LoginProfileView and use it instead of passing/returning LoginProfiles by mutable reference or copying them when passing/returning by value. Now, LoginProfiles can only be mutated by (*profileManager).setProfilePrefs. Updates #14823 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-01-22tailcfg: add ServiceNameAdrian Dewhurst1-2/+2
Rather than using a string everywhere and needing to clarify that the string should have the svc: prefix, create a separate type for Service names. Updates tailscale/corp#24607 Change-Id: I720e022f61a7221644bb60955b72cacf42f59960 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2024-12-02IPN: Update ServeConfig to accept configuration for Services.KevinLiang101-0/+49
This commit updates ServeConfig to allow configuration to Services (VIPServices for now) via Serve. The scope of this commit is only adding the Services field to ServeConfig. The field doesn't actually allow packet flowing yet. The purpose of this commit is to unblock other work on k8s end. Updates #22953 Signed-off-by: KevinLiang10 <37811973+KevinLiang10@users.noreply.github.com>
2024-10-16cmd/tailscale,ipn,tailcfg: add `tailscale advertise` subcommand behind ↵Naman Sood1-0/+2
envknob (#13734) Signed-off-by: Naman Sood <mail@nsood.in>
2024-07-11cmd/cloner, cmd/viewer, util/codegen: add support for generic types and ↵Nick Khyl1-5/+26
interfaces This adds support for generic types and interfaces to our cloner and viewer codegens. It updates these packages to determine whether to make shallow or deep copies based on the type parameter constraints. Additionally, if a template parameter or an interface type has View() and Clone() methods, we'll use them for getters and the cloner of the owning structure. Updates #12736 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2024-05-17ipn,wgengine: remove vestigial Prefs.AllowSingleHostsBrad Fitzpatrick1-1/+1
It was requested by the first customer 4-5 years ago and only used for a brief moment of time. We later added netmap visibility trimming which removes the need for this. It's been hidden by the CLI for quite some time and never documented anywhere else. This keeps the CLI flag, though, out of caution. It just returns an error if it's set to anything but true (its default). Fixes #12058 Change-Id: I7514ba572e7b82519b04ed603ff9f3bdbaecfda7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-05-06various: implement stateful firewalling on Linux (#12025)Andrew Lytvynov1-0/+2
Updates https://github.com/tailscale/corp/issues/19623 Change-Id: I7980e1fb736e234e66fa000d488066466c96ec85 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Co-authored-by: Andrew Dunham <andrew@du.nham.ca>
2024-04-16ipn/{localapi, ipnlocal}: forget the prior exit node when localAPI is used ↵Jonathan Nobels1-1/+1
to zero the ExitNodeID (#11681) Updates tailscale/corp#18724 When localAPI clients directly set ExitNodeID to "", the expected behaviour is that the prior exit node also gets zero'd - effectively setting the UI state back to 'no exit node was ever selected' The IntenalExitNodePrior has been changed to be a non-opaque type, as it is read by the UI to render the users last selected exit node, and must be concrete. Future-us can either break this, or deprecate it and replace it with something more interesting. Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
2024-04-07ipn/{ipnlocal,localapi}: add API to toggle use of exit nodeBrad Fitzpatrick1-0/+1
This is primarily for GUIs, so they don't need to remember the most recently used exit node themselves. This adds some CLI commands, but they're disabled and behind the WIP envknob, as we need to consider naming (on/off is ambiguous with running an exit node, etc) as well as automatic exit node selection in the future. For now the CLI commands are effectively developer debug things to test the LocalAPI. Updates tailscale/corp#18724 Change-Id: I9a32b00e3ffbf5b29bfdcad996a4296b5e37be7e Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-04-03tailscale: update tailfs functions and vars to use drive naming (#11597)Charlotte Brandhorst-Satzkorn1-5/+5
This change updates all tailfs functions and the majority of the tailfs variables to use the new drive naming. Updates tailscale/corp#16827 Signed-off-by: Charlotte Brandhorst-Satzkorn <charlotte@tailscale.com>
2024-04-02tailscale: update tailfs file and package names (#11590)Charlotte Brandhorst-Satzkorn1-3/+3
This change updates the tailfs file and package names to their new naming convention. Updates #tailscale/corp#16827 Signed-off-by: Charlotte Brandhorst-Satzkorn <charlotte@tailscale.com>
2024-03-08ipn,tailfs: tie TailFS share configuration to user profilePercy Wegmann1-0/+8
Previously, the configuration of which folders to share persisted across profile changes. Now, it is tied to the user's profile. Updates tailscale/corp#16827 Signed-off-by: Percy Wegmann <percy@tailscale.com>
2023-12-05linuxfw,wgengine/route,ipn: add c2n and nodeattrs to control linux netfilterNaman Sood1-0/+1
Updates tailscale/corp#14029. Signed-off-by: Naman Sood <mail@nsood.in>
2023-11-01ipn: introduce app connector advertisement preference and flagsJames Tucker1-0/+1
Introduce a preference structure to store the setting for app connector advertisement. Introduce the associated flags: tailscale up --advertise-connector{=true,=false} tailscale set --advertise-connector{=true,=false} ``` % tailscale set --advertise-connector=false % tailscale debug prefs | jq .AppConnector.Advertise false % tailscale set --advertise-connector=true % tailscale debug prefs | jq .AppConnector.Advertise true % tailscale up --advertise-connector=false % tailscale debug prefs | jq .AppConnector.Advertise false % tailscale up --advertise-connector=true % tailscale debug prefs | jq .AppConnector.Advertise true ``` Updates tailscale/corp#15437 Signed-off-by: James Tucker <james@tailscale.com>
2023-10-31ipn: add user pref for running web clientWill Norris1-0/+1
This is not currently exposed as a user-settable preference through `tailscale up` or `tailscale set`. Instead, the preference is set when turning the web client on and off via localapi. In a subsequent commit, the pref will be used to automatically start the web client on startup when appropriate. Updates tailscale/corp#14335 Signed-off-by: Will Norris <will@tailscale.com>
2023-10-09ipn: add PostureChecks to PrefsKristoffer Dalby1-0/+1
Updates #5902 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
2023-09-13cmd/tailscale/cli: use optimistic concurrency control on SetServeConfigMarwan Sulaiman1-0/+1
This PR uses the etag/if-match pattern to ensure multiple calls to SetServeConfig are synchronized. It currently errors out and asks the user to retry but we can add occ retries as a follow up. Updates #8489 Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
2023-09-05ipn, ipn/ipnlocal: add Foreground field to ServeConfigMarwan Sulaiman1-0/+7
This PR adds a new field to the ServeConfig which maps WatchIPNBus session ids to foreground serve configs. The PR also adds a DeleteForegroundSession method to ensure the config gets cleaned up on sessions ending. Note this field is not currently used but will be in follow up work. Updates #8489 Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
2023-09-01cmd/tailscale,ipn: add auto-update flags and prefs (#8861)Andrew Lytvynov1-0/+1
The flags are hidden for now. Adding propagation to tailscaled and persistence only. The prefs field is wrapped in a struct to allow for future expansion (like update schedule). Updates #6907 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-08-20cmd/cloner: use maps.Clone and ptr.ToMaisem Ali1-6/+2
Updates #cleanup Signed-off-by: Maisem Ali <maisem@tailscale.com>
2023-06-21{cmd/tailscale/cli,ipn}: add http support to tailscale serve (#8358)shayne1-0/+1
Updates #8357 Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-11-29ipn,types/persist: add DisallowedTKAStateIDs, refactor as view typeTom DNetto1-4/+1
Supercedes https://github.com/tailscale/tailscale/pull/6557, precursor to trying https://github.com/tailscale/tailscale/pull/6546 again Signed-off-by: Tom DNetto <tom@tailscale.com>
2022-11-22ipn: add ability to name profilesMaisem Ali1-0/+1
Updates #713 Signed-off-by: Maisem Ali <maisem@tailscale.com>
2022-11-17cmd/tailscale/cli: flesh out serve CLI and tests (#6304)shayne1-7/+7
Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
2022-11-10ipn/ipnlocal: add optional TLS termination on proxied TCP connectionsBrad Fitzpatrick1-1/+1
Updates tailscale/corp#7515 Change-Id: Ib250fa20275971563adccfa72db48e0cec02b7a5 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-11-10ipn/localapi: introduce get/set config for serve (#6243)shayne1-2/+2
Updates tailscale/corp#7515 Signed-off-by: Shayne Sweeney <shayne@tailscale.com>
2022-11-10ipn/ipnlocal, tailcfg: wire up ingress peerapiBrad Fitzpatrick1-2/+9
Updates tailscale/corp#7515 Co-authored-by: Shayne Sweeney <shayne@tailscale.com> Change-Id: I7eac7b4ac37fd8e8a9e0469594c1e9e7dd0da666 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-11-09ipn/ipnlocal: start implementing web server bits of serveBrad Fitzpatrick1-0/+1
Updates tailscale/corp#7515 Change-Id: I96f4016161ba3c370492da941274c6d9a234c2bb Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-11-09ipn: add WebServerConfig, add viewsBrad Fitzpatrick1-0/+86
cmd/viewer couldn't deal with that map-of-map. Add a wrapper type instead, which also gives us a place to add future stuff. Updates tailscale/corp#7515 Change-Id: I44a4ca1915300ea8678e5b0385056f0642ccb155 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-09-01cmd/tailscale/cli: add backwards compatibility 'up' processing for legacy clientBrad Fitzpatrick1-0/+1
Updates tailscale/corp#6781 Change-Id: I843fc810cbec0140d423d65db81e90179d6e0fa5 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-07-25net/netaddr: start migrating to net/netip via new netaddr adapter packageBrad Fitzpatrick1-3/+4
Updates #5162 Change-Id: Id7bdec303b25471f69d542f8ce43805328d56c12 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2022-05-06cmd/cloner,util/codegen: refactor cloner internals to allow reuseMaisem Ali1-0/+55
Also run go generate again for Copyright updates. Signed-off-by: Maisem Ali <maisem@tailscale.com>