encryptcommand allows you to encrypt and edit your environment settings. This allows you to store production secrets in your repo safely.
Here is a list of the commands available:
amber encrypt [OPTIONS] [ENV]
ENV Environment settings to encrypt (default: production)
-e, --editor Prefered Editor: [vim, nano, pico, etc]
--noedit Skip editing and just encrypt
amber encrypt productionwill use the secret key in .
config/environments/.production.encand open it in your favorite editor.
When you save and exit it will encrypt again.
Amber Encrypt Demo
amber encrypt developmentwill encrypt
config/environments/development.ymlusing same keys as above.
Editor will be opened if file is already encrypted.
amber encrypt development --noeditwill encrypt file if unencrypted but do nothing if it's already encrypted. Editor will not be opened.
Production is encrypted by default.
Keep track of the values of
ENV[AMBER_ENCRYPTION_KEY]. If you lose these you will not be able to decrypt an encrypted file.
When a new project is created the file
.encryption_keyis created with a random key. This is added to
gitignoreby default as it should never be added to your repo.
If you need to encrypt or decrypt on another development box or server you will need to manually move
.encryption_keyor set the value of
ENV[AMBER_ENCRYPTION_KEY]on that computer.
If your server can't read your encrypted settings it will use the default ones.