commit | 2687d84d52e21dcc309bac078691a84e66a9eab6 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Fri May 26 07:54:54 2017 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Mon Jun 26 14:35:49 2017 +0100 |
tree | 48eaa3a86b93e511ff7ac77498a52a98bbb8759c | |
parent | 2604d577f88b990f828d7765ace375d37d804a62 [diff] |
Filter projects based on virtual host config Allow to filter visibility and access to projects based on Gerrit virtual host configuration. Default visibility applies to non matching hosts and SSH access. Change-Id: I14b977b9f6182a4586a777b4fe5b61ed5f2a0fa3
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.
Build this module as it was a Gerrit plugin:
virtualhost
directory to Gerrit /plugins/virtualhost
bazel build plugins/virtualhost
virtualhost.jar
module is generated under /bazel-genfiles/plugins/virtualhost/
Copy virtualhost.jar
library to Gerrit /lib
and add the following two extra settings to gerrit.config
:
[gerrit] installModule = com.gerritforge.gerrit.modules.virtualhost.GuiceModule [httpd] filterClass = com.gerritforge.gerrit.modules.virtualhost.VirtualHostFilter
/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 "team1.mycompany.com"] projects = team1/* projects = ${username}/*
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:
[default] projects = ^.*