debian-mirror-gitlab/db/fixtures/production/001_admin.rb

32 lines
532 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
if ENV['GITLAB_ROOT_PASSWORD'].blank?
password = '5iveL!fe'
expire_time = Time.now
else
password = ENV['GITLAB_ROOT_PASSWORD']
expire_time = nil
end
2014-09-02 18:07:02 +05:30
admin = User.create(
email: "admin@example.com",
name: "Administrator",
username: 'root',
2015-04-26 12:48:37 +05:30
password: password,
password_expires_at: expire_time,
2014-09-02 18:07:02 +05:30
theme_id: Gitlab::Theme::MARS
)
admin.projects_limit = 10000
admin.admin = true
admin.save!
admin.confirm!
if admin.valid?
2015-04-26 12:48:37 +05:30
puts %Q[
2014-09-02 18:07:02 +05:30
Administrator account created:
login.........root
2015-04-26 12:48:37 +05:30
password......#{password}
2014-09-02 18:07:02 +05:30
]
end