gitlab send smtp settings

gitlab built half a year ago

It uses postfix to send emails, but the disadvantage of doing so is that many companies will directly treat this as spam

There's not even a fart left in the mailboxes

So consider using smtp

 

Idea 1 Use bitnamin's one-click installation of gitlab

However, there are too many files to be modified, about 3 or so, failure

 

Idea 2 After installing gitlab, modify /etc/gitlab/gitlab.rb

The modified file can refer to http://ruby-china.org/topics/20450

 

My own configuration is as follows, slightly different from the reference

wrote
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = 'xxxxxx.com'


gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "xxxxxx.com"
gitlab_rails['smtp_port'] = 994
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "xxxxxx"
gitlab_rails['smtp_domain'] = "xxxxxx.com"
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true

 

 

But in fact, the most useful thing is to refer to the gitlab-ctl tail command in the url

wrote
==> /var/log/gitlab/sidekiq/current <==
2016-12-26_04:39:15.21537 2016-12-26T04:39:15.214Z 6127 TID-ov14nw4i8 ActionMailer::DeliveryJob JID-023b5b78f627707c11056529 INFO: fail: 0.06 sec
2016-12-26_04:39:15.21540 2016-12-26T04:39:15.214Z 6127 TID-ov14nw4i8 WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"1ff89d36-dc13-41d3-85c2-9de873c0c48a","queue_name":"mailers","arguments":["DeviseMailer","reset_password_instructions","deliver_now",{"_aj_globalid":"gid://gitlab/User/7"},"-Tb-Bec-zKXUC8G4VwoH",{"_aj_symbol_keys":[]}],"locale":"en"}],"retry":3,"jid":"023b5b78f627707c11056529","created_at":1482727113.5475574,"enqueued_at":1482727155.151615,"error_message":"getaddrinfo: Name or service not known","error_class":"SocketError","failed_at":1482727113.6953247,"retry_count":1,"retried_at":1482727155.2136667}
2016-12-26_04:39:15.21541 2016-12-26T04:39:15.214Z 6127 TID-ov14nw4i8 WARN: SocketError: getaddrinfo: Name or service not known
2016-12-26_04:39:15.21542 2016-12-26T04:39:15.214Z 6127 TID-ov14nw4i8 WARN: /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize'

 

You can see what went wrong. The way out this time was discovered by rubbing your head against the south wall.

 

 

2017/1/10

Backup and restore of gitlab

https://segmentfault.com/a/1190000002439923

 

gitlab-rake gitlab:backup:create

gitlab_rails['backup_path'] = '/mnt/backups'

 

# restore from backup numbered 1393513186

gitlab-rake gitlab:backup:restore BACKUP=1393513186

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326726816&siteId=291194637