diff --git a/Passepartout/App/App.plist b/Passepartout/App/App.plist index 142827ed..2beab1b6 100644 --- a/Passepartout/App/App.plist +++ b/Passepartout/App/App.plist @@ -14,16 +14,10 @@ $(CFG_IAP_BUNDLE_PREFIX) keychainGroupId $(CFG_TEAM_ID).$(CFG_GROUP_ID) - profilesContainerName - $(CFG_PROFILES_CONTAINER_NAME) - remoteProfilesContainerName - $(CFG_PROFILES_CONTAINER_NAME).remote tunnelId $(CFG_TUNNEL_ID) legacyV2CloudKitId $(CFG_LEGACY_V2_CLOUDKIT_ID) - legacyV2ProfilesContainerName - $(CFG_LEGACY_V2_PROFILES_CONTAINER_NAME) CFBundleDocumentTypes diff --git a/Passepartout/Config.xcconfig b/Passepartout/Config.xcconfig index 3c6d1eea..f0153ec0 100644 --- a/Passepartout/Config.xcconfig +++ b/Passepartout/Config.xcconfig @@ -38,13 +38,11 @@ CFG_GROUP_ID[sdk=iphonesimulator*] = $(CFG_RAW_GROUP_ID) CFG_GROUP_ID[sdk=macosx*] = $(CFG_TEAM_ID).$(CFG_RAW_GROUP_ID) CFG_IAP_BUNDLE_PREFIX = com.algoritmico.ios.Passepartout CFG_INTENTS_ID = $(CFG_APP_ID).Intents -CFG_PROFILES_CONTAINER_NAME = Profiles-v3 CFG_RAW_GROUP_ID = group.com.algoritmico.Passepartout CFG_TEAM_ID = DTDYD63ZX9 CFG_TUNNEL_ID = $(CFG_APP_ID).Tunnel CFG_LEGACY_V2_CLOUDKIT_ID = iCloud.com.algoritmico.Passepartout -CFG_LEGACY_V2_PROFILES_CONTAINER_NAME = Profiles PATH = $(PATH):/opt/homebrew/bin:/usr/local/bin:/usr/local/go/bin CUSTOM_SCRIPT_PATH = $(PATH) diff --git a/Passepartout/Intents/Intents.plist b/Passepartout/Intents/Intents.plist index 78052cc5..d94c5250 100644 --- a/Passepartout/Intents/Intents.plist +++ b/Passepartout/Intents/Intents.plist @@ -10,8 +10,6 @@ $(CFG_GROUP_ID) keychainGroupId $(CFG_TEAM_ID).$(CFG_GROUP_ID) - profilesContainerName - $(CFG_PROFILES_CONTAINER_NAME) teamId $(CFG_TEAM_ID) tunnelId diff --git a/Passepartout/Library/Sources/CommonLibrary/Domain/BundleConfiguration+Main.swift b/Passepartout/Library/Sources/CommonLibrary/Domain/BundleConfiguration+Main.swift index e161b6a5..ef4b40a3 100644 --- a/Passepartout/Library/Sources/CommonLibrary/Domain/BundleConfiguration+Main.swift +++ b/Passepartout/Library/Sources/CommonLibrary/Domain/BundleConfiguration+Main.swift @@ -42,17 +42,11 @@ extension BundleConfiguration { case keychainGroupId - case profilesContainerName - - case remoteProfilesContainerName - case tunnelId // legacy v2 case legacyV2CloudKitId - - case legacyV2ProfilesContainerName } public static var mainDisplayName: String { diff --git a/Passepartout/Library/Sources/CommonLibrary/Domain/Constants.swift b/Passepartout/Library/Sources/CommonLibrary/Domain/Constants.swift index f7a3e290..9e61a630 100644 --- a/Passepartout/Library/Sources/CommonLibrary/Domain/Constants.swift +++ b/Passepartout/Library/Sources/CommonLibrary/Domain/Constants.swift @@ -27,6 +27,14 @@ import Foundation import PassepartoutKit public struct Constants: Decodable, Sendable { + public struct Containers: Decodable, Sendable { + public let local: String + + public let remote: String + + public let legacyV2: String + } + public struct Websites: Decodable, Sendable { public let home: URL @@ -83,6 +91,10 @@ public struct Constants: Decodable, Sendable { public let refreshInterval: TimeInterval } + public struct API: Decodable, Sendable { + public let timeoutInterval: TimeInterval + } + public struct Log: Decodable, Sendable { public struct Formatter: Decodable, Sendable { enum CodingKeys: CodingKey { @@ -126,6 +138,8 @@ public struct Constants: Decodable, Sendable { public let bundleKey: String + public let containers: Containers + public let websites: Websites public let emails: Emails @@ -134,5 +148,7 @@ public struct Constants: Decodable, Sendable { public let connection: Connection + public let api: API + public let log: Log } diff --git a/Passepartout/Library/Sources/CommonLibrary/Resources/Constants.json b/Passepartout/Library/Sources/CommonLibrary/Resources/Constants.json index ad967731..ef0676fb 100644 --- a/Passepartout/Library/Sources/CommonLibrary/Resources/Constants.json +++ b/Passepartout/Library/Sources/CommonLibrary/Resources/Constants.json @@ -1,5 +1,10 @@ { "bundleKey": "AppConfig", + "containers": { + "local": "Profiles-v3", + "remote": "Profiles-v3.remote", + "legacyV2": "Profiles" + }, "websites": { "home": "https://passepartoutvpn.app", "subreddit": "https://www.reddit.com/r/passepartout/", @@ -18,6 +23,9 @@ "connection": { "refreshInterval": 3.0 }, + "api": { + "timeoutInterval": 5.0 + }, "log": { "appPath": "app.log", "tunnelPath": "tunnel.log", diff --git a/Passepartout/Shared/Shared+App.swift b/Passepartout/Shared/Shared+App.swift index 1dd042db..a089b1f1 100644 --- a/Passepartout/Shared/Shared+App.swift +++ b/Passepartout/Shared/Shared+App.swift @@ -50,7 +50,7 @@ extension ProfileManager { let remoteStore = CoreDataPersistentStore( logger: .default, - containerName: BundleConfiguration.mainString(for: .remoteProfilesContainerName), + containerName: Constants.shared.containers.remote, model: AppData.cdProfilesModel, cloudKitIdentifier: BundleConfiguration.mainString(for: .cloudKitId), author: nil @@ -127,8 +127,8 @@ extension Tunnel { private var localProfileRepository: any ProfileRepository { let store = CoreDataPersistentStore( logger: .default, - containerName: BundleConfiguration.mainString(for: .profilesContainerName), - model: coreDataModel, + containerName: Constants.shared.containers.local, + model: AppData.cdProfilesModel, cloudKitIdentifier: nil, author: nil )