mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-09-16 09:20:56 +00:00
WIP
This commit is contained in:
parent
2d05a7b0f3
commit
4d84621b3d
@ -1186,6 +1186,9 @@
|
||||
},
|
||||
"Configure" : {
|
||||
|
||||
},
|
||||
"Configuring Tools for Secretive" : {
|
||||
|
||||
},
|
||||
"Copy" : {
|
||||
|
||||
@ -3045,12 +3048,27 @@
|
||||
},
|
||||
"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..." : {
|
||||
|
||||
},
|
||||
"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" : {
|
||||
"extractionState" : "manual",
|
||||
@ -5269,9 +5287,6 @@
|
||||
},
|
||||
"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." : {
|
||||
|
||||
@ -6233,6 +6248,12 @@
|
||||
},
|
||||
"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"
|
||||
|
@ -23,11 +23,37 @@ struct IntegrationsView: View {
|
||||
}
|
||||
} detail: {
|
||||
if let selectedInstruction {
|
||||
Form {
|
||||
switch selectedInstruction.id {
|
||||
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:
|
||||
Form {
|
||||
ForEach(selectedInstruction.steps) { stepGroup in
|
||||
Section {
|
||||
ConfigurationItemView(title: "Configuration File", value: stepGroup.path, action: .revealInFinder(stepGroup.path))
|
||||
@ -66,14 +92,21 @@ struct IntegrationsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
case .otherShell:
|
||||
Form {
|
||||
Section {
|
||||
Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/shells")!)
|
||||
} 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.")
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
|
||||
case .otherApp:
|
||||
Form {
|
||||
Section {
|
||||
Link("View on GitHub", destination: URL(string: "https://github.com/maxgoedjen/secretive-config-instructions/tree/main/apps")!)
|
||||
} header: {
|
||||
@ -81,10 +114,10 @@ struct IntegrationsView: View {
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
selectedInstruction = instructions.first?.instructions.first
|
||||
}
|
||||
@ -102,20 +135,17 @@ struct IntegrationsView: View {
|
||||
|
||||
extension IntegrationsView {
|
||||
|
||||
fileprivate var instructions: [ConfigurationGroup] {
|
||||
[
|
||||
ConfigurationGroup(name:"Integrations", instructions: [
|
||||
ConfigurationFileInstructions("Getting Started", id: .gettingStarted),
|
||||
]),
|
||||
ConfigurationGroup(
|
||||
name: "System",
|
||||
instructions: [
|
||||
fileprivate var ssh: ConfigurationFileInstructions {
|
||||
ConfigurationFileInstructions(
|
||||
tool: "SSH",
|
||||
configPath: "~/.ssh/config",
|
||||
configText: "Host *\n\tIdentityAgent \(socketPath)",
|
||||
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(
|
||||
tool: "Git Signing",
|
||||
steps: [
|
||||
@ -144,14 +174,30 @@ extension IntegrationsView {
|
||||
],
|
||||
website: URL(string: "https://git-scm.com/docs/git-config")!,
|
||||
)
|
||||
]
|
||||
),
|
||||
ConfigurationGroup(name: "Shell", instructions: [
|
||||
}
|
||||
|
||||
fileprivate var zsh: ConfigurationFileInstructions {
|
||||
ConfigurationFileInstructions(
|
||||
tool: "zsh",
|
||||
configPath: "~/.zshrc",
|
||||
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(
|
||||
tool: "bash",
|
||||
configPath: "~/.bashrc",
|
||||
@ -164,8 +210,8 @@ extension IntegrationsView {
|
||||
),
|
||||
ConfigurationFileInstructions("other", id: .otherShell),
|
||||
]),
|
||||
ConfigurationGroup(name:"Apps", instructions: [
|
||||
ConfigurationFileInstructions("Other", id: .otherApp),
|
||||
ConfigurationGroup(name: "Other", instructions: [
|
||||
ConfigurationFileInstructions("Apps", id: .otherApp),
|
||||
]),
|
||||
]
|
||||
}
|
||||
@ -198,10 +244,10 @@ struct ConfigurationFileInstructions: Hashable, Identifiable {
|
||||
var steps: [StepGroup]
|
||||
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.tool = tool
|
||||
self.steps = [StepGroup(path: configPath, steps: [configText])]
|
||||
self.steps = [StepGroup(path: configPath, steps: [configText], note: note)]
|
||||
self.website = website
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user