Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update seed: random password during install
This seems superior to the default password of `'password'`. Thoughts on this?
  • Loading branch information
rud committed Feb 9, 2015
1 parent b31b460 commit 7e462cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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
Expand Down

0 comments on commit 7e462cf

Please sign in to comment.