Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sops does not respect explicit XDG_CONFIG_HOME #1263

Closed
flowchartsman opened this issue Aug 19, 2023 · 3 comments · Fixed by #1291
Closed

sops does not respect explicit XDG_CONFIG_HOME #1263

flowchartsman opened this issue Aug 19, 2023 · 3 comments · Fixed by #1291

Comments

@flowchartsman
Copy link

I am on MacOS, and I have explicitly set XDG_CONFIG_HOME in my environment because /Users/me/Library/Application Support is an awkward location to store config files and $HOME/.config is much better. By setting this explicitly, applications should respect it.

However:

$ sops  <encrypted file>
Failed to get the data key required to decrypt the SOPS file.

Group 0: FAILED
  age<pukey>: FAILED
    - | failed to open file: open /Users/me/Library/Application
      | Support/sops/age/keys.txt: no such file or directory

Recovery failed because the file was encrypted with a Shamir threshold of
1, but only 0 part(s) were successfully recovered, one for each successful
key group. In order for SOPS to recover the file, at least 1 groups have to
be successful. In order for a group to be successful, decryption has to
succeed with any of the keys in that key group.

$ echo $XDG_CONFIG_HOME
/Users/me/.config

Sadly, the ship has sailed for os.UserConfigDir(), which is what sops uses, but that doesn't mean there can't be a fallback, so it would be nice if sops could support it.

@felixfontein
Copy link
Contributor

Note that as a workaround (for now) you can use SOPS_AGE_KEY_FILE to point sops to the right path.

@flowchartsman
Copy link
Author

You are right, I absolutely should have mentioned that. That's what I'm doing now.

@felixfontein
Copy link
Contributor

#1291 fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants