Commit Graph

21 Commits

Author SHA1 Message Date
Davide 295ba4d662
Quick selection of provider server (#750)
First of all, add country flags assets. Then, present provider server
selector:

- From installed profile view, specifically from a button with the flag
of the current country
- From profile context menu
- On toggle profile when no server is selected

Closes #711
2024-10-23 17:17:20 +02:00
Davide 39bdf145e8
Resolve issues when toggling/switching profiles (#747)
- Drop logic behind connection button tasks, let the library handle
concurrency
- Drop AppContext observation of saved profiles for reconnection, let
save() actively decide
- NETunnelStrategy and NETunnelManagerRepository are now a single entity
- Avoid flickering when toggling same profile
2024-10-22 13:03:34 +02:00
Davide 2155fe1892
Optimize updates in NEProfileRepository (#742)
Currently, NEProfileRepository decodes profiles from ALL NE managers on
any update. This is undesirable considering that:

- Profiles are only _added_ by the app
- Externally, profiles can only be _removed_

Therefore:

- Observe the initial managers to decode the initial profiles from them
- Publish values manually on save/delete (to ProfileManager eventually)
- Observe the subsequent updates for when a profile is removed
externally, i.e. its ID doesn't appear in managers

Fixes #741
2024-10-19 18:22:27 +02:00
Davide aeaf0a6eed
Some fixes
- Import remote profiles off the main thread
- Drop meaningless Published
- Add a FIXME to move Profile build logic to library
2024-10-15 23:37:50 +02:00
Davide 87c7d63678
Redo provider managers lifecycle (#732)
Update library with more efficient choices for interacting with the
providers API.

Fixes #731
2024-10-13 11:36:34 +02:00
Davide f2a141a189
Purge stale NetworkExtension/keychain data (#728)
- [x] NE managers were not deleted when unable to be decoded to a
profile
- [x] Keychain items were not deleted on profile removal
- [x] Perform clean-up on app launch
- [x] Perform clean-up on app active

Prematurely merged as #727 then reverted, this is the complete PR.
2024-10-11 17:48:37 +02:00
Davide 8f6192c2b6
Fix extra team prefix in keychain group (#721)
Team ID already included in .xcconfig

Fixes #720
2024-10-11 03:45:20 +02:00
Davide 9449a02b77
Add meaningful prefix to keychain entries (#724)
Hard to find in keychain, add "Passepartout: " prefix to profile name.
2024-10-11 00:31:32 +02:00
Davide da87ca698a
Add initial support for providers (#723)
Initial integration of providers via API:

- Generic views and modifiers for provider/server selection
- Add in OpenVPNView
- Prepare in WireGuardView

Also:

- Introduce ProfileProcessor, move IAP processing there
- Move .asModuleView() to ModuleViewModifier for proper animation
- Use .themeModal() rather than .sheet()
2024-10-11 00:24:06 +02:00
Davide d589f1162d
Reorganize shared objects (#716)
Mainly:

- Aggregate shared/mock entities in less scattered files
- Review package dependencies

Also:

- Decouple ProfileRepository from Core Data Repository in UtilsLibrary
(filters done by ProfileManager)
2024-10-10 16:20:36 +02:00
Davide 0aac8cd9f3
In-place NetworkExtension profiles (#715)
Profiles are being maintained in two places:

- Core Data
- NetworkExtension

Core Data is redundant for local profiles, so make NetworkExtension the
only source of truth.
2024-10-10 16:03:02 +02:00
Davide De Rosa d2f44d3ee2
Fix new profiles not being saved
Broken in #685
2024-10-04 21:28:56 +02:00
Davide f66193cf78
Several fixes in ProfileManager (#685)
- [x] Search not accounted for when reloading profiles
- [x] Remote profile being saved twice
- [x] Add some logging
2024-10-04 20:58:11 +02:00
Davide De Rosa 671dc7f77c
Do not import remote profiles on first load 2024-10-04 15:50:45 +02:00
Davide edb4d127e9
Delete remote profiles on local removal (#677)
Remote profiles were never deleted. Now, when removing a profile:

- The profile is deleted from the local store
- The profile is deleted from the remote store
- Other synced devices receive the update and delete the profile from
their remote store
- However, they retain a local copy of the profile
- The copy doesn't appear as "Shared on iCloud" anymore
2024-10-04 01:26:52 +02:00
Davide 211b3b83d3
Erase iCloud store from Settings (#675)
Also, fix SwiftUI not refreshing when remote profiles are updated. There
was no objectWillChange nor Published around
ProfileManager.allRemoteProfiles, and ProfileRowView was not treating it
as ObservedObject.

Closes #673
2024-10-03 23:25:51 +02:00
Davide 372e30cf68
Import remote profiles serially (#674)
Follow the same approach as #636, because if no profiles are formerly
installed the first import will trigger a VPN permission alert. Weird
things may happen in that case if profiles are imported in parallel.
2024-10-03 22:25:59 +02:00
Davide 1491766102
Per-profile iCloud syncing (#668)
Keep two separate stores to accomplish per-profile sharing:

- Local store, where to push updates manually (save/remove/search)
- Remote iCloud store, where to pull updates from

A profile can be added/removed to/from the iCloud store so that other
devices can push/pull updates to it.

Consequently, updates to the iCloud store will NEVER cause a profile
deletion. Once removed, the profile will stay locally.

Fixes #586 
Fixes #555
2024-10-03 18:41:27 +02:00
Davide a9fa6a2f62
Maintain one configuration per profile (#636)
Helps with automation. Install the VPN configuration before persisting a
profile, so that the 1:1 reference with OS settings is maintained.
Likewise, uninstall the VPN configuration after removing a profile.

This before-save hook also resolves a problem with multiple imports,
where multiple VPN permission alerts coalesce if no VPN configuration is
installed. Now the first import waits for the permission synchronously.

Fixes #618
2024-09-30 14:56:20 +02:00
Davide fbc6ece59d
Reorganize library into AppUI (#621)
Closes #611
2024-09-26 23:13:55 +02:00
Davide 6cc86e8668
Import v3 code (#597)
Closes #565
2024-09-23 15:02:26 +02:00