From f8d6368f10dfbd291bd72f45e93dda53afe14b49 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 11 Apr 2020 16:01:56 +0300 Subject: [PATCH] Add a default random for secrets Add a default random for APP_SECRET_KEY_BASE to avoid startup issues. --- config/secrets.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/secrets.yml b/config/secrets.yml index c44a38b..6da0179 100644 --- a/config/secrets.yml +++ b/config/secrets.yml @@ -1,11 +1,11 @@ development: - secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %> + secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %> test: - secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %> + secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %> production: - secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %> + secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %> staging: - secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %> \ No newline at end of file + secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %> \ No newline at end of file