Use gitlab-rails-console command in README.Debian

This commit is contained in:
Pirate Praveen 2021-02-01 15:46:34 +05:30
parent 70d4865e32
commit 4365c59b4f

View file

@ -132,7 +132,7 @@ Migrating from non-Debian gitlab
Resetting admin password without web interface
==============================================
The steps involve dropping into rails console as gitlab user for production environment and then resetting the admin password via the user object.
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && . /etc/gitlab/gitlab-debian.conf && export DB RAILS_ENV && bundle exec rails console production'
$ gitlab-rails-console
irb(main):001:0> user = User.where(admin: true).first
irb(main):002:0> user.password = 'secret_pass'
irb(main):003:0> user.password_confirmation = 'secret_pass'
@ -141,7 +141,7 @@ The steps involve dropping into rails console as gitlab user for production envi
Granting an existing user admin access
======================================
The steps involve dropping into rails console as gitlab user for production environment and running the following commands.
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && . /etc/gitlab/gitlab-debian.conf && export DB RAILS_ENV && bundle exec rails console production'
$ gitlab-rails-console
irb(main):001:0> user = User.find_by(email: 'useraddress@domain')
irb(main):003:0> user.admin=true
irb(main):004:0> user.save