Commit Graph

1431 Commits

Author SHA1 Message Date
Davide
9abbc6cde2
Redefine in-app receipt strategy ()
1. TestFlight: look for release receipt
2. Primary receipt (StoreKit) with build from local
3. Local receipt
2024-11-07 09:54:51 +01:00
Davide
abe4c779b8
Improve startup time ()
Profiles were loaded after reading receipt, which took at least a second
on iOS.

Potential regression from 
2024-11-07 01:48:39 +01:00
Davide
68df6066ba
Improve configuration on app launch/active ()
- Centralize context initialization/refresh in platform-specific app
delegates
- Prevent multiple calls to .onApplicationActive()
- Simplify local/remote profile fingerprint comparison
- Revert to always replacing Core Data entities
- The remote store somehow ended up having duplicates, which caused
repeated imports of remote profiles due to randomly different
fingerprints
- Optimize reload of in-app receipt
2024-11-06 18:42:42 +01:00
Davide
d8c4e87239
Refactor in-app entities for StoreKit/Kvitto integration ()
Refactoring:

- Get receipts from StoreKit Transaction.currentEntitlements
- Search for the originally purchased build in the local receipt anyway
(Kvitto)
- Fall back to release receipt (Kvitto), if any, for feature eligibility
in TestFlight builds
- Parse and verify expiration date in subscriptions
- Decouple in-app identifier composition from BundleConfiguration
- Fix user level features only applied when a receipt was not found

Testing:

- Add StoreKit configuration
- Fake purchases with PP_FAKE_IAP
- Fake user level with PP_USER_LEVEL

Then for reactive receipt reload, detect app activation differently:

- iOS/tvOS on .scenePhase
- macOS on launch and NSWorkspace.didActivateApplicationNotification

As to features:

- Credit former "Full version" purchasers with all current AND future
features, except the Apple TV
2024-11-06 13:20:12 +01:00
Davide
d5ac785bb8
Simulate in-app purchases ()
Integrate in-app helper into IAPManager and simulate purchases with an
in-memory receipt.
2024-11-05 18:55:57 +01:00
Davide
9351ceeb6a
TV not presenting interactive login on "Connect" ()
The side panel was not shown when interactive login was triggered by the
active profile on "Connect".
2024-11-05 16:13:03 +01:00
Davide
9286ead348
Improve logging on ineligible features 2024-11-05 14:10:17 +01:00
Davide
320b92591e
Address some issues with animations ()
- Missing animation in OpenVPN provider sections
- Hardcoded animation in TV profile, theme modifiers were not available
2024-11-05 13:43:23 +01:00
Davide
735d3b2fbe
Improve footers in macOS form sections ()
Revisit the use of informational footers in forms because:

- iOS uses Section footers
- macOS uses a secondary label below the main row label

Therefore:

- Add .themeRow() modifier to accomplish macOS behavior
- iOS: leave .themeSection() as is, and add a dummy .themeRow() that
does nothing
- macOS: make footer ineffective in .themeSection(), but add .themeRow()
modifiers to move footers to rows
2024-11-05 13:32:09 +01:00
Davide
346aaec441
Reuse PurchaseButtonModifier in restricted areas ()
Fixes 
2024-11-05 13:27:05 +01:00
Davide
833d717f06
Persist "Only favorites" toggle ()
Drop didChange subjects from filters model, observe published fields
directly.
2024-11-05 11:28:27 +01:00
Davide
1cb46e066c
Encapsulate behavior on app active ()
Implement inside AppContext.
2024-11-05 10:41:02 +01:00
Davide
bba661f104
Implement TV profile expiration ()
Based on in-app eligibility, expire TV profiles after 10 minutes.
Refactor/redesign general sections and offer .sharing feature for free,
it makes it simpler to focus on Apple TV product.
2024-11-05 10:03:54 +01:00
Davide
158200ea6d
Fix more warnings 2024-11-04 23:46:06 +01:00
Davide
f3d13d0cdf
Refactor AppContext creation and profile processing ()
Streamline initialization of AppContext objects without singletons,
especially because some are interconnected.

Rethink ProfileProcessor to be the only gateway of profile processing
for:

- Include
- Save
- Connect

Provide closures with access to the IAPManager for eligibility checks.

Finally, take a ProfileProcessor parameter in:

- ProfileManager (for isIncluded and willSave)
- ExtendedTunnel (for willConnect)

so that it's used implicitly without having to put it into the SwiftUI
environment.

Other than that:

- Move AppError to CommonLibrary
- Skip decoding of attributes from Core Data because they are already
part of the profile
2024-11-04 23:34:22 +01:00
Davide
0c66050726
Review ProfileManager observation logic ()
- Perform profiles removal in a single publisher, in
reloadRemoteProfiles() after importing remote profiles
- Only force a new lastUpdate/fingerprint if profile is saved locally,
DO NOT alter them if imported from remote repository because this would
cause a re-save on iCloud
- Profiles were purged twice on launch in the main macOS app
2024-11-04 10:10:17 +01:00
Davide
d37194a9f9
Reword selector title 2024-11-04 00:32:02 +01:00
Davide
5119cc20d5
Implement TV profile sharing ()
Add profile attribute `isAvailableForTV` and set specific behavior to:

- Observe shared profiles and delete locally when unshared
- Only keep locally those profiles with the TV attribute enabled
- Add toggle in UI
2024-11-03 23:42:17 +01:00
Davide
a22584c630
Fine-tune profile management with additional attributes ()
Additions to the domain:

- Update rather than replace existing Core Data profile
- Attach ProfileAttributes to Profile.userInfo
- Store one-off `fingerprint` UUID on each save

With the above in place, fix and improve ProfileManager to:

- Use `fingerprint` to compare local/remote profiles in history and thus
avoid local re-import of shared profiles
- Use `deletingRemotely` to delete local profiles when removed from the
remote repository (default false)
- Use `isIncluded` filter to exclude certain profiles from the local
repository (default nil)
2024-11-03 23:35:45 +01:00
Davide
d59f408db8
Reword "Connect" to "Select" in server selector
Does not reconnect if connection is inactive.

Regression in fff21c3250
2024-11-03 21:43:49 +01:00
Davide
4e423e3dd9
Fix previous PR 2024-11-03 13:47:48 +01:00
Davide
2790a2aac2
Merge AppLibrary into CommonLibrary ()
CommonLibrary barely used as standalone, almost always together with
AppLibrary.
2024-11-03 13:16:13 +01:00
Davide
1d2de39d49
Use profile name as interactive view title 2024-11-03 11:44:14 +01:00
Davide
fbe2d84113
Submit on OpenVPN fields ()
Submit on password or OTP depending on the selected method.
2024-11-03 11:27:12 +01:00
Davide
fff21c3250
Late dismissal after changing active provider server ()
The dismissal action waited until the current connection was
disconnected.

Consider that AppContext makes the explicit .connect() redundant,
reconnection is already happening after saving a profile while
connected.
2024-11-03 11:12:19 +01:00
Davide
3f7ad5bf57
Fix flashing context menu on data count update ()
Observe tunnel in InstalledProfileView subviews to avoid redraw of whole
view and context menu.
2024-11-03 08:38:53 +01:00
Davide
15959d2422
Resolve some focus issues ()
- [x] tvOS: When profile selector appears, if it's closed without
selecting any profile, it instantly reopens
- [x] Set initial focus in OpenVPN credentials
2024-11-03 08:17:19 +01:00
Davide
8aff3bedbc
Fix missing country flags 2024-11-02 16:15:19 +01:00
Davide
248f1e7257
Fix compile error on tvOS 2024-11-02 15:27:52 +01:00
Davide
aba5081450
Refactor and improve interactive login ()
Define two styles for interactive login:

- Modal (iOS/macOS) - Form inside NavigationStack
- Inline (tvOS) - VStack

Requires OpenVPN credentials view to be container-agnostic.

Play with focus to improve the overall TV experience.
2024-11-02 15:24:41 +01:00
Davide
454efb8e50
Refactor ModuleType to be a single source of truth ()
Rather than defining a new enum, tie ModuleType to ModuleHandler names
from PassepartoutKit.

Also a way to reuse ModuleType.localizedDescription on both Module and
ModuleBuilder implementations.
2024-11-02 15:23:36 +01:00
Davide
f286ed8ff9
Clean up test plan 2024-11-02 10:21:14 +01:00
Davide
070b661c43
Refactor library targets ()
Renames:

- AppUI → UILibrary
- AppUIPlatform → AppUI (conditional umbrella) + AppUI[Main|TV]
- APILibrary/CommonLibrary/UtilsLibrary → Common[API|Library|Utils]

Dependencies:

- AppUI → UILibrary
- UILibrary → AppLibrary, CommonAPI
- AppLibrary → CommonLibrary, CommonUtils
2024-11-02 10:11:59 +01:00
Davide
72e784272a
Create basic UI for TV app ()
Start with the profile tab. Left to do: search and settings.

Fixes and refactoring:

- Listen to changes in current profile in ExtendedTunnel
- Externalize style from TunnelToggleButton and ConnectionStatusText
(renamed from View)
- Add ThemeCountryText for convenience
2024-11-02 08:41:32 +01:00
Davide
357c505cc0
Refactor AppUI/AppUIMain to accomodate TV ()
- Move InteractiveView to AppUI for use in TV, with
OpenVPNCredentialsView
- Move non-UI entities to AppLibrary (IAP, ExtendedTunnel,
ProfileProcessor)
- Take API out of CommonLibrary (tunnel extension does not need it)
- Reorganize theme views/modifiers into separate files
2024-11-01 23:32:35 +01:00
Davide
ca18aadddf
Allow interactive credentials with providers ()
Fixes 
2024-11-01 20:01:18 +01:00
Davide
590b2790fa
Revisit overuse of EnvironmentObject ()
The biggest issue is the hidden and scattered use of both Tunnel and
ConnectionObserver. Only use the latter, and rename it to ExtendedTunnel
for being now a full wrapper around Tunnel (e.g. for .connectionStatus).

In general, restrict the use of EnvironmentObject to:

- Theme
- IAPManager
- ProfileProcessor
- ProviderManager

Always be explicit about:

- ProfileManager
- ExtendedTunnel

Contextually, move some UI entities to the base AppUI target.
2024-11-01 09:47:50 +01:00
Davide
33d238270e
Fix issues with iOS 16 ()
- Drop AppInlineCoordinator completely, always present profile modally
- Delay modal presentations by 50ms

Fixes 
2024-10-31 14:30:22 +01:00
Davide
e7666e6097
Fix previout commit on macOS 2024-10-31 12:23:00 +01:00
Davide
9f22053fa9
Fix lifecycle of environment objects ()
 was happening because environment objects were set on contentView,
which is not the _outmost_ root view. This clarifies why the Theme
object was not being found in ThemeLockScreenModifier.

Also, do not hardcode LogoView as lock view.
2024-10-31 11:14:39 +01:00
Davide
237277d4db
Do some refactoring in AppUI targets ()
- Refactor AppUI initialization in all platforms (sort of template
method pattern)
- Make AppMenu specific to macOS by wrapping it into a folder for
consistency
- Add SizeClassProviding for repeated checks on hsClass/vsClass

Fixes 
2024-10-31 10:02:21 +01:00
Davide
80dd6dc779
Render country flags with Emojis ()
Revert FlagKit just introduced in 
2024-10-31 01:15:07 +01:00
Davide
dcdb03a735
Improve country flags ()
Leverage the convenience of FlagKit. Update credits too.
2024-10-30 19:11:58 +01:00
Davide
14260b9bcd
Fall back to empty OTP
OpenVPN requires it to be non-nil when method is != .none

This is a quick fix.
2024-10-30 18:27:05 +01:00
Davide
bb8c760278
OpenVPN OTP is persisted with the password ()
Encode OpenVPN password + OTP in tunnel rather than in the app.

Encoding them upfront in the app ends up persisting the profile with the
combined password. Update the library with a new OTP field in
OpenVPN.Credentials, so that the password encoding is performed [on the
fly in the
tunnel](https://github.com/passepartoutvpn/passepartoutkit-source/pull/398).
Similar to how provider modules are generated.

This is likely a regression caused by migrating to NEProfileRepository,
because starting a connection causes the profile to be saved to NE with
the encoded password. Later, the profile is restored from NE and
therefore contains the encoded password.
2024-10-30 17:07:59 +01:00
Davide
9a365703c5
Refactor Theme strings
Fixes 
2024-10-30 15:20:18 +01:00
Davide
9e7860d390 Show titles and set destructive on confirmation
Fixes 
2024-10-30 15:07:22 +01:00
Davide
d12590387a Always close window on .isVisible = false
E.g. "About" would open main window when launched from login item.
2024-10-30 15:07:22 +01:00
Davide
a39583da1f Restore menu style in provider picker
Faces , but fixes 
2024-10-30 15:07:22 +01:00
Davide
c677a1e655 Fix lock view flickering on first appearance
Fixes 
2024-10-30 15:07:22 +01:00
Davide
aadc46e98f
Bundle API in app rather than library ()
Add script to speed up API update.
2024-10-30 11:46:24 +01:00
Davide
7f3d897818
Improve macOS window lifecycle ()
- Let the user close the window, the app will just remain alive in the
status bar
- Accordingly, replace "Confirm quit" preference with the option to stay
alive in the status bar
- Add "About..." item
2024-10-30 10:37:45 +01:00
Davide
9d6dfe6a76
Fix crash on lock screen ()
Missing environment Theme in LogoView.

Probably broken in 
2024-10-30 10:18:39 +01:00
Davide
00bd826096
Fix error unwrapping (previous commit) 2024-10-30 10:16:05 +01:00
Davide
f48349cde9
Fix duplicated message on import error 2024-10-29 16:30:43 +01:00
Davide
7e2bd01c36
Omit lock screen on macOS 2024-10-29 14:44:00 +01:00
Davide
944d6f8c28
Refactor AppUI for TV target ()
Split AppUI into AppUI and AppUIMain to allow for a new, simplified
AppUITV target tailored for the Apple TV.

As a PoC, present a view with a list of the shared profiles.
2024-10-29 14:30:41 +01:00
Davide
8536aee755
Show hostname with middle truncation on iOS 2024-10-29 11:50:33 +01:00
Davide
41de48789e
Show in Mac status bar plus Login Item ()
Add a status menu via SwiftUI MenuBarExtra where to:

- Show/hide app
- Launch on login via "Login Item" target
- Toggle profiles on/off

Only weird that the login item is not added to the list of "Open at
Login", but to "Allow in the Background", see
https://github.com/pilotmoon/Scroll-Reverser/issues/165

Requires some refactoring to bring AppContext initialization to the
AppDelegate.

Fixes 
Fixes  
Fixes  
Fixes 
2024-10-29 11:40:11 +01:00
Davide
d60ab97922
Fix initial country filters ()
- iOS: skip filter to speed up selection of another country
- macOS: initial country filter was lost due to category/country
chaining
2024-10-29 00:15:56 +01:00
Davide
92cf1985e2
Fix iOS app not reacting to open URL ()
Resort to SwiftUI .onOpenURL(), seems to do fine for single URL on iOS
(not on macOS).
2024-10-28 23:38:01 +01:00
Davide
33f17ab496
Move favorites toggle above servers list on iOS ()
Improve access to the most used filter.
2024-10-28 23:00:41 +01:00
Davide
5e46eb2fe5
Fix "Connect to..." appearing in non-providers 2024-10-28 22:34:07 +01:00
Davide
c930225458
Move theme-related logic to UI target
Fixes 
2024-10-28 21:45:10 +01:00
Davide
6f64edc95b
Fix overflow in installed profile name 2024-10-28 21:31:48 +01:00
Davide
5da84194a9
Hide paywall in beta 2024-10-28 21:02:45 +01:00
Davide
f8773cacf1
Filter countries by selected category ()
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 () 2024-10-28 20:30:22 +01:00
Davide
11a0f95cdd
Wrap paywall into NavigationStack 2024-10-28 20:08:13 +01:00
Davide
0ec06c2c65
Import OpenVPN configuration ()
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
ecb0348b90
Move providers paywall to picker ()
Paywall on module creation suggests that OpenVPN modules are a paid
feature.
2024-10-28 19:55:42 +01:00
Davide
639dee55ee
Replace 'lastUpdated' with 'lastUpdate' 2024-10-28 17:16:13 +01:00
Davide
0d383ec792
Store providers to Core Data ()
Also, improve filters by constraining related fields:

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

Closes 
2024-10-28 16:57:23 +01:00
Davide
cc119e18ce
Move Theme images to same file 2024-10-26 21:53:21 +02:00
Davide
ee3a40b597
Back up profiles to Core Data ()
Closes 
2024-10-26 21:41:07 +02:00
Davide
baff2c58ca
Rename favorites preference 2024-10-26 21:20:42 +02:00
Davide
b515041bd9
Add dots to Edit 2024-10-26 21:10:55 +02:00
Davide
d1b41a6615
Reconnect if necessary on profile save
Fixes 
2024-10-26 21:09:30 +02:00
Davide
b36189c5c9
Improve some providers UI on macOS
- Bigger profile modal
- Add star header to favorites column
- Tile favorites checkbox and clear filters
2024-10-26 21:02:33 +02:00
Davide
6d915f8985
Fix presets not filtered by configuration 2024-10-26 20:51:51 +02:00
Davide
61e8d8e2f7
Optimize redraws in provider servers views () 2024-10-26 20:28:02 +02:00
Davide
df4e3465f5
Save provider favorite servers ()
Fixes 
2024-10-26 13:29:26 +02:00
Davide
3abde3851a
Improve some things about providers ()
- 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 () 2024-10-25 10:54:28 +02:00
Davide
bbcd245bad
Fix compile error on iOS 2024-10-23 23:21:37 +02:00
Davide
5fcb710d5e
Allow creation of OpenVPN provider module ()
Behind paywall as per  

Fixes 
2024-10-23 23:19:53 +02:00
Davide
bf3c50c348
Do not force refresh infrastructure
Fixes 
2024-10-23 23:06:02 +02:00
Davide
1a82aea612
Optionally apply filters based on server selection ()
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
1e06c350ee
Fetch providers index on launch
Fixes 
2024-10-23 21:23:54 +02:00
Davide
91a3e42533
Start entity selector unfiltered
Do some renaming too.
2024-10-23 21:22:05 +02:00
Davide
8815e6fdf7
Use server checkmark rather than selection on macOS 2024-10-23 19:31:03 +02:00
Davide
99b9aeaa9c
Reconnect on provider server selection ()
Trigger reconnection on server selection, otherwise the installed
profile would display an outdated region. It's also more convenient.
2024-10-23 18:51:22 +02:00
Davide
12d3bd20f5
Highlight selected server ()
Use provider-aware ID.
2024-10-23 18:40:09 +02:00
Davide
48dc31a1f1
Attempt an iOS layout with DisclosureGroup
Also fix missing initial filters based on selection.

Fixes 
2024-10-23 18:31:24 +02:00
Davide
2455c5397e
Attach provider ID to issue report
Fixes 
2024-10-23 17:32:49 +02:00
Davide
295ba4d662
Quick selection of provider server ()
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 
2024-10-23 17:17:20 +02:00
Davide
07a751a237
Fix environment scope for .navigationPath on iOS
Broken in 
2024-10-23 15:46:00 +02:00
Davide
ee8ef34f06
Avoid nested module navigation ()
A NavigationLink in VPNProviderContentModifier raised a few questions
about the navigation approach in module views. It turned out that having
a Binding to a local ObservedObject (ProfileEditor) is a recipe for
disaster.

Therefore:

- We don't need a binding to the editor module (the draft), because by
doing so we end up _observing_ the same changes from two properties, the
binding and the editor. This seems to drive SwiftUI crazy and freezes
the app once we navigate from the module to another view (e.g. in
OpenVPN the credentials or the provider server). Use the module binding
as a shortcut, but do not assign the binding to the view to avoid
unnecessary observation.
- Keep .navigationDestination() in the module view, and pass a known
destination to VPNProviderContentModifier. This will save the modifier
from creating a nested NavigationLink destination. The
VPNProviderServerView is now openly instantiated by the module view when
such destination is triggered by the NavigationLink in the modifier.
- Do not implicitly dismiss VPNProviderServerView on selection, let the
presenter take care. In order to do so, we add a .navigationPath
environment key through which the module view can modify the current
navigation stack.
2024-10-23 15:42:54 +02:00
Davide
a94db35d01
Refactor a few things about provider flows ()
- Move disclosable menu from installed profile view to
ThemeDisclosableMenu
- Drop unnecessary configurationType modifier parameter
- Reorg view-related module extensions to separate files
- Reuse .flow fields instead of single blocks
- Show specific error on missing provider server selection
2024-10-22 15:06:13 +02:00
Davide
39bdf145e8
Resolve issues when toggling/switching profiles ()
- 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
696f076ac5
Add issue to FIXMEs 2024-10-20 13:00:27 +02:00
Davide
25470e61e5
Lazy-load tunnel logs in Diagnostics
Fixes 
2024-10-20 01:54:46 +02:00
Davide
ae9e200618
Omit provider in OpenVPN server configuration
Fixes 
2024-10-20 00:22:49 +02:00
Davide
2155fe1892
Optimize updates in NEProfileRepository ()
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 
2024-10-19 18:22:27 +02:00
Davide
5d2e24792c
Rewrite provider views ()
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 ()
They really belong to Profile.Builder
2024-10-16 09:50:26 +02:00
Davide
3de75e476b
Prevent iPad dismiss when tapping outside ()
The user may tap outside accidentally while editing a profile, thus
losing all the edits. Avoid that.

Fixes 
2024-10-16 08:56:58 +02:00
Davide
acf066571a
Fix some key things about providers UI ()
Fixes 
2024-10-16 08:53:16 +02:00
Davide
9656e5ed29
Filter servers with category/country of selected server ()
And use Task for blocking actions in filters.
2024-10-15 23:48: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
8cdd20dfb4
Fix animation in OpenVPNView 2024-10-15 21:39:47 +02:00
Davide
ed28126cf7
Rework OpenVPN view with provider modifiers ()
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 ()
Update library with more efficient choices for interacting with the
providers API.

Fixes 
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 ()
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
8c76f33d48
Fix copy UUID in correct format 2024-10-11 19:45:58 +02:00
Davide
208198c3f8
Create OpenVPN module without a configuration ()
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
c96e7e9d6e
Define NE configuration title format in Constants 2024-10-11 17:57:31 +02:00
Davide
619ff807fd
Drop unused code in AppContext 2024-10-11 17:53:41 +02:00
Davide
f2a141a189
Purge stale NetworkExtension/keychain data ()
- [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  then reverted, this is the complete PR.
2024-10-11 17:48:37 +02:00
Davide
1aa393ee02
Move feature mapping to a single file ()
Do not scatter sensitive data.
2024-10-11 04:17:17 +02:00
Davide
8f6192c2b6
Fix extra team prefix in keychain group ()
Team ID already included in .xcconfig

Fixes 
2024-10-11 03:45:20 +02:00
Davide
9449a02b77
Add meaningful prefix to keychain entries ()
Hard to find in keychain, add "Passepartout: " prefix to profile name.
2024-10-11 00:31:32 +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 ()
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
5c91eb4bf1
Review Constants
- Move container names out of Bundle
- Add API web services timeout
2024-10-10 19:29:38 +02:00
Davide De Rosa
6d6eef43c9
Rename 2024-10-10 16:24:09 +02:00
Davide
d589f1162d
Reorganize shared objects ()
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 ()
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
6d479a7059
Render multiple translators in Credits () 2024-10-09 21:42:42 +02:00
Davide
df2fc54044
Render profile UUID as quartets ()
Easier to read.
2024-10-09 21:40:56 +02:00
Davide De Rosa
635700c195
Revisit OpenVPN view
- Move pull section below
- Add IPv6 to preview
2024-10-06 19:22:45 +02:00
Davide De Rosa
7078e5c435
Unrestrict previews 2024-10-06 19:22:44 +02:00
Davide
504bcbdbd2
Refactor and move entities around ()
Do some housekeeping in AppLibrary/AppUI.
2024-10-06 19:19:16 +02:00
Davide
f4505d0efd
Refactor ProfileEditor to leverage ProfileType ()
Closes 
2024-10-06 13:41:02 +02:00
Davide De Rosa
8b5096ab69
Make copiable text multiline by default 2024-10-05 00:17:08 +02:00
Davide De Rosa
d2f44d3ee2
Fix new profiles not being saved
Broken in 
2024-10-04 21:28:56 +02:00
Davide De Rosa
38aa83760f
Reword on-demand 2024-10-04 21:06:03 +02:00
Davide
f66193cf78
Several fixes in ProfileManager ()
- [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
d14f22d4a1
Use gear icon for iOS About ()
Resolve a discrepancy between iPhone and iPad. Leave the info icon on
macOS, where Settings are separate.
2024-10-04 18:27:09 +02:00
Davide De Rosa
671dc7f77c
Do not import remote profiles on first load 2024-10-04 15:50:45 +02:00
Davide De Rosa
eea5486563
Fix crash on "Report issue" 2024-10-04 15:48:13 +02:00
Davide De Rosa
1b5e123fa6
Use .compact style in list based on size class 2024-10-04 11:39:50 +02:00
Davide De Rosa
e75c264258
Go multiline rather than truncate copiable
Fixes 
2024-10-04 10:40:18 +02:00
Davide De Rosa
71149e87d3
TODO -> FIXME 2024-10-04 10:30:14 +02:00
Davide
5fb6f4f4d2
Refactor static functions/entities in Library ()
Reduce the impact of hidden dependencies on BundleConfiguration and
Constants.shared

Fixes 
2024-10-04 09:58:42 +02:00
Davide De Rosa
4b0bc7f064
Reword confirm quit 2024-10-04 02:59:03 +02:00
Davide De Rosa
00bf415056
Move modules tip to +/- 2024-10-04 02:57:09 +02:00
Davide De Rosa
7070661c3b
Group row components and make icons bigger
Fixes 
2024-10-04 02:52:02 +02:00
Davide De Rosa
fe8fa93230
Fix SwiftGen warning 2024-10-04 02:44:19 +02:00
Davide De Rosa
2d32e099b7
Rename repositories 2024-10-04 02:43:18 +02:00
Davide
edb4d127e9
Delete remote profiles on local removal ()
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 De Rosa
27b7e62376
Add hint about iCloud sharing 2024-10-04 00:52:25 +02:00
Davide De Rosa
b660c499af
Use static 'Profile' in editor title 2024-10-04 00:47:28 +02:00
Davide De Rosa
07703fda9c
Fix some things about IP module
- Reword module description to "Routing"
- Make route modal title .inline
2024-10-04 00:44:31 +02:00
Davide De Rosa
ca03d057fc
Fix iCloud icon and move to the right 2024-10-04 00:39:41 +02:00
Davide De Rosa
fc834ab367
Replace Section with .themeSection
Closes 
2024-10-03 23:32:31 +02:00
Davide
211b3b83d3
Erase iCloud store from Settings ()
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 
2024-10-03 23:25:51 +02:00
Davide
372e30cf68
Import remote profiles serially ()
Follow the same approach as , 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 De Rosa
bf4ec4982a
Refactor phrases 2024-10-03 19:42:52 +02:00
Davide De Rosa
73665c5436
Use extended layout in profile list 2024-10-03 18:42:37 +02:00
Davide
1491766102
Per-profile iCloud syncing ()
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  
Fixes 
2024-10-03 18:41:27 +02:00
Davide De Rosa
1227df60ff
Present popover from button 2024-10-03 17:53:19 +02:00
Davide
8ad144239e
Present modules tip as popover on macOS () 2024-10-03 17:50:19 +02:00
Davide De Rosa
429e79cd3a
Refactor theme section and some phrases 2024-10-03 17:35:57 +02:00
Davide
0917e47ea3
Granularize app features ()
Split .networkSettings and add .sharing for 
2024-10-03 12:13:03 +02:00
Davide
63b0199a39
Merge Settings into About on iOS ()
Closes 
2024-10-03 11:25:39 +02:00
Davide
e8d5f2477b
Prepare interactive login for paywall ()
See 
2024-10-02 16:05:40 +02:00
Davide
3ab80cd076
Fix incorrect VPN status in some cases ()
Regression following 
2024-10-02 13:40:44 +02:00
Davide
3fbf803518
Ignore unmappable Core Data entities ()
But implement .discard for testing.
2024-10-02 13:35:49 +02:00
Davide De Rosa
f602655568
Link TODOs to issues 2024-10-01 15:50:12 +02:00
Davide De Rosa
bef1d36aa4
Fix annoying singleton warning 2024-10-01 15:45:53 +02:00
Davide
51dbc3f246
Add App Intents extension stub ()
Just the Xcode metadata, no actual content.
2024-10-01 10:17:20 +02:00
Davide De Rosa
087f177bd7
Omit storage section in release 2024-10-01 09:57:45 +02:00
Davide De Rosa
2191d2c946
Update library 2024-10-01 08:04:42 +02:00
Davide De Rosa
635708695e
Retain last used profile beyond disconnection
Fixes 
Fixes 
2024-10-01 00:08:36 +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 ()
Fixes  
Fixes 
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
cf3fe7449e
Fix missing CFBundleTypeName 2024-09-30 18:08:29 +02:00
Davide
0e4dd086ef
Import profiles with on-demand disabled ()
Make it friendly to Shortcuts automation by default.
2024-09-30 17:40:24 +02:00
Davide
aead866275
Open app with multiple files ()
onOpenURL cannot handle multiple URLs on macOS, whereas
NSApplicationDelegate can.

Fixes 
2024-09-30 17:22:16 +02:00
Davide
4877c2bd20
Restrict paywall to on-demand rules ()
Rather than whole module.

Closes 
2024-09-30 15:56:32 +02:00
Davide
a9fa6a2f62
Maintain one configuration per profile ()
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 
2024-09-30 14:56:20 +02:00
Davide
a29495a69c
Decouple Constants from BundleConfiguration ()
Fixes 
2024-09-28 19:05:47 +02:00
Davide
28a2017da2
Confirm quit on macOS ()
To do so, must prevent window from closing.

Fixes 
2024-09-28 17:58:48 +02:00
Davide
5deb8ec763
Prepare for macOS settings () 2024-09-28 12:47:33 +02:00
Davide De Rosa
c0234b07a8
Fix missing Window on iOS
Broken by 9e6e59276b
2024-09-28 11:56:35 +02:00
Davide
9e6e59276b
Associate and handle imported files () 2024-09-28 11:43:57 +02:00
Davide
95c09f4353
Prefix group ID with team ID on macOS ()
Fixes 
2024-09-28 11:13:32 +02:00
Davide
989886c434
Fix description of parsing errors on import ()
Fixes 
2024-09-28 00:01:01 +02:00
Davide
fbc6ece59d
Reorganize library into AppUI ()
Closes 
2024-09-26 23:13:55 +02:00
Davide
4124ff5cae
Lock app with FaceID ()
Restore feature as-is from v2.

Closes 
2024-09-25 19:32:07 +02:00
Davide
752dc6229f
Associate with ovpn/conf/zip files ()
Closes 
2024-09-25 18:14:26 +02:00
Davide
a665670cf7
Add job for public beta deployment ()
Closes 
2024-09-24 11:17:52 +02:00
Davide
6cc86e8668
Import v3 code ()
Closes 
2024-09-23 15:02:26 +02:00
Davide De Rosa
6bfda3487b
Attempt release 2024-09-22 16:29:08 +02:00
Davide De Rosa
ea4028d33c
Attempt release 2024-09-22 16:20:20 +02:00
Davide De Rosa
d1d66dcbb3
Attempt release 2024-09-22 16:16:26 +02:00
Davide De Rosa
a98cedfd7d
Attempt release 2024-09-22 16:02:40 +02:00