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

32 lines
548 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,
2015-09-11 14:41:01 +05:30
theme_id: Gitlab::Themes::APPLICATION_DEFAULT
2014-09-02 18:07:02 +05:30
)
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