Commit Graph

425 Commits

Author SHA1 Message Date
Davide f8773cacf1
Filter countries by selected category (#767)
Countries are filtered through the latest servers list. If a country is
chosen, the countries picker only lists the currently selected country,
because there are no servers from other countries.

Update the library to prefetch the available countries per category.
2024-10-28 20:53:35 +01:00
Davide 7ede841346
Present error alert on missing provider (#766) 2024-10-28 20:30:22 +01:00
Davide 0ec06c2c65
Import OpenVPN configuration (#765)
At module creation time, choose whether to use a provider or import a
configuration file. After the import, the provider picker is hidden for
mutual exclusion.

For clarity, refactor the configuration part of OpenVPNView into a
ConfigurationView subview.
2024-10-28 20:07:19 +01:00
Davide 639dee55ee
Replace 'lastUpdated' with 'lastUpdate' 2024-10-28 17:16:13 +01:00
Davide 0d383ec792
Store providers to Core Data (#763)
Also, improve filters by constraining related fields:

- Pick countries from the filtered category
- Pick presets from those available in the currently filtered servers

Closes #705
2024-10-28 16:57:23 +01:00
Davide 61e8d8e2f7
Optimize redraws in provider servers views (#760) 2024-10-26 20:28:02 +02:00
Davide 3abde3851a
Improve some things about providers (#757)
- iOS: Add category name to clarify servers context
- iOS: Show "No servers" when list is empty
- macOS: Show "Connect" in server selector when presenting from home
- Add last update to issue report
- Refactor provider strings
2024-10-25 11:38:27 +02:00
Davide 2c2b3f063a
Multi-configuration providers (#756) 2024-10-25 10:54:28 +02:00
Davide 5fcb710d5e
Allow creation of OpenVPN provider module (#755)
Behind paywall as per #712 

Fixes #712
2024-10-23 23:19:53 +02:00
Davide 1a82aea612
Optionally apply filters based on server selection (#754)
Restore passing selectedEntity, but add filtersWithSelection to decide
whether to filter servers based on selection.

Partially revert 91a3e42533
2024-10-23 22:57:30 +02:00
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 5d2e24792c
Rewrite provider views (#740)
Resolve some flickering and state inconsistency due to overextended
observation of VPNProviderManager. Narrow down its scope to
VPNProviderServerView.

The downside of that, for now, is that servers are loaded "lazily late",
but this flow will make region selection from home easier.

Finally, show filters in popover on iPad.
2024-10-18 18:12:28 +02:00
Davide 0221aea6b6
Move some profile integrity checks to library (#739)
They really belong to Profile.Builder
2024-10-16 09:50:26 +02:00
Davide 9656e5ed29
Filter servers with category/country of selected server (#735)
And use Task for blocking actions in filters.
2024-10-15 23:48:27 +02:00
Davide ed28126cf7
Rework OpenVPN view with provider modifiers (#733)
Improve rendering and work around some SwiftUI bugs, e.g. with .menu
Picker on iOS (use .navigationLink instead).

Here goes the hierarchy bottom-up:

- ProviderPicker: a Picker wrapper built around ProviderManager
- ProviderContentModifier: adds a ProviderPicker on top and replaces the
content with a set of provider selectors when a provider is selected
- VPNProviderContentModifier: wrapper for ProviderContentModifier that
adds a VPN server selector
- OpenVPNView: provides a view of specific OpenVPN settings, and adds a
credentials selector to the provider/server selectors provided by
VPNProviderContentModifier
2024-10-15 21:34:02 +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 a5d4f6aee5
Unify library iOS target to 15 2024-10-12 15:51:00 +02:00
Davide 9769a151db
Provider configuration is persisted into module (#730)
When e.g. a OpenVPNModule is created without a configuration and a
provider/server is then selected, the ProfileProcessor class serializes
the profile with the provider configuration injected. When the module is
re-edited, we can see the provider server configuration in the module
after selecting "None" as provider.

Instead, validate the provider modules in ProfileProcessor, but generate the provider configuration on the fly in the tunnel.
2024-10-12 13:19:46 +02:00
Davide 208198c3f8
Create OpenVPN module without a configuration (#729)
Update library to allow optional VPN configurations. This in turn allows
a module to be used with a provider, where the configuration is
generated on the fly.
2024-10-11 19:11:42 +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 a0b9529870
Delete keychain entry on profile deletion 2024-10-11 00:25:26 +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 f4505d0efd
Refactor ProfileEditor to leverage ProfileType (#689)
Closes #688
2024-10-06 13:41:02 +02:00
Davide De Rosa 17f1331de0
Bump version 2024-10-05 12:29:32 +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 a306d61a84
Bump version 2024-10-04 15:54:41 +02:00
Davide De Rosa c461fe27be
Bump version 2024-10-04 10:02:43 +02:00
Davide 5fb6f4f4d2
Refactor static functions/entities in Library (#679)
Reduce the impact of hidden dependencies on BundleConfiguration and
Constants.shared

Fixes #656
2024-10-04 09:58:42 +02:00
Davide De Rosa 2d32e099b7
Rename repositories 2024-10-04 02:43:18 +02:00
Davide 0917e47ea3
Granularize app features (#671)
Split .networkSettings and add .sharing for #668
2024-10-03 12:13:03 +02:00
Davide De Rosa dcdcec4da7
Bump version 2024-10-02 13:46:27 +02:00
Davide 3ab80cd076
Fix incorrect VPN status in some cases (#661)
Regression following #636
2024-10-02 13:40:44 +02:00
Davide 51dbc3f246
Add App Intents extension stub (#655)
Just the Xcode metadata, no actual content.
2024-10-01 10:17:20 +02:00
Davide De Rosa f4a17e6df8
Restore accidentally removed Package.resolved 2024-10-01 09:58:51 +02:00
Davide De Rosa 8616c002f9
Bump version 2024-10-01 08:05:09 +02:00
Davide De Rosa 6aa9abc35a
Bump version 2024-09-30 21:47:18 +02:00
Davide De Rosa 5640d4abca
Add another missing key 2024-09-30 21:27:06 +02:00
Davide De Rosa c079f606a9
Bump version 2024-09-30 21:16:31 +02:00
Davide De Rosa 0df95f9fab
Bump version 2024-09-30 21:10:17 +02:00
Davide De Rosa 51cb1d2d38
Fix library about previous commit 2024-09-30 21:08:45 +02:00
Davide 4b1f6e547b
Fix some on-demand behavior (#646)
Fixes #644 
Fixes #645
2024-09-30 19:35:41 +02:00
Davide De Rosa 3f60dee9a2
Add missing Info.plist document key 2024-09-30 19:00:09 +02:00
Davide De Rosa 6a1da55841
Bump version 2024-09-30 18:11:17 +02:00
Davide De Rosa e9298218be
Bump version 2024-09-30 17:45:52 +02:00
Davide 0e4dd086ef
Import profiles with on-demand disabled (#641)
Make it friendly to Shortcuts automation by default.
2024-09-30 17:40:24 +02:00