Skip to content

Commit

Permalink
Fixes #37061 - In DEV env generate admin with 'changeme' password
Browse files Browse the repository at this point in the history
By default the admin password is a random string,
which makes sense from a security point of view,
but in the DEV environment, the password can be something
easy to remember, like `changeme`.

This reduces the necessity of resetting the password in UI or
with the `rails permissions:reset` task, which is good
especially for newcomers who are trying Foreman for the first time.
  • Loading branch information
stejskalleos committed Jan 19, 2024
1 parent 0b40a64 commit 3e36c5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/seeds.d/035-admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
if ENV['SEED_ADMIN_PASSWORD'].present?
user.password = ENV['SEED_ADMIN_PASSWORD']
else
random = User.random_password
user.password = random
puts "Login credentials: #{user.login} / #{random}" unless Rails.env.test?
password = Rails.env.development? ? 'changeme' : User.random_password
user.password = password
puts "Login credentials: #{user.login} / #{password}" unless Rails.env.test?
end
raise "Unable to create admin user: #{SeedHelper.format_errors user}" unless user.save
end
Expand Down

0 comments on commit 3e36c5f

Please sign in to comment.