Gerrit은 계정에 대한 인증 ( Authentication )을 직접 처리하지 않는다.
따라서 로그인을 위해서는 인증에 관한 별도 처리가 필요하다.
처음 Gerrit을 설치했을때는 HTTP 인증 ( Apache )을 통해 로그인을 진행하도록 했었다. 별도의 파일에 아이디와 계정을 처리했기 때문에 가장 단순했기 때문이다. 그러나 나는 Apache에 대한 지식도 없고, Gerrit 이외에 Apache를 신경쓰는게 부담이 되었기 때문에 인증 방식을 LDAP으로 처리해보았다.
그런데, 나는 LDAP에 대한 지식도 없었고, 회사내 LDAP 서버 정보도 그다지 많지 않았다.
사내 Jenkins와 Artifactory의 설정에 LDAP 정보가 있었고, 사내 Confluence에 LDAP 관련 내용이 있었으나 확실한 정보는 아니었다. 다만 이러한 정보를 바탕으로 여러가지 시도 끝에, LDAP 서버 정보과 검색을 할 수 있었다.
Canonical URL : Gerrit에 접속하기 위한 URL. 만약 외부 접속을 막고 싶다면, 호스트이름을 localhost로 변경한다. 아래 예에서 처럼 'bungslxubu51'의 경우는, 외부에서 접속이 되지 않을 수 있다.
Plugins : 모든 플러그인을 설치하기 위해 'Y'로 입력
junggu.lee@bungslxubu51:~$ java -jar ~/bin/gerrit-3.5.1.war init -d ~/work/gerrit_standalone
Using secure store: com.google.gerrit.server.securestore.DefaultSecureStore
[2022-04-22 07:30:56,181] [main] INFO com.google.gerrit.server.config.GerritServerConfigProvider : No /home/junggu.lee/work/gerrit_standalone/etc/gerrit.config; assuming defaults
*** Gerrit Code Review 3.5.1
***
Create '/home/junggu.lee/work/gerrit_standalone' [Y/n]?
*** Git Repositories
***
Location of Git repositories [git]:
*** JGit Configuration
***
Auto-configured "receive.autogc = false" to disable auto-gc after git-receive-pack.
*** Index
***
Type [lucene]:
*** User Authentication
***
Authentication method [openid/?]:
Enable signed push support [y/N]?
Use case insensitive usernames [Y/n]?
*** Review Labels
***
Install Verified label [y/N]?
*** Email Delivery
***
SMTP server hostname [localhost]:
SMTP server port [(default)]:
SMTP encryption [none/?]:
SMTP username :
*** Container Process
***
Run as [junggu.lee]:
Java runtime [/usr/lib/jvm/java-11-openjdk-amd64]:
Copy gerrit-3.5.1.war to /home/junggu.lee/work/gerrit_standalone/bin/gerrit.war [Y/n]?
Copying gerrit-3.5.1.war to /home/junggu.lee/work/gerrit_standalone/bin/gerrit.war
*** SSH Daemon
***
Listen on address [*]:
Listen on port [29418]:
Generating SSH host key ... rsa... ed25519... ecdsa 256... ecdsa 384... ecdsa 521... done
*** HTTP Daemon
***
Behind reverse proxy [y/N]?
Use SSL (https://) [y/N]?
Listen on address [*]:
Listen on port [8080]: 8081
Canonical URL [http://bungslxubu51:8081/]:
*** Cache
***
*** Plugins
***
Installing plugins.
Install plugin codemirror-editor version v3.5.1 [y/N]? y
Installed codemirror-editor v3.5.1
Install plugin commit-message-length-validator version v3.5.1 [y/N]? y
Installed commit-message-length-validator v3.5.1
Install plugin delete-project version v3.5.1 [y/N]? y
Installed delete-project v3.5.1
Install plugin download-commands version v3.5.1 [y/N]? y
Installed download-commands v3.5.1
Install plugin gitiles version v3.5.1 [y/N]? y
Installed gitiles v3.5.1
Install plugin hooks version v3.5.1 [y/N]? y
Installed hooks v3.5.1
Install plugin plugin-manager version v3.5.1 [y/N]? y
Installed plugin-manager v3.5.1
Install plugin replication version v3.5.1 [y/N]? y
Installed replication v3.5.1
Install plugin reviewnotes version v3.5.1 [y/N]? y
Installed reviewnotes v3.5.1
Install plugin singleusergroup version v3.5.1 [y/N]? y
Installed singleusergroup v3.5.1
Install plugin webhooks version v3.5.1 [y/N]? y
Installed webhooks v3.5.1
Initializing plugins.
============================================================================
Welcome to the Gerrit community
Find more information on the homepage: https://www.gerritcodereview.com
Discuss Gerrit on the mailing list: https://groups.google.com/g/repo-discuss
============================================================================
Initialized /home/junggu.lee/work/gerrit_standalone
Init complete, reindexing accounts,changes,groups,projects with: reindex --site-path /home/junggu.lee/work/gerrit_standalone --threads 1 --index accounts --index changes --index groups --index projects --disable-cache-statsReindexed 0 documents in accounts index in 0.0s (0.0/s)
Index accounts in version 11 is ready
Reindexing groups: 100% (2/2)
Reindexed 2 documents in groups index in 0.3s (5.8/s)
Index groups in version 8 is ready
Reindexing changes: Slicing projects: 100% (2/2), done
Reindexed 0 documents in changes index in 0.5s (0.0/s)
Index changes in version 71 is ready
Reindexing projects: 100% (2/2)
Reindexed 2 documents in projects index in 0.1s (35.7/s)
Index projects in version 4 is ready
Executing /home/junggu.lee/work/gerrit_standalone/bin/gerrit.sh start
Starting Gerrit Code Review: WARNING: Could not adjust Gerrit's process for the kernel's out-of-memory killer.
This may be caused by /home/junggu.lee/work/gerrit_standalone/bin/gerrit.sh not being run as root.
Consider changing the OOM score adjustment manually for Gerrit's PID=4136478 with e.g.:
echo '-1000' | sudo tee /proc/4136478/oom_score_adj
OK
Waiting for server on bungslxubu51:8081 ... OK
Opening http://bungslxubu51:8081/#/admin/projects/ ...OK