1
0
Fork 0
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:
Jörg Thalheim 2021-09-30 14:04:10 +01:00 committed by GitHub
commit a3e3dc7710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {