Commit Graph

82 Commits (1b42117791266251b41959fc18e6c6215a85f739)

Author SHA1 Message Date
kari-ts 1b42117791
use network callback to update DNS config when network changes (#147)
* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Fixes #10107

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

hi

* hi

* .

* use network callback to update DNS config when network changes

-Use requestNetwork, which gets the best network matching the passed in network request, to listen for changes to network and cache DNS config
-Call netmon.InjectEvent on network change to indicate a change
Follow-up will fix issue in netmon where IsMajorChangeFrom doesn't identify major changes when a network is added

Updates tailscale/tailscale/#10107

* fixed missing connectivity manager
5 months ago
Brad Fitzpatrick c21bbc94a1 cmd/tailscale: prefer showing Sharer user over Owner user
Fixes tailscale/corp#14056
Updates tailscale/tailscale#8967

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
8 months ago
Maisem Ali 50b5b851eb
go.mod: bump oss (#130)
Updates #oss

Signed-off-by: Maisem Ali <maisem@tailscale.com>
9 months ago
Charlotte Brandhorst-Satzkorn aba683bb61
cmd/tailscale: rebind magicsock.Conn onConnect (#126)
We have been getting into routing loops due to the timing of when we
bind sockets on starting the tailscale app. At this point, we do
not have access to `VpnService.protect()` and are unable to protect
the magicsock sockets, which causes a routing loop issue until we
forcibly rebind about 10 minutes into the service being started.

This change causes a rebind when the service is started, which restores
connectivity in cases where the socket was unprotected.

Updates tailscale/corp#13814
10 months ago
Denton Gentry 31f2aa8097 cmd/tailscale/main.go: use ipn.NewPrefs(), not &ipn.Prefs{}
ipn.NewPrefs() sets accepting DNS and routes to true,
among other things. &ipn.Prefs{} initializes all fields
to false.

Fixes https://github.com/tailscale/corp/issues/13377

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
10 months ago
kari-ts 04b79a2206
cmd/tailscale: if first notification, set hostname even if prefs is nil (#111)
Currently, if the notification (ipn.Notify) has a nil Prefs, the hostname defaults to localhost

Fixes #7875

Signed-off-by: kari-ts <kari@tailscale.com>
11 months ago
Brad Fitzpatrick f44692addd
cmd/tailscale: don't render ShareeNode peers (#98)
Fixes tailscale/corp#11006

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
11 months ago
Charlotte Brandhorst-Satzkorn 39717f946b
Revert "Add DNS/routing prefs like on desktop (#86)" (#108)
This reverts commit d316acaa3d.
12 months ago
RoboMagus 13ecd3e34d
Exit node in notification (#96)
* Show exitnode in persistent notification when connected.
* updateNotification when exitnode changes

Fixes https://github.com/tailscale/tailscale/issues/4642

Signed-off-by: RoboMagus <68224306+RoboMagus@users.noreply.github.com>
1 year ago
Gero Gerke d316acaa3d
Add DNS/routing prefs like on desktop (#86)
ui: Add DNS/routing prefs like on desktop

Fixes https://github.com/tailscale/tailscale/issues/2155

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
Denton Gentry 62cc5fe074
cmd/tailscale: update to latest gioui.org. (#73)
There were several API changes since we last updated. We
followed examples from the upstream Gio repository:

1. Replace unit.Px with unit.Dp.
   Followed example in:
   3d37491342

2. op.Offset now takes int coordinates instead of float.
   Followed example in:
   a63e0cb44a

3. clip.RRect now takes int coordinates instead of float.
   Followed example in:
   48a8540a68

4. Replace system.CommandEvent with key.Event.
   Followed example in:
   6c76fa6dec

Updates https://github.com/tailscale/tailscale/issues/6824

Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
Denton Gentry 0244fd108d
cmd/tailscale: fix alternate ControlURL handling. (#72)
With the Fast User Switching support in Tailscale 1.34,
it is no longer necessary (nor sufficient) to exit
and restart the app, as the settings are saved upon
first connection.

Therefore:
- do not restart the app after changing the control URL,
  just go back to the authentication screen.
- call `ipn/ipnlocal/local.go:Start()` to reinitialize
  the backend using the new auth URL.

Fixes https://github.com/tailscale/tailscale/issues/6671

Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
1 year ago
Denton Gentry 1181155b7d go.mod: update from OSS.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Denton Gentry 26e72f15ef go.mod: update from OSS.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Andrew Dunham 576b46f8f7
cmd/tailscale: show an error when we hit the multiple users Android bug (#65)
Updates tailscale/tailscale#2180

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
2 years ago
Will Norris 901c43c3b9 android: add about dialog with license link
Add "about" menu item in both the logged out and logged in menus.  About
dialog shows Tailscale version and link to URL with open source
licenses.

Updates tailscale/corp#5780

Signed-off-by: Will Norris <will@tailscale.com>
2 years ago
Denton Gentry bbf31f568f
UI: remove "No internet connection" (#57)
This has never worked well. I think we'd need to periodically re-check
link state, and possibly hook up a generate_204 function, to make this
really work.

Fixes https://github.com/tailscale/tailscale/issues/5422

Signed-off-by: Denton Gentry <dgentry@tailscale.com>

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Trevor Bergeron d8aedf721a Add ability to choose a custom coordination server
Signed-off-by: Trevor Bergeron <mal@sec.gd>
2 years ago
Denton Gentry 1a0253892b go.mod: update from OSS.
Includes netaddr -> netip changes.

main.go getInterfaces still uses netaddr as it needs to return
a net.IPNet (we'd need to add a new implementation in
7c671b0220/net/interfaces/interfaces.go (L110)
to handle a different type).

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Elias Naur 83bfea18bb cmd/tailscale,com/tailscale/ipn: implement QR sign-in for TV devices
This is a cleand up version of #27.

Fixes tailscale/tailscale#1611

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2 years ago
Denton Gentry 5868fdb7b0 go.mod: update OSS from HEAD.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2 years ago
Brad Fitzpatrick e3f7123238 Add "Allow LAN access" checkbox in Exit Node menu
Updates tailscale/tailscale#2155
2 years ago
Brad Fitzpatrick 9d801a42d7 Add secret Run Exit Node option when "debug" is searched for.
And bump tailscale dep, to bring in new ipn.Prefs API and wire up
ExitDNS for Android.

This change has no visible behavior change to anybody unless they
search for "debug" and then hit the "..." menu.

Updates tailscale/tailscale#1738

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2 years ago
Brad Fitzpatrick ed29f4b3d2 cmd/tailscale: add "Bug report" item to menu
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
2 years ago
Denton Gentry 79bb2f33d0 ui: more robust isConnected check.
1. Follow
   https://developer.android.com/training/monitoring-device-state/connectivity-status-type
   to determine whether to report ourself as having connectivity or not.

   Tested by turning the Wifi & LTE off and on, seems to work well in
   the contrived test case.

2. Call superclass for onLost() and onLinkPropertiesChanged() handlers.
   Current Android versions have no code in the superclass of these two
   callbacks, but future proofiness.

3. Log when the UI report of LostInternet changes, so we can find it.

Fixes https://github.com/tailscale/tailscale/issues/3542

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Denton Gentry 5c9cec0064 retrieve current DNS servers.
Add getDnsConfigAsString() to retrieve the current DNS
configuration from the Android platform. This implements
several mechanisms to retrieve DNS information, suitable
for different Android versions:

Android 7 and later use ConnectivityManager getAllNetworks(),
then iterate over each network to retrieve DNS servers and
search domains using the LinkProperties.

Android 6 and earlier can only retrieve the currently active
interface using ConnectivityManager getActiveNetwork(), but have
two additional fallback options which leverage the system
properties available in older Android releases.

--------

Also changed how LinkChange notification works, switching from
the older BroadcastReceiver of a ConnectivityManager Intent to
the newer ConnectivityManager.registerNetworkCallback. We need
this because the onAvailable event is too early, we get notified
that LTE is up before its DNS servers have been set. We need
to wait for the onLinkPropertiesChanged event instead, which is
only available with registerNetworkCallback.

Fixes https://github.com/tailscale/tailscale/issues/2116
Updates https://github.com/tailscale/tailscale/issues/988

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Denton Gentry 02a6ae0e0d cmd/tailscale: implement getInterfaces + SDK 30
SDK 30 prohibits syscall.NetlinkRIB(syscall.RTM_GETADDR, ...)
which Go's net.Interfaces uses. Implement an Android
specific version of net.Interfaces to use instead.

Passing primitive types across JNI is relatively straightforward,
passing a single object of a complex class is annoying but still
possible, but passing lists and other more complex data structures is
way harder. As such, this commit added a Java routine to render the
interface information to a string and pass that across JNI as a
primitive type for Go code to parse.

Fixes https://github.com/tailscale/tailscale/issues/2293
3 years ago
Brad Fitzpatrick a5bed46c9c cmd/tailscale: use hostinfo setters for OSVersion, DeviceModel
Stop abusing Prefs, which bit us in the iOS client. We're going to
remove the ipn.Prefs mechanism.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
3 years ago
Denton Gentry 59aecdb2e5 cmd/tailscale: report ChromeOS.
Fixes https://github.com/tailscale/tailscale/issues/2971

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
3 years ago
Elias Naur 84b484a954 android,cmd/tailscale: implement taildrop receive for Android < 10
Fixes tailscale/tailscale#2720
Fixes tailscale/tailscale#2296

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 54eab1a5d3 cmd/tailscale: delete unused FileTargetsEvent; gofmt
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 10ded1bad2 cmd/tailscale,java: implement file sharing
Fixes tailscale/tailscale#1809

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 131bf27995 cmd/tailscale: use go:embed directives for image files
Fixes tailscale/tailscale#2243

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Brad Fitzpatrick b97cc703d8 Fix routing loop prevention, MagicDNS forwarding over Tailscale.
Fixes tailscale/tailscale#2102
Updates tailscale/tailscale#1809

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
3 years ago
Brad Fitzpatrick ac8ec020b8 Update to Tailscale 1.10.
Updates tailscale/tailscale#2102
Updates tailscale/tailscale#1809
3 years ago
Elias Naur 06e461d703 go.*,cmd/tailscale: upgrade to tailscale.com v1.8.3
Updates tailscale/tailscale#1695

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 633d81287a cmd/tailscale,com/tailscale/ipn: delete unused constant, reformat
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur e2d731dbba ensure exit node status is updated when changing it
Fixes tailscale/tailscale#1545

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 3b1a5e7a71 cmd/tailscale: implement Tailscale 1.6 default route setting
Fixes tailscale/tailscale#1401

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 71e0f2bd94 cmd/tailscale,go.*: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 56362cc61a cmd/tailscale,go.*: upgrade to latest tailscale
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur b151de039b cmd/tailscale: simplify non-blocking coalescing channels
Three variables are used everywhere a single non-blocking producer sends
values where only the latest is relevant:

    var (
	    mu sync.Mutex
	    latest T
	    notify = make(chan struct{}, 1)
    )

By draining the notification channel before sending through it, we
can simplify to just one channel:

    latest = make(chan T, 1)

Thanks to Chris Waldon for showing me this neat trick.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 33cf7c0aa1 jni: replace True and False with more convenient Bool function
Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 07b2373e6b com/tailscale/ipn,cmd/tailscale: handle quick tile clicks while signed out
Specifically, start the main activity to prompt the user to sign in or
be notified of a pending machine auth.

Fixes tailscale/tailscale#1225

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Sonia Appasamy c4f626c5a7 cmd/tailscale: use node.DisplayName for machine names
Update to tailscale 1.4.0 while here.

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
3 years ago
Elias Naur ba38a9bb59 jni,cmd/tailscale: replace jni.EnvFor with explicit conversion
The EnvFor converted an uintptr to a pointer value, which is not
guaranteed to work in general. This change removes EnvFor and pushes the
potentially unsafe conversion to users of the jni package.

Fixes tailscale/tailscale#1195

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 61d9733b24 jni,cmd/tailscale: replace jni.JVMFor with direct cast
The JVMFor function converted an uintptr to a pointer, which is not
guaranteed to work in general. This change removes JVMFor, forcing the
unsafe conversion to the user of the jni packge.

Updates tailscale/tailscale#1195

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 years ago
Elias Naur 2c9fddab4f cmd/tailscale: warn when debug signed and Google Sign-In fails
Fixes tailscale/tailscale#1036

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 9db851a113 cmd/tailscale: notify user when VPN access is denied
When tailscale starts, any other active VPN service is automatically closed by the system.
However, if the other VPN service is configured to be always-on, we will be denied access
to set up a VPN. The user may not realize this case, so this change adds a notification
when we're denied access.

The failure mode is identical to the user denying access tthrough the system dialog
shown first time Tailscale starts, so the notification also mentions that case.

Fixes tailscale/tailscale#1017

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 129abdb13f cmd/tailscale: close Tailscale when user cancels system VPN dialog
Fixes tailscale/tailscale#904

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago