Centos之Gerrit邮箱配置-yellowcong 忘是亡心i 2022-05-27 11:12 695阅读 0赞 > 配置Gerrit的邮箱信息,然后设定用户可以注册邮件,最后重启服务。这里需要注意一点的是:有可能你的gerrit启动比较的慢,不要心急,通过ps 查看进程是否挂掉了,如果挂掉了,就说明配置有问题了,如果没有就安静等待,然后查看端口号的服务是否有了,如果有了,就说明启动ok了。 ## 1、配置邮箱 ## 我们必须提供一个邮箱给gerrit,不然gerrit就不能发送邮件给用户了,让用户去绑定gerrit了。 vim etc/etc/gerrit.config #下面是腾讯企业邮箱配置 [sendemail] enable = true smtpServer = smtp.exmail.qq.com smtpServerPort = 465 smtpEncryption = SSL sslVerify = true smtpUser = 717350389@yellowcong.com smtpPass = testpass from = 717350389@yellowcong.com ## 2、配置用户可以设置邮箱 ## [oauth] allowEditFullName = true allowRegisterNewEmail = true ## 3、完整的配置 ## [gerrit] basePath = git serverId = 4de95b40-e3be-4a9b-bf36-76a3a2421d4a canonicalWebUrl = http://gerrit.yellowcong.net:8081 [database] type = mysql hostname = localhost database = reviewdb username = root [index] type = LUCENE [auth] type = OAUTH gitBasicAuthPolicy = HTTP [oauth] allowEditFullName = true allowRegisterNewEmail = true [receive] enableSignedPush = true [sendemail] enable = true smtpServer = smtp.exmail.qq.com smtpServerPort = 465 smtpEncryption = SSL sslVerify = true smtpUser = gerrit@yellowcong.cn smtpPass = yellowcong_123 from = gerrit@yellowcong.cn [container] user = root javaHome = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre [sshd] listenAddress = *:29418 [httpd] listenUrl = http://*:8081/ [cache] directory = cache [plugin "gerrit-oauth-provider-cas-oauth"] root-url = http://yellowcong.com:9000 client-id = 1100660 fix-legacy-user-id = false ## 4、重启服务 ## 重启失败了,是正常的,实际上没有失败,还在运行 bin/gerrit.sh restart #查看进程 ps -ef|grep gerrit #查看端口,服务是否启动正常 netstat -nptl 可以看到的是,服务已经启动失败,但是实际上,服务还在运行中。 ![这里写图片描述][SouthEast] 我电脑启动比较的慢,所以每次都得等个5分钟左右才启动起来,菊花藤,还能说啥呢。 ![这里写图片描述][SouthEast 1] 看看我的启动时间,我还能说啥呢,菊花疼啊。 ![这里写图片描述][SouthEast 2] ## 常见问题 ## ### 1、realm does not allow adding emails ### 这个问题是由于用户不能注册邮箱,这个问题是由于默认配置的不支持邮箱更改的。 ![这里写图片描述][SouthEast 3] 添加下面配置,设定可以修改用户名和设定新的邮箱。 ![这里写图片描述][SouthEast 4] [oauth] allowEditFullName = true allowRegisterNewEmail = true ## 参考文章 ## [https://www.cnblogs.com/jiangzhaowei/p/8005328.html][https_www.cnblogs.com_jiangzhaowei_p_8005328.html] [https://gerrit-review.googlesource.com/Documentation/config-gerrit.html\#oauth.allowRegisterNewEmail][https_gerrit-review.googlesource.com_Documentation_config-gerrit.html_oauth.allowRegisterNewEmail] [SouthEast]: /images/20220527/5210f235af6442a586094b46b7a21f8f.png [SouthEast 1]: /images/20220527/a9984ce9c7e6480496443bca1ede6762.png [SouthEast 2]: /images/20220527/96504cf694f84ed2b3669bee296cd9f7.png [SouthEast 3]: /images/20220527/e2c2a0b3469348229503a4ab1d3d64e9.png [SouthEast 4]: /images/20220527/34b828f3d05841bf97ac4ba6044393f3.png [https_www.cnblogs.com_jiangzhaowei_p_8005328.html]: https://www.cnblogs.com/jiangzhaowei/p/8005328.html [https_gerrit-review.googlesource.com_Documentation_config-gerrit.html_oauth.allowRegisterNewEmail]: https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#oauth.allowRegisterNewEmail
还没有评论,来说两句吧...