aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* More linter warnings fixed, enabled more swiftlint rules, project cleanupEric Kuck2018-12-1221-521/+572
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Tons more swiftlint warnings fixed. Still a few remaining.Eric Kuck2018-12-1221-237/+222
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Added swiftlint and fixed all errors (and a bunch, but not all, warnings)Eric Kuck2018-12-1225-406/+437
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Zip importing: importFromFile should take a completionHandlerRoopesh Chander2018-12-122-7/+13
| | | | | | | Deletion of the being-imported file should be done in the completionHandler. Signed-off-by: Roopesh Chander <roop@roopc.net>
* ErrorPresenter: Support onPresented for showErrorAlert(title:,message:)Roopesh Chander2018-12-121-3/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Zip importing: Handle spaces in filenames correctlyRoopesh Chander2018-12-122-13/+14
| | | | | | | Previously, if a filename of a .conf file inside the zip file contained spaces, it was not imported. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Supply missing pieces of path changeJason A. Donenfeld2018-12-124-13/+27
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Fixed a potential race condition, better naming on PacketTunnelSettingsGenerator methodsEric Kuck2018-12-112-18/+24
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Added an (unfinished) NWPathMonitor implementation for reconnecting on network changesEric Kuck2018-12-113-1/+42
| | | | Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
* Revert pure-go network monitoring and add wgSetConfigJason A. Donenfeld2018-12-112-84/+18
| | | | | | | This reverts commit 99f0e457c34480f25582d7b4ed509404712c648c and adds a function too. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* State restoration: Don't create duplicate mainVC and tunnelsListVCRoopesh Chander2018-12-111-6/+1
| | | | | | | | | | | | | | | | | | | This creates a duplicate tunnels manager, leading to problems tracking tunnel statuses. To reproduce the bug that this commit fixes, you can do the following: 1. Remove all tunnels 2. Run in Xcode 3. Import zip with ~10 tunnels 4. Stop app in Xcode 5. Run in Xcode 6. Turn on 1st tunnel, after it's on, turn off Turn on 2nd tunnel, after it's on, turn off ... After 6-8 tunnels, the spinner doesn't show up, indicating that the status is not being tracked. Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Error out only on no-internet scenarioRoopesh Chander2018-12-111-4/+4
| | | | | | The other scenario happens even during reloading of a tunnel for activation. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Remove the feature of waiting for another tunnel to deactivateRoopesh Chander2018-12-113-59/+11
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Deactivate only when the status becomes 'connected'Roopesh Chander2018-12-111-3/+11
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Allow turning off the status switch of a waiting tunnelRoopesh Chander2018-12-112-2/+2
| | | | | | It just means the waiting should be cancelled Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Handle status change in TunnelsManagerRoopesh Chander2018-12-111-66/+78
| | | | | | Rather than in TunnelContainer. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: alertText() can be nilRoopesh Chander2018-12-116-6/+6
| | | | | | Indicating that no alert is to be shown for that error. Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Don't act on status change on tunnelProviders we don't haveRoopesh Chander2018-12-101-2/+0
| | | | | | That causes errors we don't want, and duplicate notifications. Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Always call the completion handler before returningRoopesh Chander2018-12-101-0/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Debugging helpers for tunnel statusRoopesh Chander2018-12-101-0/+27
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Handle deactivation of a waiting tunnelRoopesh Chander2018-12-101-1/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnels list: Fix AutoLayout error during deletion of a tunnelRoopesh Chander2018-12-101-2/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Settings: Dynamic Type supportRoopesh Chander2018-12-101-2/+6
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnel edit: Dynamic Type supportRoopesh Chander2018-12-101-6/+56
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnel detail: Dynamic Type supportRoopesh Chander2018-12-102-6/+57
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnels list: Dynamic Type support for the add button at the centerRoopesh Chander2018-12-091-0/+2
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnels list: Dynamic Type support for the table viewRoopesh Chander2018-12-091-6/+12
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Model: Declare keyLength constant and use that wherever applicableRoopesh Chander2018-12-094-15/+21
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Observe status for all tunnels in one blockRoopesh Chander2018-12-081-52/+54
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* TunnelsManager: Remove unused variablesRoopesh Chander2018-12-081-14/+0
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Zip: Fix commentRoopesh Chander2018-12-081-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Version bump0.0.20181104-5Jason A. Donenfeld2018-12-071-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* PacketTunnelProvider: Show log timestampJason A. Donenfeld2018-12-071-14/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wireguard-go-bridge: account for network changesJason A. Donenfeld2018-12-071-5/+85
| | | | | | | | | Everytime the network changes, we need to recreate the UDP socket, because the ephemeral listen port is tied to the old physical interface. As well, we need to re-set the IP addresses for each endpoint, so that they're passed to getaddrinfo and are then resolved using DNS46. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Zip: Increase size of buffer used to read data from the archiveRoopesh Chander2018-12-081-1/+1
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Settings: Export log: Perform file operations in a background threadRoopesh Chander2018-12-081-26/+31
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* On-Demand: TunnelViewModel: Make activate-on-demand methods staticRoopesh Chander2018-12-082-4/+4
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* On-Demand: Move detail text to TunnelViewModelRoopesh Chander2018-12-082-20/+13
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Plist: Handle crypto exportJason A. Donenfeld2018-12-072-0/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Make strings consistentJason A. Donenfeld2018-12-074-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* State restoration: Restore tunnel detail viewRoopesh Chander2018-12-075-1/+76
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Main VC: No need to refresh statuses if the tunnelsManager isn't initialized yetRoopesh Chander2018-12-071-4/+0
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Tunnels list: Deselect rows correctlyRoopesh Chander2018-12-071-1/+7
| | | | | | Do it like UITableViewController.clearsSelectionOnViewWillAppear would. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Settings: Exporting configs as zip should open document pickerRoopesh Chander2018-12-071-5/+3
| | | | | | | | Because: - Exporting UI should be consistent with importing UI - UIActivityVC takes a long time to open Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: Use ErrorPresenter.showErrorAlert() instead of per-VC showErrorAlert() methodsRoopesh Chander2018-12-074-38/+9
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: Use WireGuardAppError and WireGuardResult throughout the appRoopesh Chander2018-12-075-41/+45
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: Introduce a WireGuardResult type to handle errors in callbacks across the appRoopesh Chander2018-12-073-28/+34
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: Introduce a WireGuardAppError protocol to manage errorsRoopesh Chander2018-12-074-29/+39
| | | | | | The alert strings shall be located next to where the errors are declared. Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error handling: Cleanup Tunnels Manager errorsRoopesh Chander2018-12-075-76/+110
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>
* Error presenter: Always handle the passed errorRoopesh Chander2018-12-071-4/+3
| | | | Signed-off-by: Roopesh Chander <roop@roopc.net>