Commit Graph

678 Commits

Author SHA1 Message Date
Jason A. Donenfeld
a60b2a37d0 Retain aggressive socket reestablishment for now
This can be reverted once we've done more testing.
2018-12-22 15:45:09 +01:00
Roopesh Chander
2e37d511db Don't set username on NETunnelProviderProtocol
The username corresponds to the Account field in iOS system VPN UI,
but if we don't set it, the field is not shown, so setting it isn't
really required.
2018-12-22 16:13:31 +05:30
Roopesh Chander
09a96ec2a8 TunnelErrors: Add alert text for PacketTunnelProviderError 2018-12-22 16:05:43 +05:30
Roopesh Chander
baf99733f5 TunnelStatus: Absorb NEVPNStatus+CustomStringConvertible 2018-12-22 15:46:28 +05:30
Jason A. Donenfeld
08daec71aa Also refresh status 2018-12-22 07:07:53 +01:00
Jason A. Donenfeld
470da3ffcc Reassign tunnelProvider if it changes from outside the app 2018-12-22 06:56:12 +01:00
Eric Kuck
8fb8d9a9d2 All models now Equatable 2018-12-21 22:57:17 -06:00
Jason A. Donenfeld
053c655fc0 Clean up trailing whitespace 2018-12-22 05:30:35 +01:00
Jason A. Donenfeld
27cd93a898 Do not crash if we can't get socket.fileDescriptor 2018-12-22 05:13:04 +01:00
Eric Kuck
3269c54718 Removing a tunnel from iOS's settings is now immediately reflected in app 2018-12-21 21:59:43 -06:00
Jason A. Donenfeld
0b2d91a7f4 Localize remaining strings in network extension 2018-12-22 03:42:01 +01:00
Eric Kuck
4277887146 RTL support 2018-12-21 20:37:22 -06:00
Eric Kuck
1124d4d359 Strongly recommended now appears as placeholder for DNS when needed 2018-12-21 19:52:51 -06:00
Jason A. Donenfeld
d0cc2a8afd Combine double log invocations 2018-12-22 02:21:07 +01:00
Jason A. Donenfeld
2cfba533a5 Bump go bridge 2018-12-22 01:58:02 +01:00
Jason A. Donenfeld
cfdb4ec233 Attempt to strongly recommend things 2018-12-22 01:55:42 +01:00
Jason A. Donenfeld
30cf9a1d1d Move model helpers to model directory 2018-12-22 01:36:42 +01:00
Eric Kuck
0d841609f6 Fixes mock tunnels 2018-12-21 18:35:01 -06:00
Jason A. Donenfeld
bfb0eb5dae Do not set copyable back to true on reuse 2018-12-22 01:31:59 +01:00
Jason A. Donenfeld
e1c3d9b57a Move name from interface to tunnel 2018-12-22 00:28:18 +01:00
Jason A. Donenfeld
41af6d863e Fix paren typo
"I am very anti-paren." --Eric
2018-12-21 23:45:20 +01:00
Jason A. Donenfeld
775e174967 Nuke trailing spaces 2018-12-21 23:34:56 +01:00
Eric Kuck
c62c56da13 providerConfiguration is now a WgQuickConfig 2018-12-21 16:32:08 -06:00
Jason A. Donenfeld
137d453c0d Do not require NetworkExtension to know its own name 2018-12-21 22:05:47 +01:00
Eric Kuck
d7a27426e9 All migration stuff moved to one gross file 2018-12-21 12:51:14 -06:00
Jason A. Donenfeld
d540c1811c Simplify versioning of stored data 2018-12-21 18:58:06 +01:00
Jason A. Donenfeld
df698658d2 Get rid of superflous isActivateOnDemandEnabled key 2018-12-21 18:50:32 +01:00
Eric Kuck
f39893685f Updated NETunnelProvider save format 2018-12-21 16:42:16 +01:00
Jason A. Donenfeld
cab80f8fc0 NE: simplify logic 2018-12-21 15:56:03 +01:00
Roopesh Chander
b02754a7bd NE: Simplify DNS resolution 2018-12-21 19:24:22 +05:30
Roopesh Chander
6b48cb3095 Localize all the things 2018-12-21 18:34:09 +05:30
Roopesh Chander
01ea8f5f30 Tunnel detail: iPad: Handle deletion of tunnel correctly 2018-12-21 18:02:18 +05:30
Roopesh Chander
939e96e5c1 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.
2018-12-21 17:32:44 +05:30
Roopesh Chander
115e057d96 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
2018-12-21 15:52:47 +05:30
Eric Kuck
7ce5cb9d58 Added missing param in MockTunnels 2018-12-20 13:51:44 -06:00
Jason A. Donenfeld
19dc44f3fa wireguard-go-bridge: SDK_DIR is not defined for simulator 2018-12-20 20:47:49 +01:00
Eric Kuck
9c7f27f19f Enabled more swiftlint rules 2018-12-20 11:22:37 -06:00
Eric Kuck
cba41de73a Added a String->[String] helper 2018-12-20 10:46:26 -06:00
Roopesh Chander
f141cf83a6 TunnelErrors: Remove unused error 2018-12-20 19:44:57 +05:30
Roopesh Chander
d82aedebbd Tunnel edit: init() need not take a tunnelConfiguration argument 2018-12-19 18:35:53 +05:30
Roopesh Chander
d36b764e20 NE: Log whether tunnel was activated from the app or not 2018-12-19 18:35:53 +05:30
Roopesh Chander
8f46713b0d Remove non-helpful comments 2018-12-19 18:35:53 +05:30
Roopesh Chander
61c3928459 Tunnel edit: Fix comment 2018-12-19 18:35:53 +05:30
Roopesh Chander
4c1c1f013c TunnelsManager: If only Activate On Demand has changed, don't restart tunnel 2018-12-19 18:35:53 +05:30
Roopesh Chander
b8c331c72d 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.
2018-12-19 15:38:00 +05:30
Roopesh Chander
82ca9f7c5a NE: No need for two startTunnel() methods 2018-12-19 13:10:42 +05:30
Roopesh Chander
fe69fe57e4 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.
2018-12-19 12:48:10 +05:30
Roopesh Chander
efc593f7da 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.
2018-12-18 23:00:27 +05:30
Roopesh Chander
332e684ad0 s/Observervation/Observation/g; 2018-12-18 23:00:27 +05:30
Roopesh Chander
bc253b1aa8 Tunnel detail: Update restorationIdentifier when tunnel name changes 2018-12-18 19:27:31 +05:30