From 35aea0729d0a11fa30dc6a4e1f5154992c2bf2f3 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 8 Aug 2021 15:55:23 -0700 Subject: [PATCH 1/5] Switch to Xcode 12.5.1 (#228) * Update release.yml * Update test.yml --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdb6009..002cf17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.3.app + run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive build: @@ -38,7 +38,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.2.app + run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app - name: Update Build Number env: TAG_NAME: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89f9231..f4773b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.3.app + run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive From 9d6bbd2a04c0bf542a4b228b56102245eb3fe6a8 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 8 Aug 2021 15:57:01 -0700 Subject: [PATCH 2/5] Fix focus resignation (#227) --- Secretive/Controllers/LaunchAgentController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Secretive/Controllers/LaunchAgentController.swift b/Secretive/Controllers/LaunchAgentController.swift index b9777c8..d50299d 100644 --- a/Secretive/Controllers/LaunchAgentController.swift +++ b/Secretive/Controllers/LaunchAgentController.swift @@ -22,7 +22,9 @@ struct LaunchAgentController { func forceLaunch(completion: ((Bool) -> Void)?) { Logger().debug("Agent is not running, attempting to force launch") let url = Bundle.main.bundleURL.appendingPathComponent("Contents/Library/LoginItems/SecretAgent.app") - NSWorkspace.shared.openApplication(at: url, configuration: NSWorkspace.OpenConfiguration()) { app, error in + let config = NSWorkspace.OpenConfiguration() + config.activates = false + NSWorkspace.shared.openApplication(at: url, configuration: config) { app, error in DispatchQueue.main.async { completion?(error == nil) } From 3f04126d00fa701fe33a79f07fa25d632dac8ca7 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Wed, 22 Sep 2021 21:10:04 -0700 Subject: [PATCH 3/5] Build with Xcode 13 (#226) --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- Brief/Updater.swift | 5 +++-- BriefTests/ReleaseParsingTests.swift | 4 ++-- SecretAgentKitTests/StubStore.swift | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 002cf17..4e2fba8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive build: @@ -38,7 +38,7 @@ jobs: APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} run: ./.github/scripts/signing.sh - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app - name: Update Build Number env: TAG_NAME: ${{ github.ref }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4773b2..7076468 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,6 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set Environment - run: sudo xcrun xcode-select -s /Applications/Xcode_12.5.1.app + run: sudo xcrun xcode-select -s /Applications/Xcode_13.0.app - name: Test run: xcrun xcodebuild test -project Secretive.xcodeproj -scheme Secretive diff --git a/Brief/Updater.swift b/Brief/Updater.swift index cea0bbb..1d75a09 100644 --- a/Brief/Updater.swift +++ b/Brief/Updater.swift @@ -12,9 +12,11 @@ public class Updater: ObservableObject, UpdaterProtocol { @Published public var update: Release? private let osVersion: SemVer + private let currentVersion: SemVer - public init(checkOnLaunch: Bool, osVersion: SemVer = SemVer(ProcessInfo.processInfo.operatingSystemVersion)) { + public init(checkOnLaunch: Bool, osVersion: SemVer = SemVer(ProcessInfo.processInfo.operatingSystemVersion), currentVersion: SemVer = SemVer(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0")) { self.osVersion = osVersion + self.currentVersion = currentVersion if checkOnLaunch { // Don't do a launch check if the user hasn't seen the setup prompt explaining updater yet. checkForUpdates() @@ -54,7 +56,6 @@ extension Updater { guard !userIgnored(release: release) else { return } guard !release.prerelease else { return } let latestVersion = SemVer(release.name) - let currentVersion = SemVer(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.0.0") if latestVersion > currentVersion { DispatchQueue.main.async { self.update = release diff --git a/BriefTests/ReleaseParsingTests.swift b/BriefTests/ReleaseParsingTests.swift index f3e0803..74af9ee 100644 --- a/BriefTests/ReleaseParsingTests.swift +++ b/BriefTests/ReleaseParsingTests.swift @@ -51,7 +51,7 @@ class ReleaseParsingTests: XCTestCase { func testGreatestSelectedIfOldPatchIsPublishedLater() { // If 2.x.x series has been published, and a patch for 1.x.x is issued // 2.x.x should still be selected if user can run it. - let updater = Updater(checkOnLaunch: false, osVersion: SemVer("2.2.3")) + let updater = Updater(checkOnLaunch: false, osVersion: SemVer("2.2.3"), currentVersion: SemVer("1.0.0")) let two = Release(name: "2.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "2.0 available! Minimum macOS Version: 2.2.3") let releases = [ Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Initial release Minimum macOS Version: 1.2.3"), @@ -72,7 +72,7 @@ class ReleaseParsingTests: XCTestCase { func testLatestVersionIsRunnable() { // If the 2.x.x series has been published but the user can't run it // the last version the user can run should be selected. - let updater = Updater(checkOnLaunch: false, osVersion: SemVer("1.2.3")) + let updater = Updater(checkOnLaunch: false, osVersion: SemVer("1.2.3"), currentVersion: SemVer("1.0.0")) let oneOhTwo = Release(name: "1.0.2", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Emergency patch! Minimum macOS Version: 1.2.3") let releases = [ Release(name: "1.0.0", prerelease: false, html_url: URL(string: "https://example.com")!, body: "Initial release Minimum macOS Version: 1.2.3"), diff --git a/SecretAgentKitTests/StubStore.swift b/SecretAgentKitTests/StubStore.swift index c96092c..7f4fb38 100644 --- a/SecretAgentKitTests/StubStore.swift +++ b/SecretAgentKitTests/StubStore.swift @@ -50,7 +50,7 @@ extension Stub { public func sign(data: Data, with secret: Secret, for provenance: SigningRequestProvenance) throws -> Data { guard !shouldThrow else { - throw NSError() + throw NSError(domain: "test", code: 0, userInfo: nil) } let privateKey = SecKeyCreateWithData(secret.privateKey as CFData, [ kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, From 3d305d95ac8ae0f20d47de5be9dca95ad05be567 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sat, 25 Sep 2021 15:12:35 -0700 Subject: [PATCH 4/5] Embed detail in scrollview (#241) --- Secretive/Views/SecretDetailView.swift | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Secretive/Views/SecretDetailView.swift b/Secretive/Views/SecretDetailView.swift index f8c7d12..e6e335a 100644 --- a/Secretive/Views/SecretDetailView.swift +++ b/Secretive/Views/SecretDetailView.swift @@ -8,19 +8,21 @@ struct SecretDetailView: View { private let keyWriter = OpenSSHKeyWriter() var body: some View { - Form { - Section { - CopyableView(title: "SHA256 Fingerprint", image: Image(systemName: "touchid"), text: keyWriter.openSSHSHA256Fingerprint(secret: secret)) - Spacer() - .frame(height: 20) - CopyableView(title: "MD5 Fingerprint", image: Image(systemName: "touchid"), text: keyWriter.openSSHMD5Fingerprint(secret: secret)) - Spacer() - .frame(height: 20) - CopyableView(title: "Public Key", image: Image(systemName: "key"), text: keyString) - Spacer() + ScrollView { + Form { + Section { + CopyableView(title: "SHA256 Fingerprint", image: Image(systemName: "touchid"), text: keyWriter.openSSHSHA256Fingerprint(secret: secret)) + Spacer() + .frame(height: 20) + CopyableView(title: "MD5 Fingerprint", image: Image(systemName: "touchid"), text: keyWriter.openSSHMD5Fingerprint(secret: secret)) + Spacer() + .frame(height: 20) + CopyableView(title: "Public Key", image: Image(systemName: "key"), text: keyString) + Spacer() + } } + .padding() } - .padding() .frame(minHeight: 200, maxHeight: .infinity) } From 88b7ef82dabd78fb21318c854e43a3dfa0d2864d Mon Sep 17 00:00:00 2001 From: Jon Tingvold Date: Tue, 19 Oct 2021 05:14:29 +0200 Subject: [PATCH 5/5] Update APP_CONFIG.md with configuration for Cyberduck (#243) --- APP_CONFIG.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/APP_CONFIG.md b/APP_CONFIG.md index eb85007..e141d3e 100644 --- a/APP_CONFIG.md +++ b/APP_CONFIG.md @@ -26,8 +26,33 @@ Host * IdentityAgent /Users/$YOUR_USERNAME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh ``` +## Cyberduck + +Add this to `~/Library/LaunchAgents/com.maxgoedjen.Secretive.SecretAgent.plist` + +``` + + + + + Label + link-ssh-auth-sock + ProgramArguments + + /bin/sh + -c + /bin/ln -sf $HOME/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh $SSH_AUTH_SOCK + + RunAtLoad + + + +``` + +Log out and log in again before launching Cyberduck. + # The app I use isn't listed here! If you know how to get it set up, please open a PR for this page and add it! Contributions are very welcome. -If you're not able to get it working, please file a [GitHub issue](https://github.com/maxgoedjen/secretive/issues/new) for it. No guarantees we'll be able to get it working, but chances are someone else in the community might be able to. \ No newline at end of file +If you're not able to get it working, please file a [GitHub issue](https://github.com/maxgoedjen/secretive/issues/new) for it. No guarantees we'll be able to get it working, but chances are someone else in the community might be able to.