rails-5-2-credentials

辑编rails的credentials

EDITOR=vim rails credentials:edit

系统中使用credentials.yml.enc

vi config/initializers/rollbar.rb

Rollbar.configure do |config|
  # Without configuration, Rollbar is enabled in all environments.
  # To disable in specific environments, set config.enabled=false.

  config.access_token = Rails.application.credentials[:rollbar_token]
... ...
end

rollbar 在cap中使用

set :rollbar_token, YAML.load(`rails credentials:show`)['rollbar_token']
set :rollbar_env, Proc.new { fetch :stage }
set :rollbar_role, Proc.new { :app }

ref:

http://dlj.bz/d5Ll3K

https://github.com/rails/rails/pull/30067

Comments