0
1

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 5 years have passed since last update.

railsのcredentials.yml.encとRAILS_MASTER_KEY

Posted at

RAILS_MASTER_KEYってなんだ?

credentials.yml.encをつかう際に、デコードするためのキー

credentials.yml.encってなんだ?

rails5.2より前のバージョンでは、secrets.ymlにて平文で情報を扱っていた。(secretsなのに。)
環境変数を暗号化して入れられるということですね。

これまでsecrets.ymlは環境ごとに分割して使われていましたが
credentials.yml.encは本番環境のみで使われる想定のものだそうです。

使い方

Rails.application.credentials.hogehoge

で情報を取得する事ができます。

参照
Rails5.2からsecrets.yml*が廃止されcredentials.yml.encに統合されるよ

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?