Commit Graph

82 Commits

Author SHA1 Message Date
Davide De Rosa 0f84859354
Do some housekeeping (#347)
- Be consistent with on-demand rules
- Use shortcut reduce(into:)
2023-09-08 16:20:42 +02:00
Davide De Rosa b4b2db176c
Fix .sink retain cycles (#345) 2023-09-08 16:20:01 +02:00
Davide De Rosa 4102894160
Always read profiles from fetched value (#340)
There may be a mismatch between profiles and profile headers. For
example, some profiles may appear in the main list, but the same ones
may not appear in the existing profile names when adding a new profile
(and vice versa). That's because they are being fetched from different
sources. Unify that.
2023-08-05 22:41:58 +02:00
Davide De Rosa 388af4a73c Attempt release 2023-07-30 17:47:41 +02:00
Davide De Rosa c8abb245f3
Restore on-demand backward compatibility (#338)
In #333, the non-optional field `disconnectsIfNotMatching` was removed
completely. Therefore, downgrading from 2.2.0 may lose profiles due to
the missing required field.

Mitigate the issue by restoring the field as optional, even if it's
unused, for the sake of not breaking profile serialization until the
2.2.0 release. Remove the deprecated field after that.
2023-07-30 17:43:03 +02:00
Davide De Rosa 38cca79683 Attempt release 2023-07-23 13:59:56 +02:00
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