Mechanism for managing confidential information of apps that appeared in Rails 5.2
master.key A file containing the private key for decrypting the encrypted secret information written in credentials.yml.enc
credentials.yml.enc
An encrypted file of credentials.yml
credentials.yml File with confidential information
Instead of editing credentials.yml.enc
directly, edit it with the following command
EDITOR='vim' rails credentials:edit
credentials.yml.enc
directly?Because credentials.yml.enc
is an encrypted file and you can't edit it. (.enc means encrypted file)
After launching Rails console, type the following command
Rails.application.credentials[:Confidential information you want to get]
https://hirocorpblog.com/rails-credentials-master/#toc1
Recommended Posts