sops icon indicating copy to clipboard operation
sops copied to clipboard

feat: follow best practices with regards to naming .env files

Open DrakeEvans opened this issue 1 year ago • 6 comments

Many libraries and dev tools use .env files. Typically different files are used for different environments like dev, staging, and production. Typically, these are named .env.production with the designation happening after the .env.

This change allows sops to recognize dotenv files named with .env at the beginning of the filename in addition to the suffix (current functionality)

DrakeEvans avatar May 24 '24 20:05 DrakeEvans

Thanks for your contribution! This is unfortunately a breaking change, see https://github.com/getsops/sops/pull/1450#issuecomment-1978049930 for details.

felixfontein avatar May 24 '24 20:05 felixfontein

@felixfontein I can re-implement as non-breaking by ensuring that the prefix has the lowest precedence when determining filetype.

DrakeEvans avatar May 28 '24 19:05 DrakeEvans

@DrakeEvans it's always a breaking change, since it affects how SOPS identifies the type of some files. It will suddenly use the env store instead of the binary store for some files.

felixfontein avatar May 29 '24 05:05 felixfontein

(A possible solution would be to embed - if asked to - the original store type in the encrypted file, so SOPS doesn't have to guess it when decrypting. The 'if asked to' part here is important since otherwise it's also breaking backwards compatibility. But that's a more complex change that first needs some discussion...)

felixfontein avatar May 29 '24 05:05 felixfontein

Yeah Im wondering if its easier to just specify the input-type/output-type in the config file. Does that functionality already exist?

DrakeEvans avatar May 29 '24 17:05 DrakeEvans

I don't think it exists so far.

felixfontein avatar May 29 '24 17:05 felixfontein