mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-17 13:22:09 +00:00
Review Constants
- Move container names out of Bundle - Add API web services timeout
This commit is contained in:
parent
6d6eef43c9
commit
5c91eb4bf1
@ -14,16 +14,10 @@
|
|||||||
<string>$(CFG_IAP_BUNDLE_PREFIX)</string>
|
<string>$(CFG_IAP_BUNDLE_PREFIX)</string>
|
||||||
<key>keychainGroupId</key>
|
<key>keychainGroupId</key>
|
||||||
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string>
|
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string>
|
||||||
<key>profilesContainerName</key>
|
|
||||||
<string>$(CFG_PROFILES_CONTAINER_NAME)</string>
|
|
||||||
<key>remoteProfilesContainerName</key>
|
|
||||||
<string>$(CFG_PROFILES_CONTAINER_NAME).remote</string>
|
|
||||||
<key>tunnelId</key>
|
<key>tunnelId</key>
|
||||||
<string>$(CFG_TUNNEL_ID)</string>
|
<string>$(CFG_TUNNEL_ID)</string>
|
||||||
<key>legacyV2CloudKitId</key>
|
<key>legacyV2CloudKitId</key>
|
||||||
<string>$(CFG_LEGACY_V2_CLOUDKIT_ID)</string>
|
<string>$(CFG_LEGACY_V2_CLOUDKIT_ID)</string>
|
||||||
<key>legacyV2ProfilesContainerName</key>
|
|
||||||
<string>$(CFG_LEGACY_V2_PROFILES_CONTAINER_NAME)</string>
|
|
||||||
</dict>
|
</dict>
|
||||||
<key>CFBundleDocumentTypes</key>
|
<key>CFBundleDocumentTypes</key>
|
||||||
<array>
|
<array>
|
||||||
|
@ -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_GROUP_ID[sdk=macosx*] = $(CFG_TEAM_ID).$(CFG_RAW_GROUP_ID)
|
||||||
CFG_IAP_BUNDLE_PREFIX = com.algoritmico.ios.Passepartout
|
CFG_IAP_BUNDLE_PREFIX = com.algoritmico.ios.Passepartout
|
||||||
CFG_INTENTS_ID = $(CFG_APP_ID).Intents
|
CFG_INTENTS_ID = $(CFG_APP_ID).Intents
|
||||||
CFG_PROFILES_CONTAINER_NAME = Profiles-v3
|
|
||||||
CFG_RAW_GROUP_ID = group.com.algoritmico.Passepartout
|
CFG_RAW_GROUP_ID = group.com.algoritmico.Passepartout
|
||||||
CFG_TEAM_ID = DTDYD63ZX9
|
CFG_TEAM_ID = DTDYD63ZX9
|
||||||
CFG_TUNNEL_ID = $(CFG_APP_ID).Tunnel
|
CFG_TUNNEL_ID = $(CFG_APP_ID).Tunnel
|
||||||
|
|
||||||
CFG_LEGACY_V2_CLOUDKIT_ID = iCloud.com.algoritmico.Passepartout
|
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
|
PATH = $(PATH):/opt/homebrew/bin:/usr/local/bin:/usr/local/go/bin
|
||||||
CUSTOM_SCRIPT_PATH = $(PATH)
|
CUSTOM_SCRIPT_PATH = $(PATH)
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
<string>$(CFG_GROUP_ID)</string>
|
<string>$(CFG_GROUP_ID)</string>
|
||||||
<key>keychainGroupId</key>
|
<key>keychainGroupId</key>
|
||||||
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string>
|
<string>$(CFG_TEAM_ID).$(CFG_GROUP_ID)</string>
|
||||||
<key>profilesContainerName</key>
|
|
||||||
<string>$(CFG_PROFILES_CONTAINER_NAME)</string>
|
|
||||||
<key>teamId</key>
|
<key>teamId</key>
|
||||||
<string>$(CFG_TEAM_ID)</string>
|
<string>$(CFG_TEAM_ID)</string>
|
||||||
<key>tunnelId</key>
|
<key>tunnelId</key>
|
||||||
|
@ -42,17 +42,11 @@ extension BundleConfiguration {
|
|||||||
|
|
||||||
case keychainGroupId
|
case keychainGroupId
|
||||||
|
|
||||||
case profilesContainerName
|
|
||||||
|
|
||||||
case remoteProfilesContainerName
|
|
||||||
|
|
||||||
case tunnelId
|
case tunnelId
|
||||||
|
|
||||||
// legacy v2
|
// legacy v2
|
||||||
|
|
||||||
case legacyV2CloudKitId
|
case legacyV2CloudKitId
|
||||||
|
|
||||||
case legacyV2ProfilesContainerName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static var mainDisplayName: String {
|
public static var mainDisplayName: String {
|
||||||
|
@ -27,6 +27,14 @@ import Foundation
|
|||||||
import PassepartoutKit
|
import PassepartoutKit
|
||||||
|
|
||||||
public struct Constants: Decodable, Sendable {
|
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 struct Websites: Decodable, Sendable {
|
||||||
public let home: URL
|
public let home: URL
|
||||||
|
|
||||||
@ -83,6 +91,10 @@ public struct Constants: Decodable, Sendable {
|
|||||||
public let refreshInterval: TimeInterval
|
public let refreshInterval: TimeInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct API: Decodable, Sendable {
|
||||||
|
public let timeoutInterval: TimeInterval
|
||||||
|
}
|
||||||
|
|
||||||
public struct Log: Decodable, Sendable {
|
public struct Log: Decodable, Sendable {
|
||||||
public struct Formatter: Decodable, Sendable {
|
public struct Formatter: Decodable, Sendable {
|
||||||
enum CodingKeys: CodingKey {
|
enum CodingKeys: CodingKey {
|
||||||
@ -126,6 +138,8 @@ public struct Constants: Decodable, Sendable {
|
|||||||
|
|
||||||
public let bundleKey: String
|
public let bundleKey: String
|
||||||
|
|
||||||
|
public let containers: Containers
|
||||||
|
|
||||||
public let websites: Websites
|
public let websites: Websites
|
||||||
|
|
||||||
public let emails: Emails
|
public let emails: Emails
|
||||||
@ -134,5 +148,7 @@ public struct Constants: Decodable, Sendable {
|
|||||||
|
|
||||||
public let connection: Connection
|
public let connection: Connection
|
||||||
|
|
||||||
|
public let api: API
|
||||||
|
|
||||||
public let log: Log
|
public let log: Log
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"bundleKey": "AppConfig",
|
"bundleKey": "AppConfig",
|
||||||
|
"containers": {
|
||||||
|
"local": "Profiles-v3",
|
||||||
|
"remote": "Profiles-v3.remote",
|
||||||
|
"legacyV2": "Profiles"
|
||||||
|
},
|
||||||
"websites": {
|
"websites": {
|
||||||
"home": "https://passepartoutvpn.app",
|
"home": "https://passepartoutvpn.app",
|
||||||
"subreddit": "https://www.reddit.com/r/passepartout/",
|
"subreddit": "https://www.reddit.com/r/passepartout/",
|
||||||
@ -18,6 +23,9 @@
|
|||||||
"connection": {
|
"connection": {
|
||||||
"refreshInterval": 3.0
|
"refreshInterval": 3.0
|
||||||
},
|
},
|
||||||
|
"api": {
|
||||||
|
"timeoutInterval": 5.0
|
||||||
|
},
|
||||||
"log": {
|
"log": {
|
||||||
"appPath": "app.log",
|
"appPath": "app.log",
|
||||||
"tunnelPath": "tunnel.log",
|
"tunnelPath": "tunnel.log",
|
||||||
|
@ -50,7 +50,7 @@ extension ProfileManager {
|
|||||||
|
|
||||||
let remoteStore = CoreDataPersistentStore(
|
let remoteStore = CoreDataPersistentStore(
|
||||||
logger: .default,
|
logger: .default,
|
||||||
containerName: BundleConfiguration.mainString(for: .remoteProfilesContainerName),
|
containerName: Constants.shared.containers.remote,
|
||||||
model: AppData.cdProfilesModel,
|
model: AppData.cdProfilesModel,
|
||||||
cloudKitIdentifier: BundleConfiguration.mainString(for: .cloudKitId),
|
cloudKitIdentifier: BundleConfiguration.mainString(for: .cloudKitId),
|
||||||
author: nil
|
author: nil
|
||||||
@ -127,8 +127,8 @@ extension Tunnel {
|
|||||||
private var localProfileRepository: any ProfileRepository {
|
private var localProfileRepository: any ProfileRepository {
|
||||||
let store = CoreDataPersistentStore(
|
let store = CoreDataPersistentStore(
|
||||||
logger: .default,
|
logger: .default,
|
||||||
containerName: BundleConfiguration.mainString(for: .profilesContainerName),
|
containerName: Constants.shared.containers.local,
|
||||||
model: coreDataModel,
|
model: AppData.cdProfilesModel,
|
||||||
cloudKitIdentifier: nil,
|
cloudKitIdentifier: nil,
|
||||||
author: nil
|
author: nil
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user