Secrex

Library that providing Mix tasks for encrypting and decrypting secret files to safely keep them in the repo

Installation

The package can be installed by adding secrex to our list of dependencies in mix.exs:

def deps do
[
{:secrex, github: "ForzaElixir/secrex", tag: "v0.1.0", runtime: false}
]
end

Usage

Secrex requires some configuration in order to work. For example, in config/config.exs:

config :secrex,
key_file: ".secrets_key",
files: ["config/env/prod.secret.exs"]

Mix tasks

Helper functions

For example if we have a deploy task, we can prevent deploy if secrets were diverged

if Mix.Secrex.secret_files_changed?() do
Mix.raise(
"Encrypted files are not matching decrypted\n" <>
"please run \"mix secrex.decrypt\" to have latest config files"
)
end

License

This software is licensed under the ISC license.