sops icon indicating copy to clipboard operation
sops copied to clipboard

SOPS cannot handle multi-line .env files

Open karlschriek opened this issue 3 years ago • 0 comments

The parser that SOPS uses seems to have a different interpretation of what constitutes a dotenv file from what how bash views is. This relates in particular to encrypting/decrypt dotenvs that have multiline environement variables.

However, SOPS is not able to handle encrypting this file. Calling sops -e --pgp xxxxxxxx my-vars.env will produce the following error:

Error unmarshalling file: invalid dotenv input line: some values

The parser is trying to interpret the second line of BAR (which is "some values") as another key-value pair, which does not work.

This is a pretty major inconsistency.

karlschriek avatar Dec 02 '21 15:12 karlschriek