|author||Luca Milanesio <firstname.lastname@example.org>||Wed May 03 20:53:02 2017 +0100|
|committer||Luca Milanesio <email@example.com>||Wed May 03 21:32:27 2017 +0100|
Plugin to provide an out-of-the-box redirect for a fresh Gerrit install
When preparing a native packaging of Gerrit Code Review, the initial “out of the box” experience is necessary.
At the very first access to Gerrit UX, the browser gets redirected to a pre-configured URL which typically points to an introduction page.
Create a symbolic link to the out-of-the-box repository from the Gerrit source code /plugins directory to the subdirectories of this project.
Then build the out-of-the-box plugin with the usual Gerrit plugin compile command.
$ git clone https://github.com/GerritForge/out-of-the-box $ git clone https://gerrit.googlesource.com/gerrit $ cd gerrit/plugins $ ln -s ../../out-of-the-box . $ cd .. $ bazel build plugins/out-of-the-box
This plugin needs to be located in the Gerrit /lib directory and can be configured from the gerrit.config httpd directory as additional servlet filter in the httpd.filterClass setting.
The URL for the initial redirection URL is then configured in the http.firstTimeRedirectUrl setting.
[httpd] filterClass = com.googlesource.gerrit.plugins.manager.FirstTimeRedirect firstTimeRedirectUrl = https://mycompany.com/gerrit-intro.html
NOTE: The redirection happens only ONCE at the very first access to Gerrit UX. After that a flag file gets create under $GERRIT_SITE directory (.firstTimeRedirect) and the redirection filter will not be effective anymore.