gitlab ce 7部署问题小结

阅读更多

git服务部署在CentOS7和gitlab-ce 7.10.0-omnibus.2

  • 超级管理员密码遗忘

 

[root@ycx bin]# gitlab-rails console production

     管理控制台输入,查找id为1的用户,即为默认的超级用户/管理员信息。也可以使用User.find_by(email: '[email protected]')根据邮箱信息进行查找。

 

    

irb(main):001:0> user = User.where(id: 1).first

    结果如下:

=> #

   重设并保存新密码

 

irb(main):001:0> user.password = 'new_pwd'
irb(main):001:0> user.save!

    重启gitlab服务

    

[root@ycx bin]# gitlab-ctl restart

 

  • 无法创建新用户

    创建用户页面,执行保存时直接返回500。

     tail命令在producted.log中发现有如下错误:

Started POST "/admin/users" for 127.0.0.1 at 2018-03-07 13:12:06 +0800
Processing by Admin::UsersController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"name"=>"zhaolijun", "username"=>"zhaolijun", "email"=>"zhaolijun", "projects_limit"=>"10", "can_create_group"=>"1", "admin"=>"0", "skype"=>"", "linkedin"=>"", "twitter"=>"", "website_url"=>""}}
Completed 500 Internal Server Error in 198ms

NoMethodError (undefined method `skip_confirmation!' for #):
  app/controllers/admin/users_controller.rb:51:in `create'

 

第一次接触ruby,根据其他代码经验。

修改

/opt/gitlab/embedded/service/gitlab-rails/app/controllers/admin/users_controller.rb

注释

# @user.skip_confirmation!

修改页面验证

/opt/gitlab/embedded/service/gitlab-rails/app/views/admin/users/_form.html.haml

搜索    f.text_field :email, required: true

修改为  f.text_field :email, required: false

 

你可能感兴趣的:(gitlab ce 7部署问题小结)