{"id":18579247,"url":"https://github.com/faust64/docker-gerrit","last_synced_at":"2025-10-27T22:01:55.085Z","repository":{"id":76091423,"uuid":"227941805","full_name":"faust64/docker-gerrit","owner":"faust64","description":"Gerrit for OpenShift","archived":false,"fork":false,"pushed_at":"2020-06-12T13:58:14.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T02:13:08.832Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/faust64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-14T00:02:26.000Z","updated_at":"2019-12-14T00:02:42.000Z","dependencies_parsed_at":"2023-05-22T11:00:19.588Z","dependency_job_id":null,"html_url":"https://github.com/faust64/docker-gerrit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faust64/docker-gerrit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faust64%2Fdocker-gerrit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faust64%2Fdocker-gerrit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faust64%2Fdocker-gerrit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faust64%2Fdocker-gerrit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faust64","download_url":"https://codeload.github.com/faust64/docker-gerrit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faust64%2Fdocker-gerrit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262387829,"owners_count":23303314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:39:37.243Z","updated_at":"2025-10-27T22:01:54.998Z","avatar_url":"https://github.com/faust64.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gerrit\n\n## Build Locally\n\n```\nmake build\n```\n\n## Build on OpenShift\n\n```\nmake ocbuild\n```\n\n## Deploy Standalone Demo\n\n```\nmake ocdemopersistent\n```\n\nOr ephemeral demo, that won't allow for container restarts:\n\n```\nmake ocdemo\n```\n\n## Deploy LDAP-Based Standalone\n\n```\nmake ocldap\n```\n\n## Deploy Master/Slave\n\nDeploy the master components with:\n\n```\nmake ocmaster\n```\n\nEventually, deploy slaves:\n\n```\nmake ocslave\n```\n\nAnd configure replication from the master Pod, and restart it:\n\n```\noc rsh dc/gerrit-master-demo\ncat \u003c\u003cEOF \u003e\u003eetc/replication.config\n[remote \"slave-demo\"]\n    url = admin@gerrit-slave-sshd-demo:/var/gerrit/git/\\${name}.git\n    push = +refs/*:refs/*\n    timeout = 30\n    replicationDelay = 1\n    threads = 4\n    replicateHiddenProjects = true\n    replicateProjectDeletion = true\n    mirror = true\nEOF\nexit\noc delete pod gerrit-master-demo-x-abcd\n```\n\nThen, on all slaves, make sure the initial /var/gerrit/git content was synced,\nas SSH connections to Gerrit management interface would not work otherwise.\n\n## OpenShift Considerations\n\nForcing clients to connect Gerrit using TLS, we would want to define an https://\nprefixed URL in gerrit.config. Doing so, while setting up a listenUrl binding\non http, Jetty would expect for some X-Forwarded-Scheme header to be set, which\nis not added by OpenShift routers.\n\nUse the following, to patch OpenShift routers template, inserting those missing\nheaders:\n\n```\nmake ocrouterprep\n```\n\n## Notes\n\nCreate a repository:\n\n```\n$ ssh localhost gerrit ls-groups\nWarning: Permanently added '[localhost]:29418' (ECDSA) to the list of known hosts.\nAdministrators\nNon-Interactive Users\n$ ssh localhost gerrit create-project --require-change-id --owner=Administrators --description='\"My Awesome Project\"' global/awesome\n```\n\nDealing with replication:\n\nhttps://gerrit.googlesource.com/plugins/replication/+/refs/heads/master/src/main/resources/Documentation/config.md\n\n```\n$ ssh localhost gerrit plugin reload replication\n$ ssh localhost replication start --all\n$ ssh localhost replication start global/awesome\n$ ssh localhost gerrit logging ls-level | grep replication\ncom.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator: DEBUG\ncom.googlesource.gerrit.plugins.replication.EventsStorage: DEBUG\ncom.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing: INFO\ncom.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig: DEBUG\nreplication_log: DEBUG\n$ ssh localhost gerrit logging set-level DEBUG com.googlesource.gerrit.plugins.replication.PushResultProcessing.GitUpdateProcessing\n$ ssh localhost replication start --wait --all --now\nReplicate All-Projects ref ..all.. to gerrit-slave-sshd-demo, Succeeded! (OK)\nReplication of All-Projects ref ..all.. completed to 1 nodes,\nReplicate All-Users ref ..all.. to gerrit-slave-sshd-demo, Succeeded! (OK)\nReplication of All-Users ref ..all.. completed to 1 nodes,\nReplicate global/awesome ref ..all.. to gerrit-slave-sshd-demo, Succeeded! (OK)\nReplication of global/awesome ref ..all.. completed to 1 nodes,\n----------------------------------------------\nReplication completed successfully!\n```\n\nMisc:\n\n```\n$ ssh localhost gerrit show-connections\n$ ssh localhost gerrit show-caches\n$ ssh localhost gerrit plugin ls\n$ ssh localhost gerrit show-queue\n$ ssh localhost ps\n```\n\nGitweb?  see https://www.gerritcodereview.com/config-gitweb.html\n\nDeaing with replication WITH ldap auth:\n\neither create a dedicated LDAP user -- or use whoever first logged in, as it whould be gerrit admin already, quick/dirty/demo\nUpload admin public key into corresponding gerrit account settings\nThen, use that account connecting to gerrit ssh server:\n\n```\n$ . /prep-cli.sh\n$ ssh faust@localhost gerrit plugin reload replication\n$ ssh faust@localhost replication start --url gerrit-slave-demo-0 --all --now --wait\nWarning: Permanently added '[localhost]:29418' (ECDSA) to the list of known hosts.\nReplicate All-Projects ref ..all.. to gerrit-slave-demo-0.gerrit-slave-demo, Succeeded! (OK)\nReplication of All-Projects ref ..all.. completed to 1 nodes,\nReplicate All-Users ref ..all.. to gerrit-slave-demo-0.gerrit-slave-demo, Succeeded! (OK)\nReplication of All-Users ref ..all.. completed to 1 nodes,\n----------------------------------------------\nReplication completed successfully!\n$ ssh faust@localhost replication start --url gerrit-slave-demo-1 --all --now --wait\n...\n```\n\nSyncing groups from LDAP: unclear, seems that when I create a group that exists in my LDAP, it\nfinally shows up in Gerrit groups listing. Meanwhile, gerrit doesn't seem to be scanning for\ngroups during login or otherwise\n\nWorking with bare repsitories: assuming I want to checkout sources out of a\nfolder in Gerrit, yet can not clone said repository:\n\n```\n$ mkdir /usr/src/\u003crepository\u003e\n$ cp -rp /var/gerrit/git/\u003cproject-path\u003e/\u003crepository\u003e /usr/src/\u003crepository\u003e/.git\n$ cd /usr/src/\u003crepository\u003e\n$ GIT_WORK_TREE=./ git checkout --\n$ ls\n...\n```\n\nEnvironment variables and volumes\n----------------------------------\n\nThe image recognizes the following environment variables that you can set during\ninitialization by passing `-e VAR=VALUE` to the Docker `run` command.\n\n|    Variable name                      |    Description                                | Default                               |\n| :------------------------------------ | --------------------------------------------- | ------------------------------------- |\n|  `DB_DRIVER`                          | Gerrit Database Driver                        | `h2`                                  |\n|  `FORCE_REINDEX`                      | Force Gerrit Reindex on boot                  | undef                                 |\n|  `GERRIT_AUTH_METHOD`                 | Gerrit Authentication Method                  | `DEVELOPMENT_BECOME_ANY_ACCOUNT`      |\n|  `GERRIT_BEHIND_PROXY`                | Gerrit is Behind an HTTP Proxy                | undef                                 |\n|  `GERRIT_MASTER`                      | OpenLDAP CodiMD Password                      | `secret`                              |\n|  `GERRIT_HOSTNAME`                    | Gerrit Service Hostname                       | `gerrit.demo.local`                   |\n|  `GERRIT_PUBLIC_PROTO`                | Gerrit Public Web Proto                       | `http`                                |\n|  `GERRIT_STRICT_HOSTKEY_CHECKING`     | Gerrit SSH Hostkey Strict Checking            | `true`                                |\n|  `GIT_USERNAME`                       | Git Default Username                          | `gitusr`                              |\n|  `HTTP_LISTEN_PORT`                   | Gerrit JVM HTTP Listen Port                   | `8080`                                |\n|  `LDAP_ACCOUNT_SCOPE`                 | LDAP Account Search Scope                     | `one`                                 |\n|  `LDAP_BASE`                          | LDAP Search Base                              | `dc=demo,dc=local`                    |\n|  `LDAP_BIND_DN_PREFIX`                | Gerrit LDAP Bind DN Prefix                    | `cn=gerrit,ou=services`               |\n|  `LDAP_BIND_PASSWORD`                 | Gerrit LDAP Bind Password                     | `secret`                              |\n|  `LDAP_DN_ATTR`                       | LDAP DisplayName Attribute                    | `displayName`                         |\n|  `LDAP_EMAIL_ATTR`                    | LDAP Email Attribute                          | `mail`                                |\n|  `LDAP_HOST`                          | LDAP Host Address                             | `openldap`                            |\n|  `LDAP_PROTO`                         | LDAP Proto                                    | `ldap`                                |\n|  `LDAP_SSL_VERIFY`                    | LDAP SSL Verify                               | `true`                                |\n|  `LDAP_START_TLS`                     | LDAP Start TLS                                | `false`                               |\n|  `MYSQL_DATABASE`                     | Gerrit MySQL Database Name                    | `gerrit`                              |\n|  `MYSQL_HOST`                         | Gerrit MySQL Host Address                     | `mysql`                               |\n|  `MYSQL_PASSWORD`                     | Gerrit MySQL Database Password                | `secret`                              |\n|  `MYSQL_USER`                         | Gerrit MySQL Database Username                | `mysql`                               |\n|  `POSTGRES_DATABASE`                  | Gerrit Postgres Database Name                 | `gerrit`                              |\n|  `POSTGRES_HOST`                      | Gerrit Postgres Host Address                  | `postgres`                            |\n|  `POSTGRES_PASSWORD`                  | Gerrit Postgres Database Password             | `secret`                              |\n|  `POSTGRES_USER`                      | Gerrit Postgres Database Username             | `postgres`                            |\n|  `SMTP_DOMAIN`                        | Gerrit Mail Domain                            | `demo.local`                          |\n|  `SMTP_HOST`                          | Gerrit SMTP Relay                             | `smtp.demo.local`                     |\n|  `SSH_LISTEN_PORT`                    | Gerrit SSHD Server Listen Port                | `29418`                               |\n|  `SSH_IDLE_TIMEOUT`                   | Gerrit SSHD Server IDLE Timeout               | `240m`                                |\n|  `SSH_THREADS`                        | Gerrit SSHD Server Threads                    | `8`                                   |\n|  `SSH_MAX_CON_PER_USER`               | Gerrit SSHD Server Max Connections per User   | `0`                                   |\n|  `SSHD_LISTEN_PORT`                   | OpenSSH Replication SSHD Server Listen Port   | `29419`                               |\n\nYou can also set the following mount points by passing the `-v /host:/container` flag to Docker.\n\n|  Volume mount point    | Description                                |\n| :--------------------- | ------------------------------------------ |\n|  `/config`             | Gerrit Configuration - prevents generation |\n|  `/var/gerrit/data`    | Gerrit Data                                |\n|  `/var/gerrit/cache`   | Gerrit Cache                               |\n|  `/var/gerrit/db`      | Gerrit DB                                  |\n|  `/var/gerrit/etc`     | Gerrit Configuration                       |\n|  `/var/gerrit/git`     | Gerrit Repositories                        |\n|  `/var/gerrit/index`   | Gerrit Indexes                             |\n|  `/var/gerrit/lib`     | Gerrit Libraries                           |\n|  `/var/gerrit/plugins` | Gerrit Plugins                             |\n|  `/var/gerrit/tmp`     | Gerrit Temp Directory                      |\n|  `/.ssh/`              | Gerrit SSH Keys to Install during boot     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaust64%2Fdocker-gerrit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaust64%2Fdocker-gerrit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaust64%2Fdocker-gerrit/lists"}