mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #9719 from mkllnk/secrets-config
Simplify config of secret token
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
# ENV vars for the development environment
|
||||
# Override locally with `.env.development.local`
|
||||
#
|
||||
# You may also want to use this when testing other environments locally:
|
||||
#
|
||||
# cp .env.development .env.local
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
OFN_REDIS_URL="redis://localhost:6379/1"
|
||||
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# ENV vars for the test environment
|
||||
# Override locally with `.env.test.local`
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
STRIPE_SECRET_TEST_API_KEY="bogus_key"
|
||||
STRIPE_CUSTOMER="bogus_customer"
|
||||
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -57,3 +57,6 @@ coverage
|
||||
/yarn-error.log
|
||||
yarn-debug.log*
|
||||
.yarn-integrity
|
||||
|
||||
/config/credentials.yml.enc
|
||||
/config/master.key
|
||||
|
||||
@@ -5,14 +5,8 @@
|
||||
# Make sure the secret is at least 30 characters and all random,
|
||||
# no regular words or you'll be exposed to dictionary attacks.
|
||||
|
||||
secret_key = if Rails.env.development? or Rails.env.test?
|
||||
('x' * 30) # Meets basic minimum of 30 chars.
|
||||
else
|
||||
ENV["SECRET_TOKEN"]
|
||||
end
|
||||
|
||||
# Rails 4+ key for signing and encrypting cookies.
|
||||
Openfoodnetwork::Application.config.secret_key_base = secret_key
|
||||
Openfoodnetwork::Application.config.secret_key_base = ENV["SECRET_TOKEN"]
|
||||
|
||||
# Legacy secret_token variable. This is still used directly for encryption.
|
||||
Openfoodnetwork::Application.config.secret_token = secret_key
|
||||
Openfoodnetwork::Application.config.secret_token = ENV["SECRET_TOKEN"]
|
||||
|
||||
Reference in New Issue
Block a user