Skip to content

Commit

Permalink
build: use Rails credentials for storing secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
santiagorodriguez96 committed Mar 22, 2024
1 parent 71ac619 commit 62e5209
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config/credentials.yml.enc diff=rails_credentials
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ end

group :development, :test do
gem 'byebug', '~> 11.0', platforms: [:mri, :mingw, :x64_mingw]
gem "dotenv-rails", '~> 2.7'
gem 'rubocop', '~> 0.80.1', require: false
gem 'rubocop-rails', '~> 2.5.0', require: false
end
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ GEM
openssl-signature_algorithm (~> 1.0)
crass (1.0.6)
date (3.3.4)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.12.0)
ffi (1.16.3)
globalid (1.2.1)
Expand Down Expand Up @@ -277,7 +273,6 @@ DEPENDENCIES
bundler-audit (~> 0.9.1)
byebug (~> 11.0)
capybara (~> 3.26)
dotenv-rails (~> 2.7)
importmap-rails (~> 1.2)
listen (~> 3.8)
minitest-stub_any_instance (~> 1.0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_rollbar_js.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
var _rollbarConfig = {
accessToken: "<%= ENV['ROLLBAR_POST_CLIENT_ITEM_ACCESS_TOKEN'] %>",
accessToken: "<%= Rails.application.credentials.rollbar_post_client_item_access_token %>",
captureUncaught: true,
captureUnhandledRejections: true,
payload: {
Expand Down
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
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8PIvLQOaw226g=--V3U6uSlBXvLmxpwM--G4Vit/cYx2o1hIf2KPnlWg==
4 changes: 2 additions & 2 deletions config/initializers/rollbar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Without configuration, Rollbar is enabled in all environments.
# To disable in specific environments, set config.enabled=false.

config.access_token = ENV['ROLLBAR_POST_SERVER_ITEM_ACCESS_TOKEN']
config.access_token = Rails.application.credentials.rollbar_post_server_item_access_token

# Here we'll disable in 'test':
if Rails.env.test? || Rails.env.development?
Expand Down Expand Up @@ -69,5 +69,5 @@
# environment variable like this: `ROLLBAR_ENV=staging`. This is a recommended
# setup for Heroku. See:
# https://devcenter.heroku.com/articles/deploying-to-a-custom-rails-environment
config.environment = ENV['ROLLBAR_ENV'].presence || Rails.env
config.environment = Rails.application.credentials.rollbar_env.presence || Rails.env
end

0 comments on commit 62e5209

Please sign in to comment.