gerrit

在Authsaur中创建应用

进入应用市场 ,点击 Gerrit,填写相关OAuth2信息。

Gerrit 安装OAuth插件

搜索OAuth插件进行安装。

修改 Gerrit Config

在你的 Gerrit Server 服务器,找到 Gerrit 配置文件。

如果你是在生成 Gerrit 的目录下

vim ./etc/gerrit.config
[gerrit]
        basePath = git
        canonicalWebUrl = http://36.140.31.89:8380
        serverId = 59656e17-6bdc-4542-bcab-0c90270bc1cb
[index]
        type = LUCENE
[auth]
        type = OAUTH
[sendemail]
        smtpServer = localhost
[sshd]
        listenAddress = *:29418
[httpd]
        listenUrl = http://*:8080/
        filterClass = com.googlesource.gerrit.plugins.ootb.FirstTimeRedirect
        firstTimeRedirectUrl = /login/%23%2F?account_id=1000000
[cache]
        directory = cache
[plugins]
        allowRemoteAdmin = true
[plugin "gerrit-oauth-provider-cas-oauth"]
        root-url = http://116.205.137.175
        client-id = gerrit-id
        client-secret = gerrit-secret
        use-json-extractor = true
[container]
        javaOptions = "-Dflogger.backend_factory=com.google.common.flogger.backend.log4j.Log4jBackendFactory#getInstance"
        javaOptions = "-Dflogger.logging_context=com.google.gerrit.server.logging.LoggingContext#getInstance"
        user = gerrit
        javaHome = /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el8_7.x86_64
        javaOptions = -Djava.security.egd=file:/dev/./urandom
        javaOptions = --add-opens java.base/java.net=ALL-UNNAMED
        javaOptions = --add-opens java.base/java.lang.invoke=ALL-UNNAMED
        javaOptions = -Djava.security.egd=file:/dev/./urandom
        javaOptions = --add-opens java.base/java.net=ALL-UNNAMED
        javaOptions = --add-opens java.base/java.lang.invoke=ALL-UNNAMED
[receive]
        enableSignedPush = false

体验登录

访问你的 Gerrit Server 登录地址,点击 Login 登录。