0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Rails] credentials.yml.enc、master.keyについて。

Last updated at Posted at 2021-02-10

結論

秘密鍵: master.key

公開鍵: credentials.yml.enc

master.keyとは

・暗号化された「credentials.yml.enc」の記述を復号化するための鍵のようなもの
####・アプリを消して、同じものをクローンした時点で、無くなっているから、credential.yml.encを再生成する必要がある。
[Rails] ActiveSupport::MessageEncryptor::InvalidMessageの解決方法

credentials.yml.encとは

中身はこんな感じで暗号化されている

LEebK7Oel2pwADz3qzaLXWYHR12UexPU097wLK9FPnnRjZXPY7ZtSBsr96yCcC5r3dKRZrzzvwkmHO7hmuMgF+fiEOEWczncvQ50XuqMC2GDXiAsK0AyuF59eJ7EzzjiYT6FLS9Hvqk8W6IKHvFRf6BsgmVjGKVhp6KIyCeU/wzTpI5s75cl4ahn1CUCfLsxjXeGKFxlYIdgFgi1h+bYPhFPs2EVagdDHir/g2pWlofJkCAdbuJFstA/qNc40mC3Pb8DPoCP1HGCXDMPGrOPSPpEefJhw2lHj5l5TOvcRWNh5q0+fjhgrUbEGD/R+uu4VqSDVXQ+eNUvS5BQbGK/09L/woCq3zz8Wg77KV53TD2uuYV83bTYTWtOvcegd4jfJFBu8i5GfTBC2yO

暗号とくとこんな感じ

# aws:
#   access_key_id: 123
#   secret_access_key: 345

# Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
secret_key_base: 8be8e637d755f79c799048bed8be0c...

編集するコマンド

EDITOR="vi" bin/rails credentials:edit

もっと詳しく
https://zenn.dev/banrih/articles/f22f0a70bbead2a02110

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?