Commit Graph

76 Commits

Author SHA1 Message Date
Davide De Rosa 6ede6f052a
Allow editing of OpenVPN endpoints (#335)
Hosts only:

- Add new
- Edit/delete existing
- Reorder

Closes #206
2023-07-23 12:45:47 +02:00
Davide De Rosa e0dbca224f
Rework "Trusted networks" to be a generic "On-demand" (#333)
Extend the feature by also providing a complementary "include" policy,
i.e. activate the VPN _only_ on the specified networks. "Trusted
networks" was only providing the "exclude" counterpart, i.e. _except_
the specified networks.

Closes #119
2023-07-23 08:44:46 +02:00
Davide De Rosa 33af87206a
Throw error on reinstate()/connect() (#328)
Errors here were just being ignored, thus preventing error alert from
appearing.
2023-07-06 19:45:43 +02:00
Davide De Rosa f0e3b2fa9c
Improve release workflow (#326) 2023-07-05 18:07:47 +02:00
Davide De Rosa 98e5e4cdde
Share common protocols across localized strings (#324) 2023-07-05 17:18:33 +02:00
Davide De Rosa e960943302
Revert "Move VPNProtocolType serialization to Data layer" (#319)
Reverts passepartoutvpn/passepartout-apple#318

`Codable` compliance at the domain layer (`Profile` etc.) makes this
change in serialization destructive.
2023-07-03 11:18:12 +02:00
Davide De Rosa ddf3dc313f
Move VPNProtocolType serialization to Data layer (#318)
It's crucial that the data layer has full control over how entities are
(de)serialized.

Do not leave this choice up to the domain layer by defining an enum as a
raw value type, because any change in the enum raw value would literally
be a disaster, i.e. _any_ serialized data would break instantly.
2023-07-02 13:27:46 +02:00
Davide De Rosa 278efaf347
Refactor domain errors (#310) 2023-07-02 12:51:50 +02:00
Davide De Rosa fb47def4ed
Avoid inline format for non-descriptive strings (#302) 2023-05-28 11:57:35 +02:00
Davide De Rosa 3a59ac7684
Invoke VPNManager methods with a Profile object (#309)
The VPNConfiguration parameter is opaque and tightly coupled to
TunnelKit. Connecting to a Profile makes infinitely more sense, beyond
simplifying the VPNManager class. Configuration building is fully
delegated to the strategy (as it has to be).

- VPNManager takes Profile and produces VPNConfigurationParameters
- VPNManagerStrategy takes VPNConfigurationParameters (abstract)
- TunnelKitVPNManagerStrategy takes VPNConfigurationParameters and
produces TunnelKitVPNConfiguration internally
2023-05-28 09:56:51 +02:00
Davide De Rosa a78a7b18b5
Encapsulate *Persistence responsibilities (#305)
Do not leave the choice of a repository context up to the library
consumer. Instead, provide a specific factory (*Persistence) for each
module.
2023-05-27 12:32:53 +02:00
Davide De Rosa efcda495bc
Address logging issues (#304)
* Make specific message levels a default extension

* Define Loggable protocol

* Keep track of message originator metadata

* Fix tracing of Core Data logs

* Log query on entity not found
2023-05-27 12:14:04 +02:00
Davide De Rosa 7ccb10febc
Rethink library architecture (#301) 2023-05-24 18:19:47 +02:00
Davide De Rosa b4ad8dea0d Do some code clean up
- Use guard in validators

- Rename URL.openURL() to URL.open()

- Sort imports (SwiftLint)

- Drop unused VPNProtocolType.allTypes

- Drop unused imports
2023-05-21 11:48:03 +02:00
Davide De Rosa 1fd38790e4 Attempt beta release 2023-04-18 17:24:47 +02:00
Davide De Rosa 2a54d59a80
Roll back broken TunnelKit .killSwitch flag (#294) 2023-04-18 17:22:45 +02:00
Davide De Rosa 67fc2a3cc0
Override manual DNS servers when using DoH/DoT (#283) 2023-04-06 12:50:39 +02:00
Davide De Rosa d4d3d97081 Attempt beta release 2023-04-04 17:11:44 +02:00
Davide De Rosa e050c0c8df
Catch WireGuard parsing errors properly (#279)
They could be reported as OpenVPN errors.
2023-04-03 08:48:18 +02:00
Davide De Rosa 6fd1f96e54
Use a distinct debug log per VPN protocol (#277)
Log content from different tunnels was interleaved.

Store debug logs in a protocol-specific folder.
2023-04-01 21:40:15 +02:00
Davide De Rosa 44e0ca9127
Force Mac "Catalyst" idiom in debug log (#276)
Mac Catalyst incorrectly reported as "Pad".
2023-04-01 16:24:27 +02:00
Davide De Rosa e9f11d1dbe Attempt beta release 2023-03-25 17:07:58 +01:00
Davide De Rosa 1e0d522010
Drop #available condition on iOS 15 (#274) 2023-03-25 17:05:53 +01:00
Davide De Rosa 513b38584d
Upgrade SwiftLint to CI version (#266) 2023-03-19 16:10:40 +01:00
Davide De Rosa 1dda8dce98 Attempt beta release 2023-03-19 08:45:34 +01:00
Davide De Rosa 8d0fb5c9b5
Support DoH/DoT network settings in WireGuard profiles (#264) 2023-03-19 08:41:51 +01:00
Davide De Rosa 17ae9793df
Randomize provider server (#263)
* Pick random server within location

* Add toggle to provider section in profile
2023-03-19 08:19:32 +01:00
Davide De Rosa c85f3d894e
Restore DNS "Domain" setting (#260) 2023-03-17 22:16:04 +01:00
Davide De Rosa f06f097f27
Add SwiftLint phase (#262) 2023-03-17 21:55:47 +01:00
Davide De Rosa e7a98acf9c Restore generic VPN in TunnelKitVPNManagerStrategy
MockVPN was not compiling.

Partially revert e17224e61e
2023-03-17 21:19:32 +01:00
Davide De Rosa 37354d1b87 Update copyright 2023-03-17 16:56:19 +01:00
Davide De Rosa e17224e61e Refactor stale library entities
- Move VPNConfiguration* to VPN implementation

- Drop old model protocols
2023-03-17 16:53:13 +01:00
Davide De Rosa 2e10aab039
Extend authentication methods (#259)
* Add profile authentication method

- Persistent (default, fallback)

- Interactive (may expire through reconnections)

- TOTP (seed-based) - currently disabled

* Disable on-demand if login is interactive

* Present interactive prompt on VPN toggle
2023-03-17 16:49:35 +01:00
Davide De Rosa 44ccd21536
Fetch full profiles from Core Data (#258)
* Fetch full profiles

* Manage full profiles in organizer
2023-03-16 16:49:09 +01:00
Davide De Rosa 17b01a4dbc Clean up some code
- Drop stale generic

- Improve readability
2023-03-16 15:12:23 +01:00
Davide De Rosa 3f6c71e4f5 Update API (TorGuard) 2022-12-04 12:22:58 +01:00
Davide De Rosa 6e6c212649 Move .killSwitch property to extras 2022-11-10 07:55:31 +01:00
Davide De Rosa 1b704d7d4a
Decouple VPNManager from TunnelKit (#248)
* Drop VPNManager dependency on TunnelKit

* Hook .masksPrivateData to preferences updates
2022-11-10 07:42:08 +01:00
Davide De Rosa e2c976e58d Attempt beta release 2022-10-31 14:18:07 +01:00
Davide De Rosa e1a3e7992f Update TunnelKit with .killSwitch option
Fixes #181
2022-10-30 11:54:52 +01:00
Davide De Rosa 22c28de641
Retain original filename as imported profile name (#240) 2022-10-30 10:22:44 +01:00
Davide De Rosa e1d8ec6066 Attempt beta release 2022-10-25 09:07:39 +02:00
Davide De Rosa c345265451 Attempt beta release 2022-10-16 08:36:17 +02:00
Davide De Rosa 54c53707e0
Add app log in Diagnostics screen (#234) 2022-10-16 08:33:32 +02:00
Davide De Rosa fbc17877b1 Suppress buggy Xcode warnings
@discardableResult annotations became suddenly ineffective.
2022-10-15 22:30:21 +02:00
Davide De Rosa 66a04862f9
Override Mullvad password (#233)
Set "m" as per official documentation:

https://mullvad.net/en/help/installing-mullvad-iphone-and-ipad/
2022-10-15 16:44:48 +02:00
Davide De Rosa f95e4f228d
Implement --route-nopull via TunnelKit (#230)
Use it internally to override server-pushed settings.
2022-10-13 19:09:51 +02:00
Davide De Rosa 5627e6c4a9
Address UI race conditions (#229)
* Make some managers concurrency-safe

- IntentsManager: @MainActor, non-shared, continuation

- SSIDReader: @MainActor, continuation

- Reviewer: main queue, non-shared

* Review wrong use of Concurrency framework

There were background thread calls e.g. in VPNToggle, because
ProfileManager was used inside a VPNManager async call.

Annotate @MainActor wherever a Task involves UI.

* Make main managers MainActor

* Apply MainActor to Mac menus

* [ci skip] Update CHANGELOG

* Set MainActor consistently on Mac menu view models
2022-10-13 08:53:50 +02:00
Davide De Rosa 54dc8a2556 Use MockVPN from TunnelKit
Rather than ad hoc strategy.
2022-10-12 22:37:40 +02:00
Davide De Rosa fb4d563804 Do not sort Core Data entities by UUID
Crash on compare.
2022-10-11 09:43:26 +02:00