Commit Graph

1004 Commits

Author SHA1 Message Date
Roopesh Chander b1ae13652c Importing: Import from zip in a background thread
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-15 13:39:56 +05:30
Roopesh Chander 203d6b4596 Importing: Refactor out zip importing into a separate class
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-14 18:52:10 +05:30
Roopesh Chander 2676ee0169 Tunnels manager: After saving after activating on-demand, reload tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-14 13:02:53 +05:30
Roopesh Chander c60c29b93c Tunnels manager: Need to keep VPN-on-demand tunnels's status under observation
Because they can turn on automatically, even while the app is in the foreground.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander bdb2411ebc Tunnel detail: Show VPN-on-demand information
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander 923d039a78 Tunnels manager: Keep track of NETunnelProviderManager's isOnDemandEnabled property
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander abb0312d38 Tunnel edit: Update for VPN-on-demand changes
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander f1b8de7312 Tunnel view model: VPN-on-demand stuff shouldn't be part of the tunnel model
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander cc122d7463 Model, Tunnels manager: Rewrite the model for VPN-on-demand
The VPN-on-demand settings should not be part of the tunnel
configuration. Rather, the onDemandRules stored in the
tunnel provider configuration serve as the one place
where the VPN-on-demand settings are stored.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-12 19:24:13 +05:30
Roopesh Chander 39a067cb96 TunnelsManager: Support for on-demand rules
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-11 01:31:38 +05:30
Roopesh Chander c5e8b05e8b Tunnel edit, Tunnel view model: UI for providing On-Demand activation options
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-11 01:18:36 +05:30
Roopesh Chander 4b7094d652 Model: Add activationType to tunnel configuration
We make sure existing tunnel serializations can be deserialized correctly.

We also bump up the tunnelConfigurationVersion, because the tunnel
configuration contents have changed.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-11 01:17:36 +05:30
Roopesh Chander 0f03ffc920 Model: ActivityType enum to represent VPN-on-demand options
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 19:17:24 +05:30
Roopesh Chander 1502bd42d3 Model: TunnelConfiguration: Add explicit conformance to Decodable
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 19:01:34 +05:30
Roopesh Chander 290f83d5ef Model: Ensure that a TunnelConfiguration always has a valid array of peers
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 17:02:30 +05:30
Roopesh Chander e8d68396ca VPN: When activating while another tunnel is active, deactivate the other tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 16:44:28 +05:30
Roopesh Chander 8e7bfb15ed TunnelsManager: startDeactivation() need not take a completion handler
Because the completion handler pattern doesn't fit in this case.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 16:44:28 +05:30
Roopesh Chander 95456ec956 VPN: There are no DNS errors to handle in the app now
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-10 16:44:28 +05:30
Roopesh Chander 7485474c4c NE: Minor refactoring to enable calling startTunnel() with a tunnelConfiguration
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-09 22:29:52 +05:30
Roopesh Chander 1d63509b92 VPN: Refresh tunnel statuses when app gets to the foreground
Because the tunnel could've be activated from iOS Settings now

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-09 19:29:34 +05:30
Roopesh Chander f3e32ab737 Remove unused code
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-09 19:20:33 +05:30
Roopesh Chander 59b9a6e5d2 TunnelsManager: Ability to refresh connection statuses
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-09 19:19:32 +05:30
Roopesh Chander 3136fe0e2c NE: When there's an error starting the tunnel, show it to the user using displayMessage()
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-09 17:07:42 +05:30
Roopesh Chander a1070d2b29 Remove unused file PacketTunnelOptionKey.swift
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 18:59:16 +05:30
Roopesh Chander 5ee4d392b5 Move logic to extension: Bring up the tunnel from the stored providerConfiguration
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 18:59:16 +05:30
Roopesh Chander c17e4a27a2 DNSResolver: Simplify
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 17:52:11 +05:30
Roopesh Chander 8409b7e929 DNSResolver: Let's not cache DNS resolution results anymore
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 17:52:11 +05:30
Roopesh Chander 651ffa0c51 DNSResolver: DNS resolution can now happen synchronously
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 17:52:11 +05:30
Roopesh Chander 4404bb2b7d Model: Endpoint.hostname()
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 17:52:11 +05:30
Roopesh Chander e66cf5264a Move logic to extension: NETunnelProviderProtocol extension code should be shared
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 17:52:01 +05:30
Roopesh Chander af58bfcb00 Move logic to extension: Refactor PacketTunnelOptionsGenerator into a PacketTunnelSettingsGenerator
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 15:44:13 +05:30
Roopesh Chander 2f7e437202 Move logic to extension: Move DNSResolver to extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 15:09:45 +05:30
Roopesh Chander 62573e2ad7 Move logic to extension: .resolvingEndpointDomains is not longer a valid status
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 15:08:57 +05:30
Roopesh Chander a5f9dc4821 Move logic to extension: DNS resolution no longer happens in the app
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 15:04:12 +05:30
Roopesh Chander 7827147bc8 Move logic to extension: Include shared model code when building the extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 14:50:05 +05:30
Roopesh Chander a473dfe4f8 Model: Move InterfaceConfiguration.publicKey to Curve25519.swift
The code for public key calculation need not be shared with the extension

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 14:48:25 +05:30
Roopesh Chander fb6a7f6007 Move logic to extension: Move PacketTunnelOptionsGenerator to the extension
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 14:16:30 +05:30
Roopesh Chander f7b04b0b5d Move logic to extension: Invoke startTunnel() without any options
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 14:15:01 +05:30
Roopesh Chander c88c660b51 Move logic to extension: Move model files to Shared
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 13:56:50 +05:30
Roopesh Chander ec2d67ea00 Tunnel edit: While preparing for reuse, should make onValueBeingEdited nil as well
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-08 12:25:36 +05:30
Jason A. Donenfeld 9840e94c84 Version bump
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-07 17:43:50 +01:00
Roopesh Chander 85a19da487 iPad: Ensure we set sourceRect for all cases where we use sourceView
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 17:43:30 +01:00
Roopesh Chander b5447add1e Info.plist: Register for handling public.text files for Open-in
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 17:43:30 +01:00
Roopesh Chander 879e9816aa Importing: Also support importing public.text files in the file picker
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 17:43:30 +01:00
Roopesh Chander 3269bb476a iPad: Set correct sourceRect for the popover anchored on the central 'Add' button
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 18:23:12 +05:30
Roopesh Chander b3515c937e TunnelsManager: Return a manager with no tunnels in the simulator
To be able to run at least parts of the app in the simulator.

Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 18:15:20 +05:30
Roopesh Chander 7e9ee913c1 iPad: Configuring the split-view controller should happen in init(), not loadView()
Signed-off-by: Roopesh Chander <roop@roopc.net>
2018-11-07 15:54:30 +05:30
Jason A. Donenfeld d0ec532bd3 Settings: show build id
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-07 05:45:39 +01:00
Jason A. Donenfeld ff6a293660 Make license consistent
We changed all the files and the README to MIT a long time ago but
forgot to update COPYING.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-07 01:26:32 +01:00
Jason A. Donenfeld c5c536318f Version bump
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-06 20:18:11 +01:00