From 7e462cfcd2babcc4ae1be55aba2586f0326b42d9 Mon Sep 17 00:00:00 2001 From: Laust Rud Jacobsen Date: Mon, 9 Feb 2015 15:07:03 +0100 Subject: [PATCH] Update seed: random password during install --- db/seeds.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index e109a69..b709a01 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,17 +1,19 @@ +require 'securerandom' + puts "Seeding database" puts "-------------------------------" # Create an initial Admin User admin_username = "errbit" admin_email = "errbit@#{Errbit::Config.host}" -admin_pass = 'password' +admin_pass = SecureRandom.urlsafe_base64(12)[0,12] puts "Creating an initial admin user:" puts "-- username: #{admin_username}" if Errbit::Config.user_has_username puts "-- email: #{admin_email}" puts "-- password: #{admin_pass}" puts "" -puts "Be sure to change these credentials ASAP!" +puts "Be sure to note down these credentials now!" user = User.find_or_initialize_by(:email => admin_email) do |u| u.name = 'Errbit Admin' u.password = admin_pass -- libgit2 0.21.2