summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-08-11 14:52:25 +0200
committermh <mh@immerda.ch>2010-08-11 14:52:25 +0200
commitab8615d05df97e6f8fd9c0b1bdbcf7439d8b8b0e (patch)
tree04b43a81f2804a37014130fd4525ff934b664901
parente563c5add3e02758c128fe6b5df31ea65f393f54 (diff)
introduce logmode for webrepos
-rw-r--r--manifests/web/repo.pp7
-rw-r--r--manifests/web/repo/lighttpd.pp4
-rw-r--r--templates/web/lighttpd4
3 files changed, 15 insertions, 0 deletions
diff --git a/manifests/web/repo.pp b/manifests/web/repo.pp
index 2cb387a..da6f74f 100644
--- a/manifests/web/repo.pp
+++ b/manifests/web/repo.pp
@@ -1,10 +1,15 @@
# domain: the domain under which this repo will be avaiable
# projectroot: where the git repos are listened
# projects_list: which repos to export
+#
+# logmode:
+# - default: Do normal logging including ips
+# - anonym: Don't log ips
define git::web::repo(
$ensure = 'present',
$projectroot = 'absent',
$projects_list = 'absent',
+ $logmode = 'default',
$sitename = 'absent'
){
if ($ensure == 'present') and (($projects_list == 'absent') or ($projectroot == 'absent')){
@@ -31,12 +36,14 @@ define git::web::repo(
'lighttpd': {
git::web::repo::lighttpd{$name:
ensure => $ensure,
+ logmode => $logmode,
gitweb_url => $gitweb_url,
gitweb_config => $gitweb_config,
}
}
'apache': {
apache::vhost::gitweb{$gitweb_url:
+ logmode => $logmode,
ensure => $ensure,
}
}
diff --git a/manifests/web/repo/lighttpd.pp b/manifests/web/repo/lighttpd.pp
index 111cc5e..621df00 100644
--- a/manifests/web/repo/lighttpd.pp
+++ b/manifests/web/repo/lighttpd.pp
@@ -1,6 +1,10 @@
+# logmode:
+# - default: Do normal logging including ips
+# - anonym: Don't log ips
define git::web::repo::lighttpd(
$ensure = 'present',
$gitweb_url,
+ $logmode = 'default'
$gitweb_config
){
if $ensure == 'present' { include git::web::lighttpd }
diff --git a/templates/web/lighttpd b/templates/web/lighttpd
index 1153154..57acb2e 100644
--- a/templates/web/lighttpd
+++ b/templates/web/lighttpd
@@ -3,6 +3,10 @@ $HTTP["host"] == "<%= gitweb_url %>" {
"^$" => "/",
)
+ <%- if logmode.to_s == 'anonym' -%>
+ accesslog.format = "127.0.0.1 %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
+ <%- end -%>
+
alias.url += (
"/gitweb.css" => "/var/www/git/gitweb.css",
"/git-logo.png" => "/var/www/git/git-logo.png",