troyhi
By:
troyhi

Gitlab with Gmail

June 5, 2014 12k views
noob question here, I am trying to give my new droplet with Gitlab installed the ability to send mail / messages with a gmail account. I have googled for this and come back with good instructions like these http://elijahpaul.co.uk/using-an-smtp-server-with-gitlab/ But he is referencing paths to files that I can't seem to find such as config/environments/production.rb I am not really sure where i should be looking, I am somewhat beating my head on the wall. can anyone give me some pointers so that I can learn more. System info Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS Release: 14.04 Codename: trusty Gitlab 6.4.2 ? Thanks !
5 Answers
I believe the absolute path should be /home/git/gitlab/config/environments/production.rb
Thanks Tony, and that is kinda what I thought it should be but that path does not exist.... hmmmmm
Try running the following command as root:
find / -name production.rb 2>/dev/null
The newer GitLab images use the omnibus installer. You can edit settings in: /etc/gitlab/gitlab.rb

You probably want to add something like:


gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'smtp.gmail.com'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = 'account@gmail.com'
gitlab_rails['smtp_password'] = 'password'
gitlab_rails['smtp_domain'] = 'gmail.com'
gitlab_rails['smtp_authentication'] = :plain
gitlab_rails['smtp_enable_starttls_auto'] = true


For the changes to take effect you need to run:


sudo gitlab-ctl reconfigure
  • I think it should be underscore instead of hyphen:

    gitlab_rails['smtp_enable'] = true
    gitlab_rails['smtp_address'] = 'smtp.gmail.com'
    gitlab_rails['smtp_port'] = 587
    gitlab_rails['smtp_user_name'] = 'account@gmail.com'
    gitlab_rails['smtp_password'] = 'password'
    gitlab_rails['smtp_domain'] = 'gmail.com'
    gitlab_rails['smtp_authentication'] = :plain
    gitlab_rails['smtp_enable_starttls_auto'] = true
    
  • Right you are! Updated above. Thanks!

Have another answer? Share your knowledge.