My initial commit which I did on my workstation, ignored my config/master.key file.
This is correct behavior. config/master.key
should not be checked in. It's a secret which should live in a separate secrets vault such as a shared password manager or something like Vault. Then you can store all the other application's secrets encrypted with that single key. If your code repository is compromised your secrets remain safe.
Review rails credentials:help
.
If you're asking if you can create the same config/master.key
, no. Such a back door would defeat the point. I'm afraid you're out of luck. Any secrets stored in the app should also be in your vault.
If you're asking if you can create a new config/master.key
, yes. Delete config/master.key
and config/credentials.yml.enc
. Then run rails credentials:edit
and it will make a new key and encrypted credentials file.