[deploy] Generate Random Health Check Tokens on App Setup (#8178)

Co-authored-by: rhymes <rhymesete@gmail.com>
This commit is contained in:
Molly Struve 2020-05-30 14:11:02 -05:00 committed by GitHub
parent af6d2325e6
commit e1b99b1b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -12,7 +12,7 @@ class SiteConfig < RailsSettings::Base
cache_prefix { "v1" }
# API Tokens
field :health_check_token, type: :string, default: "secret"
field :health_check_token, type: :string
# Authentication
field :authentication_providers, type: :array, default: Authentication::Providers.available

View file

@ -14,5 +14,7 @@ namespace :app_initializer do
puts "\n== Updating Data =="
Rake::Task["data_updates:enqueue_data_update_worker"].execute
SiteConfig.health_check_token ||= SecureRandom.hex(10)
end
end