Gerrit uses The Document Foundation's Single Sign-On service for authentication. Create an account there if you don't have one already (several other sites, such as this wiki, use it too). Then simply visit gerrit and click on the “Sign in” link at the top right of the page. You'll be redirected to our central authentication portal, and then back to Gerrit once authenticated.
Setting yourself up for gerrit - the easy way
If you have a checkout of libreoffice/core already, you can just run
./logerrit setup inside the source code directory. The logerrit script will try to automatically setup keys and configure ssh for you, and if it can't it will guide you through these steps: if necessary, just follow the steps.
The program will tell you to go to https://gerrit.libreoffice.org and sign in to automatically provision your account from our Single Single-On system. The program will also generate a key pair for SSH and print the public part (that is, the content of
/home/[username]/.ssh/id_rsa.pub). This is a long random-looking string beginning with 'ssh-rsa'. You must add it to your settings page for gerrit to work from the command line. Paste it into the field that says New SSH key and click the button that says ADD NEW SSH KEY.
./logerrit test fails and
ssh -vvv logerrit informs you about
~/.ssh/config having bad permissions, run
chmod 600 ~/.ssh/config. If ./logerrit test succeeds, nothing happens and after pressing Ctrl-C you will see a message "Your gerrit setup was successful!".
Detailed and nitty-gritty setup topics
Setting yourself up for gerrit - the manual way
- Visit https://gerrit.libreoffice.org and click the “Sign in” link at the top right of the page. Once back from our Single Single-On portal the account should be automatically provisioned using full name, primary email address, and username found from your SSO profile. Please contact the Infrastructure Team if authentication is denied; this might be due to a collision (if your username or email address is used by another account) which needs to be resolved manually.
- Take note of the username found in your gerrit profile settings. This username is referred to as
- Generate an SSH keypair for gerrit (of course you can also reuse an existing key) and upload the public part in the settings page. Users are associated by username and SSH key.
- Add the following to your
- Setup your git repo so that it pushes to gerrit using the SSH key:
- Install the hooks:
- and you are ready to go!
Host logerrit gerrit.libreoffice.org IdentityFile /path/to/your/private-key User YOUR_USERNAME_HERE Port 29418 HostName gerrit.libreoffice.org
/path/to/your/private-keymust include the file name as well. For example:
git config remote.origin.pushurl ssh://logerrit/core
cd .git/hooks && ln -s ../../.git-hooks/* ./