启用集成SMTP通知与自制钩子



首先,我对使用gitlab时通过web应用程序管理用户和项目的强大解决方案感到非常兴奋。

我完成了安装,并将我的smpt设置添加到文件config/production.rb:

 config.action_mailer.delivery_method = :smtp
 config.action_mailer.smtp_settings = {
 :address => 'myserver.com',
 :port => 25,
 :domain => 'gitlab.adomain.com',
 :authentication => :plain,
 :user_name => 'gitlab@myserver.com',
 :password => '',
 :enable_starttls_auto => true
 }

另外,我更改了文件config/gitlab.yml:

email:
from: account@myserver.com
…

检查SMTP设置,并与其他应用程序正常工作。我重新启动了gitlab-server,期望在将用户添加到项目时发送通知,或者即使提交被传播到远程而不使用自制钩子。但他们不是。

这是我的webinterface的输出:

     gitserver:3254 on mailer at 2 minutes ago
Class
    Notify
Arguments
    "project_access_granted_email"
    31    
Exception
    Net::SMTPAuthenticationError
Error
    502 Command "AUTH PLAIN <tokenid>" not implemented 

这些是我的问题:

  1. 在我的请求概述中,有一个名为mailer的队列,其中有1个未完成的活动(邮件)作业。下面的信息显示当前没有工人在工作。我该如何处理?

  2. 我想实现后接收钩子发送邮件,如果gitlab原来是无法管理这一点。我如何配置我的后缀?

这取决于您的GitLab版本,但最新的版本似乎不能很好地与Resque worker(包括Resque mailer)一起工作:
参见第2472期:

# bundle exec rake environment resque:work QUEUE=post_receive,mailer,system_hook RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid
Starting worker git1-0:7710:post_receive,mailer,system_hook
Registered signals
Running before_first_fork hooks with [#<Worker git1-0:7710:post_receive,mailer,system_hook>]
#~

如果至少有一个进程(管理/发送电子邮件)在你的情况下运行,你可以检查这种方式。

所提到的问题有更新redis的当前解决方案,因为一个过时的版本:

作为root -在稳定版的debian

/etc/init.d/redis-server stop
cd /tmp
wget http://redis.googlecode.com/files/redis-2.2.4.tar.gz
cd redis-2.2.4
make PREFIX=/usr
make install PREFIX=/usr
/etc/init.d/redis-server start

编辑init.d脚本,将PIDFILE=从resque命令中删除。
resque的start命令后添加如下

ps auxww|grep QUEUE=post|head -n1|awk '{print $2}' > $RESQUE_PID

因此创建了pidfile -这修复了"stop"错误

stop/start gitlab - push and your fine

最新更新