Skip to content

sops does not respect explicit XDG_CONFIG_HOME #1263

@flowchartsman

Description

@flowchartsman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions