Skip to content

Commit

Permalink
Testing home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgoedjen committed Nov 12, 2023
1 parent dbaa57a commit 666374d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
13 changes: 11 additions & 2 deletions Sources/SecretAgent/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ class AppDelegate: NSObject, NSApplicationDelegate {
list.add(store: SmartCard.Store())
return list
}()
private static var homeDirectory: String {
// if UserDefaults.standard.bool(forKey: "usehomedirectory") {
let folder = "/Users/max/.secretive"
try? FileManager.default.createDirectory(atPath: folder, withIntermediateDirectories: false)
return folder
// } else {
// return FileManager.default.homeDirectoryForCurrentUser.path
// }
}
private let updater = Updater(checkOnLaunch: false)
private let notifier = Notifier()
private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: NSHomeDirectory())
private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: homeDirectory)
private lazy var agent: Agent = {
Agent(storeList: storeList, witness: notifier)
}()
private lazy var socketController: SocketController = {
let path = (NSHomeDirectory() as NSString).appendingPathComponent("socket.ssh") as String
let path = (AppDelegate.homeDirectory as NSString).appendingPathComponent("socket.ssh") as String
return SocketController(path: path)
}()
private var updateSink: AnyCancellable?
Expand Down
2 changes: 2 additions & 0 deletions Sources/SecretAgent/SecretAgent.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<true/>
<key>com.apple.security.smartcard</key>
<true/>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.maxgoedjen.Secretive</string>
Expand Down
3 changes: 2 additions & 1 deletion Sources/Secretive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -878,6 +878,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = SecretAgent/SecretAgent.entitlements;
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"SecretAgent/Preview Content\"";
Expand Down

0 comments on commit 666374d

Please sign in to comment.