欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

gitlab发送smtp设置

程序员文章站 2022-05-24 16:40:19
...

半年前搭的gitlab

用的是postfix发送邮件,但是这么做的坏处就是很多公司都会把这当做垃圾邮件直接处理

各个邮箱里连个屁都没剩下

于是考虑还是用smtp

 

思路1 利用bitnamin的一键安装gitlab

不过要修改的文件实在太多,3个左右,失败

 

思路2 还是安装gitlab后,修改/etc/gitlab/gitlab.rb

修改的文件可以参照 http://ruby-china.org/topics/20450

 

我自己的配置如下,跟参照略有不同

写道
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'] = "xxxxxx@xxxxx.com"
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

 

 

但实际上最有用处的是还是参照的url里gitlab-ctl tail 这个命令

写道
==> /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'

 

可以看看到底错在哪里,这次的出路是靠用头在南墙上蹭啊蹭的探索出来的

 

 

2017/1/10

gitlab的备份与恢复

https://segmentfault.com/a/1190000002439923

 

gitlab-rake gitlab:backup:create

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

 

# 从1393513186编号备份中恢复

gitlab-rake gitlab:backup:restore BACKUP=1393513186

 

相关标签: gitlab smtp mail