作者:小怡的宝_594 | 来源:互联网 | 2023-02-03 15:33
我正在使用gitlab/gitlab-ce:latest
docker映像在公司的Intranet中设置gitlab。
这样做docker-compose up -d
就像一种魅力,我可以以root用户身份登录,因此我更改了密码,并让自己成为合适的用户……但从未收到确认电子邮件。
我一直在调整docker-compose.yml
文件以尝试修复smtp设置(我认为是问题所在),这就是我得到的:
web:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
hostname: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://127.0.0.1:11141'
gitlab_rails['gitlab_shell_ssh_port'] = 11122
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'mail'
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = 'noreply-gitlab'
gitlab_rails['smtp_password'] = 'thepass'
gitlab_rails['smtp_domain'] = 'ourhost.com'
gitlab_rails['smtp_authentication'] = 'login'
gitlab_rails['gitlab_email_from'] = 'noreply-gitlab@business.com'
gitlab_rails['gitlab_email_reply_to'] = 'gitlab@business.com'
ports:
- '11141:11141'
- '11122:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
如果没有别的,我真的很想知道如何获取日志。我知道电子邮件是作为sidekiq作业处理的,但是current
我可以在日志卷中看到的sidekiq 日志与发送电子邮件没有任何关系:\
在production.log
我看到的是:
Started POST "/users/confirmation" for 172.17.0.1 at 2017-05-18 20:26:32 +0000
Processing by ConfirmationsController#create as HTML
Parameters: {"utf8"=>"?", "authenticity_token"=>"lotsoflettershere==", "user"=>{"email"=>"sean.newell@business.com"}}
Redirected to http://git.coolsrvrname.dev/users/almost_there
Completed 302 Found in 40ms (ActiveRecord: 3.9ms)
我相信,这只是再次发送确认电子邮件的请求。这是否意味着gitlab端没有错误,并且smtp服务器有问题?
找到了此评论 -我没有配置ssl,所以我会尝试的。(也尝试gitlab_rails ['smtp_authentication'] = false)....不起作用:\
1> Sean Newell..:
正确的yml文件如下所示:
web:
image: gitlab/gitlab-ce:latest
container_name: gitlab
restart: always
hostname: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://git.coolsrvname.dev'
gitlab_rails['gitlab_shell_ssh_port'] = 10022
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'mail.myhost.com'
gitlab_rails['smtp_port'] = '25'
gitlab_rails['smtp_domain'] = 'mail.myhost.com'
gitlab_rails['smtp_authentication'] = false
gitlab_rails['gitlab_email_from'] = 'noreply-gitlab@business.com'
gitlab_rails['gitlab_email_reply_to'] = 'gitlab@business.com'
ports:
- '10081:80'
- '10082:443'
- '10022:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
这是因为我们的smtp服务器将gitlab主机的IP作为可信IP。因此,我们将smtp auth设置为false。smtp地址和域匹配似乎可以使其正常工作。外部网址必须是最终用户看到的内容,否则资产将无法正确管理。另外,端口的打开需要将外部端口映射到80 | 443 | 22,以便一切正常。
gitlab可能需要进行一些调整才能接收电子邮件,但这不是问题的意图。虽然我仍然不知道将日志存储在哪里,以便发送smtp作业/请求...