Setup flow

This commit is contained in:
Max Goedjen 2024-01-04 17:43:57 -08:00
parent f583a3c263
commit ebbaf82919
No known key found for this signature in database
3 changed files with 179 additions and 27 deletions

View File

@ -19,9 +19,6 @@
} }
} }
} }
},
"Add it For Me" : {
}, },
"agent_running_notice_detail_description" : { "agent_running_notice_detail_description" : {
"localizations" : { "localizations" : {
@ -221,15 +218,15 @@
}, },
"If you're looking to add one to your Mac, the YubiKey 5 Series are great." : { "If you're looking to add one to your Mac, the YubiKey 5 Series are great." : {
},
"If you're trying to set up a third party app, check out the FAQ." : {
}, },
"Ignore" : { "Ignore" : {
}, },
"Key" : { "Key" : {
"extractionState" : "manual" "extractionState" : "manual"
},
"MD5 Fingerprint" : {
}, },
"New Secret" : { "New Secret" : {
@ -240,7 +237,10 @@
"No Secure Storage Available" : { "No Secure Storage Available" : {
}, },
"Read more about this here." : { "Public Key" : {
},
"Public Key Path" : {
}, },
"Release Notes" : { "Release Notes" : {
@ -267,7 +267,159 @@
"Setup Secretive" : { "Setup Secretive" : {
}, },
"This helper app is called **Secret Agent** and you may see it in Activity Manager from time to time." : { "setup_agent_activity_monitor_description" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This helper app is called **Secret Agent** and you may see it in Activity Manager from time to time."
}
}
}
},
"setup_agent_description" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Secretive needs to set up a helper app to work properly. It will sign requests from SSH clients in the background, so you don't need to keep the main Secretive app open."
}
}
}
},
"setup_agent_install_button" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Install"
}
}
}
},
"setup_agent_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Setup Secret Agent"
}
}
}
},
"setup_ssh_add_for_me_button" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Add it For Me"
}
}
}
},
"setup_ssh_add_to_config_button_%@" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Add to %1$@"
}
}
}
},
"setup_ssh_added_manually_button" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "I Added it Manually"
}
}
}
},
"setup_ssh_description" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Add this line to your shell config telling SSH to talk to Secret Agent when it wants to authenticate. Secretive can either do this for you automatically, or you can copy and paste this into your config file."
}
}
}
},
"setup_ssh_title" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Configure your SSH Agent"
}
}
}
},
"setup_third_party_faq_link" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "If you're trying to set up a third party app, check out the FAQ."
}
}
}
},
"setup_updates_description" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Secretive will periodically check with GitHub to see if there's a new release. If you see any network requests to GitHub, that's why."
}
}
}
},
"setup_updates_ok" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "OK"
}
}
}
},
"setup_updates_readmore" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Read more about this here."
}
}
}
},
"setup_updates_title" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Updates"
}
}
}
},
"SHA256 Fingerprint" : {
},
"Title" : {
}, },
"Touch ID Detail prompt.Detail two." : { "Touch ID Detail prompt.Detail two." : {

View File

@ -3,7 +3,7 @@ import UniformTypeIdentifiers
struct CopyableView: View { struct CopyableView: View {
var title: String var title: LocalizedStringKey
var image: Image var image: Image
var text: String var text: String

View File

@ -101,14 +101,14 @@ extension StepView {
struct SetupStepView<Content> : View where Content : View { struct SetupStepView<Content> : View where Content : View {
let title: String let title: LocalizedStringKey
let image: Image let image: Image
let bodyText: String let bodyText: LocalizedStringKey
let buttonTitle: String let buttonTitle: LocalizedStringKey
let buttonAction: () -> Void let buttonAction: () -> Void
let content: Content let content: Content
init(title: String, image: Image, bodyText: String, buttonTitle: String, buttonAction: @escaping () -> Void = {}, @ViewBuilder content: () -> Content) { init(title: LocalizedStringKey, image: Image, bodyText: LocalizedStringKey, buttonTitle: LocalizedStringKey, buttonAction: @escaping () -> Void = {}, @ViewBuilder content: () -> Content) {
self.title = title self.title = title
self.image = image self.image = image
self.bodyText = bodyText self.bodyText = bodyText
@ -145,12 +145,12 @@ struct SecretAgentSetupView: View {
let buttonAction: () -> Void let buttonAction: () -> Void
var body: some View { var body: some View {
SetupStepView(title: "Setup Secret Agent", SetupStepView(title: "setup_agent_title",
image: Image(nsImage: NSApplication.shared.applicationIconImage), image: Image(nsImage: NSApplication.shared.applicationIconImage),
bodyText: "Secretive needs to set up a helper app to work properly. It will sign requests from SSH clients in the background, so you don't need to keep the main Secretive app open.", bodyText: "setup_agent_description",
buttonTitle: "Install", buttonTitle: "setup_agent_install_button",
buttonAction: install) { buttonAction: install) {
(Text("This helper app is called **Secret Agent** and you may see it in Activity Manager from time to time.")) Text("setup_agent_activity_monitor_description")
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
} }
} }
@ -170,12 +170,12 @@ struct SSHAgentSetupView: View {
@State private var selectedShellInstruction: ShellConfigInstruction = controller.shellInstructions.first! @State private var selectedShellInstruction: ShellConfigInstruction = controller.shellInstructions.first!
var body: some View { var body: some View {
SetupStepView(title: "Configure your SSH Agent", SetupStepView(title: "setup_ssh_title",
image: Image(systemName: "terminal"), image: Image(systemName: "terminal"),
bodyText: "Add this line to your shell config telling SSH to talk to Secret Agent when it wants to authenticate. Secretive can either do this for you automatically, or you can copy and paste this into your config file.", bodyText: "setup_ssh_description",
buttonTitle: "I Added it Manually", buttonTitle: "setup_ssh_added_manually_button",
buttonAction: buttonAction) { buttonAction: buttonAction) {
Link("If you're trying to set up a third party app, check out the FAQ.", destination: URL(string: "https://github.com/maxgoedjen/secretive/blob/main/APP_CONFIG.md")!) Link("setup_third_party_faq_link", destination: URL(string: "https://github.com/maxgoedjen/secretive/blob/main/APP_CONFIG.md")!)
Picker(selection: $selectedShellInstruction, label: EmptyView()) { Picker(selection: $selectedShellInstruction, label: EmptyView()) {
ForEach(SSHAgentSetupView.controller.shellInstructions) { instruction in ForEach(SSHAgentSetupView.controller.shellInstructions) { instruction in
Text(instruction.shell) Text(instruction.shell)
@ -183,8 +183,8 @@ struct SSHAgentSetupView: View {
.padding() .padding()
} }
}.pickerStyle(SegmentedPickerStyle()) }.pickerStyle(SegmentedPickerStyle())
CopyableView(title: "Add to \(selectedShellInstruction.shellConfigPath)", image: Image(systemName: "greaterthan.square"), text: selectedShellInstruction.text) CopyableView(title: "setup_ssh_add_to_config_button_\(selectedShellInstruction.shellConfigPath)", image: Image(systemName: "greaterthan.square"), text: selectedShellInstruction.text)
Button("Add it For Me") { Button("setup_ssh_add_for_me_button") {
let controller = ShellConfigurationController() let controller = ShellConfigurationController()
if controller.addToShell(shellInstructions: selectedShellInstruction) { if controller.addToShell(shellInstructions: selectedShellInstruction) {
buttonAction() buttonAction()
@ -214,12 +214,12 @@ struct UpdaterExplainerView: View {
let buttonAction: () -> Void let buttonAction: () -> Void
var body: some View { var body: some View {
SetupStepView(title: "Updates", SetupStepView(title: "setup_updates_title",
image: Image(systemName: "dot.radiowaves.left.and.right"), image: Image(systemName: "dot.radiowaves.left.and.right"),
bodyText: "Secretive will periodically check with GitHub to see if there's a new release. If you see any network requests to GitHub, that's why.", bodyText: "setup_updates_description",
buttonTitle: "Okay", buttonTitle: "setup_updates_ok",
buttonAction: buttonAction) { buttonAction: buttonAction) {
Link("Read more about this here.", destination: SetupView.Constants.updaterFAQURL) Link("setup_updates_readmore", destination: SetupView.Constants.updaterFAQURL)
} }
} }