Add a fake contactstore CGI.
This is useful for testing Gerrit's contactstore features if you don't have a real contact store server set up already. * modules/gerrit/files/fakestore.cgi: An extremely trivial shell script which returns the content Gerrit expects from a successful submission to a contactstore server. Note this does not check the application security key or store any of the post variables--it is simply a black hole for contact updates. * modules/gerrit/manifests/init.pp: If the contactstore feature is enabled in Gerrit, install the fakestore.cgi script so it can be available for testing. * modules/gerrit/templates/gerrit.vhost.erb: If the contactstore feature is enabled, ScriptAlias the /fakestore URL to the fakestore.cgi script. Change-Id: Ifa0f80bab9e8b8e207f0ffd83f01c8a3d904618e Reviewed-on: https://review.openstack.org/19939 Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Tested-by: Jenkins
This commit is contained in:
parent
6e54fb05ab
commit
fe35df9605
5
modules/gerrit/files/fakestore.cgi
Normal file
5
modules/gerrit/files/fakestore.cgi
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo 'Content-Type: text/html
|
||||
|
||||
OK'
|
@ -519,5 +519,13 @@ class gerrit(
|
||||
replace => true,
|
||||
require => File['/home/gerrit2/review_site/etc'],
|
||||
}
|
||||
file { '/home/gerrit2/review_site/lib/fakestore.cgi':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0555',
|
||||
source => 'puppet:///modules/gerrit/fakestore.cgi',
|
||||
require => File['/home/gerrit2/review_site/lib'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,10 @@
|
||||
ScriptAlias /p/ /usr/lib/git-core/git-http-backend/
|
||||
<% end -%>
|
||||
|
||||
<% if scope.lookupvar("gerrit::contactstore") == true -%>
|
||||
ScriptAlias /fakestore /home/gerrit2/review_site/lib/fakestore.cgi
|
||||
<% end -%>
|
||||
|
||||
<Directory /home/gerrit2/review_site/git/>
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
|
Loading…
x
Reference in New Issue
Block a user