Commit Graph

95 Commits (e8dfa1c833a20aa639e44dea658e071507968ca1)

Author SHA1 Message Date
Elias Naur e2d731dbba ensure exit node status is updated when changing it
Fixes tailscale/tailscale#1545

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 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>
4 years ago
Elias Naur 71e0f2bd94 cmd/tailscale,go.*: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 56362cc61a cmd/tailscale,go.*: upgrade to latest tailscale
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 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>
4 years ago
Elias Naur 33cf7c0aa1 jni: replace True and False with more convenient Bool function
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 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>
4 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>
4 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>
4 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>
4 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
Elias Naur 5a018c7209 cmd/tailscale: reset loader indicator after Google Sign-in
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 2119f8aa9d cmd/tailscale: avoid backend deadlocks from SetPrefs and LinkChange
Updates tailscale/tailscale#471 (perhaps fixes it)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur bae9b8394a android: add quick setting tile support
Fixes tailscale/tailscale#516

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur df1d8b338b cmd/tailscale: implement Google ID sign-in
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur ad92c8d81f cmd/tailscale: remove redundant locking
There are no more concurrent accesses to the prefs variable.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 22851bfa05 cmd/tailscale: add progress indicator to sign in buttons
For tailscale/tailscale#481

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur ec9bb108c6 cmd/tailscale: add Google sign-in button
Hidden behind a flag pending support from the Tailscale client.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur cd9c808dd2 java/com/tailscale,cmd/tailscale: remove webview signin
Adjust the Custom Tabs browser color to match the app header while
here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 8f621e531a cmd/tailscale: don't notify for never-expiring sessions
Fixes tailscale/tailscale#469

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 28c8a2e1e5 go.mod: change the module name to github.com/tailscale/tailscale-android
Makes it go-gettable.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 31b3c725c8 cmd/tailscale: reset cached config when failing to set up VPN tunnel
Add a bit of logging while here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 0d0a049057 cmd/tailscale: avoid deadlocking between backend calls and callbacks
The runBackend goroutine issues backend requests (StartLoginInteractive,
Logout, SetPrefs) from the same select that receives callbacks the
backend.

Avoid the potential for same-goroutine deadlock by issuing backend requests on
separate goroutines.

Fixes tailscale/tailscale#470

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 18adee11a5 cmd/tailscale: assume internet connectivity at startup
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur bfd730f3d7 cmd/tailscale: handle IPN callbacks from the backend goroutine
Before this change, the notification and configuration callbacks
raced with the backend goroutine.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 4c1017a548 cmd/tailscale,android: bump gio version
Updates tailscale/tailscale#431 (fixes a resize crash)

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur adb6bb736b cmd/tailscale: dim want-running switch when not authorized
Updates tailscale/tailscale#420

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 5de04d4177 cmd/tailscale: bump gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 8ae20a98eb cmd/tailscale: synchronize UI switch with ipn.Prefs.WantRunning
Updates tailscale/tailscale#420

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 3db59c3a9b cmd/tailscale,java/com/tailscale/ipn: set hostname to Build.MODEL
Fixes tailscale/tailscale#409

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur dd6a68bae7 cmd/tailscale: use Stopped as the barrier state for enabling the VPN
NeedsLogin is not the correct barrier because NeedsMachineAuth should also
block VPN startup.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago
Elias Naur 5109987e18 all: initial commit
Signed-off-by: Elias Naur <mail@eliasnaur.com>
4 years ago