This commit is contained in:
musjj 2025-12-21 15:02:26 -05:00 committed by GitHub
commit 51be135cf0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 1 deletions

View file

@ -79,6 +79,7 @@ type manifest struct {
SSHKeyPaths []string `json:"sshKeyPaths"`
GnupgHome string `json:"gnupgHome"`
AgeKeyFile string `json:"ageKeyFile"`
AgeSSHKeyFile string `json:"ageSshKeyFile"`
AgeSSHKeyPaths []string `json:"ageSshKeyPaths"`
UseTmpfs bool `json:"useTmpfs"`
UserMode bool `json:"userMode"`
@ -1341,7 +1342,7 @@ func installSecrets(args []string) error {
}
// Import age keys
if len(manifest.AgeSSHKeyPaths) != 0 || manifest.AgeKeyFile != "" {
if (len(manifest.AgeSSHKeyPaths) != 0 || manifest.AgeKeyFile != "") && manifest.AgeSSHKeyFile == "" {
keyfile := filepath.Join(manifest.SecretsMountPoint, "age-keys.txt")
err = os.Setenv("SOPS_AGE_KEY_FILE", keyfile)
if err != nil {
@ -1382,6 +1383,10 @@ func installSecrets(args []string) error {
}
}
if manifest.AgeSSHKeyFile != "" {
os.Setenv("SOPS_AGE_SSH_PRIVATE_KEY_FILE", manifest.AgeSSHKeyFile)
}
if err := decryptSecrets(manifest.Secrets); err != nil {
return err
}