Skip to content

Instantly share code, notes, and snippets.

View stratigos's full-sized avatar
👷‍♂️
building the internet

Todd stratigos

👷‍♂️
building the internet
View GitHub Profile
@jessejanderson
jessejanderson / macros.md
Last active October 28, 2024 00:58
Don't Write Macros (but do learn how they work)
@db0sch
db0sch / regenerate_credentials.md
Last active July 30, 2024 12:59
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc