GitLab에서는 E-mail을 기반으로 사용자 관리가 이루어진다.

특히 새로운 사용자를 추가할 때 패스워드를 바로 설정하지 않는다.
임시 패스워드를 등록된 이메일 주소로 발송을 해주게 된다.

이 때, GitLab에 smtp 셋팅이 안되어 있으면 난감하다.
그래서 일단 급한대로 Gmail을 smtp로 셋팅하는 방법을 찾아보았다.

물론 Gitlab에서는 친절히 직접 설명을 해주고 있다.
   - https://gist.github.com/xavierjurado/3138813

$ sudo su - git
$ cd /home/git/gitlab/
$ nano ./config/environments/production.rb

다음의 내용을 수정 및 추가하자.

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true

  config.action_mailer.smtp_settings = {
     :address              => "smtp.gmail.com",
     :port                 => 587,
     :domain               => 'gmail.com',
     :user_name            => 'whatwant@gmail.com',
     :password             => 'xxx',
     :authentication       =>  :plain,
     :enable_starttls_auto => true
  }

발신자 정보도 셋팅을 해야한다.

$ nano ./config/gitlab.yml

    ## Email settings
    # Email address used in the "From" field in mails sent by GitLab
    email_from: whatwant@gmail.com


이제 GitLab만 재시작 하면 된다.

$ exit
$ sudo /etc/init.d/gitlab restart



이렇게 하면 이메일 발송 기능은 잘 동작하지만,
서버 주소 등에 있어서는 집에서 혼자 설치해서 사용하기에 좀 신경써야 하는 점은 귀찮다.

반응형

+ Recent posts