Commit Graph

50 Commits

Author SHA1 Message Date
Davide 6cc86e8668
Import v3 code (#597)
Closes #565
2024-09-23 15:02:26 +02:00
Davide De Rosa 64d1131fdd
Update copyright
Closes #473
2024-01-14 14:36:55 +01:00
Davide De Rosa d0cd953031
Drop deprecated .disconnectsIfNotMatching (#472)
Unused since trusted networks was converted to on-demand.
2024-01-14 14:20:39 +01:00
Davide De Rosa dde2d22eed
Revisit submission of OpenVPN diagnostic report (#452)
Some improvements:

- Suggest replacing the template with the description of the issue
- Attach app log
- Append purchased features

Also reuse the same body for `mailto:` reports, as metadata were not
being attached in that case.

Closes #377
2024-01-07 12:11:16 +01:00
Davide De Rosa 5c5697762b
Add minimal TV app
Closes #315
2023-12-31 01:21:38 +01:00
Davide De Rosa 239d3e6853
Fix in-app eligibility in VPN (#440) 2023-12-23 07:59:23 +01:00
Davide De Rosa d7f14aa3b4 Read updated profiles from function argument
Coming from a "will" publisher, the value in ProfileRepository is
not up-to-date. Use the function argument instead.

Fixes #367
2023-10-14 19:30:37 +02:00
Davide De Rosa 12c08c132c
Update metadata and translations (#365) 2023-10-10 23:00:19 +02:00
Davide De Rosa a4ca8cc996
Support iCloud sync as an option (#350)
Sync will be enabled on upgrade for consistency with current behavior,
and disabled for new installs.

Fixes #227
2023-09-09 20:29:04 +02:00
Davide De Rosa a3cfde1950
Drop v2 migrations (#348) 2023-09-08 22:18:41 +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 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 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 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 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 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 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 513b38584d
Upgrade SwiftLint to CI version (#266) 2023-03-19 16:10:40 +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 17b01a4dbc Clean up some code
- Drop stale generic

- Improve readability
2023-03-16 15:12:23 +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 e1a3e7992f Update TunnelKit with .killSwitch option
Fixes #181
2022-10-30 11:54:52 +01: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 092d4f5de2 Drop return in one-line functions 2022-09-04 20:30:55 +02:00
Davide De Rosa 4c4b3ee0c9 Revert to concrete-only managers
Abstraction was overcomplicated. Strategy pattern is enough.
2022-09-03 12:47:40 +02:00
Davide De Rosa 92ffc382cb Reconnect VPN without disabling it
Retain on-demand flag to avoid leaks during reconnection.
2022-08-05 07:40:43 +02:00
Davide De Rosa 58e375ec41 Attach @MainActor where needed
Some methods were updating UI from non-main thread.
2022-07-16 17:39:42 +02:00
Davide De Rosa 3f4b55a003 Implement Mac bundle with system menu
Use bundle as a means to provide Mac APIs to Catalyst app.

In order to cross the @objc wall set by the Mac Bundle mechanism,
Swift structures cannot be used directly and must be bridged
through ObjC facades.

Create NSMenu in MVVM style and install it on app launch. Make
sure to do it in AppDelegate.applicationDidFinishLaunching(),
because doing it as early as in PassepartoutApp.init() would
crash Mac code.

Use .representedObject to own view models.

With menu in place, app can be sent to background when main window
is closed. Requires multiple documents support for app not to die
instantly.
2022-07-16 17:39:42 +02:00
Davide De Rosa 9d9dc2b2f6 Rename activeProfileId publisher for consistency 2022-07-14 17:07:30 +02:00
Davide De Rosa 0a2d1e9d37 Mitigate fatalError() in properties, fail gracefully
Do not trigger fatalError() on properties too much because
SwiftUI may read them at any unpredictable time.
2022-07-08 20:01:53 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00