Skip to content

Commit a94b56b

Browse files
committed
New credential locations
1 parent cf0a2e1 commit a94b56b

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

.env.postgresql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ROLLBAR_ENV=
4242
# customized content in ./app/views/branded and `app` is for the core roadmap translations.
4343
# Include your Translation.io API key for the appropriate domains:
4444
# app => TRANSLATION_API_ROADMAP
45-
# client => TRANSLATION_API_CLIENT
46-
DOMAIN=app
47-
TRANSLATION_API_ROADMAP=
48-
TRANSLATION_API_CLIENT=
45+
# # client => TRANSLATION_API_CLIENT
46+
# DOMAIN=app
47+
# TRANSLATION_API_ROADMAP=
48+
# TRANSLATION_API_CLIENT=

config/credentials.yml.sample

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# aws:
2+
# access_key_id: 123
3+
# secret_access_key: 345
4+
5+
# Recaptcha credentials
6+
recaptcha:
7+
site_key: "11111"
8+
secret_key: "22222"
9+
10+
# Database details
11+
database:
12+
user_name: roadmap
13+
password: password123
14+
15+
# Dragonfly gem
16+
dragonfly_secret: "my_dragonfly_secret"
17+
18+
# Devise credentials
19+
secret_key: "11111122222"
20+
devise_pepper: "111122223333444455555"
21+
22+
# Translation.io API key
23+
translation_api_key: "111112222333334444"
24+
25+
translation_api_client_key: "Client key if present"
26+
27+
# Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
28+
secret_key_base: "1111111111111222222223333333444444"

config/database.yml.sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ defaults: &defaults
55
host: <%= ENV.fetch('DB_HOST', 'localhost') %>
66
port: <%= ENV.fetch('DB_PORT', '5432') %>
77
database: <%= ENV.fetch('DB_NAME', 'roadmap') %>
8-
username: <%= ENV.fetch('DB_USERNAME', Rails.application.credentials.db_username) %>
9-
password: <%= ENV.fetch('DB_PASSWORD', Rails.application.credentials.db_password) %>
8+
username: <%= Rails.application.credentials.dig(:database, :username) %>
9+
password: <%= Rails.application.credentials.dig(:database, :password) %>
1010

1111
development:
1212
<<: *defaults
1313

14-
staging:
14+
test:
1515
<<: *defaults

config/initializers/translation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# domain specified in order to generate both sets of translation keys.
2222
if !ENV['DOMAIN'] || ENV['DOMAIN'] == 'app'
2323
TranslationIO.configure do |config|
24-
config.api_key = ENV.fetch('TRANSLATION_API_ROADMAP', nil)
24+
config.api_key = Rails.application.credentials.dig(:translation_api_key).presence
2525
config.source_locale = 'en'
2626
config.target_locales = SUPPORTED_LOCALES
2727
config.text_domain = 'app'
@@ -31,7 +31,7 @@
3131
end
3232
elsif ENV['DOMAIN'] == 'client'
3333
TranslationIO.configure do |config|
34-
config.api_key = ENV.fetch('TRANSLATION_API_CLIENT', nil)
34+
config.api_key = Rails.application.credentials.dig(:translation_api_client_key).presence
3535
config.source_locale = 'en'
3636
config.target_locales = CLIENT_LOCALES
3737
config.text_domain = 'client'

0 commit comments

Comments
 (0)