mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-03-13 20:29:17 +00:00
Merge pull request #122 from Mic92/feat/swap-age-keys
Swap order of age ssh keys and the key file
This commit is contained in:
commit
a3e3dc7710
1 changed files with 3 additions and 3 deletions
|
@ -645,15 +645,15 @@ func installSecrets(args []string) error {
|
|||
os.Setenv("GNUPGHOME", manifest.GnupgHome)
|
||||
}
|
||||
|
||||
if len(manifest.AgeSshKeyPaths) != 0 {
|
||||
if manifest.AgeKeyFile != "" {
|
||||
os.Setenv("SOPS_AGE_KEY_FILE", manifest.AgeKeyFile)
|
||||
} else if len(manifest.AgeSshKeyPaths) != 0 {
|
||||
keyfile := filepath.Join(manifest.SecretsMountPoint, "age-keys.txt")
|
||||
err = importAgeSSHKeys(manifest.AgeSshKeyPaths, keyfile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
os.Setenv("SOPS_AGE_KEY_FILE", keyfile)
|
||||
} else if manifest.AgeKeyFile != "" {
|
||||
os.Setenv("SOPS_AGE_KEY_FILE", manifest.AgeKeyFile)
|
||||
}
|
||||
|
||||
if err := decryptSecrets(manifest.Secrets); err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue