Commit Graph

48 Commits

Author SHA1 Message Date
Davide De Rosa
b1e2d60f37 Make connect rule interface explicit
Shouldn't make a difference but you never know with iOS.
2019-05-17 17:21:30 +02:00
Davide De Rosa
accd04eead Default to server settings for default gateway
IPv6 is not necessarily supported.
2019-05-11 15:59:02 +02:00
Davide De Rosa
d44e9f861b Set supported preset on start 2019-05-04 10:29:27 +02:00
Davide De Rosa
c6fbdca342 Move network settings to ad-hoc screen
Can now set gateway/DNS/proxy settings explicitly.

- Read from .ovpn (hosts only)
- Pull from server (PUSH_REPLY)
- Set manually
2019-05-01 23:00:28 +02:00
Davide De Rosa
bab8e28b04 Use builders for editing configurations
Slip-ups in TunnelKit made configurations erroneously mutable.
2019-05-01 23:00:28 +02:00
Davide De Rosa
04c2191e83 Migrate profiles routing policies
- Providers: enforce all (IPv4 + IPv6)
- Hosts: re-read .ovpn on app update, fall back to all (safer)

Reload hosts in order to re-interpret "redirect-gateway".
2019-04-25 15:40:40 +02:00
Davide De Rosa
8a81ad8f72 Update NordVPN infrastructure
- Pick default pool by country e.g. "us" rather than "us-123"
- Drop overwhelming resolved addresses

Required changes:

- Assume default pool id to be a prefix
- Make Pool addresses optional
2019-04-11 21:14:56 +02:00
Davide De Rosa
489229b1eb Fix nil pool for renamed/removed ids
Would crash on connect otherwise.
2019-04-10 16:28:13 +02:00
Davide De Rosa
89d7c6924d Make hostname optional in provider pool
E.g. ProtonVPN SecureCore servers don't provide a hostname.
2019-04-09 20:47:08 +02:00
Davide De Rosa
caab7fa9bc Fall back to default infrastructure preset
Fixes #57
2019-04-05 19:45:20 +02:00
Davide De Rosa
485fd091aa Add shortcut for profile by key 2019-04-05 00:52:36 +02:00
Davide De Rosa
d53e874cac Migrate old endpoints to new format 2019-04-04 19:03:55 +02:00
Davide De Rosa
cb2917a0a8 Fix wrong return in loadProfiles() 2019-04-04 12:00:12 +02:00
Davide De Rosa
bc0a0d40dc Observe tunnel data count periodically (5s)
Use Timer as KVO is not possible on App Group defaults.

Be tolerant about missing sections, return type is optional.

Also reword data count cell caption.
2019-03-30 20:10:04 +01:00
Davide De Rosa
e4c1ea4def Delete log on masking change
It may contain stale and either sensitive or irrelevant data.
2019-03-22 18:54:54 +01:00
Davide De Rosa
15602f7dc9 Pick profile/location for connection intent
- Host: ConnectVPN intent
- Provider: requires Pool selection
2019-03-18 22:13:36 +01:00
Davide De Rosa
f661008679 Make framework internal components public 2019-03-18 11:50:52 +01:00
Davide De Rosa
8ede1ed3d4 Use App Group container for documents and caches 2019-03-11 10:05:54 +01:00
Davide De Rosa
7a21338042 Update copyright 2019-03-09 11:44:44 +01:00
Davide De Rosa
c7cb00f679 Move ProfileKey to separate file 2018-11-06 11:16:34 +01:00
Davide De Rosa
389746180b Move PlaceholderConnectionProfile to separate file 2018-11-06 11:16:30 +01:00
Davide De Rosa
0c389d8d8e Make caught errors warnings instead 2018-11-06 11:03:15 +01:00
Davide De Rosa
137e87ad69 Add description for generic ConnectionProfile 2018-11-04 15:56:05 +01:00
Davide De Rosa
e7d2dde972 Add/remove profile to/from filesystem immediately
Save unnecessary serialization of unaffected profiles.
2018-11-04 15:06:53 +01:00
Davide De Rosa
9e7c4960e5 Update GitHub URL in license preamble 2018-11-04 10:53:16 +01:00
Davide De Rosa
ef03b2b94d Leave serialization up to delegate
Ends up calling saveProfiles() multiple times otherwise.
2018-11-04 10:49:40 +01:00
Davide De Rosa
8e445e90b3 Move profile reactions to delegate
- Activation
- Removal
2018-11-04 10:49:40 +01:00
Davide De Rosa
f75fbfb4bb Remove keychain password with profile removal 2018-11-02 15:52:36 +01:00
Davide De Rosa
56c0a1a15e Add profile renaming logic
- Suspend delegation of internal add/remove.
- Review several try/throws.
2018-11-02 15:52:36 +01:00
Davide De Rosa
aa2b6bafaf Add method to rename immutable profile 2018-11-02 15:52:34 +01:00
Davide De Rosa
3f1e98f8ac Delegate profile management from ConnectionService
Makes much more sense than dumb wizard notifications. Organizer is
already a ConnectionServiceDelegate.
2018-11-02 15:20:37 +01:00
Davide De Rosa
36995e089b Locate profiles via relative URLs
Avoid absolute URLs, profiles directory is always relative to
documents. Assume profiles to be based in the documents root
unless directory is != nil.

Given that, starting from iOS 8, the documents location can change
from time to time, could this fix #19?
2018-11-01 13:39:55 +01:00
Davide De Rosa
2197c96bd9 Move serialization URLs to ConnectionService
Keep ProfileKey a bare struct.
2018-11-01 13:32:53 +01:00
Davide De Rosa
dcecc84bda Remove .ovpn of deleted profile 2018-10-27 13:35:21 +02:00
Davide De Rosa
4bcb1fe2ad Convert some warnings to errors 2018-10-27 12:08:44 +02:00
Davide De Rosa
804585f13d Fix/improve some poor filename parsing 2018-10-27 10:52:26 +02:00
Davide De Rosa
821393af70 Refactor configurations in service extension
Reuse same directories of ConnectionService for storing
configuration files.
2018-10-27 09:42:41 +02:00
Davide De Rosa
b5347e04b2 Move Context to ConnectionProfile
Fix an id conflict in credentials.
2018-10-26 18:57:07 +02:00
Davide De Rosa
78abb8c764 Refactor service to use external profile JSONs
- Store only profile key/metadata into service.

- Map profiles by (context, id), context being either provider
or host.

- Initialize cache with a placeholder profile, lazily load full
profile (e.g. after opening profile).

- Only serialize non-placeholder profiles (opened once).

- Do not load full profiles for organizer listing

WARNING: always load active profile as non-placeholder.
2018-10-26 18:30:37 +02:00
Davide De Rosa
9726158030 Drop deprecated configuration values
- debugLogKey
- lastErrorKey
2018-10-25 22:45:50 +02:00
Davide De Rosa
082ffa3cb1 Attach build number to service JSON
Update before serializing.
2018-10-25 22:45:50 +02:00
Davide De Rosa
c73c2e3826 Rename tunnelConfiguration to baseConfiguration
It's much less confusing. Migrate too.
2018-10-25 22:45:50 +02:00
Davide De Rosa
ef9032e440 Update TunnelKit
- Improve logging performance and privacy.
- Fix server-side renegotiation issues.
2018-10-24 21:23:13 +02:00
Davide De Rosa
976e47af64 Clear VPN error status before restart 2018-10-22 21:49:43 +02:00
Davide De Rosa
e8f2aaaf08 Show tunnel failure reason in VPN status 2018-10-22 21:49:43 +02:00
Davide De Rosa
8219519a22 Fix credentials requirement in VPN configuration
Refines #4
2018-10-19 17:51:25 +02:00
Davide De Rosa
5e0590184b Require credentials for providers only
Not always the case, but PIA certainly requires them. Will make it
an infrastructure option later. Only require credentials as a
configuration check, everything else has defaults.
2018-10-19 01:29:44 +02:00
Davide De Rosa
b9ec01945d Initial commit 2018-10-11 09:13:19 +02:00