001_admin.rb 599 Bytes
Newer Older
1
if ENV['GITLAB_ROOT_PASSWORD'].blank?
2
  password = '5iveL!fe'
3 4 5 6 7
  expire_time = Time.now
else
  password = ENV['GITLAB_ROOT_PASSWORD']
  expire_time = nil
end
8

9 10
email = ENV['GITLAB_ROOT_EMAIL'].presence || 'admin@example.com'

gitlabhq's avatar
gitlabhq committed
11
admin = User.create(
12
  email: email,
13 14
  name: "Administrator",
  username: 'root',
15
  password: password,
16
  password_expires_at: expire_time,
17
  theme_id: Gitlab::Themes::APPLICATION_DEFAULT
18

gitlabhq's avatar
gitlabhq committed
19 20
)

Valera Sizov's avatar
Valera Sizov committed
21
admin.projects_limit = 10000
gitlabhq's avatar
gitlabhq committed
22 23
admin.admin = true
admin.save!
24
admin.confirm
gitlabhq's avatar
gitlabhq committed
25 26

if admin.valid?
27
puts %Q[
gitlabhq's avatar
gitlabhq committed
28 29
Administrator account created:

30
login.........root
31
password......#{password}
gitlabhq's avatar
gitlabhq committed
32 33
]
end