Module to split the projects' space into virtual hosts similarly to an HTTP server and different domain names.

Clone this repo:


  1. 46e9112 Adapt to updated PermissionBackend#ForProject interface by Paladox none · 6 years ago master
  2. 2687d84 Filter projects based on virtual host config by Luca Milanesio · 6 years ago
  3. 2604d57 Initial empty repository by David Pursehouse · 6 years ago

Gerrit VirtualHost

Gerrit lib module to split the projects' space into virtual hosts similarly of what you would do with an HTTP Server and different domain names.

How to build

Build this module as it was a Gerrit plugin:

  • Clone Gerrit source tree
  • Clone the virtualhost source tree
  • Link the virtualhost directory to Gerrit /plugins/virtualhost
  • From Gerrit source tree run bazel build plugins/virtualhost
  • The virtualhost.jar module is generated under /bazel-genfiles/plugins/virtualhost/

How install

Copy virtualhost.jar library to Gerrit /lib and add the following two extra settings to gerrit.config:

  installModule = com.gerritforge.gerrit.modules.virtualhost.GuiceModule

  filterClass = com.gerritforge.gerrit.modules.virtualhost.VirtualHostFilter

How to define virtual hosts

/etc/virtualhost.config contains the definition of the virtual hosts and the set of projects included.

Each server section defines a virtual host and contains a set of projects included. Projects are defined using Gerrit ref-matching expressions and can be repeated multiple times to include multiple matchers.

Example to include all the projects starting with team1/ and the ones starting with the username:

[server ""]
  projects = team1/*
  projects = ${username}/*

Default host

For all the other server names that are not defined and for SSH access, there is a special default section that lists of visible projects.

Example to include all the projects by default:

  projects = ^.*