2014-11-04 10:02:38 -05:00
|
|
|
if ENV['GITLAB_ROOT_PASSWORD'].blank?
|
2015-07-14 11:59:36 -04:00
|
|
|
password = '5iveL!fe'
|
2014-11-04 10:02:38 -05:00
|
|
|
expire_time = Time.now
|
|
|
|
else
|
|
|
|
password = ENV['GITLAB_ROOT_PASSWORD']
|
|
|
|
expire_time = nil
|
|
|
|
end
|
2014-09-11 04:04:58 -04:00
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
admin = User.create(
|
2014-07-19 07:27:01 -04:00
|
|
|
email: "admin@example.com",
|
2012-11-23 13:11:09 -05:00
|
|
|
name: "Administrator",
|
|
|
|
username: 'root',
|
2014-09-11 04:04:58 -04:00
|
|
|
password: password,
|
2014-11-04 10:02:38 -05:00
|
|
|
password_expires_at: expire_time,
|
2015-06-05 17:30:40 -04:00
|
|
|
theme_id: Gitlab::Themes::APPLICATION_DEFAULT
|
2013-08-26 06:06:41 -04:00
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
)
|
|
|
|
|
2011-10-09 14:15:01 -04:00
|
|
|
admin.projects_limit = 10000
|
2011-10-08 17:36:38 -04:00
|
|
|
admin.admin = true
|
|
|
|
admin.save!
|
2015-09-19 21:15:13 -04:00
|
|
|
admin.confirm
|
2011-10-21 13:58:04 -04:00
|
|
|
|
|
|
|
if admin.valid?
|
2014-10-07 05:48:25 -04:00
|
|
|
puts %Q[
|
2011-10-21 13:58:04 -04:00
|
|
|
Administrator account created:
|
|
|
|
|
2014-07-19 07:27:01 -04:00
|
|
|
login.........root
|
2014-09-11 04:04:58 -04:00
|
|
|
password......#{password}
|
2011-10-21 13:58:04 -04:00
|
|
|
]
|
|
|
|
end
|