Commit Graph

858 Commits

Author SHA1 Message Date
Jason A. Donenfeld 9295895e3a Fix paren typo
"I am very anti-paren." --Eric

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 23:45:20 +01:00
Jason A. Donenfeld 7b9d4cb9e3 Nuke trailing spaces
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 23:34:56 +01:00
Eric Kuck 1fecd8eb6c providerConfiguration is now a WgQuickConfig
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-21 16:32:08 -06:00
Jason A. Donenfeld accf60b82f Do not require NetworkExtension to know its own name
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 22:05:47 +01:00
Eric Kuck f6af9d9ffb All migration stuff moved to one gross file
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-21 12:51:14 -06:00
Jason A. Donenfeld 78b38a4eba Simplify versioning of stored data
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 18:58:06 +01:00
Jason A. Donenfeld ec031b1f19 Get rid of superflous isActivateOnDemandEnabled key
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 18:50:32 +01:00
Eric Kuck 8553723e04 Updated NETunnelProvider save format
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-21 16:42:16 +01:00
Jason A. Donenfeld 38445114e0 NE: simplify logic
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-21 15:56:03 +01:00
Roopesh Chander a21c569e9f NE: Simplify DNS resolution
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-21 19:24:22 +05:30
Roopesh Chander 0552d75aa1 Localize all the things
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-21 18:34:09 +05:30
Roopesh Chander e47a8232d8 Tunnel detail: iPad: Handle deletion of tunnel correctly
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-21 18:02:18 +05:30
Roopesh Chander f818cdd963 NE: Update listen port only when first interface changes
When handling network path changes, change the listen port
only when the first interface has changed.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-21 17:32:44 +05:30
Roopesh Chander 28ce4d5164 NE: Change handling of bad domain names and Activate On Demand
The solution implemented in commit b8c331c causes the tunnel to
remain in 'Activating' state, without the ability to cancel that.

So, in this commit, instead of retrying DNS silently on
Activated-On-Demand tunnels, we fail the startTunnel() silently.

To summarize, if activate-on-demand is on:
- If started from the WireGuard app, show error using lastErrorFile
mechanism, suggesting a way to turn off Activate On Demand
- If not started from WireGuard app, don't call displayMessage()
(don't show error to user) and silently fail starting the tunnel

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-21 15:52:47 +05:30
Eric Kuck c2131cb757 Added missing param in MockTunnels
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-20 13:51:44 -06:00
Jason A. Donenfeld b23578dc7c wireguard-go-bridge: SDK_DIR is not defined for simulator
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-20 20:47:49 +01:00
Eric Kuck a89ad95901 Enabled more swiftlint rules
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-20 11:22:37 -06:00
Eric Kuck 5618c465a2 Added a String->[String] helper
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-20 10:46:26 -06:00
Roopesh Chander de08978a80 TunnelErrors: Remove unused error
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-20 19:44:57 +05:30
Roopesh Chander 9268c0c4bc Tunnel edit: init() need not take a tunnelConfiguration argument
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 18:35:53 +05:30
Roopesh Chander 5c501ac9a6 NE: Log whether tunnel was activated from the app or not
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 18:35:53 +05:30
Roopesh Chander 35450bf407 Remove non-helpful comments
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 18:35:53 +05:30
Roopesh Chander f93c9797ea Tunnel edit: Fix comment
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 18:35:53 +05:30
Roopesh Chander bba6d2f919 TunnelsManager: If only Activate On Demand has changed, don't restart tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 18:35:53 +05:30
Roopesh Chander fa51e3f1d1 NE: Handle bad domain names and Activate On Demand
This combination causes iOS to keep trying to bring up the tunnel,
leading to a lot of displayMessage() alerts.

In this fix, if we get a DNS resolution error in an Activate On Demand
enabled tunnel, we silently retry 9 times (with a 4-second delay before
each retry) and then show the displayMessage() alert.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 15:38:00 +05:30
Roopesh Chander 04a8c2ff5a NE: No need for two startTunnel() methods
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 13:10:42 +05:30
Roopesh Chander 4e516d6769 TunnelsManager: Handle waiting on a stale tunnel
If we have a stale tunnel on which we don't get status updates we rely
on a timer to update the status (see commit 34a7e5b).  Previously, if
the user tries to activate another tunnel, that resulted in both tunnels
waiting indefinitely. This commit fixes that.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-19 12:48:10 +05:30
Roopesh Chander fab7af6f38 Remove buttons and text from LaunchScreen.storyboard
With state restoration, we're not guaranteed that the
list view will get shown immediately after the launch screen.
So, generalize the launch screen as much as possible.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-18 23:00:27 +05:30
Roopesh Chander 3ae9fb538d s/Observervation/Observation/g;
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-18 23:00:27 +05:30
Roopesh Chander 78eaab8b5b Tunnel detail: Update restorationIdentifier when tunnel name changes
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-18 19:27:31 +05:30
Roopesh Chander 20f8abdf04 TunnelsManager: Add periods to end the system error messages
Because they can be part of a multi-sentence message when displayed
in the alert.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-18 15:47:20 +05:30
Roopesh Chander 2582ddd6f6 Error handling: Add info on the underlying system error to error alerts
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-17 19:04:17 +05:30
Jason A. Donenfeld 9556901a33 Version bump
This is our first release to the real app store.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-17 14:08:17 +01:00
Eric Kuck ed9b4c85ed Got TunnelsManager back under the max file length by splitting out NEVPNStatus+CustomStringConvertible
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-16 23:51:25 -06:00
Eric Kuck fc452753a7 Potential fix for insertRowAtIndexPath crash
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-16 21:11:33 -06:00
Jason A. Donenfeld d775682ef4 More proper way to get sdk root directory
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-17 00:23:11 +01:00
Jason A. Donenfeld ae339a000e Further generalize makefile
This should allow us to eventually build on macOS

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-16 03:51:43 +01:00
Jason A. Donenfeld a80cf6a0dc Bump the go runtime
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-16 01:55:04 +01:00
Jason A. Donenfeld 727992f5d2 Improve mock tunnels generation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-16 01:51:14 +01:00
Roopesh Chander 2a22c0f2d6 Provide mock tunnels for the Simulator
To help in generation of screenshots for the App Store

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-12-16 01:15:10 +05:30
Jason A. Donenfeld b3f5635f4e Nuke duplicate file
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15 06:21:49 +01:00
Jason A. Donenfeld 946524aa8b Bump the go runtime
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15 06:14:05 +01:00
Jason A. Donenfeld 1450538846 Version bump
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15 05:08:31 +01:00
Eric Kuck 5a08c67f33 Fixed editable KeyValueCells being copyable
Fixed DNS servers not saving

Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-14 21:48:48 -06:00
Jason A. Donenfeld 1e9c806614 Fix confusing indentation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15 04:42:46 +01:00
Eric Kuck ccd8cfe478 KeyValueCells now share code
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-14 20:02:37 -06:00
Eric Kuck cb051f695d Reorganized project structure
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-14 17:27:11 -06:00
Eric Kuck 7a24f18eb7 Most similar views now shared between ViewControllers
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
2018-12-14 17:15:22 -06:00
Jason A. Donenfeld 83c95dc26d Prettier log time format
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-15 00:08:54 +01:00
Jason A. Donenfeld e0bc5e12b3 Simplify logging tags
This was roop's initial idea, and it turns out to be the better one, now
that we can pass cstrings more easily.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-14 22:53:42 +01:00