Add an option to supply root password through an environmental variable.
This commit is contained in:
parent
d7ab859b91
commit
09e64ae605
2 changed files with 13 additions and 3 deletions
|
@ -1,9 +1,15 @@
|
|||
password = if ENV['GITLAB_ROOT_PASSWORD'].nil? || ENV['GITLAB_ROOT_PASSWORD'].empty?
|
||||
"5iveL!fe"
|
||||
else
|
||||
ENV['GITLAB_ROOT_PASSWORD']
|
||||
end
|
||||
|
||||
admin = User.create(
|
||||
email: "admin@example.com",
|
||||
name: "Administrator",
|
||||
username: 'root',
|
||||
password: "5iveL!fe",
|
||||
password_confirmation: "5iveL!fe",
|
||||
password: password,
|
||||
password_confirmation: password,
|
||||
password_expires_at: Time.now,
|
||||
theme_id: Gitlab::Theme::MARS
|
||||
|
||||
|
@ -19,6 +25,6 @@ puts %q[
|
|||
Administrator account created:
|
||||
|
||||
login.........root
|
||||
password......5iveL!fe
|
||||
password......#{password}
|
||||
]
|
||||
end
|
||||
|
|
|
@ -244,6 +244,10 @@ GitLab Shell is an SSH access and repository management software developed speci
|
|||
|
||||
# When done you see 'Administrator account created:'
|
||||
|
||||
**Note:** You can set the Administrator password by supplying it in environmental variable `GITLAB_ROOT_PASSWORD`, eg.:
|
||||
|
||||
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=newpassword
|
||||
|
||||
### Install Init Script
|
||||
|
||||
Download the init script (will be `/etc/init.d/gitlab`):
|
||||
|
|
Loading…
Reference in a new issue