From 82bca2419d75d9156bf17f1f11f6bb6bf5d4f3ca Mon Sep 17 00:00:00 2001 From: albert Date: Mon, 14 Jan 2013 15:11:53 -0500 Subject: [PATCH] add alt source for secret token --- config/initializers/secret_token.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 116c6f0c7..d6765aaf9 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -4,4 +4,10 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Danbooru::Application.config.secret_token = 'bd49b99b97bed9bf337d83224d315abaf5e5f48fbd20183570b6c4d81220035536e5a6683461da02f60a8f507ea74aa92fa083c577963e0f16a557ce808c2f30' + +if File.exists?(File.expand_path("~/.danbooru/secret_token")) + Danbooru::Application.config.secret_token = File.read(File.expand_path("~/.danbooru/secret_token")) +else + Danbooru::Application.config.secret_token = 'bd49b99b97bed9bf337d83224d315abaf5e5f48fbd20183570b6c4d81220035536e5a6683461da02f60a8f507ea74aa92fa083c577963e0f16a557ce808c2f30' +end +