From d69b04de0ff33237209afea6f6cac3ab27934908 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Thu, 20 Sep 2018 11:08:18 +0900 Subject: Fix env name for master key When using environment specific credentials, `RAILS_MASTER_KEY` is not used. --- railties/lib/rails/application.rb | 2 +- railties/lib/rails/commands/credentials/USAGE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 656786246d..3cc5b70e9e 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -440,7 +440,7 @@ module Rails # +config/master.key+. # If specific credentials file exists for current environment, it takes precedence, thus for +production+ # environment look first for +config/credentials/production.yml.enc+ with master key taken - # from ENV["RAILS_MASTER_KEY"] or from loading +config/credentials/production.key+. + # from ENV["RAILS_PRODUCTION_KEY"] or from loading +config/credentials/production.key+. # Default behavior can be overwritten by setting +config.credentials.content_path+ and +config.credentials.key_path+. def credentials @credentials ||= encrypted(config.credentials.content_path, key_path: config.credentials.key_path) diff --git a/railties/lib/rails/commands/credentials/USAGE b/railties/lib/rails/commands/credentials/USAGE index 6b33d1ab74..513afcbc78 100644 --- a/railties/lib/rails/commands/credentials/USAGE +++ b/railties/lib/rails/commands/credentials/USAGE @@ -43,7 +43,7 @@ from leaking. It is possible to have credentials for each environment. If the file for current environment exists it will take precedence over `config/credentials.yml.enc`, thus for `production` environment first look for -`config/credentials/production.yml.enc` that can be decrypted using master key taken from `ENV["RAILS_MASTER_KEY"]` +`config/credentials/production.yml.enc` that can be decrypted using master key taken from `ENV["RAILS_PRODUCTION_KEY"]` or stored in `config/credentials/production.key`. To edit given file use command `rails credentials:edit --environment production` Default paths can be overwritten by setting `config.credentials.content_path` and `config.credentials.key_path`. -- cgit v1.2.3