feat: Working encrypt and decrypt commands.
This commit is contained in:
@@ -68,13 +68,14 @@ extension CliClient: DependencyKey {
|
||||
in: nil,
|
||||
args
|
||||
))
|
||||
} else {
|
||||
try await shellClient.background(.init(
|
||||
shell: shell,
|
||||
environment: ProcessInfo.processInfo.environment,
|
||||
in: nil,
|
||||
args
|
||||
))
|
||||
}
|
||||
try await shellClient.background(.init(
|
||||
shell: shell,
|
||||
environment: ProcessInfo.processInfo.environment,
|
||||
in: nil,
|
||||
args
|
||||
))
|
||||
} createConfiguration: { path, json in
|
||||
|
||||
// Early out if a file exists at the path already.
|
||||
|
||||
@@ -12,6 +12,7 @@ public struct Configuration: Codable, Sendable {
|
||||
public let templateDir: String?
|
||||
public let defaultPlaybookArgs: [String]?
|
||||
public let defaultVaultArgs: [String]?
|
||||
public let defaultVaultEncryptId: String?
|
||||
|
||||
fileprivate enum CodingKeys: String, CodingKey {
|
||||
case playbookDir = "HPA_PLAYBOOK_DIR"
|
||||
@@ -21,6 +22,7 @@ public struct Configuration: Codable, Sendable {
|
||||
case templateDir = "HPA_TEMPLATE_DIR"
|
||||
case defaultPlaybookArgs = "HPA_DEFAULT_PLAYBOOK_ARGS"
|
||||
case defaultVaultArgs = "HPA_DEFAULT_VAULT_ARGS"
|
||||
case defaultVaultEncryptId = "HPA_DEFAULT_VAULT_ENCRYPT_ID"
|
||||
}
|
||||
|
||||
public static func fromEnv(
|
||||
@@ -40,7 +42,8 @@ public struct Configuration: Codable, Sendable {
|
||||
templateRepoVersion: hpaValues.value(for: .templateRepoVersion),
|
||||
templateDir: hpaValues.value(for: .templateDir),
|
||||
defaultPlaybookArgs: hpaValues.array(for: .defaultPlaybookArgs),
|
||||
defaultVaultArgs: hpaValues.array(for: .defaultVaultArgs)
|
||||
defaultVaultArgs: hpaValues.array(for: .defaultVaultArgs),
|
||||
defaultVaultEncryptId: hpaValues.value(for: .defaultVaultEncryptId)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -52,7 +55,8 @@ public struct Configuration: Codable, Sendable {
|
||||
templateRepoVersion: "main",
|
||||
templateDir: "/path/to/local/template",
|
||||
defaultPlaybookArgs: ["--tags", "debug"],
|
||||
defaultVaultArgs: ["--vault-id=myId@$SCRIPTS/vault-gopass-client"]
|
||||
defaultVaultArgs: ["--vault-id=myId@$SCRIPTS/vault-gopass-client"],
|
||||
defaultVaultEncryptId: "myId"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user