2013-08-20 02:09:42 -05:00
|
|
|
# We have had lots of config issues with SECRET_TOKEN to avoid this mess we are moving it to redis
|
|
|
|
# if you feel strongly that it does not belong there use ENV['SECRET_TOKEN']
|
2013-02-20 19:32:32 -06:00
|
|
|
#
|
2013-08-29 00:27:01 -05:00
|
|
|
token = ENV['SECRET_TOKEN']
|
|
|
|
unless token
|
|
|
|
token = $redis.get('SECRET_TOKEN')
|
|
|
|
unless token && token.length == 128
|
|
|
|
token = SecureRandom.hex(64)
|
|
|
|
$redis.set('SECRET_TOKEN',token)
|
|
|
|
end
|
2013-02-18 00:34:43 -06:00
|
|
|
end
|
|
|
|
|
2013-08-20 02:09:42 -05:00
|
|
|
Discourse::Application.config.secret_token = token
|
2015-03-08 19:45:49 -05:00
|
|
|
Discourse::Application.config.secret_key_base = token
|