This commit is contained in:
Max Goedjen 2025-09-01 16:10:27 -07:00
parent 2d05a7b0f3
commit 4d84621b3d
No known key found for this signature in database
2 changed files with 166 additions and 99 deletions

View File

@ -1186,6 +1186,9 @@
}, },
"Configure" : { "Configure" : {
},
"Configuring Tools for Secretive" : {
}, },
"Copy" : { "Copy" : {
@ -3045,12 +3048,27 @@
}, },
"Getting Started" : { "Getting Started" : {
},
"If you don't known what shell you use and haven't changed it, you're probably using `zsh`." : {
},
"If you're trying to authenticate with an SSH server or authenticating with a service like GitHub over SSH, configure your SSH client." : {
},
"If you're trying to configure anything your command line runs to use Secretive, configure your shell." : {
},
"If you're trying to sign your git commits, set up Git Signing." : {
}, },
"Integrations" : { "Integrations" : {
}, },
"Integrations..." : { "Integrations..." : {
},
"Most tools will try and look for SSH keys on disk in `~/.ssh`. To use Secretive, we need to configure those tools to talk to Secretive instead." : {
}, },
"no_secure_storage_description" : { "no_secure_storage_description" : {
"extractionState" : "manual", "extractionState" : "manual",
@ -5269,9 +5287,6 @@
}, },
"System" : { "System" : {
},
"TBD" : {
}, },
"There's a community-maintained list of instructions for apps on GitHub. If the app you're looking for isn't supported, create an issue and the community may be able to help." : { "There's a community-maintained list of instructions for apps on GitHub. If the app you're looking for isn't supported, create an issue and the community may be able to help." : {
@ -6233,6 +6248,12 @@
}, },
"View on GitHub" : { "View on GitHub" : {
},
"What Should I Configure?" : {
},
"You can configure more than one tool, they generally won't interfere with each other." : {
} }
}, },
"version" : "1.0" "version" : "1.0"

View File

@ -23,11 +23,37 @@ struct IntegrationsView: View {
} }
} detail: { } detail: {
if let selectedInstruction { if let selectedInstruction {
Form {
switch selectedInstruction.id { switch selectedInstruction.id {
case .gettingStarted: case .gettingStarted:
Text("TBD") Form {
Section("Configuring Tools for Secretive") {
Text("Most tools will try and look for SSH keys on disk in `~/.ssh`. To use Secretive, we need to configure those tools to talk to Secretive instead.")
}
Section {
NavigationLink(value: ssh) {
Text("If you're trying to authenticate with an SSH server or authenticating with a service like GitHub over SSH, configure your SSH client.")
}
NavigationLink(value: zsh) {
VStack(alignment: .leading) {
Text("If you're trying to configure anything your command line runs to use Secretive, configure your shell.")
Text("If you don't known what shell you use and haven't changed it, you're probably using `zsh`.")
.font(.caption2)
.foregroundStyle(.secondary)
}
}
NavigationLink(value: git) {
Text("If you're trying to sign your git commits, set up Git Signing.")
}
} header: {
Text("What Should I Configure?")
}
footer: {
Text("You can configure more than one tool, they generally won't interfere with each other.")
}
}
.formStyle(.grouped)
case .tool: case .tool:
Form {
ForEach(selectedInstruction.steps) { stepGroup in ForEach(selectedInstruction.steps) { stepGroup in
Section { Section {
ConfigurationItemView(title: "Configuration File", value: stepGroup.path, action: .revealInFinder(stepGroup.path)) ConfigurationItemView(title: "Configuration File", value: stepGroup.path, action: .revealInFinder(stepGroup.path))
@ -66,14 +92,21 @@ struct IntegrationsView: View {
} }
} }
} }
}
.formStyle(.grouped)
case .otherShell: case .otherShell:
Form {
Section { Section {
Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/shells")!) Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/shells")!)
} header: { } header: {
Text("There's a community-maintained list of shell instructions on GitHub. If the shell you're looking for isn't supported, create an issue and the community may be able to help.") Text("There's a community-maintained list of shell instructions on GitHub. If the shell you're looking for isn't supported, create an issue and the community may be able to help.")
.font(.body) .font(.body)
} }
}
.formStyle(.grouped)
case .otherApp: case .otherApp:
Form {
Section { Section {
Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/apps")!) Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/apps")!)
} header: { } header: {
@ -81,10 +114,10 @@ struct IntegrationsView: View {
.font(.body) .font(.body)
} }
} }
}
.formStyle(.grouped) .formStyle(.grouped)
} }
} }
}
.onAppear { .onAppear {
selectedInstruction = instructions.first?.instructions.first selectedInstruction = instructions.first?.instructions.first
} }
@ -102,20 +135,17 @@ struct IntegrationsView: View {
extension IntegrationsView { extension IntegrationsView {
fileprivate var instructions: [ConfigurationGroup] { fileprivate var ssh: ConfigurationFileInstructions {
[
ConfigurationGroup(name:"Integrations", instructions: [
ConfigurationFileInstructions("Getting Started", id: .gettingStarted),
]),
ConfigurationGroup(
name: "System",
instructions: [
ConfigurationFileInstructions( ConfigurationFileInstructions(
tool: "SSH", tool: "SSH",
configPath: "~/.ssh/config", configPath: "~/.ssh/config",
configText: "Host *\n\tIdentityAgent \(socketPath)", configText: "Host *\n\tIdentityAgent \(socketPath)",
website: URL(string: "https://man.openbsd.org/ssh_config.5")!, website: URL(string: "https://man.openbsd.org/ssh_config.5")!,
), note: "You can tell SSH to use a specific key for a given host. See the web documentation for more details.",
)
}
fileprivate var git: ConfigurationFileInstructions {
ConfigurationFileInstructions( ConfigurationFileInstructions(
tool: "Git Signing", tool: "Git Signing",
steps: [ steps: [
@ -144,14 +174,30 @@ extension IntegrationsView {
], ],
website: URL(string: "https://git-scm.com/docs/git-config")!, website: URL(string: "https://git-scm.com/docs/git-config")!,
) )
] }
),
ConfigurationGroup(name: "Shell", instructions: [ fileprivate var zsh: ConfigurationFileInstructions {
ConfigurationFileInstructions( ConfigurationFileInstructions(
tool: "zsh", tool: "zsh",
configPath: "~/.zshrc", configPath: "~/.zshrc",
configText: "export SSH_AUTH_SOCK=\(socketPath)" configText: "export SSH_AUTH_SOCK=\(socketPath)"
)
}
fileprivate var instructions: [ConfigurationGroup] {
[
ConfigurationGroup(name:"Integrations", instructions: [
ConfigurationFileInstructions("Getting Started", id: .gettingStarted),
]),
ConfigurationGroup(
name: "System",
instructions: [
ssh,
git,
]
), ),
ConfigurationGroup(name: "Shell", instructions: [
zsh,
ConfigurationFileInstructions( ConfigurationFileInstructions(
tool: "bash", tool: "bash",
configPath: "~/.bashrc", configPath: "~/.bashrc",
@ -164,8 +210,8 @@ extension IntegrationsView {
), ),
ConfigurationFileInstructions("other", id: .otherShell), ConfigurationFileInstructions("other", id: .otherShell),
]), ]),
ConfigurationGroup(name:"Apps", instructions: [ ConfigurationGroup(name: "Other", instructions: [
ConfigurationFileInstructions("Other", id: .otherApp), ConfigurationFileInstructions("Apps", id: .otherApp),
]), ]),
] ]
} }
@ -198,10 +244,10 @@ struct ConfigurationFileInstructions: Hashable, Identifiable {
var steps: [StepGroup] var steps: [StepGroup]
var website: URL? var website: URL?
init(tool: String, configPath: String, configText: String, website: URL? = nil) { init(tool: String, configPath: String, configText: String, website: URL? = nil, note: String? = nil) {
self.id = .tool(tool) self.id = .tool(tool)
self.tool = tool self.tool = tool
self.steps = [StepGroup(path: configPath, steps: [configText])] self.steps = [StepGroup(path: configPath, steps: [configText], note: note)]
self.website = website self.website = website
} }