gitlab 取消掉郵箱驗證功能

系統 :centos7
gitlab版本:gitlab-ce-11.6.2-ce.0.el7.x86_64
安裝方式: yum install gitlab-ce-11.6.2-ce.0.el7.x86_64 -y
需求:用gitlab api python方式導入大量用戶須要郵箱驗證比較麻煩 ,因此,去掉新建用戶的郵件驗證,還能切斷外網,內網使用gitlab。html

[root@k8s_gitlab ~]# vim /opt/gitlab/embedded/service/gitlab-rails/app/models/user.rb
devise :lockable, :recoverable, :rememberable, :trackable,
:validatable, :omniauthable, :registerablepython

vim /opt/gitlab/embedded/service/gitlab-rails/app/controllers/admin/users_controller.rb
def confirm
if user.confirm!
redirect_to :back, notice: "Successfully confirmed"
else
redirect_to :back, alert: "Error occurred. User was not confirmed"
end
endgit

刪掉!!!!vim

vim /opt/gitlab/embedded/service/gitlab-rails/app/views/admin/users/show.html.hamlcentos

  • unless @user.confirmed?
    .panel.panel-info
    .panel-heading
    Confirm user
    .panel-body
    • if @user.unconfirmed_email.present?
      • email = " (#{@user.unconfirmed_email})"
        %p This user has an unconfirmed email address#{email}. You may force a confirmation.
        %br
        = link_to 'Confirm user', confirm_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }

刪掉
掛掉以上三個文件api

gitlab-ctl restartapp

相關文章
相關標籤/搜索