Commit Graph

71 Commits (6f6d319048bc587a431ad464e7145c2e6fbf0e8f)

Author SHA1 Message Date
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>
2 years 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
3 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>
3 years ago
Brad Fitzpatrick ed29f4b3d2 cmd/tailscale: add "Bug report" item to menu
Signed-off-by: Brad Fitzpatrick <brad@danga.com>
3 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
Elias Naur f2c035a8bf cmd/tailscale: note in Hostinfo.OSVersion if Google Play is unavailable
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 6d9acbb479 cmd/tailscale,java: refactor Google Sign-In into separate class
In preparation for the F-Droid release, refactor the non-free Google dependency
into a separate Java class and make the Go client tolerate missing support.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 233515e86a cmd/tailscale: move the App.appDir field to the only method that uses it
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 7de19cd9b8 cmd/tailscale: remove unused field stateStore.dataDir
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 1b402aebb0 cmd/tailscale,java/com/tailscale/ipn: always register the Peer Fragment
Before this change, the Peer would be registered across Activity restarts
but not after Activity destruction (for example, when the user pressed the
back button).

Use the newer Gio ViewEvent API for tracking the Activity lifecycle and
the most recent Activity reference.

Move Java calls that need an Activity from Peer to App, leaving Peer solely
as a method for receiving onActivityResult.

Fixes tailscale/tailscale#670

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 3089ad8347 cmd/tailsca,java/comt/tailscale/ipn: don't require an Activity for Google sign-out
The GoogleSignIn.getClient has a version that only needs a Context, not an Activity.

Updates tailscale/tailscale#670

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 05fc3ef433 cmd/tailscale: close overflow menu when the Android back button is pressed
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur a7dfea267c cmd/tailscale: fallback back to Google DNS on ChromeOS
Contrary to the VpnService.Builder documentation, ChromeOS doesn't
automatically fall back to the underlying network nameservers when
none are provided.

Updates tailscale/tailscale#431

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 9e45538997 cmd/tailscale,java/com/tailscale/ipn: provide OSVersion and DeviceModel for the backend
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 91d4d47fd8 cmd/tailscale: stop loader indicator when Google Sign-in is cancelled
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 15632cb15b cmd/tailscale: sign-out any Google users when logging out from Tailscale
Fixes tailscale/tailscale#585

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